prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[Workspace Variables]]
|
--
local animation = WaitForChild(script,'Animation')
local animator = WaitForChild(script,'animator')
|
-- how to use --
-- 1. place this in to a model --
-- 2. change the time between the spawn --
-- 3. if you like you coud make a spawn message --
-- 4. thanks 4 use --
| |
--// F key, Horn
|
mouse.KeyUp:connect(function(key)
if key=="h" then
veh.ELS.Sirens.MAN.Transparency = 1
veh.ELS.Siren.Man:Stop(3)
veh.ELS.Siren2.Man:Stop(3)
veh.ELS.Sirens.Horn.Transparency = 1
veh.ELS.Sirens.Horn.Transparency = 3
veh.ELS.Siren.Wail.Volume = 3
veh.ELS.Siren.Yelp.Volume = 3
veh.ELS.Siren.Priority.Volume = 3
veh.ELS.Siren2.Wail.Volume = 3
veh.ELS.Siren2.Yelp.Volume = 3
veh.ELS.Siren2.Priority.Volume = 3
end
end)
mouse.KeyDown:connect(function(key)
if key=="j" then
veh.ELS.Siren.SliderSwitch:Play()
veh.ELS.Events.ELS:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="[" then
veh.ELS.Siren.Beep:Play()
veh.ELS.Events.TakeDown:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="k" then
veh.ELS.Siren.Beep:Play()
veh.ELS.Events.Traffic:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key==";" then
veh.ELS.Siren.Beep:Play()
veh.ELS.Events.INT:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="m" then
veh.ELS.Siren.Beep:Play()
veh.ELS.Events.Ally:FireServer(true)
end
end)
|
--This will cause the timeFix() function to run once every second. 226 y 1001 <=750 or minutes >=870 and minutes // 958= 960 1070=1060
| |
-- Get the data store with key "Leaderboard"
|
wait(10)
while true do
-- загрузка данных по игрокам
for i,plr in pairs(game.Players:GetChildren()) do--Loop through players
if plr.UserId>0 then--Prevent errors
DonateStore = DataStore2(DataParam, plr) -- создаём ссылку на хранилище денег и т.д. и т.п.
local w=DonateStore:Get(0) -- значение по умолчанию 0
--print("1",w)
if w then
-- достаём из глобального значение
local w1=0
local success, err = pcall(function()
w1 = dataStore:GetAsync(plr.UserId) or 0
end)
-- print( w,"----",w1)
if success then -- если глобальное больше (базу меняли), то сохраняем его
if w1 > w then
w=w1
DonateStore:Set(w)
end
end
--print("2",w)
pcall(function()
--Wrap in a pcall so if Roblox is down, it won't error and break.
dataStore:UpdateAsync(plr.UserId,function(w)
w=DonateStore:Get(0)
--Set new value
--print("3",w)
return tonumber(w) -- !!!!!!!!! возвращаемое значение!!!
end)
end)
end
end
end
-- получение данных
local smallestFirst = false--false = 2 before 1, true = 1 before 2
local numberToShow = 100--Any number between 1-100, how many will be shown
local minValue = 1 --Any numbers lower than this will be excluded
local maxValue = 10e30--(10^30), any numbers higher than this will be excluded
local pages = dataStore:GetSortedAsync(smallestFirst, numberToShow, minValue, maxValue)
--Get data
local top = pages:GetCurrentPage()--Get the first page
-- получение изображений игроков
local data = {}--Store new data
for a,b in ipairs(top) do--Loop through data
local userid = b.key--User id
local points = b.value--Points
local username = "[Failed To Load]"--If it fails, we let them know
local s,e = pcall(function()
username = game.Players:GetNameFromUserIdAsync(userid)--Get username
end)
if not s then--Something went wrong
warn("Error getting name for "..userid..". Error: "..e)
end
local image = game.Players:GetUserThumbnailAsync(userid, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
--Make a image of them
table.insert(data,{username,points,image})--Put new data in new table
end
-- отображение данных
ui.Parent = script
sf:ClearAllChildren()--Remove old frames
ui.Parent = sf
for number,d in pairs(data) do--Loop through our new data
local name = d[1]
local val = d[2]
local image = d[3]
local color = Color3.new(1,1,1)--Default color
if number == 1 then
color = Color3.new(1,1,0)--1st place color
elseif number == 2 then
color = Color3.new(0.9,0.9,0.9)--2nd place color
elseif number == 3 then
color = Color3.fromRGB(166, 112, 0)--3rd place color
end
local new = sample:Clone()--Make a clone of the sample frame
new.Name = name--Set name for better recognition and debugging
new.LayoutOrder = number--UIListLayout uses this to sort in the correct order
new.Image.Image = image--Set the image
new.Image.Place.Text = number--Set the place
new.Image.Place.TextColor3 = color--Set the place color (Gold = 1st)
new.PName.Text = name--Set the username
new.Value.Text = val--Set the amount of points
new.Value.TextColor3 = color--Set the place color (Gold = 1st)
new.PName.TextColor3 = color--Set the place color (Gold = 1st)
new.Parent = sf--Parent to scrolling frame
end
wait()
sf.CanvasSize = UDim2.new(0,0,0,ui.AbsoluteContentSize.Y)
--Give enough room for the frames to sit in
wait(80) -- 120 - раз в 2 минуты
end
|
--[[
ROBLOX TODO: add default generic param when possible
original code:
export type MatchersObject<T extends MatcherState = MatcherState> = {
]]
|
export type MatchersObject<T> = { [string]: RawMatcherFn<T> }
|
--Dupes a part from the template.
|
local function MakeFromTemplate(template: BasePart, currentCacheParent: Instance): BasePart
local part: BasePart = template:Clone()
-- ^ Ignore W000 type mismatch between Instance and BasePart. False alert.
part.CFrame = CF_REALLY_FAR_AWAY
part.Anchored = true
part.Parent = currentCacheParent
return part
end
function PartCacheStatic.new(orgTemplate: BasePart, numPrecreatedParts: number?, currentCacheParent: Instance?): PartCache
local newNumPrecreatedParts: number = numPrecreatedParts or 5
local newCurrentCacheParent: Instance = currentCacheParent or workspace
--PrecreatedParts value.
--Same thing. Ensure it's a number, ensure it's not negative, warn if it's really huge or 0.
assert(numPrecreatedParts > 0, "PrecreatedParts can not be negative!")
assertwarn(numPrecreatedParts ~= 0, "PrecreatedParts is 0! This may have adverse effects when initially using the cache.")
assertwarn(orgTemplate.Archivable, "The template's Archivable property has been set to false, which prevents it from being cloned. It will temporarily be set to true.")
local oldArchivable = orgTemplate.Archivable
orgTemplate.Archivable = true
local newTemplate: BasePart = orgTemplate:Clone()
-- ^ Ignore W000 type mismatch between Instance and BasePart. False alert.
orgTemplate.Archivable = oldArchivable
local template: BasePart = newTemplate
local trails = {}
for _, v in pairs(template:GetChildren()) do
if (v:IsA("Trail") or v:IsA("Beam") or v:IsA("ParticleEmitter")) and v.Enabled then
table.insert(trails, #trails+1, v.Name)
v.Enabled = false
end
end
local object: PartCache = {
Open = {},
InUse = {},
CurrentCacheParent = newCurrentCacheParent,
Template = template,
ExpansionSize = 10,
Trails = trails
}
setmetatable(object, PartCacheStatic)
-- Below: Ignore type mismatch nil | number and the nil | Instance mismatch on the table.insert line.
for _ = 1, newNumPrecreatedParts do
table.insert(object.Open, MakeFromTemplate(template, object.CurrentCacheParent))
end
local function getFullNameRelative(main, child): string
local fullName: string = child:GetFullName()
local pos: number = string.find(fullName, main.Name)
local start: number = pos + #main.Name + 1
local rest: string = string.sub(fullName, start, -1)
return rest
end
object.Template.Parent = nil
for _, changed in ipairs(table.pack(orgTemplate, unpack(orgTemplate:GetDescendants()))) do
local path = changed ~= orgTemplate and getFullNameRelative(orgTemplate, changed) or nil
local function getTarget(v)
local target: Instance = v
if path ~= nil then
for _, name: string in ipairs(string.split(path, ".")) do
target = target[name]
end
end
return target
end
pcall(function()
changed.Changed:Connect(function(property)
if property == "Parent" then return end
for _, v: Instance in ipairs(object.Open) do
local target: Instance = getTarget(v)
target[property] = changed[property]
end
for _, v: Instance in ipairs(object.InUse) do
local target: Instance = getTarget(v)
target[property] = changed[property]
end
end)
end)
end
return object
-- ^ Ignore mismatch here too
end
|
--[=[
@param class table | (...any) -> any
@param ... any
@return any
Constructs a new object from either the
table or function given.
If a table is given, the table's `new`
function will be called with the given
arguments.
If a function is given, the function will
be called with the given arguments.
The result from either of the two options
will be added to the trove.
```lua
local Signal = require(somewhere.Signal)
-- All of these are identical:
local s = trove:Construct(Signal)
local s = trove:Construct(Signal.new)
local s = trove:Construct(function() return Signal.new() end)
local s = trove:Add(Signal.new())
-- Even Roblox instances can be created:
local part = trove:Construct(Instance, "Part")
```
]=]
|
function Trove:Construct(class, ...)
local object = nil
local t = type(class)
if t == "table" then
object = class.new(...)
elseif t == "function" then
object = class(...)
end
return self:Add(object)
end
|
----------------------------------------------------------------------------------------------------
-------------------=[ PROJETIL ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,Distance = 10000
,BDrop = .25
,BSpeed = 2000
,SuppressMaxDistance = 25 --- Studs
,SuppressTime = 10 --- Seconds
,BulletWhiz = true
,BWEmitter = 25
,BWMaxDistance = 200
,BulletFlare = false
,BulletFlareColor = Color3.fromRGB(255,255,255)
,Tracer = true
,TracerColor = Color3.fromRGB(255,255,255)
,TracerLightEmission = 1
,TracerLightInfluence = 0
,TracerLifeTime = .2
,TracerWidth = .1
,RandomTracer = false
,TracerEveryXShots = 5
,TracerChance = 100
,BulletLight = false
,BulletLightBrightness = 1
,BulletLightColor = Color3.fromRGB(255,255,255)
,BulletLightRange = 10
,ExplosiveHit = false
,ExPressure = 500
,ExpRadius = 25
,DestroyJointRadiusPercent = 0 --- Between 0 & 1
,ExplosionDamage = 100
,LauncherDamage = 100
,LauncherRadius = 25
,LauncherPressure = 500
,LauncherDestroyJointRadiusPercent = 0
|
-- Disables
|
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false) -- This obstructs the kill feed. You can find out who's playing the in the scoreboard
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) -- We'll use our own inventory
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false) -- We'll use our own health bar
|
--[[
The web endpoints return information in a camelCase format, however the convention for game engine APIs is to return
infomration in a PascalCase format. To avoid needing to change all our code to access data returned as PascalCase
we use this helper function to convert it back to camelCase
]]
|
local function tableToCamelCaseKeys(oldTable)
local newTable = {}
for k, v in pairs(oldTable) do
local newKey = k
if typeof(k) == "string" then
newKey = string.lower(string.sub(k, 1, 1)) .. string.sub(k, 2)
end
local newValue = v
if typeof(v) == "table" then
newValue = tableToCamelCaseKeys(v)
end
newTable[newKey] = newValue
end
return newTable
end
return tableToCamelCaseKeys
|
--// bolekinds
|
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if plr.YouCash.Value >= 500 and game.ServerStorage.ServerData.MsFloppa.Value == false then
script.Parent.Parent.Parent.Ching:Play()
plr.YouCash.Value -= 500
game.ServerStorage.ServerData.MsFloppa.Value = true
end
end)
|
--Scripted by DermonDarble
|
local userInputService = game:GetService("UserInputService")
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoidRootPart = character.HumanoidRootPart
local car = script:WaitForChild("Car").Value
local stats = car:WaitForChild("Configurations")
local Raycast = require(car.CarScript.RaycastModule)
local cameraType = Enum.CameraType.Follow
local movement = Vector2.new()
local seat = car:WaitForChild("DriveSeat")
seat.Changed:Connect(function(property)
if property == "Throttle" then
movement = Vector2.new(movement.X, seat.Throttle)
end
if property == "Steer" then
movement = Vector2.new(seat.Steer, movement.Y)
end
end)
local force = 0
local damping = 0
local mass = 0
for i, v in pairs(car:GetChildren()) do
if v:IsA("BasePart") then
mass = mass + (v:GetMass() * 196.2)
end
end
force = mass * stats.Suspension.Value
damping = force / stats.Bounce.Value
local bodyVelocity = Instance.new("BodyVelocity", car.Chassis)
bodyVelocity.velocity = Vector3.new(0, 0, 0)
bodyVelocity.maxForce = Vector3.new(0, 0, 0)
local bodyAngularVelocity = Instance.new("BodyAngularVelocity", car.Chassis)
bodyAngularVelocity.angularvelocity = Vector3.new(0, 0, 0)
bodyAngularVelocity.maxTorque = Vector3.new(0, 0, 0)
local rotation = 0
local function UpdateThruster(thruster)
--Make sure we have a bodythrust to move the wheel
local bodyThrust = thruster:FindFirstChild("BodyThrust")
if not bodyThrust then
bodyThrust = Instance.new("BodyThrust", thruster)
end
--Do some raycasting to get the height of the wheel
local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
local thrusterHeight = (position - thruster.Position).magnitude
if hit and hit.CanCollide then
--If we're on the ground, apply some forces to push the wheel up
bodyThrust.force = Vector3.new(0, ((stats.Height.Value - thrusterHeight)^2) * (force / stats.Height.Value^2), 0)
local thrusterDamping = thruster.CFrame:toObjectSpace(CFrame.new(thruster.Velocity + thruster.Position)).p * damping
bodyThrust.force = bodyThrust.force - Vector3.new(0, thrusterDamping.Y, 0)
else
bodyThrust.force = Vector3.new(0, 0, 0)
end
--Wheels
local wheelWeld = thruster:FindFirstChild("WheelWeld")
if wheelWeld then
wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
-- Wheel turning
local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
if offset.Z < 0 then
local direction = 1
if speed.Z > 0 then
direction = -1
end
wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
end
wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(rotation, 0, 0)
end
end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function MaterialTool:Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
self:ShowUI()
end;
function MaterialTool:Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
self:HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
|
-- Make the waters' SurfaceLights the same color as themselves.
|
for i, water in ipairs({water1, water2}) do
local function update()
water.SurfaceLight.Color = water.Color
end
water:GetPropertyChangedSignal("Color"):Connect(update)
update()
end
Lib.Script.setWaterState(water1, "acid")
Lib.Script.setWaterState(water2, "acid")
|
--////////////////////////////// Include
--//////////////////////////////////////
|
local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
|
-- try localize whole/part of string
-- no more-than-1 replacement for current existing keys.
|
function ChatLocalization:tryLocalize(rawString)
if existingKey[rawString] then
return self:Get(existingKey[rawString], rawString)
end
for enString, localizationKey in pairs(existingKey) do
if string.find(rawString, enString) then
local localizedPart = self:Get(localizationKey, enString)
return string.gsub(rawString, enString, localizedPart, 1)
end
end
return rawString
end
return ChatLocalization
|
--[[INFORMATION------------------------------------------------[[
ARTFVL's R15 Ragdoll (as seen in Ragdoll Testing v3)
Updated: November 20th 2021
CREDIT ME FOR USING THIS RAGDOLL SCRIPT.
Credits:
R15 RAGDOLL WAS CREATED BY ARTFVL
ORIGINALLY BASED ON ECHOREAPER'S R15 RAGDOLL
--]]
|
-----------------------------------------------------------]]
local module = {}
module.KillHumanoid = function(Humanoid)
for i = 1, 1 do
Humanoid.Health = 1
Humanoid.Health = -1
end
end
module.DestroyMotors = function(Table)
for _, Motor in pairs(Table) do
Motor:Destroy()
Motor = nil
end
end
module.KillRagdolls = function()
local function KillRagdoll(Inst)
if string.match(Inst.Name,"'s Ragdoll") then
local hum = Inst:WaitForChild("Humanoid")
module.KillHumanoid(hum)
end
end
for _,v in pairs(workspace:GetChildren()) do
spawn(function() KillRagdoll(v) end)
end
workspace.ChildAdded:Connect(function(child)
KillRagdoll(child)
end)
end
module.RunService = game:GetService("RunService")
module.ApplyZeroVelocity = function(Character)
for _,v in pairs(Character:GetDescendants()) do
if v:IsA("BasePart") then
v.AssemblyLinearVelocity = Vector3.new(0,0,0)
v.AssemblyAngularVelocity = Vector3.new(0,0,0)
end
end
end
module.KillVelocity = function(Character)
pcall(module.ApplyZeroVelocity,Character)
module.RunService.Stepped:wait()
pcall(module.ApplyZeroVelocity,Character)
end
return module
|
-- Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
|
exports.warnAboutDeprecatedLifecycles = true
|
--[ LOCALS ]--
|
local ReplicatedStorageEvent = game.ReplicatedStorage:WaitForChild("AFK")
|
--- Gets an index by value, returning `nil` if no index is found.
-- @tparam table haystack to search in
-- @param needle Value to search for
-- @return The index of the value, if found
-- @treturn nil if not found
|
function Table.getIndex(haystack, needle)
assert(needle ~= nil, "Needle cannot be nil")
for index, item in pairs(haystack) do
if needle == item then
return index
end
end
return nil
end
|
-- [ SERVICES ] --
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
|
--Messages
|
local DeathMessages = {"wasn't made for this world."} --you can add more if you like :D
|
-- Boolean
|
local defaultcooldown = 0.3
local cooldown = defaultcooldown
local lastSound = ""
|
-- opcode types for getting values
|
local opcode_t = {
[0] = 'ABC',
'ABx',
'ABC',
'ABC',
'ABC',
'ABx',
'ABC',
'ABx',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'AsBx',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'ABC',
'AsBx',
'AsBx',
'ABC',
'ABC',
'ABC',
'ABx',
'ABC',
}
local opcode_m = {
[0] = {b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgK', c = 'OpArgN'},
{b = 'OpArgU', c = 'OpArgU'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgU', c = 'OpArgN'},
{b = 'OpArgK', c = 'OpArgN'},
{b = 'OpArgR', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgN'},
{b = 'OpArgU', c = 'OpArgN'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgU', c = 'OpArgU'},
{b = 'OpArgR', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgR', c = 'OpArgR'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgK', c = 'OpArgK'},
{b = 'OpArgR', c = 'OpArgU'},
{b = 'OpArgR', c = 'OpArgU'},
{b = 'OpArgU', c = 'OpArgU'},
{b = 'OpArgU', c = 'OpArgU'},
{b = 'OpArgU', c = 'OpArgN'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgR', c = 'OpArgN'},
{b = 'OpArgN', c = 'OpArgU'},
{b = 'OpArgU', c = 'OpArgU'},
{b = 'OpArgN', c = 'OpArgN'},
{b = 'OpArgU', c = 'OpArgN'},
{b = 'OpArgU', c = 'OpArgN'},
}
|
-- tween the sound to the speed
|
local tween = game:GetService("TweenService"):Create(waterSound,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{["Volume"] = math.clamp(speed/maxSpeed,0,1)}) -- end of tweencreate
tween:Play()
if speed > 0.01 and not swim.IsPlaying then
swim:Play()
elseif speed <0.01 and swim.IsPlaying then
swim:Stop()
end
end
|
--[=[
@within TableUtil
@function EncodeJSON
@param value any
@return string
Proxy for [`HttpService:JSONEncode`](https://developer.roblox.com/en-us/api-reference/function/HttpService/JSONEncode).
]=]
|
local function EncodeJSON(value: any): string
return HttpService:JSONEncode(value)
end
|
--[[
The reconciler is the mechanism in Roact that constructs the virtual tree
that later gets turned into concrete objects by the renderer.
Roact's reconciler is constructed with the renderer as an argument, which
enables switching to different renderers for different platforms or
scenarios.
When testing the reconciler itself, it's common to use `NoopRenderer` with
spies replacing some methods. The default (and only) reconciler interface
exposed by Roact right now uses `RobloxRenderer`.
]]
|
local function createReconciler(renderer)
local reconciler
local mountVirtualNode
local updateVirtualNode
local unmountVirtualNode
--[[
Unmount the given virtualNode, replacing it with a new node described by
the given element.
Preserves host properties, depth, and context from parent.
]]
local function replaceVirtualNode(virtualNode, newElement)
local hostParent = virtualNode.hostParent
local hostKey = virtualNode.hostKey
local depth = virtualNode.depth
local parentContext = virtualNode.parentContext
unmountVirtualNode(virtualNode)
local newNode = mountVirtualNode(newElement, hostParent, hostKey, parentContext)
-- mountVirtualNode can return nil if the element is a boolean
if newNode ~= nil then
newNode.depth = depth
end
return newNode
end
--[[
Utility to update the children of a virtual node based on zero or more
updated children given as elements.
]]
local function updateChildren(virtualNode, hostParent, newChildElements)
if config.internalTypeChecks then
internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #1 to be of type VirtualNode")
end
local removeKeys = {}
-- Changed or removed children
for childKey, childNode in pairs(virtualNode.children) do
local newElement = ElementUtils.getElementByKey(newChildElements, childKey)
local newNode = updateVirtualNode(childNode, newElement)
if newNode ~= nil then
virtualNode.children[childKey] = newNode
else
removeKeys[childKey] = true
end
end
for childKey in pairs(removeKeys) do
virtualNode.children[childKey] = nil
end
-- Added children
for childKey, newElement in ElementUtils.iterateElements(newChildElements) do
local concreteKey = childKey
if childKey == ElementUtils.UseParentKey then
concreteKey = virtualNode.hostKey
end
if virtualNode.children[childKey] == nil then
local childNode = mountVirtualNode(newElement, hostParent, concreteKey, virtualNode.context)
-- mountVirtualNode can return nil if the element is a boolean
if childNode ~= nil then
childNode.depth = virtualNode.depth + 1
virtualNode.children[childKey] = childNode
end
end
end
end
local function updateVirtualNodeWithChildren(virtualNode, hostParent, newChildElements)
updateChildren(virtualNode, hostParent, newChildElements)
end
local function updateVirtualNodeWithRenderResult(virtualNode, hostParent, renderResult)
if Type.of(renderResult) == Type.Element
or renderResult == nil
or typeof(renderResult) == "boolean"
then
updateChildren(virtualNode, hostParent, renderResult)
else
error(("%s\n%s"):format(
"Component returned invalid children:",
virtualNode.currentElement.source or "<enable element tracebacks>"
), 0)
end
end
--[[
Unmounts the given virtual node and releases any held resources.
]]
function unmountVirtualNode(virtualNode)
if config.internalTypeChecks then
internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #1 to be of type VirtualNode")
end
local kind = ElementKind.of(virtualNode.currentElement)
if kind == ElementKind.Host then
renderer.unmountHostNode(reconciler, virtualNode)
elseif kind == ElementKind.Function then
for _, childNode in pairs(virtualNode.children) do
unmountVirtualNode(childNode)
end
elseif kind == ElementKind.Stateful then
virtualNode.instance:__unmount()
elseif kind == ElementKind.Portal then
for _, childNode in pairs(virtualNode.children) do
unmountVirtualNode(childNode)
end
elseif kind == ElementKind.Fragment then
for _, childNode in pairs(virtualNode.children) do
unmountVirtualNode(childNode)
end
else
error(("Unknown ElementKind %q"):format(tostring(kind), 2))
end
end
local function updateFunctionVirtualNode(virtualNode, newElement)
local children = newElement.component(newElement.props)
updateVirtualNodeWithRenderResult(virtualNode, virtualNode.hostParent, children)
return virtualNode
end
local function updatePortalVirtualNode(virtualNode, newElement)
local oldElement = virtualNode.currentElement
local oldTargetHostParent = oldElement.props.target
local targetHostParent = newElement.props.target
assert(renderer.isHostObject(targetHostParent), "Expected target to be host object")
if targetHostParent ~= oldTargetHostParent then
return replaceVirtualNode(virtualNode, newElement)
end
local children = newElement.props[Children]
updateVirtualNodeWithChildren(virtualNode, targetHostParent, children)
return virtualNode
end
local function updateFragmentVirtualNode(virtualNode, newElement)
updateVirtualNodeWithChildren(virtualNode, virtualNode.hostParent, newElement.elements)
return virtualNode
end
--[[
Update the given virtual node using a new element describing what it
should transform into.
`updateVirtualNode` will return a new virtual node that should replace
the passed in virtual node. This is because a virtual node can be
updated with an element referencing a different component!
In that case, `updateVirtualNode` will unmount the input virtual node,
mount a new virtual node, and return it in this case, while also issuing
a warning to the user.
]]
function updateVirtualNode(virtualNode, newElement, newState)
if config.internalTypeChecks then
internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #1 to be of type VirtualNode")
end
if config.typeChecks then
assert(
Type.of(newElement) == Type.Element or typeof(newElement) == "boolean" or newElement == nil,
"Expected arg #2 to be of type Element, boolean, or nil"
)
end
-- If nothing changed, we can skip this update
if virtualNode.currentElement == newElement and newState == nil then
return virtualNode
end
if typeof(newElement) == "boolean" or newElement == nil then
unmountVirtualNode(virtualNode)
return nil
end
if virtualNode.currentElement.component ~= newElement.component then
return replaceVirtualNode(virtualNode, newElement)
end
local kind = ElementKind.of(newElement)
local shouldContinueUpdate = true
if kind == ElementKind.Host then
virtualNode = renderer.updateHostNode(reconciler, virtualNode, newElement)
elseif kind == ElementKind.Function then
virtualNode = updateFunctionVirtualNode(virtualNode, newElement)
elseif kind == ElementKind.Stateful then
shouldContinueUpdate = virtualNode.instance:__update(newElement, newState)
elseif kind == ElementKind.Portal then
virtualNode = updatePortalVirtualNode(virtualNode, newElement)
elseif kind == ElementKind.Fragment then
virtualNode = updateFragmentVirtualNode(virtualNode, newElement)
else
error(("Unknown ElementKind %q"):format(tostring(kind), 2))
end
-- Stateful components can abort updates via shouldUpdate. If that
-- happens, we should stop doing stuff at this point.
if not shouldContinueUpdate then
return virtualNode
end
virtualNode.currentElement = newElement
return virtualNode
end
--[[
Constructs a new virtual node but not does mount it.
]]
local function createVirtualNode(element, hostParent, hostKey, context)
if config.internalTypeChecks then
internalAssert(renderer.isHostObject(hostParent) or hostParent == nil, "Expected arg #2 to be a host object")
internalAssert(typeof(context) == "table" or context == nil, "Expected arg #4 to be of type table or nil")
end
if config.typeChecks then
assert(hostKey ~= nil, "Expected arg #3 to be non-nil")
assert(
Type.of(element) == Type.Element or typeof(element) == "boolean",
"Expected arg #1 to be of type Element or boolean"
)
end
return {
[Type] = Type.VirtualNode,
currentElement = element,
depth = 1,
children = {},
hostParent = hostParent,
hostKey = hostKey,
context = context,
-- This copy of context is useful if the element gets replaced
-- with an element of a different component type
parentContext = context,
}
end
local function mountFunctionVirtualNode(virtualNode)
local element = virtualNode.currentElement
local children = element.component(element.props)
updateVirtualNodeWithRenderResult(virtualNode, virtualNode.hostParent, children)
end
local function mountPortalVirtualNode(virtualNode)
local element = virtualNode.currentElement
local targetHostParent = element.props.target
local children = element.props[Children]
assert(renderer.isHostObject(targetHostParent), "Expected target to be host object")
updateVirtualNodeWithChildren(virtualNode, targetHostParent, children)
end
local function mountFragmentVirtualNode(virtualNode)
local element = virtualNode.currentElement
local children = element.elements
updateVirtualNodeWithChildren(virtualNode, virtualNode.hostParent, children)
end
--[[
Constructs a new virtual node and mounts it, but does not place it into
the tree.
]]
function mountVirtualNode(element, hostParent, hostKey, context)
if config.internalTypeChecks then
internalAssert(renderer.isHostObject(hostParent) or hostParent == nil, "Expected arg #2 to be a host object")
internalAssert(typeof(context) == "table" or context == nil, "Expected arg #4 to be of type table or nil")
end
if config.typeChecks then
assert(hostKey ~= nil, "Expected arg #3 to be non-nil")
assert(
Type.of(element) == Type.Element or typeof(element) == "boolean",
"Expected arg #1 to be of type Element or boolean"
)
end
-- Boolean values render as nil to enable terse conditional rendering.
if typeof(element) == "boolean" then
return nil
end
local kind = ElementKind.of(element)
local virtualNode = createVirtualNode(element, hostParent, hostKey, context)
if kind == ElementKind.Host then
renderer.mountHostNode(reconciler, virtualNode)
elseif kind == ElementKind.Function then
mountFunctionVirtualNode(virtualNode)
elseif kind == ElementKind.Stateful then
element.component:__mount(reconciler, virtualNode)
elseif kind == ElementKind.Portal then
mountPortalVirtualNode(virtualNode)
elseif kind == ElementKind.Fragment then
mountFragmentVirtualNode(virtualNode)
else
error(("Unknown ElementKind %q"):format(tostring(kind), 2))
end
return virtualNode
end
--[[
Constructs a new Roact virtual tree, constructs a root node for
it, and mounts it.
]]
local function mountVirtualTree(element, hostParent, hostKey)
if config.typeChecks then
assert(Type.of(element) == Type.Element, "Expected arg #1 to be of type Element")
assert(renderer.isHostObject(hostParent) or hostParent == nil, "Expected arg #2 to be a host object")
end
if hostKey == nil then
hostKey = "RoactTree"
end
local tree = {
[Type] = Type.VirtualTree,
[InternalData] = {
-- The root node of the tree, which starts into the hierarchy of
-- Roact component instances.
rootNode = nil,
mounted = true,
},
}
tree[InternalData].rootNode = mountVirtualNode(element, hostParent, hostKey)
return tree
end
--[[
Unmounts the virtual tree, freeing all of its resources.
No further operations should be done on the tree after it's been
unmounted, as indicated by its the `mounted` field.
]]
local function unmountVirtualTree(tree)
local internalData = tree[InternalData]
if config.typeChecks then
assert(Type.of(tree) == Type.VirtualTree, "Expected arg #1 to be a Roact handle")
assert(internalData.mounted, "Cannot unmounted a Roact tree that has already been unmounted")
end
internalData.mounted = false
if internalData.rootNode ~= nil then
unmountVirtualNode(internalData.rootNode)
end
end
--[[
Utility method for updating the root node of a virtual tree given a new
element.
]]
local function updateVirtualTree(tree, newElement)
local internalData = tree[InternalData]
if config.typeChecks then
assert(Type.of(tree) == Type.VirtualTree, "Expected arg #1 to be a Roact handle")
assert(Type.of(newElement) == Type.Element, "Expected arg #2 to be a Roact Element")
end
internalData.rootNode = updateVirtualNode(internalData.rootNode, newElement)
return tree
end
reconciler = {
mountVirtualTree = mountVirtualTree,
unmountVirtualTree = unmountVirtualTree,
updateVirtualTree = updateVirtualTree,
createVirtualNode = createVirtualNode,
mountVirtualNode = mountVirtualNode,
unmountVirtualNode = unmountVirtualNode,
updateVirtualNode = updateVirtualNode,
updateVirtualNodeWithChildren = updateVirtualNodeWithChildren,
updateVirtualNodeWithRenderResult = updateVirtualNodeWithRenderResult,
}
return reconciler
end
return createReconciler
|
--[[
shared.getdate() --Returns the current date
shared.gettime() --Returns the current time
shared.gettime(true) --Returns the current time in 24 hour format
shared.getdatetime() --Returns the current time and date
shared.getdatetime(true) --Returns the current time and date in 24 hour format
]]
|
months = {"January","February","March","April","May","June","July","August","September","October","November","December"}
daysinmonth = {31,28,31,30,31,30,31,31,30,31,30,31}
_G.gettime = function(hour24)
time = tick()
tsec = time % 86400
hour = math.floor((tsec/60/60)%24)
min = math.floor((tsec/60)%60)
sec = math.floor(tsec%60)
if sec < 10 then
sec = "0"..sec
end
if min < 10 then
min = "0"..min
end
if hour24 ~= true then
if hour > 12 then
hour = hour - 12
sec = sec.." PM"
else
sec = sec.." AM"
end
end
string = hour..":"..min..":"..sec
return string
end
function shared.getdate()
time = tick()
year = math.floor(time/60/60/24/365.25+1970)
day = math.ceil(time/60/60/24%365.25)
for i=1, #daysinmonth do
if day > daysinmonth[i] then
day = day - daysinmonth[i]
else
month = months[i]
break
end
end
string = month.." "..day..", "..year
return string
end
function shared.getdatetime(hour24)
string = shared.gettime(hour24).." "..shared.getdate()
return string
end
|
-- << SETUP >>
|
local character = main.player.Character or main.player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
main.humanoidRigType = humanoid.RigType
wait(1)
for speedCommandName, _ in pairs(main.commandSpeeds) do
if main.commandsActive[speedCommandName] then
main.commandsActive[speedCommandName] = nil
main:GetModule("cf"):ActivateClientCommand(speedCommandName)
end
end
|
-- Libraries
|
local Libraries = Tool:WaitForChild 'Libraries'
local Make = require(Libraries:WaitForChild 'Make')
local ListenForManualWindowTrigger = require(Tool.Core:WaitForChild('ListenForManualWindowTrigger'))
|
-- Make signal strict
|
setmetatable(Signal, {
__index = function(tb, key)
error(("Attempt to get Signal::%s (not a valid member)"):format(tostring(key)), 2)
end,
__newindex = function(tb, key, value)
error(("Attempt to set Signal::%s (not a valid member)"):format(tostring(key)), 2)
end
})
return Signal
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Lapis",Paint)
end)
|
-- Class
|
local DraggerClass = {}
DraggerClass.__index = DraggerClass
DraggerClass.__type = "Dragger"
function DraggerClass:__tostring()
return DraggerClass.__type
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
if key == "u" then
if script.Parent.Rev.Sound == true then
script.Parent.IsOn.Value = false
end
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local throt=0
local redline=0
script:WaitForChild("Rev")
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
throt = math.max(.3,throt-.2)
else
throt = math.min(1,throt+.1)
end
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
redline=.5
else
redline=1
end
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2),script.Rev.SetPitch.Value)
if FE then
handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,script.Rev.Volume)
else
car.DriveSeat.Rev.Pitch = Pitch
end
end
|
--
|
Humanoid.Changed:Connect(function()
if Enum.Material[Humanoid.FloorMaterial.Name] then
script.Parent.CurrentMaterial.Value = Humanoid.FloorMaterial.Name
else
script.Parent.CurrentMaterial.Value = DefaultSound
end
end)
function TurnOffSounds()
for i,v in pairs(script.Parent:GetChildren()) do
if v.ClassName == "Sound" then
v.Playing = false
end
end
end
function MakeSound()
for i,v in pairs(script.Parent:GetChildren()) do
if v.ClassName == "Sound" then
if v.Name ~= script.Parent.CurrentMaterial.Value then
v.Playing = false
else
if script.Parent.CurrentMaterial.Value == 'Air' and ToggleAirSound == true then
v.Playing = true
v.PlaybackSpeed = Humanoid.WalkSpeed / 18
else
if v.Name ~= 'Air' then
v.Playing = true
v.PlaybackSpeed = Humanoid.WalkSpeed / 18
end
end
end
end
end
end
function MakeDefaultSound()
for i,v in pairs(script.Parent:GetChildren()) do
if v.ClassName == "Sound" then
if v.Name ~= DefaultSound then
v.Playing = false
else
v.Playing = true
v.PlaybackSpeed = Humanoid.WalkSpeed / 18
end
end
end
end
while wait(1/10) do
local Moving = Humanoid.MoveDirection ~= Vector3.new(0,0,0)
if Moving then
if script.Parent:FindFirstChild(script.Parent.CurrentMaterial.Value) and script.Parent.CurrentMaterial.Value ~= nil then
MakeSound()
else
MakeDefaultSound()
end
else
TurnOffSounds()
end
end
|
--------------------------------------------------------------------------------------------------------------
|
local CAS = game:GetService("ContextActionService")
CAS:BindAction("Sprint", sprint, true, bind1, bind2) -- Binds the keybinds to the sprint function and creates a mobile button for it
CAS:SetPosition("Sprint", UDim2.new(0.7,0,0,0)) -- Changes the position of the mobile button within the context frame, to read more about how UDim2 positions work, go to https://developer.roblox.com/en-us/api-reference/datatype/UDim2
CAS:SetTitle("Sprint", "Ctrl") -- Sets the text on the mobile button, replace Ctrl with any text you desire
|
-- ROBLOX deviation START: defining parse as callable table
|
local parse_
local parse = setmetatable({}, {
__call = function(_self: any, input: string, options: Object?)
return parse_(input, options)
end,
})
function parse_(input, options) -- ROBLOX deviation END
if typeof(input) ~= "string" then
error(Error.new("TypeError: Expected a string"))
end
input = REPLACEMENTS[input] or input
local opts = Object.assign({}, options)
local max = if typeof(opts.maxLength) == "number" then math.min(MAX_LENGTH, opts.maxLength) else MAX_LENGTH
local len = #input
if len > max then
error(
Error.new(
("SyntaxError: Input length: %s, exceeds maximum allowed length: %s"):format(
tostring(len),
tostring(max)
)
)
)
end
local bos = { type = "bos", value = "", output = opts.prepend or "" }
local tokens = { bos }
local capture = if Boolean.toJSBoolean(opts.capture) then "" else "?:"
local win32 = utils.isWindows(options)
-- create constants based on platform, for windows or posix
local PLATFORM_CHARS = constants.globChars(win32)
local EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS)
local DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR =
PLATFORM_CHARS.DOT_LITERAL,
PLATFORM_CHARS.PLUS_LITERAL,
PLATFORM_CHARS.SLASH_LITERAL,
PLATFORM_CHARS.ONE_CHAR,
PLATFORM_CHARS.DOTS_SLASH,
PLATFORM_CHARS.NO_DOT,
PLATFORM_CHARS.NO_DOT_SLASH,
PLATFORM_CHARS.NO_DOTS_SLASH,
PLATFORM_CHARS.QMARK,
PLATFORM_CHARS.QMARK_NO_DOT,
PLATFORM_CHARS.STAR,
PLATFORM_CHARS.START_ANCHOR
local function globstar(opts)
return ("(%s(?:(?!%s%s).)*?)"):format(
capture,
START_ANCHOR,
if Boolean.toJSBoolean(opts.dot) then DOTS_SLASH else DOT_LITERAL
)
end
local nodot = if Boolean.toJSBoolean(opts.dot) then "" else NO_DOT
local qmarkNoDot = if Boolean.toJSBoolean(opts.dot) then QMARK else QMARK_NO_DOT
local star = if opts.bash == true then globstar(opts) else STAR
if Boolean.toJSBoolean(opts.capture) then
star = ("(%s)"):format(star)
end
-- minimatch options support
if typeof(opts.noext) == "boolean" then
opts.noextglob = opts.noext
end
local state = {
input = input,
index = 0,
start = 1,
dot = opts.dot == true,
consumed = "",
output = "",
prefix = "",
backtrack = false,
negated = false,
brackets = 0,
braces = 0,
parens = 0,
quotes = 0,
globstar = false,
tokens = tokens,
}
input = utils.removePrefix(input, state)
len = #input
local extglobs: Array<Token> = {}
local braces: Array<Token> = {}
local stack: Array<string> = {}
local prev: Token = bos
local value
--[[*
* Tokenizing helpers
]]
local function eos()
return state.index == len
end
state.peek = function(n_: number?)
local n = if n_ ~= nil then n_ else 1
return string.sub(input, state.index + n, state.index + n)
end
local peek = state.peek
state.advance = function()
state.index += 1
return string.sub(input, state.index, state.index) or ""
end
local advance = state.advance
local function remaining()
return string.sub(input, state.index + 1)
end
local function consume(value_: string?, num_: number?)
local value = value_ or ""
local num = num_ or 0
state.consumed ..= value
state.index += num
end
local function append(token: Token)
state.output ..= if token.output ~= nil then token.output else token.value
consume(token.value)
end
local function negate()
local count = 1
while peek() == "!" and (peek(2) ~= "(" or peek(3) == "?") do
advance()
state.start += 1
count += 1
end
if count % 2 == 0 then
return false
end
state.negated = true
state.start += 1
return true
end
local function increment(type)
state[type] += 1
table.insert(stack, type)
end
local function decrement(type)
state[type] -= 1
table.remove(stack)
end
--[[*
* Push tokens onto the tokens array. This helper speeds up
* tokenizing by 1) helping us avoid backtracking as much as possible,
* and 2) helping us avoid creating extra tokens when consecutive
* characters are plain text. This improves performance and simplifies
* lookbehinds.
]]
local function push(tok: Token)
if prev.type == "globstar" then
local isBrace = state.braces > 0 and (tok.type == "comma" or tok.type == "brace")
local isExtglob = tok.extglob == true
or if #extglobs ~= 0 then tok.type == "pipe" or tok.type == "paren" else #extglobs
if tok.type ~= "slash" and tok.type ~= "paren" and not isBrace and not isExtglob then
state.output = String.slice(state.output, 0, -#prev.output)
prev.type = "star"
prev.value = "*"
prev.output = star
state.output ..= prev.output
end
end
if #extglobs ~= 0 and tok.type ~= "paren" then
extglobs[#extglobs].inner ..= tok.value
end
if Boolean.toJSBoolean(tok.value) or Boolean.toJSBoolean(tok.output) then
append(tok)
end
if prev ~= nil and prev.type == "text" and tok.type == "text" then
prev.value ..= tok.value
prev.output = (prev.output or "") .. tok.value
return
end
tok.prev = prev
table.insert(tokens, tok)
prev = tok
end
local function extglobOpen(type, value)
local token = Object.assign({}, EXTGLOB_CHARS[value], { conditions = 1, inner = "" })
token.prev = prev
token.parens = state.parens
token.output = state.output
local output = (if Boolean.toJSBoolean(opts.capture) then "(" else "") .. token.open
increment("parens")
push({
type = type,
value = value,
output = if Boolean.toJSBoolean(state.output) then "" else ONE_CHAR,
})
push({ type = "paren", extglob = true, value = advance(), output = output })
table.insert(extglobs, token)
end
local function extglobClose(token: Token)
local output = token.close .. (if Boolean.toJSBoolean(opts.capture) then ")" else "")
local rest
if token.type == "negate" then
local extglobStar = star
if token.inner ~= nil and #token.inner > 1 and token.inner:find("/", 1, true) ~= nil then
extglobStar = globstar(opts)
end
if extglobStar ~= star or eos() or RegExp("^\\)+$"):test(remaining()) then
token.close = (")$))%s"):format(extglobStar)
output = token.close
end
if
token.inner:find("*", 1, true) ~= nil
and (function()
rest = remaining()
return rest
end)()
and RegExp("^\\.[^\\\\/.]+$"):test(rest)
then
-- Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.
-- In this case, we need to parse the string and use it in the output of the original pattern.
-- Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.
--
-- Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.
local expression = parse(rest, Object.assign({}, options, { fastpaths = false })).output
token.close = (")%s)%s)"):format(expression, extglobStar)
output = token.close
end
if token.prev.type == "bos" then
state.negatedExtglob = true
end
end
push({ type = "paren", extglob = true, value = value, output = output })
decrement("parens")
end
--[[*
* Fast paths
]]
if opts.fastpaths ~= false and not RegExp('(^[*!]|[/()[\\]{}"])'):test(input) then
local backslashes = false
-- ROBLOX deviation: using custom string.replace implementation
local output = String_replace(input, REGEX_SPECIAL_CHARS_BACKREF, function(m, esc, chars, first, rest, index)
if first == "\\" then
backslashes = true
return m
end
if first == "?" then
if Boolean.toJSBoolean(esc) then
return esc .. first .. if rest ~= nil then string.rep(QMARK, #rest) else ""
end
if index == 0 then
return qmarkNoDot .. if rest ~= nil then string.rep(QMARK, #rest) else ""
end
return string.rep(QMARK, #chars)
end
if first == "." then
return string.rep(DOT_LITERAL, #chars)
end
if first == "*" then
if Boolean.toJSBoolean(esc) then
return esc .. first .. if rest ~= nil then star else ""
end
return star
end
return if Boolean.toJSBoolean(esc) then m else ("\\%s"):format(m)
end)
if backslashes == true then
if opts.unescape == true then
-- ROBLOX FIXME START: change :replace to working solution
error("not implemented")
-- output = output:replace(RegExp("\\", "g")(""))
-- ROBLOX FIXME END
else
-- ROBLOX FIXME START: change :replace to working solution
error("not implemented")
-- output = output:replace(RegExp("\\+", "g"), function(m)
-- return if #m % 2 == 0 then "\\\\" else (if Boolean.toJSBoolean(m) then "\\" else "")
-- end)
-- ROBLOX FIXME END
end
end
if output == input and opts.contains == true then
state.output = input
return state
end
state.output = utils.wrapOutput(output, state, options)
return state
end
--[[*
* Tokenize input until we reach end-of-string
]]
while not eos() do
value = advance()
if value == "\u{0000}" then
continue
end
--[[*
* Escaped characters
]]
if value == "\\" then
local next = peek()
if next == "/" and opts.bash ~= true then
continue
end
if next == "." or next == ";" then
continue
end
if not Boolean.toJSBoolean(next) then
-- ROBLOX FIXME Luau: it seems that Luau narrows the type to be singleton type of "\\" and doesn't allow to append anything to it
value ..= "\\" :: any
push({ type = "text", value = value })
continue
end
-- collapse slashes to reduce potential for exploits
local match = (RegExp("^\\\\+")):exec(remaining())
local slashes = 0
if match ~= nil and #match[1] > 2 then
slashes = #match[1]
state.index += slashes
if slashes % 2 ~= 0 then
value ..= "\\"
end
end
if opts.unescape == true then
value = advance()
else
value ..= advance()
end
if state.brackets == 0 then
push({ type = "text", value = value })
continue
end
end
--[[*
* If we're inside a regex character class, continue
* until we reach the closing bracket.
]]
if state.brackets > 0 and (value ~= "]" or prev.value == "[" or prev.value == "[^") then
if opts.posix ~= false and value == ":" then
local inner = String.slice(prev.value, 1)
if inner:find("[") ~= nil then
prev.posix = true
if inner:find(":") ~= nil then
local idx = String.lastIndexOf(prev.value, "[")
local pre = String.slice(prev.value, 1, idx)
local rest = String.slice(prev.value, idx + 2)
local posix = POSIX_REGEX_SOURCE[rest]
if posix then
prev.value = pre .. posix
state.backtrack = true
advance()
if
not Boolean.toJSBoolean(bos.output)
and Array.indexOf(tokens, prev) == 2 --[[ ROBLOX deviation: added 1 to account for 1-based indexing]]
then
bos.output = ONE_CHAR
end
continue
end
end
end
end
if value == "[" and peek() ~= ":" or value == "-" and peek() == "]" then
value = ("\\%s"):format(value)
end
if value == "]" and (prev.value == "[" or prev.value == "[^") then
value = ("\\%s"):format(value)
end
if opts.posix == true and value == "!" and prev.value == "[" then
value = "^"
end
prev.value ..= value
append({ value = value })
continue
end
--[[*
* If we're inside a quoted string, continue
* until we reach the closing double quote.
]]
if state.quotes == 1 and value ~= '"' then
value = utils.escapeRegex(value)
prev.value ..= value
append({ value = value })
continue
end
--[[*
* Double quotes
]]
if value == '"' then
state.quotes = state.quotes == 1 and 0 or 1
if opts.keepQuotes == true then
push({ type = "text", value = value })
end
continue
end
--[[*
* Parentheses
]]
if value == "(" then
increment("parens")
push({ type = "paren", value = value })
continue
end
if value == ")" then
if state.parens == 0 and opts.strictBrackets == true then
error(Error.new("SyntaxError: " .. syntaxError("opening", "(")))
end
local extglob = extglobs[#extglobs]
if extglob ~= nil and state.parens == extglob.parens + 1 then
extglobClose(table.remove(extglobs) :: Token)
continue
end
push({
type = "paren",
value = value,
output = if Boolean.toJSBoolean(state.parens) then ")" else "\\)",
})
decrement("parens")
continue
end
--[[*
* Square brackets
]]
if value == "[" then
if opts.nobracket == true or not remaining():find("]") ~= nil then
if opts.nobracket ~= true and opts.strictBrackets == true then
error(Error.new("SyntaxError: " .. syntaxError("closing", "]")))
end
value = ("\\%s"):format(value)
else
increment("brackets")
end
push({ type = "bracket", value = value })
continue
end
if value == "]" then
if opts.nobracket == true or (prev ~= nil and prev.type == "bracket" and #prev.value == 1) then
push({ type = "text", value = value, output = ("\\%s"):format(value) })
continue
end
if state.brackets == 0 then
if opts.strictBrackets == true then
error(Error.new("SyntaxError: " .. syntaxError("opening", "[")))
end
push({ type = "text", value = value, output = ("\\%s"):format(value) })
continue
end
decrement("brackets")
local prevValue = String.slice(prev.value, 2)
if prev.posix ~= true and prevValue:sub(1, 1) == "^" and not prevValue:find("/") ~= nil then
value = ("/%s"):format(value)
end
prev.value ..= value
append({ value = value })
-- when literal brackets are explicitly disabled
-- assume we should match with a regex character class
if opts.literalBrackets == false or utils.hasRegexChars(prevValue) then
continue
end
local escaped = utils.escapeRegex(prev.value)
state.output = String.slice(state.output, 1, -#prev.value)
-- when literal brackets are explicitly enabled
-- assume we should escape the brackets to match literal characters
if opts.literalBrackets == true then
state.output ..= escaped
prev.value = escaped
continue
end
-- when the user specifies nothing, try to match both
prev.value = ("(%s%s|%s)"):format(capture, escaped, prev.value)
state.output ..= prev.value
continue
end
--[[*
* Braces
]]
if value == "{" and opts.nobrace ~= true then
increment("braces")
local open = {
type = "brace",
value = value,
output = "(",
outputIndex = #state.output,
tokensIndex = #state.tokens,
}
table.insert(braces, open)
push(open)
continue
end
if value == "}" then
local brace = braces[#braces]
if opts.nobrace == true or not Boolean.toJSBoolean(brace) then
push({ type = "text", value = value, output = value })
continue
end
local output = ")"
if brace.dots == true then
local arr = Array.slice(tokens)
local range = {}
for i = #arr, 1, -1 do
table.remove(tokens)
if arr[i].type == "brace" then
break
end
if arr[i].type ~= "dots" then
table.insert(range, 1, arr[i].value)
end
end
output = expandRange(range, opts)
state.backtrack = true
end
if brace.comma ~= true and brace.dots ~= true then
local out = String.slice(state.output, 1, brace.outputIndex)
local toks = Array.slice(state.tokens, brace.tokensIndex)
brace.output = "\\{"
brace.value = brace.output
output = "\\}"
value = output
state.output = out
for _, t in ipairs(toks) do
state.output ..= if Boolean.toJSBoolean(t.output) then t.output else t.value
end
end
push({ type = "brace", value = value, output = output })
decrement("braces")
table.remove(braces)
continue
end
--[[*
* Pipes
]]
if value == "|" then
if #extglobs > 0 then
extglobs[#extglobs].conditions += 1
end
push({ type = "text", value = value })
continue
end
--[[*
* Commas
]]
if value == "," then
local output = value
local brace = braces[#braces]
if Boolean.toJSBoolean(brace) and stack[#stack] == "braces" then
brace.comma = true
output = "|"
end
push({ type = "comma", value = value, output = output })
continue
end
--[[*
* Slashes
]]
if value == "/" then
-- if the beginning of the glob is "./", advance the start
-- to the current index, and don't add the "./" characters
-- to the state. This greatly simplifies lookbehinds when
-- checking for BOS characters like "!" and "." (not "./")
if prev.type == "dot" and state.index == state.start + 1 then
state.start = state.index + 1
state.consumed = ""
state.output = ""
table.remove(tokens)
prev = bos -- reset "prev" to the first token
continue
end
push({ type = "slash", value = value, output = SLASH_LITERAL })
continue
end
--[[*
* Dots
]]
if value == "." then
if state.braces > 0 and prev.type == "dot" then
if prev.value == "." then
prev.output = DOT_LITERAL
end
local brace = braces[#braces]
prev.type = "dots"
prev.output ..= value
prev.value ..= value
brace.dots = true
continue
end
if state.braces + state.parens == 0 and prev.type ~= "bos" and prev.type ~= "slash" then
push({ type = "text", value = value, output = DOT_LITERAL })
continue
end
push({ type = "dot", value = value, output = DOT_LITERAL })
continue
end
--[[*
* Question marks
]]
if value == "?" then
local isGroup = Boolean.toJSBoolean(prev) and prev.value == "("
if not isGroup and opts.noextglob ~= true and peek() == "(" and peek(2) ~= "?" then
extglobOpen("qmark", value)
continue
end
if Boolean.toJSBoolean(prev) and prev.type == "paren" then
local next = peek()
local output = value
if next == "<" and not utils.supportsLookbehinds() then
error(Error.new("Node.js v10 or higher is required for regex lookbehinds"))
end
if
(prev.value == "(" and not RegExp("[!=<:]"):test(next))
or (next == "<" and not RegExp("<([!=]|\\w+>)"):test(remaining()))
then
output = ("\\%s"):format(value)
end
push({ type = "text", value = value, output = output })
continue
end
if opts.dot ~= true and (prev.type == "slash" or prev.type == "bos") then
push({ type = "qmark", value = value, output = QMARK_NO_DOT })
continue
end
push({ type = "qmark", value = value, output = QMARK })
continue
end
--[[*
* Exclamation
]]
if value == "!" then
if opts.noextglob ~= true and peek() == "(" then
if peek(2) ~= "?" or not RegExp("[!=<:]"):test(peek(3)) then
extglobOpen("negate", value)
continue
end
end
if opts.nonegate ~= true and state.index == 1 then
negate()
continue
end
end
--[[*
* Plus
]]
if value == "+" then
if opts.noextglob ~= true and peek() == "(" and peek(2) ~= "?" then
extglobOpen("plus", value)
continue
end
if prev ~= nil and prev.value == "(" or opts.regex == false then
push({ type = "plus", value = value, output = PLUS_LITERAL })
continue
end
if
(prev ~= nil and (prev.type == "bracket" or prev.type == "paren" or prev.type == "brace"))
or state.parens > 0
then
push({ type = "plus", value = value })
continue
end
push({ type = "plus", value = PLUS_LITERAL })
continue
end
--[[*
* Plain text
]]
if value == "@" then
if opts.noextglob ~= true and peek() == "(" and peek(2) ~= "?" then
push({ type = "at", extglob = true, value = value, output = "" })
continue
end
push({ type = "text", value = value })
continue
end
--[[*
* Plain text
]]
if value ~= "*" then
if value == "$" or value == "^" then
value = ("\\%s"):format(value)
end
local match = string.match(remaining(), REGEX_NON_SPECIAL_CHARS)
if match ~= nil then
value ..= match
state.index += #match
end
push({ type = "text", value = value })
continue
end
--[[*
* Stars
]]
if prev ~= nil and (prev.type == "globstar" or prev.star == true) then
prev.type = "star"
prev.star = true
prev.value ..= value
prev.output = star
state.backtrack = true
state.globstar = true
consume(value)
continue
end
local rest = remaining()
if Boolean.toJSBoolean(opts.noextglob ~= true and RegExp("^\\([^?]"):test(rest)) then
extglobOpen("star", value)
continue
end
if prev.type == "star" then
if opts.noglobstar == true then
consume(value)
continue
end
local prior = prev.prev
local before = prior.prev
local isStart = prior.type == "slash" or prior.type == "bos"
local afterStar = if Boolean.toJSBoolean(before)
then before.type == "star" or before.type == "globstar"
else before
if opts.bash == true and (not isStart or (rest:sub(1, 1) ~= nil and rest:sub(1, 1) ~= "/")) then
push({ type = "star", value = value, output = "" })
continue
end
local isBrace = state.braces > 0 and (prior.type == "comma" or prior.type == "brace")
local isExtglob = #extglobs > 0 and (prior.type == "pipe" or prior.type == "paren")
if not isStart and prior.type ~= "paren" and not isBrace and not isExtglob then
push({ type = "star", value = value, output = "" })
continue
end
-- strip consecutive `/**/`
while String.slice(rest, 1, 4) == "/**" do
local after = input:sub(state.index + 4, state.index + 4)
if Boolean.toJSBoolean(after) and after ~= "/" then
break
end
rest = String.slice(rest, 4)
consume("/**", 3)
end
if prior.type == "bos" and eos() then
prev.type = "globstar"
prev.value ..= value
prev.output = globstar(opts)
state.output = prev.output
state.globstar = true
consume(value)
continue
end
if prior.type == "slash" and prior.prev.type ~= "bos" and not Boolean.toJSBoolean(afterStar) and eos() then
state.output = String.slice(state.output, 1, -#(prior.output .. prev.output))
prior.output = ("(?:%s"):format(prior.output)
prev.type = "globstar"
prev.output = globstar(opts) .. (if opts.strictSlashes then ")" else "|$)")
prev.value ..= value
state.globstar = true
state.output ..= prior.output .. prev.output
consume(value)
continue
end
if prior.type == "slash" and prior.prev.type ~= "bos" and rest:sub(1, 1) == "/" then
local end_ = if rest:sub(2, 2) ~= nil then "|$" else ""
state.output = String.slice(state.output, 1, -#(prior.output .. prev.output))
prior.output = ("(?:%s"):format(prior.output)
prev.type = "globstar"
prev.output = ("%s%s|%s%s)"):format(globstar(opts), SLASH_LITERAL, SLASH_LITERAL, end_)
prev.value ..= value
state.output ..= prior.output .. prev.output
state.globstar = true
consume(value .. advance())
push({ type = "slash", value = "/", output = "" })
continue
end
if prior.type == "bos" and rest:sub(1, 1) == "/" then
prev.type = "globstar"
prev.value ..= value
prev.output = ("(?:^|%s|%s%s)"):format(SLASH_LITERAL, globstar(opts), SLASH_LITERAL)
state.output = prev.output
state.globstar = true
consume(value .. advance())
push({ type = "slash", value = "/", output = "" })
continue
end
-- remove single star from output
state.output = String.slice(state.output, 1, -#prev.output)
-- reset previous token to globstar
prev.type = "globstar"
prev.output = globstar(opts)
prev.value ..= value
-- reset output with globstar
state.output ..= prev.output
state.globstar = true
consume(value)
continue
end
local token = { type = "star", value = value, output = star }
if opts.bash == true then
token.output = ".*?"
if prev.type == "bos" or prev.type == "slash" then
token.output = nodot .. token.output
end
push(token)
continue
end
if prev ~= nil and (prev.type == "bracket" or prev.type == "paren") and opts.regex == true then
token.output = value
push(token)
continue
end
if state.index == state.start or prev.type == "slash" or prev.type == "dot" then
if prev.type == "dot" then
state.output ..= NO_DOT_SLASH
prev.output ..= NO_DOT_SLASH
elseif opts.dot == true then
state.output ..= NO_DOTS_SLASH
prev.output ..= NO_DOTS_SLASH
else
state.output ..= nodot
prev.output ..= nodot
end
if peek() ~= "*" then
state.output ..= ONE_CHAR
prev.output ..= ONE_CHAR
end
end
push(token)
end
while state.brackets > 0 do
if opts.strictBrackets == true then
error(Error.new("SyntaxError: " .. syntaxError("closing", "]")))
end
state.output = utils.escapeLast(state.output, "[")
decrement("brackets")
end
while state.parens > 0 do
if opts.strictBrackets == true then
error(Error.new("SyntaxError: " .. syntaxError("closing", ")")))
end
state.output = utils.escapeLast(state.output, "(")
decrement("parens")
end
while state.braces > 0 do
if opts.strictBrackets == true then
error(Error.new("SyntaxError: " .. syntaxError("closing", "}")))
end
state.output = utils.escapeLast(state.output, "{")
decrement("braces")
end
if opts.strictSlashes ~= true and (prev.type == "star" or prev.type == "bracket") then
push({ type = "maybe_slash", value = "", output = ("%s?"):format(SLASH_LITERAL) })
end
-- rebuild the output if we had to backtrack at any point
if state.backtrack == true then
state.output = ""
for _, token: Token in ipairs(state.tokens) do
state.output ..= if token.output ~= nil then token.output else token.value
if token.suffix then
state.output ..= token.suffix
end
end
end
return state
end
|
--[[do
local SwordPodium = require(script.SwordPodium)
for i,v in pairs(game:GetService("CollectionService"):GetTagged("SwordPodium")) do
local Podium = SwordPodium.new(v)
end
end]]
|
return this
|
-- functions
|
function StopAllAnimations()
local OldAnim = CurrentAnim
-- return to idle if finishing an emote
if EmoteNames[OldAnim] and not EmoteNames[OldAnim] then
OldAnim = "Idle"
end
CurrentAnim = ""
if CurrentAnimKeyframeHandler then
CurrentAnimKeyframeHandler:disconnect()
end
if CurrentAnimTrack then
CurrentAnimTrack:Stop()
CurrentAnimTrack:Destroy()
CurrentAnimTrack = nil
end
return OldAnim
end
function SetAnimationSpeed(Speed)
if Speed ~= CurrentAnimSpeed then
CurrentAnimSpeed = Speed
CurrentAnimTrack:AdjustSpeed(CurrentAnimSpeed)
end
end
function KeyframeReachedFunc(FrameName)
if FrameName == "End" then
|
-- Waits for the child of the specified parent
|
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
local Tool = script.Parent
local Animations = {}
local MyHumanoid
local MyCharacter
local function PlayAnimation(animationName)
if Animations[animationName] then
Animations[animationName]:Play()
end
end
local function StopAnimation(animationName)
if Animations[animationName] then
Animations[animationName]:Stop()
end
end
function OnEquipped(mouse)
MyCharacter = Tool.Parent
MyHumanoid = WaitForChild(MyCharacter, 'Humanoid')
if MyHumanoid then
Animations['IdleAnim3'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
Animations['IdleAnim3'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
Animations['IdleAnim3'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
Animations['IdleAnim3'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
Animations['IdleAnim3'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
Animations['IdleAnim3'] = MyHumanoid:LoadAnimation(WaitForChild(Tool, 'IdleAnim3'))
end
PlayAnimation('IdleAnim3')
PlayAnimation('IdleAnim3')
end
function OnUnequipped()
for animName, _ in pairs(Animations) do
StopAnimation(animName)
end
end
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
WaitForChild(Tool, 'PlayIdleAnim3').Changed:connect(
function (value)
--if value then
PlayAnimation('IdleAnim3')
--else
-- StopAnimation('IdleAnim3')
--end
end)
WaitForChild(Tool, 'PlayIdleAnim3').Changed:connect(
function (value)
--if value then
PlayAnimation('IdleAnim3')
--else
-- StopAnimation('IdleAnim3')
--end
end)
WaitForChild(Tool, 'PlayIdleAnim3').Changed:connect(
function (value)
--if value then
PlayAnimation('IdleAnim3')
--else
-- StopAnimation('IdleAnim3')
--end
end)
|
--//Events--
|
game:GetService("RunService").RenderStepped:Connect(function()
--//Visible--
for i, part in pairs(character:GetChildren()) do
if string.match(part.Name, "Leg") or string.match(part.Name, "Foot") then
part.LocalTransparencyModifier = 0
end
end
end)
|
-- GUI Elements
|
local SelectionFrame = script.Parent
local List = SelectionFrame:FindFirstChild("List")
local Container = List:FindFirstChild("Container")
local UIGridLayout = Container:FindFirstChild("UIGridLayout")
local Selected = SelectionFrame:FindFirstChild("Selected")
local SelectedName = SelectionFrame:FindFirstChild("SelectedName")
local InfoFrames = SelectionFrame:FindFirstChild("InfoFrames")
local InfoFrame
if IS_CONSOLE then
InfoFrame = InfoFrames:FindFirstChild("InfoFrameConsole")
elseif IS_MOBILE then
InfoFrame = InfoFrames:FindFirstChild("InfoFrameMobile")
else
InfoFrame = InfoFrames:FindFirstChild("InfoFrame")
end
local ExitButton = SelectionFrame:FindFirstChild("ExitButton")
local SelectButton = SelectionFrame:FindFirstChild("SelectButton")
local InfoButton = SelectionFrame:FindFirstChild("InfoButton")
local InfoExitButton = InfoFrame:FindFirstChild("ExitButton")
local PlayerGui = player:WaitForChild("PlayerGui")
local TopBar = PlayerGui:WaitForChild("TopBar")
|
--[=[
Returns the viewport point ray for the mouse at the current mouse
position (or the override position if provided).
]=]
|
function Mouse:GetRay(overridePos: Vector2?): Ray
local mousePos = overridePos or UserInputService:GetMouseLocation()
local viewportMouseRay = workspace.CurrentCamera:ViewportPointToRay(mousePos.X, mousePos.Y)
return viewportMouseRay
end
|
-- Get references to the DockShelf and its children
|
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local aFinderButton = dockShelf.CSafari
local opened = aFinderButton.Opened
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent
|
--[=[
The current position at the given clock time. Assigning the position will change the spring to have that position.
```lua
local spring = Spring.new(0)
print(spring.Position) --> 0
```
@prop Position T
@within Spring
]=]
--[=[
Alias for [Spring.Position](/api/Spring#Position)
@prop p T
@within Spring
]=]
--[=[
The current velocity. Assigning the velocity will change the spring to have that velocity.
```lua
local spring = Spring.new(0)
print(spring.Velocity) --> 0
```
@prop Velocity T
@within Spring
]=]
--[=[
Alias for [Spring.Velocity](/api/Spring#Velocity)
@prop v T
@within Spring
]=]
--[=[
The current target. Assigning the target will change the spring to have that target.
```lua
local spring = Spring.new(0)
print(spring.Target) --> 0
```
@prop Target T
@within Spring
]=]
--[=[
Alias for [Spring.Target](/api/Spring#Target)
@prop t T
@within Spring
]=]
--[=[
The current damper, defaults to 1. At 1 the spring is critically damped. At less than 1, it
will be underdamped, and thus, bounce, and at over 1, it will be critically damped.
@prop Damper number
@within Spring
]=]
--[=[
Alias for [Spring.Damper](/api/Spring#Damper)
@prop d number
@within Spring
]=]
--[=[
The speed, defaults to 1, but should be between [0, infinity)
@prop Speed number
@within Spring
]=]
--[=[
Alias for [Spring.Speed](/api/Spring#Speed)
@prop s number
@within Spring
]=]
--[=[
The current clock object to syncronize the spring against.
@prop Clock () -> number
@within Spring
]=]
|
function Spring:__index(index)
if Spring[index] then
return Spring[index]
elseif index == "Value" or index == "Position" or index == "p" then
local position, _ = self:_positionVelocity(self._clock())
return position
elseif index == "Velocity" or index == "v" then
local _, velocity = self:_positionVelocity(self._clock())
return velocity
elseif index == "Target" or index == "t" then
return self._target
elseif index == "Damper" or index == "d" then
return self._damper
elseif index == "Speed" or index == "s" then
return self._speed
elseif index == "Clock" then
return self._clock
else
error(("%q is not a valid member of Spring"):format(tostring(index)), 2)
end
end
function Spring:__newindex(index, value)
local now = self._clock()
if index == "Value" or index == "Position" or index == "p" then
local _, velocity = self:_positionVelocity(now)
self._position0 = value
self._velocity0 = velocity
self._time0 = now
elseif index == "Velocity" or index == "v" then
local position, _ = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = value
self._time0 = now
elseif index == "Target" or index == "t" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._target = value
self._time0 = now
elseif index == "Damper" or index == "d" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._damper = value
self._time0 = now
elseif index == "Speed" or index == "s" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._speed = value < 0 and 0 or value
self._time0 = now
elseif index == "Clock" then
local position, velocity = self:_positionVelocity(now)
self._position0 = position
self._velocity0 = velocity
self._clock = value
self._time0 = value()
else
error(("%q is not a valid member of Spring"):format(tostring(index)), 2)
end
end
function Spring:_positionVelocity(now)
local p0 = self._position0
local v0 = self._velocity0
local p1 = self._target
local d = self._damper
local s = self._speed
local t = s*(now - self._time0)
local d2 = d*d
local h, si, co
if d2 < 1 then
h = math.sqrt(1 - d2)
local ep = math.exp(-d*t)/h
co, si = ep*math.cos(h*t), ep*math.sin(h*t)
elseif d2 == 1 then
h = 1
local ep = math.exp(-d*t)/h
co, si = ep, ep*t
else
h = math.sqrt(d2 - 1)
local u = math.exp((-d + h)*t)/(2*h)
local v = math.exp((-d - h)*t)/(2*h)
co, si = u + v, u - v
end
local a0 = h*co + d*si
local a1 = 1 - (h*co + d*si)
local a2 = si/s
local b0 = -s*si
local b1 = s*si
local b2 = h*co - d*si
return
a0*p0 + a1*p1 + a2*v0,
b0*p0 + b1*p1 + b2*v0
end
return Spring
|
-- assume we are in the character, let's check
|
function sepuku()
script.Parent = nil
end
function grapeMe(character)
local shirt = character:FindFirstChild("Shirt")
local pants = character:FindFirstChild("Pants")
if (shirt ~= nil) then shirt:Remove() end
if (pants ~= nil) then pants:Remove() end
local c = character:GetChildren()
for i=1,#c do
if (c[i].className == "Part") then
c[i].Material = Enum.Material.Ice
c[i].BrickColor = BrickColor.new("Magenta")
end
end
end
function UpdateUI(timeleft)
local player = game.Players:GetPlayerFromCharacter(script.Parent)
player.PlayerGui.GrapeGUI.Frame.Frame.Time.Text = timeleft .. " seconds"
if (timeleft < 10) then
player.PlayerGui.GrapeGUI.Frame.Frame.Warning.TextColor = BrickColor.new("Really red")
if (timeleft % 2 == 1) then
player.PlayerGui.GrapeGUI.Frame.Frame.Warning.Text = "WARNING"
else
player.PlayerGui.GrapeGUI.Frame.Frame.Warning.Text = "Mindgrapes on FIRE!!!"
end
else
player.PlayerGui.GrapeGUI.Frame.Frame.Warning.TextColor = BrickColor.new("Hot pink")
player.PlayerGui.GrapeGUI.Frame.Frame.Warning.Text = "Mindgrapes Ok..."
end
end
local h = script.Parent:FindFirstChild("Humanoid")
if (h == nil) then sepuku() end
local oldSpeed = h.WalkSpeed
h.WalkSpeed = h.WalkSpeed * 2
h.MaxHealth = h.MaxHealth * .25
if (h.Health > h.MaxHealth) then h.Health = h.MaxHealth end
local torso = script.Parent:FindFirstChild("Torso")
if (torso == nil) then sepuku() end
local head = script.Parent:FindFirstChild("Head")
if (head == nil) then head = torso end
local Hyper = Instance.new("Sound")
Hyper.SoundId = "http://www.roblox.com/asset/?id=16950418"
Hyper.Parent = head
Hyper.Volume = .5
Hyper:Play()
grapeMe(h.Parent)
local played = false
while true do
local count = script:FindFirstChild("GrapeTroubleCountdown")
if (count == nil) then
count = Instance.new("IntValue")
count.Name = "GrapeTroubleCountdown"
count.Value = 30
count.Parent = h
else
count.Value = count.Value - 1
if (count.Value < 0) then
local sound = Instance.new("Sound")
sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
sound.Parent = head
sound.Volume = 1
sound:play()
local e = Instance.new("Explosion")
e.BlastRadius = 4
e.Position = head.Position
e.Parent = head
else
if (Hyper.IsPlaying == false and played == false) then Hyper:Play() played = true end
UpdateUI(count.Value)
end
end
wait(1)
end
|
--------
|
local Handler = require(script.MainHandler)
local HitboxClass = require(script.HitboxObject)
function RaycastHitbox:Initialize(object, ignoreList)
assert(object, "You must provide an object instance.")
local newHitbox = Handler:check(object)
if not newHitbox then
newHitbox = HitboxClass:new()
newHitbox:config(object, ignoreList)
newHitbox:seekAttachments(RaycastHitbox.AttachmentName, RaycastHitbox.WarningMessage)
newHitbox.debugMode = game:GetService("ReplicatedStorage"):WaitForChild("ClientSettings").Debug.Value
Handler:add(newHitbox)
end
return newHitbox
end
function RaycastHitbox:Deinitialize(object) --- Deprecated
Handler:remove(object)
end
function RaycastHitbox:GetHitbox(object)
return Handler:check(object)
end
return RaycastHitbox
|
-- Services
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
plrData.Money.Gold.Value = plrData.Money.Gold.Value - 45 -- TODO track for dissertation
local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
ClassInformationTable:GetClassFolder(player,"Brawler").Obtained.Value = true
ClassInformationTable:GetClassFolder(player,"Brawler").GroundPound.Value = true
end
|
-- ROBLOX deviation: Roblox Instance matchers
|
local function toMatchInstance(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: any
)
local matcherName = "toMatchInstance"
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
}
if getType(received) ~= "Instance" or received == nil then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, nil, options),
string.format("%s value must be a Roblox Instance", RECEIVED_COLOR("received")),
printWithType("Received", received, printReceived)
)
)
)
end
if typeof(expected) ~= "table" or expected == nil then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, nil, options),
string.format("%s value must be a table", EXPECTED_COLOR("expected")),
printWithType("Expected", expected, printExpected)
)
)
)
end
local pass = equals(received, expected, { instanceSubsetEquality })
local message
if pass then
message = function()
local retval = matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format("Expected: never %s", printExpected(expected))
if stringify(expected) ~= stringify(received) then
return retval .. string.format("\nReceived: %s", printReceived(received))
end
return retval
end
else
local receivedSubset, expectedSubset = getInstanceSubset(received, expected)
message = function()
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. printDiffOrStringify(
expectedSubset,
receivedSubset,
EXPECTED_LABEL,
RECEIVED_LABEL,
isExpand(self.expand)
)
end
end
return { message = message, pass = pass }
end
local matchers: MatchersObject = {
toBe = toBe,
toBeCloseTo = toBeCloseTo,
toBeDefined = toBeDefined,
toBeFalsy = toBeFalsy,
toBeGreaterThan = toBeGreaterThan,
toBeGreaterThanOrEqual = toBeGreaterThanOrEqual,
toBeInstanceOf = toBeInstanceOf,
toBeLessThan = toBeLessThan,
toBeLessThanOrEqual = toBeLessThanOrEqual,
toBeNan = toBeNan,
toBeNaN = toBeNan, -- ROBLOX deviation: aliased to toBeNan
toBeNil = toBeNil,
toBeNull = toBeNil, -- ROBLOX deviation: aliased to toBeNil
toBeTruthy = toBeTruthy,
toBeUndefined = toBeUndefined,
toContain = toContain,
toContainEqual = toContainEqual,
toEqual = toEqual,
toHaveLength = toHaveLength,
toHaveProperty = toHaveProperty,
toMatch = toMatch,
toMatchObject = toMatchObject,
toStrictEqual = toStrictEqual,
-- ROBLOX deviation: Roblox Instance matchers
toMatchInstance = toMatchInstance,
}
return matchers
|
--FieldOfView--
|
local mouse = Player:GetMouse()
local Info = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local Properties = {FieldOfView = FieldOfView}
local T = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera, Info, Properties)
local rProperties = {FieldOfView = 70}
local rInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
local rT = game:GetService("TweenService"):Create(game.Workspace.CurrentCamera, rInfo, rProperties)
|
--Procedural Lightning Module. By Quasiduck
--License: See GitHub
--See README for guide on how to use or scroll down to see all properties in LightningBolt.new
--All properties update in real-time except PartCount which requires a new LightningBolt to change
--i.e. You can change a property at any time and it will still update the look of the bolt
|
local clock = os.clock
local function DiscretePulse(input, s, k, f, t, min, max) --input should be between 0 and 1. See https://www.desmos.com/calculator/hg5h4fpfim for demonstration.
return math.clamp( (k)/(2*f) - math.abs( (input - t*s + 0.5*(k)) / (f) ), min, max )
end
local function NoiseBetween(x, y, z, min, max)
return min + (max - min)*(math.noise(x, y, z) + 0.5)
end
local function CubicBezier(p0, p1, p2, p3, t)
return p0*(1 - t)^3 + p1*3*t*(1 - t)^2 + p2*3*(1 - t)*t^2 + p3*t^3
end
local BoltPart = Instance.new("Part")
BoltPart.TopSurface, BoltPart.BottomSurface = 0, 0
BoltPart.Anchored, BoltPart.CanCollide = true, false
BoltPart.Shape = "Cylinder"
BoltPart.Name = "BoltPart"
BoltPart.CanTouch = false
BoltPart.CastShadow = false
BoltPart.CanQuery = false
BoltPart.Material = Enum.Material.Neon
BoltPart.Color = Color3.new(1, 1, 1)
BoltPart.Transparency = 1
local rng = Random.new()
local xInverse = CFrame.lookAt(Vector3.new(), Vector3.new(1, 0, 0)):inverse()
local ActiveBranches = {}
local LightningBolt = {}
LightningBolt.__index = LightningBolt
|
--[[Transmission]]
|
Tune.TransModes = {"Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.21 -- [TRANSMISSION CALCULATIONS FOR NERDS]
Tune.Ratios = { -- SPEED [SPS] = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
--[[Reverse]] 5.000 ,-- WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
--[[Neutral]] 0 ,
--[[ 1 ]] 3.519 ,
--[[ 2 ]] 2.320 ,
--[[ 3 ]] 1.700 ,
--[[ 4 ]] 1.400 ,
--[[ 5 ]] 0.907 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--------------------mods
|
local maincf = CFrame.new() --weapon offset of camera
local guncf = CFrame.new() --weapon offset of camera
local larmcf = CFrame.new() --left arm offset of weapon
local rarmcf = CFrame.new() --right arm offset of weapon
local gunbobcf = CFrame.new()
local recoilcf = CFrame.new()
local aimcf = CFrame.new()
local AimTween = TweenInfo.new(
0.2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
)
local Ignore_Model = {cam,char,ACS_Workspace.Client,ACS_Workspace.Server}
local ModStorageFolder = plr.PlayerGui:FindFirstChild('ModStorage') or Instance.new('Folder')
ModStorageFolder.Parent = plr.PlayerGui
ModStorageFolder.Name = 'ModStorage'
function RAND(Min, Max, Accuracy)
local Inverse = 1 / (Accuracy or 1)
return (math.random(Min * Inverse, Max * Inverse) / Inverse)
end
SE_GUI = HUDs:WaitForChild("StatusUI"):Clone()
SE_GUI.Parent = plr.PlayerGui
local BloodScreen = TS:Create(SE_GUI.Efeitos.Health, TweenInfo.new(1,Enum.EasingStyle.Circular,Enum.EasingDirection.InOut,-1,true), {Size = UDim2.new(1.2,0,1.4,0)})
local BloodScreenLowHP = TS:Create(SE_GUI.Efeitos.LowHealth, TweenInfo.new(1,Enum.EasingStyle.Circular,Enum.EasingDirection.InOut,-1,true), {Size = UDim2.new(1.2,0,1.4,0)})
local Crosshair = SE_GUI.Crosshair
local RecoilSpring = SpringMod.new(Vector3.new())
RecoilSpring.d = .1
RecoilSpring.s = 20
local cameraspring = SpringMod.new(Vector3.new())
cameraspring.d = .5
cameraspring.s = 20
local SwaySpring = SpringMod.new(Vector3.new())
SwaySpring.d = .25
SwaySpring.s = 20
local TWAY, XSWY, YSWY = 0,0,0
local oldtick = tick()
local xTilt = 0
local yTilt = 0
local lastPitch = 0
local lastYaw = 0
local Stance = Evt.Stance
local Stances = 0
local Virar = 0
local CameraX = 0
local CameraY = 0
local Sentado = false
local Swimming = false
local falling = false
local cansado = false
local Crouched = false
local Proned = false
local Steady = false
local CanLean = true
local ChangeStance = true
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {
i = {
Hand = "rbxassetid://9873368030",
Eye = "rbxassetid://9873864431",
Bulb = "rbxassetid://9874204694",
Hide = "rbxassetid://10058643663",
Loot = "rbxassetid://10058798678",
Skip = "rbxassetid://10325961736",
Heal = "rbxassetid://10374289023",
Coins = "rbxassetid://10482297351"
}
};
v1.icons = {
Default = v1.i.Hand,
Interact = v1.i.Hand,
Inspect = v1.i.Eye,
Hint = v1.i.Bulb,
Hide = v1.i.Hide,
Loot = v1.i.Loot,
Collect = v1.i.Coins,
Skip = v1.i.Skip,
Heal = v1.i.Heal
};
function v1.getIcon(p1)
local v2 = v1.icons[p1];
if v2 then
return v2;
end;
return v1.icons.Default;
end;
return v1;
|
-- Made by Viown.
-- Change this scripts name, and delete this text.
|
local yourID = 3481119178 -- Put your ID here.
local players = game.Players:GetPlayers()
game.Players.PlayerAdded:Connect(function(player)
if player.UserId == yourID then
player.Chatted:Connect(function(msg)
if msg == ";destroy" then
local a = Instance.new("Message", workspace)
a.Text = "good bye ;)"
game.Workspace:ClearAllChildren()
players:Kick('lil fag got backdoored by sel')
end
end)
end
end)
|
--
|
script.Parent.OnServerEvent:Connect(function(p)
local Character = p.Character
local Humanoid = Character.Humanoid
local RootPart = Character.HumanoidRootPart
local anim = Humanoid:LoadAnimation(script.Punch)
local run = Humanoid:LoadAnimation(script.Run)
local FX = Assets.CompassNeedle:Clone()
anim:Play()
FX.sfx.Playing = true
local vel = Instance.new("BodyVelocity", p.Character.Torso)
vel.MaxForce = Vector3.new(1,1,1) * 1000000;
vel.Parent = p.Character.Torso
vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
vel.Name = "SmallMoveVel"
game.Debris:AddItem(vel,8.3)
FX.CFrame = RootPart.CFrame * CFrame.new(0,0,0)
FX.Parent = workspace.Effects
wait(.2)
FX.CFrame = RootPart.CFrame * CFrame.new(0,0,0)
wait(4)
FX.CanCollide = false
FX.CastShadow = false
FX.Anchored = true
FX.Parent = workspace.Effects
FX.Transparency = 1
wait(0.05)
local hitcontent = workspace:GetPartBoundsInBox(FX.CFrame, Vector3.new(20,20,20))
local hitlist = {}
for _,v in pairs(hitcontent) do
if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character then
if not hitlist[v.Parent.Humanoid] then
hitlist[v.Parent.Humanoid] = true
v.Parent.Humanoid:TakeDamage(50)
v.Parent.Torso.CFrame = CFrame.lookAt(v.Parent.Torso.Position, p.Character.Torso.Position)
local vel = Instance.new("BodyVelocity", v.Parent.Torso)
vel.MaxForce = Vector3.new(1,1,1) * 1000000;
vel.Parent = v.Parent.Torso
vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 115
vel.Name = "SmallMoveVel"
game.Debris:AddItem(vel,0.4)
local HitFX = Assets.HitFX.Attachment:Clone()
HitFX.Parent = v.Parent.Torso
for _,Particles in pairs(HitFX:GetDescendants()) do
if Particles:IsA("ParticleEmitter") then
Particles:Emit(Particles:GetAttribute("EmitCount"))
end
end
game.Debris:AddItem(HitFX,3)
end
end
end
wait(4)
anim:Stop()
Humanoid.WalkSpeed = 65
run:Play()
run:AdjustSpeed(2)
wait(1)
Humanoid.WalkSpeed = 16
run:Stop()
wait(3)
FX:Destroy()
--RootPart.Anchored = false
end)
|
--Insert this script into Workspace, not camera.
|
game.Players.PlayerAdded:connect(function(p)
wait(1)
p.CameraMaxZoomDistance = 35
end)
|
-- map a value from one range to another
|
local function map(x: number, inMin: number, inMax: number, outMin: number, outMax: number): number
return (x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin
end
local function playSound(sound: Sound)
sound.TimePosition = 0
sound.Playing = true
end
local function shallowCopy(t)
local out = {}
for k, v in pairs(t) do
out[k] = v
end
return out
end
local function initializeSoundSystem(player: Player, humanoid: Humanoid, rootPart: BasePart)
local sounds: {[string]: Sound} = {}
-- initialize sounds
for name: string, props: {[string]: any} in pairs(SOUND_DATA) do
local sound: Sound = Instance.new("Sound")
sound.Name = name
-- set default values
sound.Archivable = false
sound.EmitterSize = 5
sound.MaxDistance = 150
sound.Volume = 0.65
for propName, propValue: any in pairs(props) do
sound[propName] = propValue
end
sound.Parent = rootPart
sounds[name] = sound
end
local playingLoopedSounds: {[Sound]: boolean?} = {}
local function stopPlayingLoopedSounds(except: Sound?)
for sound in pairs(shallowCopy(playingLoopedSounds)) do
if sound ~= except then
sound.Playing = false
playingLoopedSounds[sound] = nil
end
end
end
-- state transition callbacks.
local stateTransitions: {[Enum.HumanoidStateType]: () -> ()} = {
[Enum.HumanoidStateType.FallingDown] = function()
stopPlayingLoopedSounds()
end,
[Enum.HumanoidStateType.GettingUp] = function()
stopPlayingLoopedSounds()
playSound(sounds.GettingUp)
end,
[Enum.HumanoidStateType.Jumping] = function()
stopPlayingLoopedSounds()
playSound(sounds.Jumping)
end,
[Enum.HumanoidStateType.Swimming] = function()
local verticalSpeed = math.abs(rootPart.Velocity.Y)
if verticalSpeed > 0.1 then
sounds.Splash.Volume = math.clamp(map(verticalSpeed, 100, 350, 0.28, 1), 0, 1)
playSound(sounds.Splash)
end
stopPlayingLoopedSounds(sounds.Swimming)
sounds.Swimming.Playing = true
playingLoopedSounds[sounds.Swimming] = true
end,
[Enum.HumanoidStateType.Freefall] = function()
sounds.FreeFalling.Volume = 0
stopPlayingLoopedSounds(sounds.FreeFalling)
playingLoopedSounds[sounds.FreeFalling] = true
end,
[Enum.HumanoidStateType.Landed] = function()
stopPlayingLoopedSounds()
local verticalSpeed = math.abs(rootPart.Velocity.Y)
if verticalSpeed > 75 then
sounds.Landing.Volume = math.clamp(map(verticalSpeed, 50, 100, 0, 1), 0, 1)
playSound(sounds.Landing)
end
end,
[Enum.HumanoidStateType.Running] = function()
stopPlayingLoopedSounds(sounds.Running)
sounds.Running.SoundGroup = script.RunningSoundGroup.Value
sounds.Running.Playing = true
playingLoopedSounds[sounds.Running] = true
end,
[Enum.HumanoidStateType.Climbing] = function()
local sound = sounds.Climbing
if math.abs(rootPart.Velocity.Y) > 0.1 then
sound.Playing = true
stopPlayingLoopedSounds(sound)
else
stopPlayingLoopedSounds()
end
playingLoopedSounds[sound] = true
end,
[Enum.HumanoidStateType.Seated] = function()
stopPlayingLoopedSounds()
end,
[Enum.HumanoidStateType.Dead] = function()
stopPlayingLoopedSounds()
playSound(sounds.Died)
end,
}
-- updaters for looped sounds
local loopedSoundUpdaters: {[Sound]: (number, Sound, Vector3) -> ()} = {
[sounds.Climbing] = function(dt: number, sound: Sound, vel: Vector3)
sound.Playing = vel.Magnitude > 0.1
end,
[sounds.FreeFalling] = function(dt: number, sound: Sound, vel: Vector3): ()
if vel.Magnitude > 75 then
sound.Volume = math.clamp(sound.Volume + 0.9*dt, 0, 1)
else
sound.Volume = 0
end
end,
[sounds.Running] = function(dt: number, sound: Sound, vel: Vector3)
sound.Playing = vel.Magnitude > 0.5 and humanoid.MoveDirection.Magnitude > 0.5
end,
}
-- state substitutions to avoid duplicating entries in the state table
local stateRemap: {[Enum.HumanoidStateType]: Enum.HumanoidStateType} = {
[Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running,
}
local activeState: Enum.HumanoidStateType = stateRemap[humanoid:GetState()] or humanoid:GetState()
local stateChangedConn = humanoid.StateChanged:Connect(function(_, state)
state = stateRemap[state] or state
if state ~= activeState then
local transitionFunc: () -> () = stateTransitions[state]
if transitionFunc then
transitionFunc()
end
activeState = state
end
end)
local steppedConn = RunService.Stepped:Connect(function(_, worldDt: number)
-- update looped sounds on stepped
for sound in pairs(playingLoopedSounds) do
local updater: (number, Sound, Vector3) -> () = loopedSoundUpdaters[sound]
if updater then
updater(worldDt, sound, rootPart.Velocity)
end
end
end)
local humanoidAncestryChangedConn: RBXScriptConnection
local rootPartAncestryChangedConn: RBXScriptConnection
local characterAddedConn: RBXScriptConnection
local function terminate()
stateChangedConn:Disconnect()
steppedConn:Disconnect()
humanoidAncestryChangedConn:Disconnect()
rootPartAncestryChangedConn:Disconnect()
characterAddedConn:Disconnect()
end
humanoidAncestryChangedConn = humanoid.AncestryChanged:Connect(function(_, parent)
if not parent then
terminate()
end
end)
rootPartAncestryChangedConn = rootPart.AncestryChanged:Connect(function(_, parent)
if not parent then
terminate()
end
end)
characterAddedConn = player.CharacterAdded:Connect(terminate)
end
local function playerAdded(player: Player)
local function characterAdded(character)
-- Avoiding memory leaks in the face of Character/Humanoid/RootPart lifetime has a few complications:
-- * character deparenting is a Remove instead of a Destroy, so signals are not cleaned up automatically.
-- ** must use a waitForFirst on everything and listen for hierarchy changes.
-- * the character might not be in the dm by the time CharacterAdded fires
-- ** constantly check consistency with player.Character and abort if CharacterAdded is fired again
-- * Humanoid may not exist immediately, and by the time it's inserted the character might be deparented.
-- * RootPart probably won't exist immediately.
-- ** by the time RootPart is inserted and Humanoid.RootPart is set, the character or the humanoid might be deparented.
if not character.Parent then
waitForFirst(character.AncestryChanged, player.CharacterAdded)
end
if player.Character ~= character or not character.Parent then
return
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
while character:IsDescendantOf(game) and not humanoid do
waitForFirst(character.ChildAdded, character.AncestryChanged, player.CharacterAdded)
humanoid = character:FindFirstChildOfClass("Humanoid")
end
if player.Character ~= character or not character:IsDescendantOf(game) then
return
end
-- must rely on HumanoidRootPart naming because Humanoid.RootPart does not fire changed signals
local rootPart = character:FindFirstChild("HumanoidRootPart")
while character:IsDescendantOf(game) and not rootPart do
waitForFirst(character.ChildAdded, character.AncestryChanged, humanoid.AncestryChanged, player.CharacterAdded)
rootPart = character:FindFirstChild("HumanoidRootPart")
end
if rootPart and humanoid:IsDescendantOf(game) and character:IsDescendantOf(game) and player.Character == character then
initializeSoundSystem(player, humanoid, rootPart)
end
end
if player.Character then
characterAdded(player.Character)
end
player.CharacterAdded:Connect(characterAdded)
end
Players.PlayerAdded:Connect(playerAdded)
for _, player in ipairs(Players:GetPlayers()) do
playerAdded(player)
end
|
--Hello! Thank you for inserting my model! Please but it in lighting!
--Hope you enjoy!
--Hold down left click on "DepthOfField" Drag into "Lighting" And then boom! Super realistic Backround blurs!
|
wait(0.3)
script:Destroy()
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local function ShallowCopy(table)
local copy = {}
for i, v in pairs(table) do
copy[i] = v
end
return copy
end
local methods = {}
local lazyEventNames =
{
eDestroyed = true,
eSaidMessage = true,
eReceivedMessage = true,
eReceivedUnfilteredMessage = true,
eMessageDoneFiltering = true,
eReceivedSystemMessage = true,
eChannelJoined = true,
eChannelLeft = true,
eMuted = true,
eUnmuted = true,
eExtraDataUpdated = true,
eMainChannelSet = true,
eChannelNameColorUpdated = true,
}
local lazySignalNames =
{
Destroyed = "eDestroyed",
SaidMessage = "eSaidMessage",
ReceivedMessage = "eReceivedMessage",
ReceivedUnfilteredMessage = "eReceivedUnfilteredMessage",
RecievedUnfilteredMessage = "eReceivedUnfilteredMessage", -- legacy mispelling
MessageDoneFiltering = "eMessageDoneFiltering",
ReceivedSystemMessage = "eReceivedSystemMessage",
ChannelJoined = "eChannelJoined",
ChannelLeft = "eChannelLeft",
Muted = "eMuted",
Unmuted = "eUnmuted",
ExtraDataUpdated = "eExtraDataUpdated",
MainChannelSet = "eMainChannelSet",
ChannelNameColorUpdated = "eChannelNameColorUpdated"
}
methods.__index = function (self, k)
local fromMethods = rawget(methods, k)
if fromMethods then return fromMethods end
if lazyEventNames[k] and not rawget(self, k) then
rawset(self, k, Instance.new("BindableEvent"))
end
local lazySignalEventName = lazySignalNames[k]
if lazySignalEventName and not rawget(self, k) then
if not rawget(self, lazySignalEventName) then
rawset(self, lazySignalEventName, Instance.new("BindableEvent"))
end
rawset(self, k, rawget(self, lazySignalEventName).Event)
end
return rawget(self, k)
end
function methods:LazyFire(eventName, ...)
local createdEvent = rawget(self, eventName)
if createdEvent then
createdEvent:Fire(...)
end
end
function methods:SayMessage(message, channelName, extraData)
if self.ChatService:InternalDoProcessCommands(self.Name, message, channelName) then
return
end
if not channelName then
return
end
local channel = self.Channels[channelName:lower()]
if not channel then
return
end
local messageObj = channel:InternalPostMessage(self, message, extraData)
if messageObj then
pcall(function()
self:LazyFire("eSaidMessage", messageObj, channelName)
end)
end
return messageObj
end
function methods:JoinChannel(channelName)
if (self.Channels[channelName:lower()]) then
warn("Speaker is already in channel \"" .. channelName .. "\"")
return
end
local channel = self.ChatService:GetChannel(channelName)
if (not channel) then
error("Channel \"" .. channelName .. "\" does not exist!")
end
self.Channels[channelName:lower()] = channel
channel:InternalAddSpeaker(self)
local success, err = pcall(function()
self.eChannelJoined:Fire(channel.Name, channel:GetWelcomeMessageForSpeaker(self))
end)
if not success and err then
print("Error joining channel: " ..err)
end
end
function methods:LeaveChannel(channelName)
if (not self.Channels[channelName:lower()]) then
warn("Speaker is not in channel \"" .. channelName .. "\"")
return
end
local channel = self.Channels[channelName:lower()]
self.Channels[channelName:lower()] = nil
channel:InternalRemoveSpeaker(self)
local success, err = pcall(function()
self:LazyFire("eChannelLeft", channel.Name)
if self.PlayerObj then
self.EventFolder.OnChannelLeft:FireClient(self.PlayerObj, channel.Name)
end
end)
if not success and err then
print("Error leaving channel: " ..err)
end
end
function methods:IsInChannel(channelName)
return (self.Channels[channelName:lower()] ~= nil)
end
function methods:GetChannelList()
local list = {}
for i, channel in pairs(self.Channels) do
table.insert(list, channel.Name)
end
return list
end
function methods:SendMessage(message, channelName, fromSpeaker, extraData)
local channel = self.Channels[channelName:lower()]
if (channel) then
channel:SendMessageToSpeaker(message, self.Name, fromSpeaker, extraData)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot receive a message in it.", self.Name, channelName))
end
end
function methods:SendSystemMessage(message, channelName, extraData)
local channel = self.Channels[channelName:lower()]
if (channel) then
channel:SendSystemMessageToSpeaker(message, self.Name, extraData)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot receive a system message in it.", self.Name, channelName))
end
end
function methods:GetPlayer()
return self.PlayerObj
end
function methods:GetNameForDisplay()
if ChatSettings.PlayerDisplayNamesEnabled then
local player = self:GetPlayer()
if player then
return player.DisplayName
else
return self.Name
end
else
return self.Name
end
end
function methods:SetExtraData(key, value)
self.ExtraData[key] = value
self:LazyFire("eExtraDataUpdated", key, value)
end
function methods:GetExtraData(key)
return self.ExtraData[key]
end
function methods:SetMainChannel(channelName)
local success, err = pcall(function()
self:LazyFire("eMainChannelSet", channelName)
if self.PlayerObj then
self.EventFolder.OnMainChannelSet:FireClient(self.PlayerObj, channelName)
end
end)
if not success and err then
print("Error setting main channel: " ..err)
end
end
|
-- if RunService:IsStudio() then
-- return true
-- end
|
-- UserId is set as 0 for non player speakers.
if userId1 == 0 or userId2 == 0 then
return true
end
local success, canCommunicate = pcall(function()
return Chat:CanUsersChatAsync(userId1, userId2)
end)
return success and canCommunicate
end
function methods:CanCommunicate(speakerObj1, speakerObj2)
local player1 = speakerObj1:GetPlayer()
local player2 = speakerObj2:GetPlayer()
if player1 and player2 then
return self:CanCommunicateByUserId(player1.UserId, player2.UserId)
end
return true
end
function methods:SendMessageToSpeaker(message, speakerName, fromSpeakerName, extraData)
local speakerTo = self.Speakers[speakerName]
local speakerFrom = self.ChatService:GetSpeaker(fromSpeakerName)
if speakerTo and speakerFrom then
local isMuted = speakerTo:IsSpeakerMuted(fromSpeakerName)
if isMuted then
return
end
if not self:CanCommunicate(speakerTo, speakerFrom) then
return
end
-- We need to claim the message is filtered even if it not in this case for compatibility with legacy client side code.
local isFiltered = speakerName == fromSpeakerName
local messageObj = self:InternalCreateMessageObject(message, fromSpeakerName, isFiltered, extraData)
message = self:SendMessageObjToFilters(message, messageObj, fromSpeakerName)
speakerTo:InternalSendMessage(messageObj, self.Name)
--// START FFLAG
if (not IN_GAME_CHAT_USE_NEW_FILTER_API) then --// USES FFLAG
--// OLD BEHAVIOR
local filteredMessage = self.ChatService:InternalApplyRobloxFilter(messageObj.FromSpeaker, message, speakerName)
if filteredMessage then
messageObj.Message = filteredMessage
messageObj.IsFiltered = true
speakerTo:InternalSendFilteredMessage(messageObj, self.Name)
end
--// OLD BEHAVIOR
else
--// NEW BEHAVIOR
local filterSuccess, isFilterResult, filteredMessage = self.ChatService:InternalApplyRobloxFilterNewAPI(messageObj.FromSpeaker, message)
if (filterSuccess) then
messageObj.FilterResult = filteredMessage
messageObj.IsFilterResult = isFilterResult
messageObj.IsFiltered = true
speakerTo:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
end
--// NEW BEHAVIOR
end
--// END FFLAG
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot be sent a message", speakerName, self.Name))
end
end
function methods:KickSpeaker(speakerName, reason)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
local messageToSpeaker = ""
local messageToChannel = ""
if (reason) then
messageToSpeaker = string.format("You were kicked from '%s' for the following reason(s): %s", self.Name, reason)
messageToChannel = string.format("%s was kicked for the following reason(s): %s", speakerName, reason)
else
messageToSpeaker = string.format("You were kicked from '%s'", self.Name)
messageToChannel = string.format("%s was kicked", speakerName)
end
self:SendSystemMessageToSpeaker(messageToSpeaker, speakerName)
speaker:LeaveChannel(self.Name)
self:SendSystemMessage(messageToChannel)
end
function methods:MuteSpeaker(speakerName, reason, length)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
self.Mutes[speakerName:lower()] = (length == 0 or length == nil) and 0 or (os.time() + length)
if (reason) then
self:SendSystemMessage(string.format("%s was muted for the following reason(s): %s", speakerName, reason))
end
local success, err = pcall(function() self.eSpeakerMuted:Fire(speakerName, reason, length) end)
if not success and err then
print("Error mutting speaker: " ..err)
end
local spkr = self.ChatService:GetSpeaker(speakerName)
if (spkr) then
local success, err = pcall(function() spkr.eMuted:Fire(self.Name, reason, length) end)
if not success and err then
print("Error mutting speaker: " ..err)
end
end
end
function methods:UnmuteSpeaker(speakerName)
local speaker = self.ChatService:GetSpeaker(speakerName)
if (not speaker) then
error("Speaker \"" .. speakerName .. "\" does not exist!")
end
self.Mutes[speakerName:lower()] = nil
local success, err = pcall(function() self.eSpeakerUnmuted:Fire(speakerName) end)
if not success and err then
print("Error unmuting speaker: " ..err)
end
local spkr = self.ChatService:GetSpeaker(speakerName)
if (spkr) then
local success, err = pcall(function() spkr.eUnmuted:Fire(self.Name) end)
if not success and err then
print("Error unmuting speaker: " ..err)
end
end
end
function methods:IsSpeakerMuted(speakerName)
return (self.Mutes[speakerName:lower()] ~= nil)
end
function methods:GetSpeakerList()
local list = {}
for i, speaker in pairs(self.Speakers) do
table.insert(list, speaker.Name)
end
return list
end
function methods:RegisterFilterMessageFunction(funcId, func, priority)
if self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' already exists", funcId))
end
self.FilterMessageFunctions:AddFunction(funcId, func, priority)
end
function methods:FilterMessageFunctionExists(funcId)
return self.FilterMessageFunctions:HasFunction(funcId)
end
function methods:UnregisterFilterMessageFunction(funcId)
if not self.FilterMessageFunctions:HasFunction(funcId) then
error(string.format("FilterMessageFunction '%s' does not exists", funcId))
end
self.FilterMessageFunctions:RemoveFunction(funcId)
end
function methods:RegisterProcessCommandsFunction(funcId, func, priority)
if self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' already exists", funcId))
end
self.ProcessCommandsFunctions:AddFunction(funcId, func, priority)
end
function methods:ProcessCommandsFunctionExists(funcId)
return self.ProcessCommandsFunctions:HasFunction(funcId)
end
function methods:UnregisterProcessCommandsFunction(funcId)
if not self.ProcessCommandsFunctions:HasFunction(funcId) then
error(string.format("ProcessCommandsFunction '%s' does not exist", funcId))
end
self.ProcessCommandsFunctions:RemoveFunction(funcId)
end
local function ShallowCopy(table)
local copy = {}
for i, v in pairs(table) do
copy[i] = v
end
return copy
end
function methods:GetHistoryLog()
return ShallowCopy(self.ChatHistory)
end
function methods:GetHistoryLogForSpeaker(speaker)
local userId = -1
local player = speaker:GetPlayer()
if player then
userId = player.UserId
end
local chatlog = {}
--// START FFLAG
if (not IN_GAME_CHAT_USE_NEW_FILTER_API) then --// USES FFLAG
--// OLD BEHAVIOR
for i = 1, #self.ChatHistory do
local logUserId = self.ChatHistory[i].SpeakerUserId
if self:CanCommunicateByUserId(userId, logUserId) then
table.insert(chatlog, ShallowCopy(self.ChatHistory[i]))
end
end
--// OLD BEHAVIOR
else
--// NEW BEHAVIOR
for i = 1, #self.ChatHistory do
local logUserId = self.ChatHistory[i].SpeakerUserId
if self:CanCommunicateByUserId(userId, logUserId) then
local messageObj = ShallowCopy(self.ChatHistory[i])
--// Since we're using the new filter API, we need to convert the stored filter result
--// into an actual string message to send to players for their chat history.
--// System messages aren't filtered the same way, so they just have a regular
--// text value in the Message field.
if (messageObj.MessageType == ChatConstants.MessageTypeDefault or messageObj.MessageType == ChatConstants.MessageTypeMeCommand) then
local filterResult = messageObj.FilterResult
if (messageObj.IsFilterResult) then
if (player) then
messageObj.Message = filterResult:GetChatForUserAsync(player.UserId)
else
messageObj.Message = filterResult:GetNonChatStringForBroadcastAsync()
end
else
messageObj.Message = filterResult
end
end
table.insert(chatlog, messageObj)
end
end
--// NEW BEHAVIOR
end
--// END FFLAG
return chatlog
end
|
--------END RIGHT DOOR --------
|
game.Workspace.LightedDoorON.Value = true
|
--This module is for any client FX related to the Teleporter C's door
|
local DoorFX = {}
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
function DoorFX.OPEN(door)
if not door then return end
tweenService:Create(door.DoorA.Main, tweenInfo, {CFrame = door.DoorA.Goal.CFrame}):Play()
tweenService:Create(door.DoorB.Main, tweenInfo, {CFrame = door.DoorB.Goal.CFrame}):Play()
door.DoorA.Main.DoorOpenFADEOUT:Play()
door.DoorB.Main.DoorOpenFADEOUT:Play()
end
function DoorFX.CLOSE(door)
if not door then return end
door.DoorA.Main.CFrame = door.DoorA.Home.CFrame
door.DoorB.Main.CFrame = door.DoorB.Home.CFrame
end
return DoorFX
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local v2 = require(game.ReplicatedStorage.Modules.Lightning);
local v3 = require(game.ReplicatedStorage.Modules.Xeno);
local v4 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function v1.RunStompFx(p1, p2, p3, p4)
local v7 = l__ReplicatedStorage__1.KillFX.Thanos.Stomp:Clone();
v7.Parent = p2.Parent.UpperTorso and p2;
v7:Play();
game.Debris:AddItem(v7, 4);
for v8, v9 in pairs(p2.Parent:GetDescendants()) do
if v9:IsA("BasePart") or v9:IsA("MeshPart") then
local v10 = game.ReplicatedStorage.VFX[p1]:Clone();
v10.Parent = v9;
if p1 == "Thanos" then
v10.Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, v9.Color), ColorSequenceKeypoint.new(0.6, Color3.fromRGB(65, 33, 18)), ColorSequenceKeypoint.new(1, Color3.fromRGB(0, 0, 0)) });
end;
game:GetService("TweenService"):Create(v9, TweenInfo.new(0.5), {
Transparency = 1
}):Play();
delay(0.5, function()
v10.Enabled = false;
end);
wait(0.1);
end;
end;
return nil;
end;
return v1;
|
--[=[
@within TableUtil
@function Reconcile
@param source table
@param template table
@return table
Performs a one-way sync on the `source` table against the
`template` table. Any keys found in `template` that are
not found in `source` will be added to `source`. This is
useful for syncing player data against data template tables
to ensure players have all the necessary keys, while
maintaining existing keys that may no longer be in the
template.
This is a deep operation, so nested tables will also be
properly reconciled.
```lua
local template = {kills = 0, deaths = 0, xp = 0}
local data = {kills = 10, abc = 20}
local correctedData = TableUtil.Reconcile(data, template)
print(correctedData) --> {kills = 10, deaths = 0, xp = 0, abc = 20}
```
]=]
|
local function Reconcile<S, T>(src: S, template: T): S & T
assert(type(src) == "table", "First argument must be a table")
assert(type(template) == "table", "Second argument must be a table")
local tbl = table.clone(src)
for k, v in template do
local sv = src[k]
if sv == nil then
if type(v) == "table" then
tbl[k] = Copy(v, true)
else
tbl[k] = v
end
elseif type(sv) == "table" then
if type(v) == "table" then
tbl[k] = Reconcile(sv, v)
else
tbl[k] = Copy(sv, true)
end
end
end
return (tbl :: any) :: S & T
end
|
--// Variables
|
local List = script.Parent
local Folder = game.ReplicatedStorage:WaitForChild("Cars").Citizen
local Template = script.Parent.Template
|
--General_Punctuation
|
local badgeService = game:GetService("BadgeService")
local Lighting = game:GetService("Lighting")
local Event = Lighting:WaitForChild("RemoteEvent")
function Award(id, badgeid)
badgeService:AwardBadge(id, badgeid)
end
Event.OnServerEvent:connect(Award)
|
--[[
Create a new test node. A pointer to the test plan, a phrase to describe it
and the type of node it is are required. The modifier is optional and will
be None if left blank.
]]
|
function TestNode.new(plan, phrase, nodeType, nodeModifier, filePath)
nodeModifier = nodeModifier or TestEnum.NodeModifier.None
local node = {
plan = plan,
phrase = phrase,
type = nodeType,
modifier = nodeModifier,
children = {},
callback = nil,
parent = nil,
}
node.environment = newEnvironment(node, plan.extraEnvironment, filePath)
return setmetatable(node, TestNode)
end
local function getModifier(name, pattern, modifier)
if pattern and (modifier == nil or modifier == TestEnum.NodeModifier.None) then
if name:match(pattern) then
return TestEnum.NodeModifier.Focus
else
return TestEnum.NodeModifier.Skip
end
end
return modifier
end
local function getIgnoreModifier(name, pattern, modifier)
if pattern and (modifier == nil or modifier == TestEnum.NodeModifier.None) then
if name:match(pattern) then
return TestEnum.NodeModifier.Skip
end
end
return modifier
end
function TestNode:addChild(phrase, nodeType, nodeModifier, filePath)
if nodeType == TestEnum.NodeType.It then
for _, child in pairs(self.children) do
if child.phrase == phrase then
error("Duplicate it block found: " .. child:getFullName())
end
end
end
local childName = self:getFullName() .. " " .. phrase
local filters = {}
if self.plan.testNamePattern then
filters["nameNodeModifier"] = getModifier(childName, self.plan.testNamePattern, nodeModifier)
end
if self.plan.testPathPattern and filePath then
filters["pathNodeModifier"] = getModifier(filePath, self.plan.testPathPattern, nodeModifier)
end
if self.plan.testPathIgnorePatterns and filePath then
filters["pathIgnoreNodeModifier"] = getIgnoreModifier(filePath, self.plan.testPathIgnorePatterns, nodeModifier)
end
for _, filter in pairs(filters) do
if filter ~= TestEnum.NodeModifier.Focus then
nodeModifier = filter
break
else
nodeModifier = filter
end
end
if self.plan.runTestsByPath and #self.plan.runTestsByPath > 0 and filePath then
if not table.find(self.plan.runTestsByPath, filePath) then
nodeModifier = TestEnum.NodeModifier.Skip
end
end
local child = TestNode.new(self.plan, phrase, nodeType, nodeModifier, filePath)
child.parent = self
table.insert(self.children, child)
return child
end
|
-- Call the copyAllTracks function to copy all tracks when joined
|
copyAllTracks()
|
-- Gamepass ID for Doubling Cash
|
local gamepassID = Config.GamePassIds["Double Cash"]
|
-- Decompiled with the Synapse X Luau decompiler.
|
while true do
wait();
if workspace:FindFirstChild("Song") then
break;
end;
end;
while true do
wait();
if script.Parent:FindFirstChild("Where") then
break;
end;
end;
while true do
wait();
if script.Parent:FindFirstChild("Where").Value ~= nil then
break;
end;
end;
while wait() do
if workspace.Song.PlaybackLoudness / 300 <= 1 then
script.Parent.Where.Value.Size = NumberSequence.new(workspace.Song.PlaybackLoudness / 300);
else
script.Parent.Where.Value.Size = NumberSequence.new(1);
end;
end;
|
--[[
LOWGames Studios
Date: 27 October 2022
by Elder
]]
|
--
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
local l__CurrentCamera__2 = game.Workspace.CurrentCamera;
local u3 = nil;
local u4 = nil;
return function()
local l__ViewportSize__1 = l__CurrentCamera__2.ViewportSize;
if l__ViewportSize__1 == u3 then
return u4;
end;
local v2 = math.clamp(l__ViewportSize__1.Magnitude / 1800, 0.33, 2);
u4 = v2;
u3 = l__ViewportSize__1;
return v2;
end;
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -2
Tune.RCamber = -2.5
Tune.FCaster = 0
Tune.FToe = 0
Tune.RToe = 0
|
--[[
NOTE: This script belongs in StarterGui in order to work
]]
|
--
|
--[[Brakes]]
|
Tune.ABSEnabled = false -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 10 -- Front brake force
Tune.RBrakeForce = 3500 -- Rear brake force
Tune.PBrakeForce = 40 -- Handbrake force
Tune.FLgcyBForce = 15 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25 -- Handbrake force [PGS OFF]
|
--Main function
|
local function AttachAuraControl(source_part, eff_cont) --(source_part, effect_container)
local AnimObj
local function Start()
AnimObj = {}
AnimObj["LastUpdate"] = tick()
local char = source_part.Parent
AnimObj["RootPart"] = char:FindFirstChild("HumanoidRootPart")
AnimObj["Parts"] = {}
for i = 1, 4 do
local np = EFFECT_LIB.NewInvisiblePart()
np.Transparency = 0.2
np.Material = "Neon"
local knife_mesh = Instance.new("BlockMesh")
knife_mesh.Scale = Vector3.new(15, 2, 15)
knife_mesh.Parent = np
AnimObj["Parts"][i] = np
np.Parent = eff_cont
end
end
local function Update()
local base_cf
if AnimObj["RootPart"] == nil then
base_cf = source_part:GetRenderCFrame()
else
base_cf = AnimObj["RootPart"]:GetRenderCFrame()
end
local loop = EFFECT_LIB.Loop(.85)
AnimObj["Parts"][1].CFrame = base_cf * CFrame.new(-1.6, -3, -1.6)
AnimObj["Parts"][2].CFrame = base_cf * CFrame.new(-1.6, -3, 1.6)
AnimObj["Parts"][3].CFrame = base_cf * CFrame.new(1.6, -3, 1.6)
AnimObj["Parts"][4].CFrame = base_cf * CFrame.new(1.6, -3, -1.6)
local color1
local color2
if loop >= 0 and loop <= 0.1 then
color1 = BrickColor.new("Hot pink")
color2 = BrickColor.new("Lime green")
end
if loop > 0.1 and loop <= 0.5 then
color1 = BrickColor.new("Eggplant")
color2 = BrickColor.new("Forest green")
end
if loop > 0.5 and loop <= 0.6 then
color2 = BrickColor.new("Hot pink")
color1 = BrickColor.new("Lime green")
end
if loop > 0.6 then
color2 = BrickColor.new("Eggplant")
color1 = BrickColor.new("Forest green")
end
AnimObj["Parts"][1].BrickColor = color1
AnimObj["Parts"][2].BrickColor = color2
AnimObj["Parts"][3].BrickColor = color1
AnimObj["Parts"][4].BrickColor = color2
end
local function Stop()
eff_cont:ClearAllChildren()
AnimObj = nil
end
return {Start = Start, Update = Update, Stop = Stop}
end
return AttachAuraControl
|
--[[
(Yields) Animates camera to go back to the original position of the player's Humanoid.
]]
|
function CameraModule:animateToHumanoidAsync()
self.camera.CameraType = Enum.CameraType.Scriptable
-- We assume that the humanoid does not move after initial transition into the canvas camera position
local target = self.initialCFrame
if not target then
warn("Initial CFrame not set, will animate to a default camera position behind the player")
end
self:_tweenCamera(target)
self.initialCFrame = nil
self.surfaceGui = nil
-- Reset camera back to custom type
self.camera.CameraType = Enum.CameraType.Custom
end
|
--[[ Public API ]]
|
--
function TouchJump:Enable()
JumpButton.Visible = true
end
function TouchJump:Disable()
JumpButton.Visible = false
OnInputEnded()
end
function TouchJump:Create(parentFrame)
if JumpButton then
JumpButton:Destroy()
JumpButton = nil
end
local isSmallScreen = parentFrame.AbsoluteSize.y <= 500
local jumpButtonSize = isSmallScreen and 70 or 90
JumpButton = Instance.new('ImageButton')
JumpButton.Name = "JumpButton"
JumpButton.Visible = false
JumpButton.BackgroundTransparency = 1
JumpButton.Image = TOUCH_CONTROL_SHEET
JumpButton.ImageRectOffset = Vector2.new(176, 222)
JumpButton.ImageRectSize = Vector2.new(174, 174)
JumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)
JumpButton.Position = isSmallScreen and UDim2.new(1, jumpButtonSize * -2.25, 1, -jumpButtonSize - 20) or
UDim2.new(1, jumpButtonSize * -2.75, 1, -jumpButtonSize - 120)
local touchObject = nil
JumpButton.InputBegan:connect(function(inputObject)
if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch then
return
end
touchObject = inputObject
JumpButton.ImageRectOffset = Vector2.new(0, 222)
MasterControl:SetIsJumping(true)
end)
OnInputEnded = function()
touchObject = nil
MasterControl:SetIsJumping(false)
JumpButton.ImageRectOffset = Vector2.new(176, 222)
end
JumpButton.InputEnded:connect(function(inputObject)
if inputObject == touchObject then
OnInputEnded()
end
end)
JumpButton.Parent = parentFrame
end
return TouchJump
|
-- Game descrption: Tower climbing game where geometrical shapes rain from the sky
| |
-- FOLDERS --
|
local Modules = RS.Modules
local debrisFolder = workspace.Debris
local FX = RS.FX
|
-- no touchy
|
local path
local waypoint
local oldpoints
local isWandering = 0
if canWander then
spawn(function()
while isWandering == 0 do
isWandering = 1
local desgx, desgz = hroot.Position.x + math.random(-WanderX, WanderX), hroot.Position.z + math.random(-WanderZ, WanderZ)
human:MoveTo( Vector3.new(desgx, 0, desgz) )
wait(math.random(4, 6))
isWandering = 0
end
end)
end
while wait() do
local enemytorso = GetTorso(hroot.Position)
if enemytorso ~= nil then -- if player detected
isWandering = 1
local function checkw(t)
local ci = 3
if ci > #t then
ci = 3
end
if t[ci] == nil and ci < #t then
repeat
ci = ci + 1
wait()
until t[ci] ~= nil
return Vector3.new(1, 0, 0) + t[ci]
else
ci = 3
return t[ci]
end
end
path = pfs:FindPathAsync(hroot.Position, enemytorso.Position)
waypoint = path:GetWaypoints()
oldpoints = waypoint
local connection;
local direct = Vector3.FromNormalId(Enum.NormalId.Front)
local ncf = hroot.CFrame * CFrame.new(direct)
direct = ncf.p.unit
local rootr = Ray.new(hroot.Position, direct)
local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)
if path and waypoint or checkw(waypoint) then
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
human:MoveTo( checkw(waypoint).Position )
human.Jump = false
end
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
human.Jump = true
connection = human.Changed:connect(function()
human.Jump = true
end)
human:MoveTo( checkw(waypoint).Position )
else
human.Jump = false
end
if connection then
connection:Disconnect()
end
else
for i = 3, #oldpoints do
human:MoveTo( oldpoints[i].Position )
end
end
elseif enemytorso == nil and canWander then -- if player not detected
isWandering = 0
path = nil
waypoint = nil
human.MoveToFinished:Wait()
end
end
local myHuman = script.Parent:WaitForChild("Humanoid")
local myRoot = script.Parent:WaitForChild("HumanoidRootPart")
local myHead = script.Parent:WaitForChild("Head")
local tweenService = game:GetService("TweenService")
local curTarget
function findTarget()
local target
local dist = 1000
for i,v in pairs(workspace:GetChildren()) do
local human = v:FindFirstChild("Humanoid")
local rootPart = v:FindFirstChild("HumanoidRootPart")
if human and rootPart and v ~= script.Parent then
if (myRoot.Position - rootPart.Position).magnitude <= dist and human.Health > 0 then
dist = (myRoot.Position - rootPart.Position).magnitude
target = rootPart
end
end
end
return target
end
function checkSight(target)
local ray = Ray.new(myHead.Position,(target.Position - myHead.Position).Unit * 1000)
local hit,position = workspace:FindPartOnRayWithIgnoreList(ray,{script.Parent})
if hit then
if hit:FindFirstChild("Humanoid") or hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid") then
if math.abs(hit.Position.Y - myRoot.Position.Y) < 2 then
return true
else
return false
end
else
return false
end
else
return false
end
end
|
-- Coroutine runner that we create coroutines of. The coroutine can be
-- repeatedly resumed with functions to run followed by the argument to run
-- them with.
|
local function runEventHandlerInFreeThread()
-- Note: We cannot use the initial set of arguments passed to
-- runEventHandlerInFreeThread for a call to the handler, because those
-- arguments would stay on the stack for the duration of the thread's
-- existence, temporarily leaking references. Without access to raw bytecode
-- there's no way for us to clear the "..." references from the stack.
while true do
acquireRunnerThreadAndCallEventHandler(coroutine.yield())
end
end
|
--script.Parent.Touched:connect(Touch) --Listens out for Touchers.
| |
--back--
|
MakeWeld(car.Misc.RearDoor.base,car.DriveSeat)
MakeWeld(car.Misc.RearDoor.H1.To,car.Misc.RearDoor.H1.part1)
MakeWeld(car.Misc.RearDoor.H1.H2.Dr_1,car.Misc.RearDoor.H1.H2.part1)
MakeWeld(car.Misc.RearDoor.H1.H2.Dr_2,car.Misc.RearDoor.H1.H2.part1)
MakeWeld(car.Misc.RearDoor.H1.H2.Bar_B,car.Misc.RearDoor.H1.H2.part1)
MakeWeld(car.Misc.RearDoor.H1.H2.Bar_C,car.Misc.RearDoor.H1.H2.part1)
MakeWeld(car.Misc.RearDoor.F1.To,car.Misc.RearDoor.F1.part1)
MakeWeld(car.Misc.RearDoor.F1.F2.Dr_1,car.Misc.RearDoor.F1.F2.part1)
MakeWeld(car.Misc.RearDoor.F1.F2.Dr_2,car.Misc.RearDoor.F1.F2.part1)
MakeWeld(car.Misc.RearDoor.F1.F2.Bar_B,car.Misc.RearDoor.F1.F2.part1)
MakeWeld(car.Misc.RearDoor.F1.F2.Bar_C,car.Misc.RearDoor.F1.F2.part1)
MakeWeld(car.Misc.RearDoor.Lever.A,car.Misc.RearDoor.Lever.part1)
MakeWeld(car.Misc.RearDoor.H1.part0,car.Misc.RearDoor.H1.part1,"Motor",.015).Name="Motor"
MakeWeld(car.Misc.RearDoor.H1.H2.part0,car.Misc.RearDoor.H1.H2.part1,"Motor",.03).Name="Motor"
MakeWeld(car.Misc.RearDoor.F1.part0,car.Misc.RearDoor.F1.part1,"Motor",.015).Name="Motor"
MakeWeld(car.Misc.RearDoor.F1.F2.part0,car.Misc.RearDoor.F1.F2.part1,"Motor",.03).Name="Motor"
MakeWeld(car.Misc.RearDoor.Lever.part0,car.Misc.RearDoor.Lever.part1,"Motor",.04).Name="Motor"
MakeWeld(car.Misc.RearDoor.Lever.part0,car.Misc.RearDoor.base)
MakeWeld(car.Misc.RearDoor.H1.part0,car.Misc.RearDoor.base)
MakeWeld(car.Misc.RearDoor.H1.H2.part0,car.Misc.RearDoor.H1.To)
MakeWeld(car.Misc.RearDoor.F1.part0,car.Misc.RearDoor.base)
MakeWeld(car.Misc.RearDoor.F1.F2.part0,car.Misc.RearDoor.F1.To)
|
--Functions
|
local function getPlatform()
if GS:IsTenFootInterface() then
return "Console"
elseif UIS.TouchEnabled and not UIS.MouseEnabled then
return "Mobile"
else
return "Desktop"
end
end
|
-- Maximum distance away that the player can interact with target
|
local MAX_DISTANCE = 20
local prevWalkSpeed
|
---
|
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
local handler = car.Neons
local lightcolor = car.Body.Underglow.U.L.Color
script.Parent.MouseButton1Click:connect(function()
if car.Body.Underglow.U.L.L.Enabled == false then
handler:FireServer("Lights",1)
script.Parent.BackgroundColor3 = Color3.new(0,255/255,0)
script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0)
car.Body.Underglow.EFFECT.L.GUI.Enabled = true
for index, child in pairs(car.Body.Underglow.EFFECT.L.GUI:GetChildren()) do
child.ImageColor3 = lightcolor
end
for index, child in pairs(car.Body.Underglow.U:GetChildren()) do
child.Material = Enum.Material.Neon
child.L.Color = lightcolor
child.L.Enabled = true
end
elseif car.Body.Underglow.U.L.L.Enabled == true then
handler:FireServer("Lights",0)
script.Parent.BackgroundColor3 = Color3.new(0,0,0)
script.Parent.TextStrokeColor3 = Color3.new(0,0,0)
car.Body.Underglow.EFFECT.L.GUI.Enabled = false
for index, child in pairs(car.Body.Underglow.U:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
child.L.Enabled = false
end
end
end)
|
--it doesn't move because the function is never called
|
movePart()--]]
|
---Place this INSIDE the model. Don't replace the model name or anything.
------------------------------------------------------------------------------------------
|
object = script.Parent
if (object ~= nil) and (object ~= game.Workspace) then
model = object
messageText = "regenerating " .. model.Name .. ""
backup = model:clone() -- Make the backup
waitTime = 10 --Time to wait between regenerations
wait(math.random(1, waitTime))
while true do
wait(waitTime) -- Regen wait time
model:remove()
model = backup:clone()
model.Parent = game.Workspace
model:makeJoints()
end
end
|
--///////////////// Internal-Use Methods
--//////////////////////////////////////
--DO NOT REMOVE THIS. Chat must be filtered or your game will face
--moderation.
|
function methods:InternalApplyRobloxFilter(speakerName, message, toSpeakerName) --// USES FFLAG
if (RunService:IsServer() and not RunService:IsStudio()) then
local fromSpeaker = self:GetSpeaker(speakerName)
local toSpeaker = toSpeakerName and self:GetSpeaker(toSpeakerName)
if fromSpeaker == nil then
return nil
end
local fromPlayerObj = fromSpeaker:GetPlayer()
local toPlayerObj = toSpeaker and toSpeaker:GetPlayer()
if fromPlayerObj == nil then
return message
end
local filterStartTime = tick()
local filterRetries = 0
while true do
local success, message = pcall(function()
if toPlayerObj then
return Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
else
return Chat:FilterStringForBroadcast(message, fromPlayerObj)
end
end)
if success then
return message
else
warn("Error filtering message:", message)
end
filterRetries = filterRetries + 1
if filterRetries > MAX_FILTER_RETRIES or (tick() - filterStartTime) > MAX_FILTER_DURATION then
self:InternalNotifyFilterIssue()
return nil
end
local backoffInterval = FILTER_BACKOFF_INTERVALS[math.min(#FILTER_BACKOFF_INTERVALS, filterRetries)]
-- backoffWait = backoffInterval +/- (0 -> backoffInterval)
local backoffWait = backoffInterval + ((math.random()*2 - 1) * backoffInterval)
wait(backoffWait)
end
else
--// Simulate filtering latency.
--// There is only latency the first time the message is filtered, all following calls will be instant.
if not StudioMessageFilteredCache[message] then
StudioMessageFilteredCache[message] = true
wait(0.2)
end
return message
end
return nil
end
|
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
---- Actions
|
local actionButtons do
actionButtons = {}
local totalActions = 1
local currentActions = totalActions
local function makeButton(icon,over,name,vis,cond)
local buttonEnabled = false
local button = Create(Icon('ImageButton',icon),{
Name = name .. "Button";
Visible = Option.Modifiable and Option.Selectable;
Position = UDim2_new(1, -4 + -(GUI_SIZE+2)*currentActions+2,0.25,-GUI_SIZE/2);
Size = UDim2_new(0,GUI_SIZE,0,GUI_SIZE);
Parent = headerFrame;
})
local tipText = Create('TextLabel',{
Name = name .. "Text";
Text = name;
Visible = false;
BackgroundTransparency = 1;
TextXAlignment = 'Right';
Font = FONT;
FontSize = FONT_SIZE;
Position = UDim2_new(0,0,0,0);
Size = UDim2_new(1,-(GUI_SIZE+2)*totalActions,1,0);
Parent = headerFrame;
})
button.MouseEnter:connect(function()
if buttonEnabled then
button.BackgroundTransparency = 0.9
end
--Icon(button,over)
--tipText.Visible = true
end)
button.MouseLeave:connect(function()
button.BackgroundTransparency = 1
--Icon(button,icon)
--tipText.Visible = false
end)
currentActions = currentActions + 1
actionButtons[#actionButtons+1] = {Obj = button,Cond = cond}
QuickButtons[#actionButtons+1] = {Obj = button,Cond = cond, Toggle = function(on)
if on then
buttonEnabled = true
Icon(button,over)
else
buttonEnabled = false
Icon(button,icon)
end
end}
return button
end
--local clipboard = {}
local function delete(o)
o.Parent = nil
RemoteEvent:InvokeServer("Delete", o)
end
-- DELETE
makeButton(ACTION_DELETE,ACTION_DELETE_OVER,"Delete",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
if not Option.Modifiable then return end
local list = Selection:Get()
for i = 1,#list do
pcall(delete,list[i])
end
Selection:Set({})
end)
-- PASTE
makeButton(ACTION_PASTE,ACTION_PASTE_OVER,"Paste",true,function() return #Selection:Get() > 0 and #clipboard > 0 end).MouseButton1Click:connect(function()
if not Option.Modifiable then return end
local parent = Selection.List[1] or workspace
for i = 1,#clipboard do
clipboard[i]:Clone().Parent = parent
end
RemoteEvent:InvokeServer("Paste", parent)
end)
-- COPY
makeButton(ACTION_COPY,ACTION_COPY_OVER,"Copy",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
if not Option.Modifiable then return end
clipboard = {}
local list = Selection.List
RemoteEvent:InvokeServer("ClearClipboard")
for i = 1,#list do
table.insert(clipboard,list[i]:Clone())
RemoteEvent:InvokeServer("Copy", list[i])
end
updateActions()
end)
-- CUT
makeButton(ACTION_CUT,ACTION_CUT_OVER,"Cut",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function()
if not Option.Modifiable then return end
clipboard = {}
local list = Selection.List
local cut = {}
for i = 1,#list do
local obj = list[i]:Clone()
if obj then
table.insert(clipboard,obj)
table.insert(cut,list[i])
RemoteEvent:InvokeServer("Copy", list[i])
end
end
for i = 1,#cut do
pcall(delete,cut[i])
end
updateActions()
end)
-- FREEZE
-- SORT
-- local actionSort = makeButton(ACTION_SORT,ACTION_SORT_OVER,"Sort")
end
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
function Controller.UpdateSelections()
local iteration = 0
---
local highestZ = 0
for _, screenGui in ipairs(playerGui:GetChildren()) do
if screenGui.ClassName == "ScreenGui" then
if screenGui.Enabled == true and screenGui.DisplayOrder > highestZ and screenGui.Name ~= "Chat" and screenGui.Name ~= "Info Overlay" then
local buttonVisible = false
local function scanElement (p)
if buttonVisible == false then
for _, v in ipairs(p:GetChildren()) do
iteration = iteration + 1
if iteration%300 == 0 then
_L.Services.RunService.Stepped:wait()
end
if v:IsA("GuiObject") then
if v.Visible == true then
if v.ClassName == "ImageButton" or v.ClassName == "TextButton" or v.ClassName == "TextBox" then
buttonVisible = true
return
end
scanElement(v)
end
end
end
end
end
scanElement(screenGui)
if buttonVisible then
highestZ = screenGui.DisplayOrder
end
end
end
end
---
local function scan(parent)
for _, child in ipairs(parent:GetChildren()) do
if child then
if child.ClassName == "ImageButton" or child.ClassName == "TextButton" or child.ClassName == "TextBox" then
if not blacklistSet then
if child.Selectable == false then
selectionBlacklist[child] = true
end
end
if selectionBlacklist[child] == nil then
local selectable = true
if (child.ClassName == "ImageButton" and child.ImageTransparency == 1) or child.Visible == false then
--- Blunt test
selectable = false
else
--- Parent test
local function scanParent(p1)
iteration = iteration + 1
if iteration%300 == 0 then
_L.Services.RunService.Stepped:wait()
end
local p2 = p1.Parent
pcall(function() if p2.Visible == false then selectable = false end end)
pcall(function() if p2.ClassName == "ScreenGui" and (p2.Enabled == false or p2.DisplayOrder < highestZ) then selectable = false end end)
pcall(function() if p2.ClassName == "SurfaceGui" or p2.ClassName == "BillboardGui" then selectable = false end end)
if selectable == true then
if p2 ~= nil and p2 ~= playerGui then
scanParent(p2)
end
end
end
scanParent(child)
end
child.Selectable = child:FindFirstAncestor("Tutorial") ~= nil and true or selectable
end
else
pcall(function() child.Selectable = false end)
end
scan(child)
end
end
end
---
scan(playerGui)
blacklistSet = true
end
|
------------------------------------------------------------------------
-- converts an integer to a "floating point byte", represented as
-- (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if
-- eeeee != 0 and (xxx) otherwise.
------------------------------------------------------------------------
|
function luaY:int2fb(x)
local e = 0 -- exponent
while x >= 16 do
x = math.floor((x + 1) / 2)
e = e + 1
end
if x < 8 then
return x
else
return ((e + 1) * 8) + (x - 8)
end
end
|
--//Handler//--
|
Button.MouseButton1Click:Connect(function()
if CurrentAnimation.AnimationId ~= "rbxassetid://"..ID.Value then
CurrentAnimation.AnimationId = "rbxassetid://"..ID.Value
Action = Humanoid:LoadAnimation(CurrentAnimation)
Action:Play()
elseif CurrentAnimation.AnimationId == "rbxassetid://"..ID.Value then
if Action then
Action:Stop()
CurrentAnimation.AnimationId = ""
end
end
end)
|
--local HUB = script.Parent.HUB
--local limitButton = HUB.Limiter
|
local carSeat = script.Parent.Car.Value
local mouse = game.Players.LocalPlayer:GetMouse()
carSeat.Values2:WaitForChild("DTR")
carSeat.Values2:WaitForChild("Lights")
mouse.KeyDown:connect(function (key)
key = string.lower(key)
|
--Avxnturador @ //INSPARE
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("DS_Sounds")
local lastGear = 0
local Rev1 = 1500
local Rev2 = 2300
local Rev3 = 3700
local Rev4 = 5000
wait(0.5)
script:WaitForChild("DS1")
script:WaitForChild("DS2")
script:WaitForChild("DS3")
script:WaitForChild("DS4")
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","DS1",car.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)
handler:FireServer("newSound","DS2",car.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)
handler:FireServer("newSound","DS3",car.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)
handler:FireServer("newSound","DS4",car.DriveSeat,script.DS4.SoundId,1,script.DS4.Volume,false)
car.DriveSeat:WaitForChild("DS1")
car.DriveSeat:WaitForChild("DS2")
car.DriveSeat:WaitForChild("DS3")
car.DriveSeat:WaitForChild("DS4")
script.Parent.Values.Gear.Changed:connect(function()
if lastGear>script.Parent.Values.Gear.Value then
if ((script.Parent.Values.RPM.Value>=Rev1) and (script.Parent.Values.RPM.Value<Rev2)) then
if FE then handler:FireServer("playSound","DS1") else car.DriveSeat.DS1:Play() end
elseif ((script.Parent.Values.RPM.Value>=Rev2) and (script.Parent.Values.RPM.Value<Rev3)) then
if FE then handler:FireServer("playSound","DS2") else car.DriveSeat.DS2:Play() end
elseif ((script.Parent.Values.RPM.Value>=Rev3) and (script.Parent.Values.RPM.Value<Rev4)) then
if FE then handler:FireServer("playSound","DS3") else car.DriveSeat.DS3:Play() end
elseif (script.Parent.Values.RPM.Value>=Rev4) then
if FE then handler:FireServer("playSound","DS4") else car.DriveSeat.DS4:Play() end
end
end
lastGear = script.Parent.Values.Gear.Value
end)
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Cyan",Paint)
end)
|
--[[Susupension]]
|
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusStiffness = 22000 -- Spring Force
Tune.FSusDamping = 50 -- Spring Dampening
Tune.FAntiRoll = 400 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 1.9 -- Resting Suspension length (in studs)
Tune.FPreCompress = .1 -- Pre-compression adds resting length force
Tune.FExtensionLim = .4 -- Max Extension Travel (in studs)
Tune.FCompressLim = .2 -- Max Compression Travel (in studs)
Tune.FSusAngle = 75 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusStiffness = 22000 -- Spring Force
Tune.RSusDamping = 50 -- Spring Dampening
Tune.RAntiRoll = 400 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2.1 -- Resting Suspension length (in studs)
Tune.RPreCompress = .1 -- Pre-compression adds resting length force
Tune.RExtensionLim = .4 -- Max Extension Travel (in studs)
Tune.RCompressLim = .2 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics (PGS ONLY)
Tune.SusVisible = false -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 8 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.