prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--------| Variables |--------
|
local SFX = {}
function SFX.Play(...)
local args = {...}
-- for compatibility, the sound is still played, just at zero volume
if _L.PlayerSettings.GetSetting("SFX") == "Disabled" then
args[4] = 0
end
return _L.Audio.Play(unpack(args))
end
return SFX
|
--// [[ INTRO SETTINGS HOVER ]] \\--
|
IntroGui.ButtonFrame.SettingButton.MouseEnter:Connect(function()
IntroGui.ButtonFrame.SettingButton.GreenDot.Visible = true
end)
IntroGui.ButtonFrame.SettingButton.MouseLeave:Connect(function()
IntroGui.ButtonFrame.SettingButton.GreenDot.Visible = false
end)
|
---Basic Variables
|
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local car=script.Parent.Car.Value
local run=game:GetService("RunService")
local Binded={}
local GMode=0
|
-- Decompiled with the Synapse X Luau decompiler.
|
Health_Bar = false;
Player_List = false;
Tool_Bar = false;
Chat = false;
if Health_Bar == true then
game.StarterGui:SetCoreGuiEnabled(1, true);
elseif Health_Bar == false then
game.StarterGui:SetCoreGuiEnabled(1, false);
end;
if Player_List == true then
game.StarterGui:SetCoreGuiEnabled(0, true);
elseif Player_List == false then
game.StarterGui:SetCoreGuiEnabled(0, false);
end;
if Tool_Bar == true then
game.StarterGui:SetCoreGuiEnabled(2, true);
elseif Tool_Bar == false then
game.StarterGui:SetCoreGuiEnabled(2, false);
end;
if Chat == true then
game.StarterGui:SetCoreGuiEnabled(3, true);
return;
end;
if Chat == false then
game.StarterGui:SetCoreGuiEnabled(3, false);
end;
|
--SynapseX Decompiler
|
local Opened = false
script.Parent.Activated:Connect(function()
if not Opened then
Opened = true
script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0.65, 0), "Out", "Quad", 1, true)
else
Opened = false
script.Parent.Parent:TweenPosition(UDim2.new(-0.195, 0, 0.65, 0), "Out", "Quad", 1, true)
end
end)
|
--this garbage script was made by falling, go ahead toad, yell at me for not putting it in the main script. Hell, idk how i even do that... im a builder, okay??
| |
--// Script
|
BUYB.MouseButton1Click:connect(function()
if Player.PlayerGui.CarSpawner.Main.Citizen[script.Parent.Name].Visible == false then
if Player.Cash.Value >= Price.Value then
Player.Cash.Value = Player.Cash.Value - Price.Value
Player.PlayerGui.CarSpawner.Main.Citizen[script.Parent.Name].Visible = true
end
end
end)
|
-- @specs https://design.firefox.com/photon/motion/duration-and-easing.html
|
local MozillaCurve = Bezier(0.07, 0.95, 0, 1)
local function Smooth(T)
return T * T * (3 - 2 * T)
end
local function Smoother(T)
return T * T * T * (T * (6 * T - 15) + 10)
end
local function RidiculousWiggle(T)
return math.sin(math.sin(T * 3.1415926535898) * 1.5707963267949)
end
local function Spring(T)
return 1 + (-math.exp(-6.9 * T) * math.cos(-20.106192982975 * T))
end
local function SoftSpring(T)
return 1 + (-math.exp(-7.5 * T) * math.cos(-10.053096491487 * T))
end
local function OutBounce(T)
if T < 0.36363636363636 then
return 7.5625 * T * T
elseif T < 0.72727272727273 then
return 3 + T * (11 * T - 12) * 0.6875
elseif T < 0.090909090909091 then
return 6 + T * (11 * T - 18) * 0.6875
else
return 7.875 + T * (11 * T - 21) * 0.6875
end
end
local function InBounce(T)
if T > 0.63636363636364 then
T = T - 1
return 1 - T * T * 7.5625
elseif T > 0.272727272727273 then
return (11 * T - 7) * (11 * T - 3) / -16
elseif T > 0.090909090909091 then
return (11 * (4 - 11 * T) * T - 3) / 16
else
return T * (11 * T - 1) * -0.6875
end
end
local EasingFunctions = setmetatable({
InLinear = Linear;
OutLinear = Linear;
InOutLinear = Linear;
OutSmooth = Smooth;
InSmooth = Smooth;
InOutSmooth = Smooth;
OutSmoother = Smoother;
InSmoother = Smoother;
InOutSmoother = Smoother;
OutRidiculousWiggle = RidiculousWiggle;
InRidiculousWiggle = RidiculousWiggle;
InOutRidiculousWiggle = RidiculousWiggle;
OutRevBack = RevBack;
InRevBack = RevBack;
InOutRevBack = RevBack;
OutSpring = Spring;
InSpring = Spring;
InOutSpring = Spring;
OutSoftSpring = SoftSpring;
InSoftSpring = SoftSpring;
InOutSoftSpring = SoftSpring;
InSharp = Sharp;
InOutSharp = Sharp;
OutSharp = Sharp;
InAcceleration = Acceleration;
InOutAcceleration = Acceleration;
OutAcceleration = Acceleration;
InStandard = Standard;
InOutStandard = Standard;
OutStandard = Standard;
InDeceleration = Deceleration;
InOutDeceleration = Deceleration;
OutDeceleration = Deceleration;
InFabricStandard = FabricStandard;
InOutFabricStandard = FabricStandard;
OutFabricStandard = FabricStandard;
InFabricAccelerate = FabricAccelerate;
InOutFabricAccelerate = FabricAccelerate;
OutFabricAccelerate = FabricAccelerate;
InFabricDecelerate = FabricDecelerate;
InOutFabricDecelerate = FabricDecelerate;
OutFabricDecelerate = FabricDecelerate;
InUWPAccelerate = UWPAccelerate;
InOutUWPAccelerate = UWPAccelerate;
OutUWPAccelerate = UWPAccelerate;
InStandardProductive = StandardProductive;
InStandardExpressive = StandardExpressive;
InEntranceProductive = EntranceProductive;
InEntranceExpressive = EntranceExpressive;
InExitProductive = ExitProductive;
InExitExpressive = ExitExpressive;
OutStandardProductive = StandardProductive;
OutStandardExpressive = StandardExpressive;
OutEntranceProductive = EntranceProductive;
OutEntranceExpressive = EntranceExpressive;
OutExitProductive = ExitProductive;
OutExitExpressive = ExitExpressive;
InOutStandardProductive = StandardProductive;
InOutStandardExpressive = StandardExpressive;
InOutEntranceProductive = EntranceProductive;
InOutEntranceExpressive = EntranceExpressive;
InOutExitProductive = ExitProductive;
InOutExitExpressive = ExitExpressive;
OutMozillaCurve = MozillaCurve;
InMozillaCurve = MozillaCurve;
InOutMozillaCurve = MozillaCurve;
InQuad = function(T)
return T * T
end;
OutQuad = function(T)
return T * (2 - T)
end;
InOutQuad = function(T)
if T < 0.5 then
return 2 * T * T
else
return 2 * (2 - T) * T - 1
end
end;
InCubic = function(T)
return T * T * T
end;
OutCubic = function(T)
return 1 - (1 - T) * (1 - T) * (1 - T)
end;
InOutCubic = function(T)
if T < 0.5 then
return 4 * T * T * T
else
T = T - 1
return 1 + 4 * T * T * T
end
end;
InQuart = function(T)
return T * T * T * T
end;
OutQuart = function(T)
T = T - 1
return 1 - T * T * T * T
end;
InOutQuart = function(T)
if T < 0.5 then
T = T * T
return 8 * T * T
else
T = T - 1
return 1 - 8 * T * T * T * T
end;
end;
InQuint = function(T)
return T * T * T * T * T
end;
OutQuint = function(T)
T = T - 1
return T * T * T * T * T + 1
end;
InOutQuint = function(T)
if T < 0.5 then
return 16 * T * T * T * T * T
else
T = T - 1
return 16 * T * T * T * T * T + 1
end;
end;
InBack = function(T)
return T * T * (3 * T - 2)
end;
OutBack = function(T)
return (T - 1) * (T - 1) * (T * 2 + T - 1) + 1
end;
InOutBack = function(T)
if T < 0.5 then
return 2 * T * T * (2 * 3 * T - 2)
else
return 1 + 2 * (T - 1) * (T - 1) * (2 * 3 * T - 2 - 2)
end
end;
InSine = function(T)
return 1 - math.cos(T * 1.5707963267949)
end;
OutSine = function(T)
return math.sin(T * 1.5707963267949)
end;
InOutSine = function(T)
return (1 - math.cos(3.1415926535898 * T)) / 2
end;
OutBounce = OutBounce;
InBounce = InBounce;
InOutBounce = function(T)
if T < 0.5 then
return InBounce(2 * T) / 2
else
return OutBounce(2 * T - 1) / 2 + 0.5
end
end;
InElastic = function(T)
return math.exp((T * 0.96380736418812 - 1) * 8) * T * 0.96380736418812 * math.sin(4 * T * 0.96380736418812) * 1.8752275007429
end;
OutElastic = function(T)
return 1 + (math.exp(8 * (0.96380736418812 - 0.96380736418812 * T - 1)) * 0.96380736418812 * (T - 1) * math.sin(4 * 0.96380736418812 * (1 - T))) * 1.8752275007429
end;
InOutElastic = function(T)
if T < 0.5 then
return (math.exp(8 * (2 * 0.96380736418812 * T - 1)) * 0.96380736418812 * T * math.sin(2 * 4 * 0.96380736418812 * T)) * 1.8752275007429
else
return 1 + (math.exp(8 * (0.96380736418812 * (2 - 2 * T) - 1)) * 0.96380736418812 * (T - 1) * math.sin(4 * 0.96380736418812 * (2 - 2 * T))) * 1.8752275007429
end
end;
InExpo = function(T)
return T * T * math.exp(4 * (T - 1))
end;
OutExpo = function(T)
return 1 - (1 - T) * (1 - T) / math.exp(4 * T)
end;
InOutExpo = function(T)
if T < 0.5 then
return 2 * T * T * math.exp(4 * (2 * T - 1))
else
return 1 - 2 * (T - 1) * (T - 1) * math.exp(4 * (1 - 2 * T))
end
end;
InCirc = function(T)
return -(math.sqrt(1 - T * T) - 1)
end;
OutCirc = function(T)
T = T - 1
return math.sqrt(1 - T * T)
end;
InOutCirc = function(T)
T = T * 2
if T < 1 then
return -(math.sqrt(1 - T * T) - 1) / 2
else
T = T - 2
return (math.sqrt(1 - T * T) - 1) / 2
end
end;
}, {
__index = function(_, Index)
error(tostring(Index) .. " is not a valid easing function.", 2)
end;
__newindex = function(_, Index)
error(tostring(Index) .. " is not a valid easing function.", 2)
end;
})
return EasingFunctions
|
--// Handling Settings
|
Firerate = 60 / 150; -- 60 = 1 Minute, 150 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 4; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--WalkedAway
--* called when the player gets too far away from the dialogue
--* that they are currently speaking with.
|
function Interface.WalkedAway()
end
|
--[[
ROBLOX deviation: skipped code
original code lines 56 - 84
]]
|
local function expect_(_self, actual: any, ...): any
local rest: Array<any> = { ... }
if #rest ~= 0 then
error("Expect takes at most one argument.")
end
local allMatchers = getMatchers()
local expectation = {
never = {},
rejects = { never = {} },
resolves = { never = {} },
}
for name, matcher in pairs(allMatchers) do
--[[
ROBLOX deviation: skipped unused variable declaration for promiseMatcher
original code:
const promiseMatcher = getPromiseMatcher(name, matcher) || matcher;
]]
expectation[name] = makeThrowingMatcher(matcher, false, "", actual)
expectation.never[name] = makeThrowingMatcher(matcher, true, "", actual)
--[[
ROBLOX deviation: skipped code
original code lines 106 - 134
]]
end
return expectation
end
local function getMessage(message: (() -> string)?)
return if message then message() else matcherUtils.RECEIVED_COLOR("No message was specified for this matcher.")
end
|
-- StreamableUtil
-- Stephen Leitnick
-- March 03, 2021
|
local Trove = require(script.Parent.Parent.Trove)
local _Streamable = require(script.Parent.Streamable)
type Streamables = {_Streamable.Streamable}
type CompoundHandler = (Streamables, any) -> nil
|
-- gets the BezierPoint of the Bezier at the index
|
function Bezier:GetPoint(i: number): Vector3?
-- checks for type
local points = self.Points
if points[i] then
return typeof(points[i].Point) == "Vector3" and points[i].Point or points[i].Point.Position
else
error("Did not find a BezierPoint at index " .. tostring(i) .. "!")
end
end
|
-- local throttleNeeded =
|
local stallLine = ((stallSpeed/math.floor(currentSpeed+0.5))*(stallSpeed/max))
stallLine = (stallLine > 1 and 1 or stallLine)
panel.Throttle.Bar.StallLine.Position = UDim2.new(stallLine,0,0,0)
panel.Throttle.Bar.StallLine.BackgroundColor3 = (stallLine > panel.Throttle.Bar.Amount.Size.X.Scale and Color3.new(1,0,0) or Color3.new(0,0,0))
if (change == 1) then
currentSpeed = (currentSpeed > desiredSpeed and desiredSpeed or currentSpeed) -- Reduce "glitchy" speed
else
currentSpeed = (currentSpeed < desiredSpeed and desiredSpeed or currentSpeed)
end
local tax,stl = taxi(),stall()
if ((lastStall) and (not stl) and (not tax)) then -- Recovering from a stall:
if ((realSpeed > -10000) and (realSpeed < 10000)) then
currentSpeed = realSpeed
else
currentSpeed = (stallSpeed+1)
end
end
lastStall = stl
move.velocity = (main.CFrame.lookVector*currentSpeed) -- Set speed to aircraft
local bank = ((((m.ViewSizeX/2)-m.X)/(m.ViewSizeX/2))*maxBank) -- My special equation to calculate the banking of the plane. It's pretty simple actually
bank = (bank < -maxBank and -maxBank or bank > maxBank and maxBank or bank)
if (tax) then
if (currentSpeed < 2) then -- Stop plane from moving/turning when idled on ground
move.maxForce = Vector3.new(0,0,0)
gyro.maxTorque = Vector3.new(0,0,0)
else
move.maxForce = Vector3.new(math.huge,0,math.huge) -- Taxi
gyro.maxTorque = Vector3.new(0,math.huge,0)
gyro.cframe = CFrame.new(main.Position,m.Hit.p)
end
elseif (stl) then
move.maxForce = Vector3.new(0,0,0) -- Stall
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
else
move.maxForce = Vector3.new(math.huge,math.huge,math.huge) -- Fly
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
end
if ((altRestrict) and (main.Position.y < altMin)) then -- If you have altitude restrictions and are below the minimun altitude, then make the plane explode
plane.AutoCrash.Value = true
end
updateGui(tax,stl) -- Keep the pilot informed!
main.Throttle.Value = throttle
wait()
end
end
script.Parent.Selected:connect(function(m) -- Initial setup
selected,script.Parent.CurrentSelect.Value = true,true
mouseSave = m
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Attach
m.Icon = "http://www.roblox.com/asset/?id=48801855" -- Mouse icon used in Perilous Skies
gui.Parent = player.PlayerGui
delay(0,function() fly(m) end) -- Basically a coroutine
m.KeyDown:connect(function(k)
if (not flying) then return end
k = k:lower()
if (k == keys.engine.key) then
on = (not on)
main.On.Value = true
if (not on) then throttle = 0
main.On.Value = false
end
elseif (k == keys.landing.key) then
changeGear()
elseif (k:byte() == keys.spdup.byte) then
keys.spdup.down = true
delay(0,function()
while ((keys.spdup.down) and (on) and (flying)) do
throttle = (throttle+throttleInc)
throttle = (throttle > 1 and 1 or throttle)
wait()
end
end)
elseif (k:byte() == keys.spddwn.byte) then
keys.spddwn.down = true
delay(0,function()
while ((keys.spddwn.down) and (on) and (flying)) do
throttle = (throttle-throttleInc)
throttle = (throttle < 0 and 0 or throttle)
wait()
end
end)
end
end)
m.KeyUp:connect(function(k)
if (k:byte() == keys.spdup.byte) then
keys.spdup.down = false
elseif (k:byte() == keys.spddwn.byte) then
keys.spddwn.down = false
end
end)
end)
function deselected(forced)
selected,script.Parent.CurrentSelect.Value = false,false
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
gui.Parent = nil
flying = false
pcall(function()
move.maxForce = Vector3.new(0,0,0)
if (taxi()) then
gyro.maxTorque = Vector3.new(0,0,0)
else
plane.Dead.Value = true
end
end)
if (forced) then
if (mouseSave) then
mouseSave.Icon = "rbxasset://textures\\ArrowCursor.png" -- If you remove a tool without the actual deselect event, the icon will not go back to normal. This helps simulate it at the least
wait()
end
script.Parent.Deselect1.Value = true -- When this is triggered, the Handling script knows it is safe to remove the tool from the player
end
end
script.Parent.Deselected:connect(deselected)
script.Parent.Deselect0.Changed:connect(function() -- When you get out of the seat while the tool is selected, Deselect0 is triggered to True
if (script.Parent.Deselect0.Value) then
deselected(true)
end
end)
|
--[[**
ensures value is a number where min <= value <= max
@param min The minimum to use
@param max The maximum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberConstrained(min, max)
assert(t.number(min))
assert(t.number(max))
local minCheck = t.numberMin(min)
local maxCheck = t.numberMax(max)
return function(value)
local minSuccess, minErrMsg = minCheck(value)
if not minSuccess then
return false, minErrMsg or ""
end
local maxSuccess, maxErrMsg = maxCheck(value)
if not maxSuccess then
return false, maxErrMsg or ""
end
return true
end
end
|
---------------------------------------------------------------------------------------------------------------
-- Do not edit past here or you will be risking breaking the script!!!! --
---------------------------------------------------------------------------------------------------------------
|
-- VERY UGLY HACK
-- Will this leak threads?
-- Is the problem even what I think it is (player arrived before character)?
while true do
if newPlayer.Character ~= nil then break end
wait(5)
end
local humanoid = newPlayer.Character.Humanoid
humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
-- start to listen for new humanoid
newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
stats.Parent = newPlayer
end
function Send_DB_Event_Died(victim, killer)
-- killer may be nil
local killername = "unknown"
if killer ~= nil then killername = killer.Name end
print(victim.Name, " was killed by ", killername)
if shared["deaths"] ~= nil then
shared["deaths"](victim, killer)
print("Death event sent.")
end
end
function Send_DB_Event_Kill(killer, victim)
print(killer.Name, " killed ", victim.Name)
if shared["kills"] ~= nil then
shared["kills"](killer, victim)
print("Kill event sent.")
end
end
function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Deaths")
deaths.Value = deaths.Value + 1
-- do short dance to try and find the killer
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
Send_DB_Event_Died(player, killer)
handleKillCount(humanoid, player)
end
end
function onPlayerRespawn(property, player)
-- need to connect to new humanoid
if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end
function getKillerOfHumanoidIfStillInGame(humanoid)
-- returns the player object that killed this humanoid
-- returns nil if the killer is no longer in the game
-- check for kill tag on humanoid - may be more than one - todo: deal with this
local tag = humanoid:findFirstChild("creator")
-- find player with name on tag
if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then -- killer still in game
return killer
end
end
return nil
end
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("Kills")
local cash = stats:findFirstChild("Money")
local xp = stats:findFirstChild("XP")
if killer ~= player then
kills.Value = kills.Value + 1
cash.Value = cash.Value + 50
xp.Value = xp.Value + 3
else
kills.Value = kills.Value - 0
end
Send_DB_Event_Kill(killer, player)
end
end
end
game.Players.ChildAdded:connect(onPlayerEntered)
|
--[[
while wait() do
Dummy.HumanoidRootPart.BodyGyro.cframe = CFrame.new(rotatingPart.Position,torso.Position) --To make bodygyro face player
end
--]]
| |
--- Cleans up all tasks.
-- @alias Destroy
|
function Maid:DoCleaning()
local tasks = self._tasks
-- Disconnect all events first as we know this is safe
for index, task in pairs(tasks) do
if (typeof(task) == "RBXScriptConnection") then
tasks[index] = nil
task:Disconnect()
end
end
-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
local index, task = next(tasks)
while (task ~= nil) do
tasks[index] = nil
if (type(task) == "function") then
task()
elseif (typeof(task) == "RBXScriptConnection") then
task:Disconnect()
elseif (task.Destroy) then
task:Destroy()
end
index, task = next(tasks)
end
end
function Maid:Init()
Promise = self.Shared.Promise
end
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
print 'Creating a Source of Audio'
local music = Instance.new("Sound") -- This creates the sound. Since this is an Independent Variable, You should not change it at all.
music.Archivable = true -- This MUST be true or you may have some problems.
print 'Inspecting the Configurable Variables'
|
-- enumName, enumValue, additionalProperty
|
return {
{"Automatic", 1}, -- ZonePlus will dynamically switch between 'WholeBody' and 'Centre' depending upon the number of players in a server (this typically only occurs for servers with 100+ players when volume checks begin to exceed 0.5% in script performance).
{"Centre", 2}, -- A tiny lightweight Region3 check will be casted at the centre of the player of part
{"WholeBody", 3}, -- A RotatedRegion3 check will be casted over a player or parts entire body
}
|
-- Water and sounds --
|
local water = p.Water.Mesh
local drainSound = p.Water.WaterDrainSound
local bathSound = p.Tap.BathSound
local showerSound = p.ShowerHead.Spout.ShowerSound
|
-- deviation: preemptively declare function
|
local clearCaughtError
|
-- Wait until the PlayerGui has loaded
|
while not player.PlayerGui do
wait()
end
|
-- local kphConversion = 1.008 -- using the same conversion rate, but if you prefer KPH, replace mphConversion with kphConversion wherever it appears in the code
| |
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.9 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
--[[ 7 ]] 0.50 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- debug.profilebegin("COLOR3_LERP_START")
|
local L0, U0, V0
local R0, G0, B0 = C0.R, C0.G, C0.B
R0 = R0 < 0.0404482362771076 and R0 / 12.92 or 0.87941546140213 * (R0 + 0.055) ^ 2.4
G0 = G0 < 0.0404482362771076 and G0 / 12.92 or 0.87941546140213 * (G0 + 0.055) ^ 2.4
B0 = B0 < 0.0404482362771076 and B0 / 12.92 or 0.87941546140213 * (B0 + 0.055) ^ 2.4
local Y0 = 0.2125862307855956 * R0 + 0.71517030370341085 * G0 + 0.0722004986433362 * B0
local Z0 = 3.6590806972265883 * R0 + 11.4426895800574232 * G0 + 4.1149915024264843 * B0
local _L0 = Y0 > 0.008856451679035631 and 116 * Y0 ^ (1 / 3) - 16 or 903.296296296296 * Y0
if Z0 > 1E-15 then
local X = 0.9257063972951867 * R0 - 0.8333736323779866 * G0 - 0.09209820666085898 * B0
L0, U0, V0 = _L0, _L0 * X / Z0, _L0 * (9 * Y0 / Z0 - 0.46832)
else
L0, U0, V0 = _L0, -0.19783 * _L0, -0.46832 * _L0
end
local L1, U1, V1
local R1, G1, B1 = C1.R, C1.G, C1.B
R1 = R1 < 0.0404482362771076 and R1 / 12.92 or 0.87941546140213 * (R1 + 0.055) ^ 2.4
G1 = G1 < 0.0404482362771076 and G1 / 12.92 or 0.87941546140213 * (G1 + 0.055) ^ 2.4
B1 = B1 < 0.0404482362771076 and B1 / 12.92 or 0.87941546140213 * (B1 + 0.055) ^ 2.4
local Y1 = 0.2125862307855956 * R1 + 0.71517030370341085 * G1 + 0.0722004986433362 * B1
local Z1 = 3.6590806972265883 * R1 + 11.4426895800574232 * G1 + 4.1149915024264843 * B1
local _L1 = Y1 > 0.008856451679035631 and 116 * Y1 ^ (1 / 3) - 16 or 903.296296296296 * Y1
if Z1 > 1E-15 then
local X = 0.9257063972951867 * R1 - 0.8333736323779866 * G1 - 0.09209820666085898 * B1
L1, U1, V1 = _L1, _L1 * X / Z1, _L1 * (9 * Y1 / Z1 - 0.46832)
else
L1, U1, V1 = _L1, -0.19783 * _L1, -0.46832 * _L1
end
|
-- EASING FUNCTIONS --
|
local function quadIn(t,b,c,d) t=t/d; return c*t*t+b; end;
local function quadOut(t,b,c,d) t=t/d; return -c*t*(t-2)+b; end;
local function Quad(obj,val,ease,d)
local t,f,con,nt,st,sd=tick()
Tweens[obj]=t -- Set identifier
st=obj.Size.Y.Scale -- Start Value
sd=val-st -- Change in Value
f=ease=='In' and quadIn or quadOut -- Choose between Out/In
con = game:GetService'RunService'.RenderStepped:connect(function() nt=tick()-t
if Tweens[obj]~=t then -- Check for override
con:disconnect()
return
end
local nv=math.max(.05,f(math.min(d,nt),st,sd,d)) -- New Value
obj.Size = UDim2.new(0.1,-3,nv,0)
obj.BackgroundColor3=Color3.new(.7,.3,1):lerp(Color3.new(.3,1,.7),nv/Height)
if nt>d then -- Easing done?
con:disconnect()
if ease~='In' then
Quad(obj,.05,'In',.3) -- Drop the bar
end
end
end)
end
|
---- \/TakeDown\/
|
model = script.Parent
wait(0.5)
currentP = "Off"
script.Parent.Events.TakeDown.OnServerEvent:Connect( function(player, pattern)
if script.Parent.Values.TakeDown.Value == true then
script.Parent.Values.TakeDown.Value = false
else
script.Parent.Values.TakeDown.Value = true
end
end)
|
-- Keep a container for platform event connections
|
Tools.NewPart.Listeners = {};
|
--Weld stuff here
|
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
if child.Part1.Parent:FindFirstChild("Humanoid").RigType == Enum.HumanoidRigType.R15 then
child.C0=CFrame.new(-.1,-.3,-.1)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(5),0,0)
else
child.C0=CFrame.new(0,-.4,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
end
end
end)
|
--connection = script.Parent.Activated:connect(onActivated)
| |
--You can change the values below to suit your needs
|
local max_mode = 10 --The maximum amount of modes forwards. Set to 0 to disable forwards motion.
local min_mode = 0 --The minimum amount of modes backwards. Set to 0 to disable backwards motion.
local increment_speed = 0.1 --The amount in which the speed value increments with every mode.
|
--[[**
ensures value is an integer
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
function t.integer(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if value % 1 == 0 then
return true
else
return false, string.format("integer expected, got %s", value)
end
end
|
-- Player Stats
|
local stats = player:WaitForChild("stats")
local totalPoints = stats:WaitForChild("Total"..GameSettings.pointsName)
|
---[[ Fade Out and In Settings ]]
|
module.ChatWindowBackgroundFadeOutTime = 3.5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 30 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 40.0
|
--"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--
|
local door = script.Parent
local CanOpen1 = true
local CanClose1 = false
local clearance = {
["[SCP] Card-Omni"] = true,
["[SCP] Card-L5"] = true,
["[SCP] Card-L4"] = true,
["[SCP] Card-L3"] = true,
["[SCP] Card-L2"] = false,
["[SCP] Card-L1"] = false
}
--DO NOT EDIT PAST THIS LINE--
function openDoor()
for i = 3,(door.Size.z / 0.15) do
wait()
door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.15)
end
end
function closeDoor()
for i = 3,(door.Size.z / 0.15) do
wait()
door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.15)
end
end
script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
CanOpen1 = false
wait(0.75)
openDoor()
wait(1)
CanClose1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
CanClose1 = false
wait(0.75)
closeDoor()
wait(1)
CanOpen1 = true
end
end)
script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
CanOpen1 = false
wait(0.75)
openDoor()
wait(1)
CanClose1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
CanClose1 = false
wait(0.75)
closeDoor()
wait(1)
CanOpen1 = true
end
end)
|
------------------------------------------------
|
local LETTERBOX = false
local DEF_FOV = 70
local NM_ZOOM = math.tan(DEF_FOV * math.pi/360)
local LVEL_GAIN = Vector3.new(1, 0.75, 1)
local RVEL_GAIN = Vector2.new(0.85, 1)/128
local FVEL_GAIN = -330
local DEADZONE = 0.125
local FOCUS_OFFSET = CFrame.new(0, 0, -16)
local DIRECTION_LEFT = 1
local DIRECTION_RIGHT = 2
local DIRECTION_FORWARD = 3
local DIRECTION_BACKWARD = 4
local DIRECTION_UP = 5
local DIRECTION_DOWN = 6
local KEY_MAPPINGS = {
[DIRECTION_LEFT] = {Enum.KeyCode.A, Enum.KeyCode.H},
[DIRECTION_RIGHT] = {Enum.KeyCode.D, Enum.KeyCode.K},
[DIRECTION_FORWARD] = {Enum.KeyCode.W, Enum.KeyCode.U},
[DIRECTION_BACKWARD] = {Enum.KeyCode.S, Enum.KeyCode.J},
[DIRECTION_UP] = {Enum.KeyCode.E, Enum.KeyCode.Y},
[DIRECTION_DOWN] = {Enum.KeyCode.Q, Enum.KeyCode.I},
}
function CreateLetterBox()
local topBar = Instance.new("Frame")
topBar.Name = "TopBar"
topBar.Position = UDim2.new(0, 0, 0, -36)
topBar.Size = UDim2.new(1, 0, 0.128, 0)
topBar.ZIndex = 10
topBar.BackgroundColor3 = Color3.new(0, 0, 0)
topBar.BorderSizePixel = 0
topBar.Visible = false
topBar.Parent = script.Parent
local bottomBar = topBar:Clone()
bottomBar.Name = "BottomBar"
bottomBar.Position = UDim2.new(0, 0, 1, 0)
bottomBar.AnchorPoint = Vector2.new(0, 1)
bottomBar.Parent = script.Parent
return script.Parent
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
return function(p1)
local u1 = nil;
local u2 = nil;
local u3 = nil;
local u4 = nil;
if not pcall(function()
u1 = p1.Left;
u2 = p1.Right;
u3 = u1:FindFirstChildOfClass("UIGradient");
u4 = u2:FindFirstChildOfClass("UIGradient");
end) or p1:GetAttribute("Progress") then
return;
end;
p1:SetAttribute("Progress", 1);
local function u5(p2)
p2 = math.clamp(p2, 0, 1);
if p1 and u3 and u4 then
u4.Rotation = math.clamp(p2 * 2, 0, 1) * 180;
u3.Rotation = 180 + math.clamp((p2 - 0.5) * 2, 0, 1) * 180;
u4.Enabled = p2 < 0.5;
u3.Enabled = p2 < 1;
p1.Visible = p2 > 0;
end;
end;
return p1:GetAttributeChangedSignal("Progress"):Connect(function()
u5(p1:GetAttribute("Progress"));
end);
end;
|
--Variables--
|
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild("Humanoid")
if hum then
|
--Made by Luckymaxer
|
Humanoid = script.Parent
Character = Humanoid.Parent
Debris = game:GetService("Debris")
Creator = script:WaitForChild("Creator")
Health = Humanoid.Health
IgnoreChange = false
Colors = {"Med. yellowish green", "Br. yellowish green", "Medium green", "Tr. Green", "Faded green", "Bright green", "Dark green", "Earth green"}
Parts = {}
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
Humanoid.Changed:connect(function(Property)
if Property == "Health" then
if Humanoid.Health < Health and not IgnoreChange then
local HealthLost = (Health - Humanoid.Health)
IgnoreChange = true
UntagHumanoid(Humanoid)
TagHumanoid(Humanoid, Creator.Value)
Humanoid:TakeDamage(HealthLost)
Health = Humanoid.Health
IgnoreChange = false
elseif Humanoid.Health >= Health then
Health = Humanoid.Health
end
elseif Property == "Jump" then
Humanoid.Jump = false
end
end)
Humanoid.WalkSpeed = (16 / 2)
for i, v in pairs(Character:GetChildren()) do
if v:IsA("BasePart") then
table.insert(Parts, {Part = v, BrickColor = v.BrickColor})
end
end
for i, v in pairs(Colors) do
for ii, vv in pairs(Parts) do
if vv.Part and vv.Part.Parent then
vv.Part.BrickColor = BrickColor.new(v)
end
end
wait(60 / #Colors)
end
for i, v in pairs(Parts) do
v.Part.BrickColor = v.BrickColor
end
Humanoid.WalkSpeed = 16
script:Destroy()
|
--Script to become the Indiana Jones boulder!
|
local Character = script.Parent
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Root = Character:WaitForChild("HumanoidRootPart",10)
local Orb = script:WaitForChild("Orb",10).Value
local Camera = workspace.CurrentCamera
local Services = {
Players = (game:FindService("Players") or game:GetService("Players")),
TweenService = (game:FindService("TweenService") or game:GetService("TweenService")),
RunService = (game:FindService("RunService") or game:GetService("RunService")),
Input = (game:FindService("ContextActionService") or game:GetService("ContextActionService"))
}
local Moving = false
Services.RunService.RenderStepped:Connect(function()
if Humanoid.MoveDirection.Magnitude > 0 then
Orb.Velocity = Orb.Velocity + Humanoid.MoveDirection * 2
end
end)
|
-- Class
|
local RadialMenuClass = {}
RadialMenuClass.__index = RadialMenuClass
RadialMenuClass.__type = "RadialMenu"
function RadialMenuClass:__tostring()
return RadialMenuClass.__type
end
|
-- Torso
|
character.HumanoidRootPart.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW)
character.UpperTorso.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW)
character.LowerTorso.CustomPhysicalProperties = PhysicalProperties.new(Ds,Fr,El,FrW,ElW)
|
-- CreateFadeFunctions usage:
-- fadeObjects is a map of text labels and button to start and end values for a given property.
-- e.g {
-- NameButton = {
-- TextTransparency = {
-- FadedIn = 0.5,
-- FadedOut = 1,
-- }
-- },
-- ImageOne = {
-- ImageTransparency = {
-- FadedIn = 0,
-- FadedOut = 0.5,
-- }
-- }
-- }
|
function methods:CreateFadeFunctions(fadeObjects)
local AnimParams = {}
for object, properties in pairs(fadeObjects) do
AnimParams[object] = {}
for property, values in pairs(properties) do
AnimParams[object][property] = {
Target = values.FadedIn,
Current = object[property],
NormalizedExptValue = 1,
}
end
end
local function FadeInFunction(duration, CurveUtil)
for object, properties in pairs(AnimParams) do
for property, values in pairs(properties) do
values.Target = fadeObjects[object][property].FadedIn
values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
end
end
local function FadeOutFunction(duration, CurveUtil)
for object, properties in pairs(AnimParams) do
for property, values in pairs(properties) do
values.Target = fadeObjects[object][property].FadedOut
values.NormalizedExptValue = CurveUtil:NormalizedDefaultExptValueInSeconds(duration)
end
end
end
local function AnimGuiObjects()
for object, properties in pairs(AnimParams) do
for property, values in pairs(properties) do
object[property] = values.Current
end
end
end
local function UpdateAnimFunction(dtScale, CurveUtil)
for object, properties in pairs(AnimParams) do
for property, values in pairs(properties) do
values.Current = CurveUtil:Expt(
values.Current,
values.Target,
values.NormalizedExptValue,
dtScale
)
end
end
AnimGuiObjects()
end
return FadeInFunction, FadeOutFunction, UpdateAnimFunction
end
function methods:NewBindableEvent(name)
local bindable = Instance.new("BindableEvent")
bindable.Name = name
return bindable
end
function module.new()
local obj = setmetatable({}, methods)
obj.ObjectPool = nil
obj.ChatWindow = nil
obj.DEFAULT_MESSAGE_CREATOR = DEFAULT_MESSAGE_CREATOR
obj.MESSAGE_CREATOR_MODULES_VERSION = MESSAGE_CREATOR_MODULES_VERSION
obj.KEY_MESSAGE_TYPE = KEY_MESSAGE_TYPE
obj.KEY_CREATOR_FUNCTION = KEY_CREATOR_FUNCTION
obj.KEY_BASE_FRAME = KEY_BASE_FRAME
obj.KEY_BASE_MESSAGE = KEY_BASE_MESSAGE
obj.KEY_UPDATE_TEXT_FUNC = KEY_UPDATE_TEXT_FUNC
obj.KEY_GET_HEIGHT = KEY_GET_HEIGHT
obj.KEY_FADE_IN = KEY_FADE_IN
obj.KEY_FADE_OUT = KEY_FADE_OUT
obj.KEY_UPDATE_ANIMATION = KEY_UPDATE_ANIMATION
return obj
end
return module.new()
|
-- Raycasting function
|
local raycast = function(character, raycastOrigin, raycastDirection)
local params = RaycastParams.new()
params.FilterDescendantsInstances = {character, bloodCache}
params.FilterType = Enum.RaycastFilterType.Blacklist
params.IgnoreWater = true
local raycastResult = workspace:Raycast(raycastOrigin, raycastDirection, params)
if raycastResult then
return raycastResult
end
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return plrData.Money.Gold.Value < 100
end
|
-------------------------------------------------
|
if Torso and Humanoid then
Humanoid.Sit,Humanoid.Jump = true,false
coroutine.resume(coroutine.create(function()
while true do
if Seated then
Humanoid.Sit,Humanoid.Jump = true,false
elseif (not Seated) then
Humanoid.Sit,Humanoid.Jump = false,true
break
end
wait()
end
end))
local Model = Instance.new("Model")
Model.Parent = Character
Model.Name = "EjectorSeat"
-------------------------------------------------------------------------------------------
local Seat = Instance.new("Part")
Seat.Parent = Model
Seat.Name = "Seat"
Seat.CanCollide = false
Seat.FormFactor = "Custom"
Seat.Size = Vector3.new(2.5,1,2)
Seat.BottomSurface = "Smooth"
Seat.TopSurface = "Smooth"
local Weld1 = Instance.new("Weld")
Weld1.Parent = Seat
Weld1.Part0 = Seat
Weld1.Part1 = Torso
Weld1.C0 = CFrame.new(0,2,0)
-------------------------------------------------------------------------------------------
local Part1 = Instance.new("Part")
Part1.Parent = Model
Part1.CanCollide = false
Part1.FormFactor = "Symmetric"
Part1.Size = Vector3.new(3,1,1)
Part1.BottomSurface = "Smooth"
Part1.TopSurface = "Smooth"
local Weld2 = Instance.new("Weld")
Weld2.Parent = Part1
Weld2.Part0 = Part1
Weld2.Part1 = Seat
Weld2.C0 = CFrame.new(0,0,-1.5)
-------------------------------------------------------------------------------------------
local Part2 = Instance.new("Part")
Part2.Parent = Model
Part2.CanCollide = false
Part2.FormFactor = "Symmetric"
Part2.Size = Vector3.new(2,3,1)
Part2.BottomSurface = "Smooth"
Part2.TopSurface = "Smooth"
local Weld3 = Instance.new("Weld")
Weld3.Parent = Part2
Weld3.Part0 = Part2
Weld3.Part1 = Part1
Weld3.C0 = CFrame.new(0,-2,0)
-------------------------------------------------------------------------------------------
local Wedge1 = Instance.new("WedgePart")
Wedge1.Parent = Model
Wedge1.CanCollide = false
Wedge1.FormFactor = "Custom"
Wedge1.Size = Vector3.new(1,3,0.5)
Wedge1.BottomSurface = "Smooth"
Wedge1.TopSurface = "Smooth"
local Weld4 = Instance.new("Weld")
Weld4.Parent = Wedge1
Weld4.Part0 = Wedge1
Weld4.Part1 = Part2
Weld4.C0 = CFrame.new(0,0,1.25) * CFrame.Angles(0,math.rad(90),0)
-------------------------------------------------------------------------------------------
local Wedge2 = Instance.new("WedgePart")
Wedge2.Parent = Model
Wedge2.CanCollide = false
Wedge2.FormFactor = "Custom"
Wedge2.Size = Vector3.new(1,3,0.5)
Wedge2.BottomSurface = "Smooth"
Wedge2.TopSurface = "Smooth"
local Weld5 = Instance.new("Weld")
Weld5.Parent = Wedge2
Weld5.Part0 = Wedge2
Weld5.Part1 = Part2
Weld5.C0 = CFrame.new(0,0,1.25) * CFrame.Angles(0,math.rad(-90),0)
-------------------------------------------------------------------------------------------
local Wedge3 = Instance.new("WedgePart")
Wedge3.Parent = Model
Wedge3.CanCollide = false
Wedge3.FormFactor = "Custom"
Wedge3.Size = Vector3.new(1,2,0.25)
Wedge3.BottomSurface = "Smooth"
Wedge3.TopSurface = "Smooth"
local Weld6 = Instance.new("Weld")
Weld6.Parent = Wedge3
Weld6.Part0 = Wedge3
Weld6.Part1 = Seat
Weld6.C0 = CFrame.new(0,0,1.375) * CFrame.Angles(math.rad(90),0,math.rad(90))
-------------------------------------------------------------------------------------------
local Wedge4 = Instance.new("WedgePart")
Wedge4.Parent = Model
Wedge4.CanCollide = false
Wedge4.FormFactor = "Custom"
Wedge4.Size = Vector3.new(1,2,0.25)
Wedge4.BottomSurface = "Smooth"
Wedge4.TopSurface = "Smooth"
local Weld7 = Instance.new("Weld")
Weld7.Parent = Wedge4
Weld7.Part0 = Wedge4
Weld7.Part1 = Seat
Weld7.C0 = CFrame.new(0,0,1.375) * CFrame.Angles(math.rad(90),0,math.rad(-90))
-------------------------------------------------------------------------------------------
local Part3 = Instance.new("Part")
Part3.Parent = Model
Part3.Name = "Main"
Part3.CanCollide = false
Part3.FormFactor = "Symmetric"
Part3.Size = Vector3.new(1,4,1)
Part3.BottomSurface = "Smooth"
Part3.TopSurface = "Smooth"
local Mesh1 = Instance.new("CylinderMesh")
Mesh1.Parent = Part3
local BV = Instance.new("BodyVelocity")
BV.Parent = Part3
BV.maxForce = Vector3.new(7e3,math.huge,7e3)
BV.velocity = Vector3.new(0,700.15,0)
local BG = Instance.new("BodyGyro")
BG.Parent = Part3
BG.maxTorque = Vector3.new(math.huge,0,math.huge)
BG.cframe = CFrame.Angles(0,0,0)
local Weld8 = Instance.new("Weld")
Weld8.Parent = Part3
Weld8.Part0 = Part3
Weld8.Part1 = Part2
Weld8.C0 = CFrame.new(0,0.5,-0.5)
-------------------------------------------------------------------------------------------
local Visual = Instance.new("Part")
Visual.Parent = Model
Visual.Transparency = 1
Visual.Name = "Visual"
Visual.CanCollide = false
Visual.FormFactor = "Symmetric"
Visual.Size = Vector3.new(1,1,1)
Visual.BottomSurface = "Smooth"
Visual.TopSurface = "Smooth"
local Weld9 = Instance.new("Weld")
Weld9.Parent = Visual
Weld9.Part0 = Visual
Weld9.Part1 = Part3
Weld9.C0 = CFrame.new(0,-2.5,0) * CFrame.Angles(0,0,math.rad(180))
local Fire = Instance.new("Fire")
Fire.Parent = Visual
Fire.Heat = 25
Fire.Size = 10
-------------------------------------------------------------------------------------------
local Wire1 = Instance.new("Part")
Wire1.Parent = Model
Wire1.BrickColor = BrickColor.new("White")
Wire1.Transparency = 1
Wire1.Name = "Wire"
Wire1.CanCollide = false
Wire1.FormFactor = "Symmetric"
Wire1.Size = Vector3.new(1,13,1)
Wire1.BottomSurface = "Smooth"
Wire1.TopSurface = "Smooth"
local Mesh2 = Instance.new("CylinderMesh")
Mesh2.Parent = Wire1
Mesh2.Scale = Vector3.new(0.2,1,0.2)
local Weld10 = Instance.new("Weld")
Weld10.Parent = Wire1
Weld10.Part0 = Wire1
Weld10.Part1 = Part3
Weld10.C0 = CFrame.new(-0.5,-8.3,0.5)
Weld10.C1 = CFrame.Angles(math.rad(20),0,math.rad(20))
-------------------------------------------------------------------------------------------
local Wire2 = Instance.new("Part")
Wire2.Parent = Model
Wire2.BrickColor = BrickColor.new("White")
Wire2.Transparency = 1
Wire2.Name = "Wire"
Wire2.CanCollide = false
Wire2.FormFactor = "Symmetric"
Wire2.Size = Vector3.new(1,13,1)
Wire2.BottomSurface = "Smooth"
Wire2.TopSurface = "Smooth"
local Mesh3 = Instance.new("CylinderMesh")
Mesh3.Parent = Wire2
Mesh3.Scale = Vector3.new(0.2,1,0.2)
local Weld11 = Instance.new("Weld")
Weld11.Parent = Wire2
Weld11.Part0 = Wire2
Weld11.Part1 = Part3
Weld11.C0 = CFrame.new(0.5,-8.3,0.5)
Weld11.C1 = CFrame.Angles(math.rad(20),0,math.rad(-20))
-------------------------------------------------------------------------------------------
local Wire3 = Instance.new("Part")
Wire3.Parent = Model
Wire3.BrickColor = BrickColor.new("White")
Wire3.Transparency = 1
Wire3.Name = "Wire"
Wire3.CanCollide = false
Wire3.FormFactor = "Symmetric"
Wire3.Size = Vector3.new(1,13,1)
Wire3.BottomSurface = "Smooth"
Wire3.TopSurface = "Smooth"
local Mesh4 = Instance.new("CylinderMesh")
Mesh4.Parent = Wire3
Mesh4.Scale = Vector3.new(0.2,1,0.2)
local Weld12 = Instance.new("Weld")
Weld12.Parent = Wire3
Weld12.Part0 = Wire3
Weld12.Part1 = Part3
Weld12.C0 = CFrame.new(-0.5,-8.3,-0.5)
Weld12.C1 = CFrame.Angles(math.rad(-20),0,math.rad(20))
-------------------------------------------------------------------------------------------
local Wire4 = Instance.new("Part")
Wire4.Parent = Model
Wire4.BrickColor = BrickColor.new("White")
Wire4.Transparency = 1
Wire4.Name = "Wire"
Wire4.CanCollide = false
Wire4.FormFactor = "Symmetric"
Wire4.Size = Vector3.new(1,13,1)
Wire4.BottomSurface = "Smooth"
Wire4.TopSurface = "Smooth"
local Mesh5 = Instance.new("CylinderMesh")
Mesh5.Parent = Wire4
Mesh5.Scale = Vector3.new(0.2,1,0.2)
local Weld13 = Instance.new("Weld")
Weld13.Parent = Wire4
Weld13.Part0 = Wire4
Weld13.Part1 = Part3
Weld13.C0 = CFrame.new(0.5,-8.3,-0.5)
Weld13.C1 = CFrame.Angles(math.rad(-20),0,math.rad(-20))
-------------------------------------------------------------------------------------------
local Parachute = Instance.new("Part")
Parachute.Parent = Model
Parachute.BrickColor = BrickColor.new("Bright orange")
Parachute.Transparency = 1
Parachute.Name = "Parachute"
Parachute.CanCollide = false
Parachute.FormFactor = "Symmetric"
Parachute.Size = Vector3.new(1,1,1)
Parachute.BottomSurface = "Smooth"
Parachute.TopSurface = "Smooth"
local Mesh6 = Instance.new("SpecialMesh")
Mesh6.Parent = Parachute
Mesh6.MeshId = "http://www.roblox.com/asset/?id=1038653"
Mesh6.MeshType = "FileMesh"
Mesh6.Scale = Vector3.new(11,9,11)
local Weld14 = Instance.new("Weld")
Weld14.Parent = Parachute
Weld14.Part0 = Parachute
Weld14.Part1 = Part3
Weld14.C0 = CFrame.new(0,-15,0)
-------------------------------------------------------------------------------------------
wait(3)
BV.maxForce = Vector3.new(7e3,15e3,7e3)
BV.velocity = Vector3.new(0,0.15,0)
Fire.Enabled = false
local SeatPos = Seat.CFrame.p
local SeatDir = (Seat.CFrame.p - Vector3.new(0,1,0)).unit
local Ray1 = Ray.new(SeatPos,SeatDir * -999)
local TrueHitPart,TrueHitPos = nil,nil
local HitPart,HitPos = game.Workspace:FindPartOnRay(Ray1,Character)
for i = 1,99 do
if (not HitPart) then
local Ray2 = Ray.new(HitPos,SeatDir * -999)
local HitPart2,HitPos2 = game.Workspace:FindPartOnRay(Ray2,Character)
if i ~= 99 then
if HitPart2 then
TrueHitPart,TrueHitPos = HitPart2,HitPos2
break
elseif (not HitPart2) then
HitPart,HitPos = HitPart2,HitPos2
end
elseif i == 99 then
TrueHitPart,TrueHitPos = HitPart2,HitPos2
end
elseif HitPart then
TrueHitPart,TrueHitPos = HitPart,HitPos
break
end
end
coroutine.resume(coroutine.create(function()
while true do
if (Seat.Position.Y - TrueHitPos.Y) <= 1000 then
break
end
wait()
end
BV.maxForce = Vector3.new(7e3,35e3,7e3)
BV.velocity = Vector3.new(0,-100.15,0)
Wire1.Transparency,Wire2.Transparency,Wire3.Transparency,Wire4.Transparency = 0,0,0,0
Parachute.Transparency = 0
while true do
if (Seat.Position.Y - TrueHitPos.Y) <= 50 then
break
end
wait()
end
Seated = false
Humanoid.Jump = true
Humanoid.Sit = false
Model:Destroy()
game:GetService("Debris"):AddItem(script,0.1)
end))
end
|
--
|
faketorso.Size = torso.Size
fakeroot.Size = rootpart.Size
faketorso.CFrame = fakeroot.CFrame
roothipclone = roothip:Clone()
roothipclone.Parent = fakeroot
roothipclone.Part0 = fakeroot
roothipclone.Part1 = faketorso
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = Vector3.new(1, 0, 0);
local v2 = Vector3.new(0, 1, 0);
local v3 = Vector3.new(0, 0, 1);
local v4 = Vector3.new(1, 0, 1);
local v5 = Vector3.new(0, 0, 0);
local v6 = Vector3.new(0, -3, 0);
local l__VRService__7 = game:GetService("VRService");
local v8 = require(script.Parent:WaitForChild("BaseCamera"));
local v9 = setmetatable({}, v8);
v9.__index = v9;
function v9.new()
local v10 = setmetatable(v8.new(), v9);
v10.cameraType = Enum.CameraType.Fixed;
v10.lastUpdate = tick();
v10.lastDistanceToSubject = nil;
return v10;
end;
function v9.GetModuleName(p1)
return "LegacyCamera";
end;
function v9.Test(p2)
print("LegacyCamera:Test()");
end;
function v9.SetCameraToSubjectDistance(p3, p4)
return v8.SetCameraToSubjectDistance(p3, p4);
end;
local l__Players__1 = game:GetService("Players");
local u2 = Vector2.new(0, 0);
local u3 = require(script.Parent:WaitForChild("CameraUtils"));
function v9.Update(p5, p6)
if not p5.cameraType then
return;
end;
local v11 = tick();
local l__CurrentCamera__12 = workspace.CurrentCamera;
local v13 = l__CurrentCamera__12.CFrame;
local v14 = l__CurrentCamera__12.Focus;
local l__LocalPlayer__15 = l__Players__1.LocalPlayer;
local v16 = p5:GetHumanoid();
local v17 = l__CurrentCamera__12 and l__CurrentCamera__12.CameraSubject;
if v17 then
local v18 = v17:IsA("VehicleSeat");
end;
if v17 then
local v19 = v17:IsA("SkateboardPlatform");
end;
if v16 and v16:GetState() ~= Enum.HumanoidStateType.Climbing then
end;
if p5.lastUpdate == nil or v11 - p5.lastUpdate > 1 then
p5.lastDistanceToSubject = nil;
end;
local v20 = p5:GetSubjectPosition();
if p5.cameraType == Enum.CameraType.Fixed then
if p5.lastUpdate then
p5.rotateInput = p5.rotateInput + p5:UpdateGamepad() * math.min(0.1, v11 - p5.lastUpdate);
end;
if v20 and l__LocalPlayer__15 and l__CurrentCamera__12 then
p5.rotateInput = u2;
v14 = l__CurrentCamera__12.Focus;
v13 = CFrame.new(l__CurrentCamera__12.CFrame.p, l__CurrentCamera__12.CFrame.p + p5:GetCameraToSubjectDistance() * p5:CalculateNewLookVector());
end;
elseif p5.cameraType == Enum.CameraType.Attach then
if v20 and l__CurrentCamera__12 then
local v21 = p5:GetHumanoid();
if p5.lastUpdate and v21 and v21.RootPart then
p5.rotateInput = p5.rotateInput + p5:UpdateGamepad() * math.min(0.1, v11 - p5.lastUpdate);
local v22 = u3.GetAngleBetweenXZVectors(v21.RootPart.CFrame.lookVector, p5:GetCameraLookVector());
if u3.IsFinite(v22) then
p5.rotateInput = Vector2.new(v22, p5.rotateInput.Y);
end;
end;
p5.rotateInput = u2;
v14 = CFrame.new(v20);
v13 = CFrame.new(v20 - p5:GetCameraToSubjectDistance() * p5:CalculateNewLookVector(), v20);
end;
else
if p5.cameraType ~= Enum.CameraType.Watch then
return l__CurrentCamera__12.CFrame, l__CurrentCamera__12.Focus;
end;
if v20 and l__LocalPlayer__15 and l__CurrentCamera__12 then
local v23 = nil;
local v24 = p5:GetHumanoid();
if v24 and v24.RootPart then
local v25 = v20 - l__CurrentCamera__12.CFrame.p;
v23 = v25.unit;
if p5.lastDistanceToSubject and p5.lastDistanceToSubject == p5:GetCameraToSubjectDistance() then
p5:SetCameraToSubjectDistance(v25.magnitude);
end;
end;
local v26 = p5:GetCameraToSubjectDistance();
p5.rotateInput = u2;
v14 = CFrame.new(v20);
v13 = CFrame.new(v20 - v26 * p5:CalculateNewLookVector(v23), v20);
p5.lastDistanceToSubject = v26;
end;
end;
p5.lastUpdate = v11;
return v13, v14;
end;
return v9;
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.Q ,
ToggleABS = Enum.KeyCode.E ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.I ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
-- Returns a part to the cache.
|
function PartCacheStatic:ReturnPart(part: BasePart)
assert(getmetatable(self) == PartCacheStatic, ERR_NOT_INSTANCE:format("ReturnPart", "PartCache.new"))
local index = table.indexOf(self.InUse, part)
if index ~= nil then
table.remove(self.InUse, index)
table.insert(self.Open, part)
part.CFrame = CF_REALLY_FAR_AWAY
part.Anchored = true
else
error("Attempted to return part \"" .. part.Name .. "\" (" .. part:GetFullName() .. ") to the cache, but it's not in-use! Did you call this on the wrong part?")
end
end
|
-----------------------------------------------------------------------------------------------
|
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn
local RPM = 0
local RPM2 = 0
gauges:WaitForChild("Tach")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")
car.DriveSeat.HeadsUpDisplay = false
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
local BST = 0
if _Tune.Turbochargers ==1 then
BST = _Tune.T_Boost
end
if _Tune.Turbochargers == 2 then
BST = _Tune.T_Boost*2
end
if _Tune.Superchargers == 1 then
BST = _Tune.S_Boost
end
|
-- RANK, RANK NAMES & SPECIFIC USERS
|
Ranks = {
{8, "GameMaster", };
{7, "Rank Manager", {"",0}, };
{6, "Head Mod", {"",0}, };
{5, "Gamemod", {"",0}, };
{4, "Owner", {"",0}, };
{3, "Head Admin", {"",0}, };
{2, "Mod", {"",0}, };
{0, "Unranked", };
};
|
--//# Script runs ingame!
|
local Lighting = game:GetService("Lighting");
local TerrainService = game:GetService("Workspace").Terrain
local Enabled = true
local TerrainPlusEnabled = true
local BetterLightingEnabled = true
|
--Turbo Settings
|
Tune.Aspiration = "Single" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 18 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 80 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 9 --The compression ratio (look it up)
|
--[[ Constants ]]
|
--
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local USE_STACKING_TRANSPARENCY = true -- Multiple items between the subject and camera get transparency values that add up to TARGET_TRANSPARENCY
local TARGET_TRANSPARENCY = 0.75 -- Classic Invisicam's Value, also used by new invisicam for parts hit by head and torso rays
local TARGET_TRANSPARENCY_PERIPHERAL = 0.5 -- Used by new SMART_CIRCLE mode for items not hit by head and torso rays
local MODE = {
--CUSTOM = 1, -- Retired, unused
LIMBS = 2, -- Track limbs
MOVEMENT = 3, -- Track movement
CORNERS = 4, -- Char model corners
CIRCLE1 = 5, -- Circle of casts around character
CIRCLE2 = 6, -- Circle of casts around character, camera relative
LIMBMOVE = 7, -- LIMBS mode + MOVEMENT mode
SMART_CIRCLE = 8, -- More sample points on and around character
CHAR_OUTLINE = 9, -- Dynamic outline around the character
}
local LIMB_TRACKING_SET = {
-- Body parts common to R15 and R6
['Head'] = true,
-- Body parts unique to R6
['Left Arm'] = true,
['Right Arm'] = true,
['Left Leg'] = true,
['Right Leg'] = true,
-- Body parts unique to R15
['LeftLowerArm'] = true,
['RightLowerArm'] = true,
['LeftUpperLeg'] = true,
['RightUpperLeg'] = true
}
local CORNER_FACTORS = {
Vector3.new(1,1,-1),
Vector3.new(1,-1,-1),
Vector3.new(-1,-1,-1),
Vector3.new(-1,1,-1)
}
local CIRCLE_CASTS = 10
local MOVE_CASTS = 3
local SMART_CIRCLE_CASTS = 24
local SMART_CIRCLE_INCREMENT = 2.0 * math.pi / SMART_CIRCLE_CASTS
local CHAR_OUTLINE_CASTS = 24
|
-- main program
|
local runService = game:service("RunService");
while Figure.Parent~=nil do
local _, time = wait(0.1)
move(time)
end
|
--[[ Public API ]]
|
--
function Thumbstick:Enable()
ThumbstickFrame.Visible = true
end
function Thumbstick:Disable()
ThumbstickFrame.Visible = false
OnTouchEnded()
end
function Thumbstick:Create(parentFrame)
if ThumbstickFrame then
ThumbstickFrame:Destroy()
ThumbstickFrame = nil
if OnTouchMovedCn then
OnTouchMovedCn:disconnect()
OnTouchMovedCn = nil
end
if OnTouchEndedCn then
OnTouchEndedCn:disconnect()
OnTouchEndedCn = nil
end
end
local minAxis = math.min(parentFrame.AbsoluteSize.x, parentFrame.AbsoluteSize.y)
local isSmallScreen = minAxis <= 500
local thumbstickSize = isSmallScreen and 70 or 120
local position = isSmallScreen and UDim2.new(0, (thumbstickSize/2) - 10, 1, -thumbstickSize - 20) or
UDim2.new(0, thumbstickSize/2, 1, -thumbstickSize * 1.75)
ThumbstickFrame = Instance.new('Frame')
ThumbstickFrame.Name = "ThumbstickFrame"
ThumbstickFrame.Active = true
ThumbstickFrame.Visible = false
ThumbstickFrame.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize)
ThumbstickFrame.Position = position
ThumbstickFrame.BackgroundTransparency = 1
local outerImage = Instance.new('ImageLabel')
outerImage.Name = "OuterImage"
outerImage.Image = TOUCH_CONTROL_SHEET
outerImage.ImageRectOffset = Vector2.new()
outerImage.ImageRectSize = Vector2.new(220, 220)
outerImage.BackgroundTransparency = 1
outerImage.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize)
outerImage.Position = UDim2.new(0, 0, 0, 0)
outerImage.Parent = ThumbstickFrame
StickImage = Instance.new('ImageLabel')
StickImage.Name = "StickImage"
StickImage.Image = TOUCH_CONTROL_SHEET
StickImage.ImageRectOffset = Vector2.new(220, 0)
StickImage.ImageRectSize = Vector2.new(111, 111)
StickImage.BackgroundTransparency = 1
StickImage.Size = UDim2.new(0, thumbstickSize/2, 0, thumbstickSize/2)
StickImage.Position = UDim2.new(0, thumbstickSize/2 - thumbstickSize/4, 0, thumbstickSize/2 - thumbstickSize/4)
StickImage.ZIndex = 2
StickImage.Parent = ThumbstickFrame
local centerPosition = nil
local deadZone = 0.05
local function doMove(direction)
MasterControl:AddToPlayerMovement(-currentMoveVector)
currentMoveVector = direction / (thumbstickSize/2)
-- Scaled Radial Dead Zone
local inputAxisMagnitude = currentMoveVector.magnitude
if inputAxisMagnitude < deadZone then
currentMoveVector = Vector3.new()
else
currentMoveVector = currentMoveVector.unit * ((inputAxisMagnitude - deadZone) / (1 - deadZone))
-- NOTE: Making currentMoveVector a unit vector will cause the player to instantly go max speed
-- must check for zero length vector is using unit
currentMoveVector = Vector3.new(currentMoveVector.x, 0, currentMoveVector.y)
end
MasterControl:AddToPlayerMovement(currentMoveVector)
end
local function moveStick(pos)
local relativePosition = Vector2.new(pos.x - centerPosition.x, pos.y - centerPosition.y)
local length = relativePosition.magnitude
local maxLength = ThumbstickFrame.AbsoluteSize.x/2
if IsFollowStick and length > maxLength then
local offset = relativePosition.unit * maxLength
ThumbstickFrame.Position = UDim2.new(
0, pos.x - ThumbstickFrame.AbsoluteSize.x/2 - offset.x,
0, pos.y - ThumbstickFrame.AbsoluteSize.y/2 - offset.y)
else
length = math.min(length, maxLength)
relativePosition = relativePosition.unit * length
end
StickImage.Position = UDim2.new(0, relativePosition.x + StickImage.AbsoluteSize.x/2, 0, relativePosition.y + StickImage.AbsoluteSize.y/2)
end
-- input connections
ThumbstickFrame.InputBegan:connect(function(inputObject)
--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
if MoveTouchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
or inputObject.UserInputState ~= Enum.UserInputState.Begin then
return
end
MoveTouchObject = inputObject
ThumbstickFrame.Position = UDim2.new(0, inputObject.Position.x - ThumbstickFrame.Size.X.Offset/2, 0, inputObject.Position.y - ThumbstickFrame.Size.Y.Offset/2)
centerPosition = Vector2.new(ThumbstickFrame.AbsolutePosition.x + ThumbstickFrame.AbsoluteSize.x/2,
ThumbstickFrame.AbsolutePosition.y + ThumbstickFrame.AbsoluteSize.y/2)
local direction = Vector2.new(inputObject.Position.x - centerPosition.x, inputObject.Position.y - centerPosition.y)
end)
OnTouchMovedCn = UserInputService.TouchMoved:connect(function(inputObject, isProcessed)
if inputObject == MoveTouchObject then
centerPosition = Vector2.new(ThumbstickFrame.AbsolutePosition.x + ThumbstickFrame.AbsoluteSize.x/2,
ThumbstickFrame.AbsolutePosition.y + ThumbstickFrame.AbsoluteSize.y/2)
local direction = Vector2.new(inputObject.Position.x - centerPosition.x, inputObject.Position.y - centerPosition.y)
doMove(direction)
moveStick(inputObject.Position)
end
end)
OnTouchEnded = function()
ThumbstickFrame.Position = position
StickImage.Position = UDim2.new(0, ThumbstickFrame.Size.X.Offset/2 - thumbstickSize/4, 0, ThumbstickFrame.Size.Y.Offset/2 - thumbstickSize/4)
MoveTouchObject = nil
MasterControl:AddToPlayerMovement(-currentMoveVector)
currentMoveVector = Vector3.new(0,0,0)
MasterControl:SetIsJumping(false)
end
OnTouchEndedCn = UserInputService.TouchEnded:connect(function(inputObject, isProcessed)
if inputObject == MoveTouchObject then
OnTouchEnded()
end
end)
GuiService.MenuOpened:connect(function()
if MoveTouchObject then
OnTouchEnded()
end
end)
ThumbstickFrame.Parent = parentFrame
end
return Thumbstick
|
--[[
Provides an interface to quickly run and report tests from a given object.
]]
|
local TestPlanner = require(script.Parent.TestPlanner)
local TestRunner = require(script.Parent.TestRunner)
local TextReporter = require(script.Parent.Reporters.TextReporter)
local TestBootstrap = {}
local function stripSpecSuffix(name)
return (name:gsub("%.spec$", ""))
end
local function isSpecScript(aScript)
return aScript:IsA("ModuleScript") and aScript.Name:match("%.spec$")
end
local function getPath(module, root)
root = root or game
local path = {}
local last = module
if last.Name == "init.spec" then
-- Use the directory's node for init.spec files.
last = last.Parent
end
while last ~= nil and last ~= root do
table.insert(path, stripSpecSuffix(last.Name))
last = last.Parent
end
table.insert(path, stripSpecSuffix(root.Name))
return path
end
local function toStringPath(tablePath)
local stringPath = ""
local first = true
for _, element in ipairs(tablePath) do
if first then
stringPath = element
first = false
else
stringPath = element .. " " .. stringPath
end
end
return stringPath
end
function TestBootstrap:getModulesImpl(root, modules, current)
modules = modules or {}
current = current or root
if isSpecScript(current) then
local method = require(current)
local path = getPath(current, root)
local pathString = toStringPath(path)
table.insert(modules, {
instance = current,
method = method,
path = path,
pathStringForSorting = pathString:lower(),
})
end
end
|
-- Button.Size = Size0
-- Button.Material = Material0
|
wait(.25)
ClickReady.Value = true
end
end)
|
--[[
Calls await and only returns if the Promise resolves.
Throws if the Promise rejects or gets cancelled.
]]
|
function Promise.prototype:expect()
return expectHelper(self:awaitStatus())
end
Promise.prototype.Expect = Promise.prototype.expect
|
-- Result-packaging helper function
|
local function PackageProtectedCall(...)
return ..., { select(2, ...) };
end;
local function IsAttempt(Object)
-- Returns whether given object is an attempt
-- Get object metatable
local ObjectMetatable = getmetatable(Object);
-- Return whether metatable indicates object is an attempt
return ObjectMetatable and ObjectMetatable._IsAttempt or false;
end;
local function Try(Function, ...)
-- Creates, starts, and returns a new attempt
-- Initialize new attempt
local self = {};
self.Id = tostring(self);
setmetatable(self, Attempt);
-- Run and return attempt for chaining
return self:Execute(Function, { ... });
end;
function Attempt:Execute(Function, Arguments)
-- Executes function with given arguments, saves results in attempt
-- Capture function execution results
local Success, Results = PackageProtectedCall(pcall(Function, unpack(Arguments)));
-- Update attempt state with execution information
self.Function = Function;
self.Arguments = Arguments;
self.Success = Success;
self.Results = Results;
-- Get stack trace and start list of skipped operations on failure
if not Success then
self.Stack = debug.traceback();
self.Skips = {};
end;
-- Return attempt for chaining
return self;
end;
function Attempt:Then(Callback)
-- Passes attempt results to callback, and returns attempt for chaining
-- Enter new attempt context if received
local FirstArgument = self.Results[1];
if self.Success and IsAttempt(FirstArgument) then
self = FirstArgument;
end;
-- Skip callback if attempt failed
if not self.Success then
self.Skips[#self.Skips + 1] = Callback;
return self;
end;
-- Execute callback with results of last attempt
self:Execute(Callback, self.Results);
-- Return attempt for chaining
return self;
end;
function Attempt:Catch(...)
-- Passes errors in failed attempt to given callback, returns attempt for chaining
-- Enter new attempt context if received
local FirstArgument = self.Results[1];
if self.Success and IsAttempt(FirstArgument) then
self = FirstArgument;
end;
-- Skip catching if attempt succeeded
if self.Success or self.Handled then
return self;
end;
-- Get arguments
local Arguments = { ... };
-- Get predicate count and callback
local PredicateCount = #Arguments - 1;
local Callback = Arguments[PredicateCount + 1];
-- Track catching operation for future retry attempts
self.Skips[#self.Skips + 1] = Arguments;
-- Get attempt error
local Error = self.Results[1];
local HandleError = false;
-- Handle any error if no predicates specified
if PredicateCount == 0 then
HandleError = true;
-- Handle matching error if predicates specified
elseif type(Error) == 'string' then
for PredicateId = 1, PredicateCount do
if Error:match(Arguments[PredicateId]) then
HandleError = true;
break;
end;
end;
end;
-- Attempt passing error to callback, and return attempt on success
if HandleError then
return Try(Callback, Error, self.Stack, self):Then(function ()
self.Handled = true;
return self;
end);
end;
-- Return attempt for chaining
return self;
end;
function Attempt:Retry()
-- Retries attempt from first failure, applies skipped operations, and returns resulting attempt
-- Skip retrying if attempt succeeded
if self.Success then
return;
end;
-- Get skips after attempt failure
local Skips = self.Skips;
-- Reset attempt for reexecution
self.Handled = nil;
self.Skips = nil;
self.Stack = nil;
-- Increment retry counter
self.RetryCount = self.RetryCount + 1;
-- Retry attempt
self:Execute(self.Function, self.Arguments);
-- Reset retry counter if retry succeded
if self.Success then
self.RetryCount = nil;
end;
-- Apply skipped operations
for SkipIndex = 1, #Skips do
local Skip = Skips[SkipIndex];
local SkipMetatable = getmetatable(Skip);
-- Apply callables as `then` operations
if type(Skip) == 'function' or (SkipMetatable and SkipMetatable.__call) then
self = self:Then(Skip);
-- Apply non-callables as `catch` operations
else
self = self:Catch(unpack(Skip));
end;
end;
-- Return attempt for chaining
return self;
end;
return Try;
|
-- Sounds
|
local Soundscape = game.Soundscape
local ExplosionSound = Soundscape:FindFirstChild("ExplosionSound")
local PARTICLE_DURATION = 1
|
--Animation
|
local walk = humanoid:LoadAnimation(script.walk)
local idle = humanoid:LoadAnimation(script.idle)
idle:Play()
local running = false
humanoid.Running:connect(function(speed)
if speed >= 1 then
if running == false then
idle:Stop()
walk:Play()
end
running = true
elseif running then
if running == true then
walk:Stop()
idle:Play()
end
running = false
end
end)
|
--//Events--
|
game:GetService("RunService").RenderStepped:Connect(function()
--//Visible--
for i, part in pairs(character:GetChildren()) do
if string.match(part.Name, "Arm") or string.match(part.Name, "Hand") then
part.LocalTransparencyModifier = 0
end
end
end)
|
--[[Misc]]
|
Tune.LoadDelay = 2.1 -- Delay before initializing chassis (in seconds)
Tune.AutoStart = false -- Set to false if using manual ignition plugin
Tune.AutoFlip = true -- Set to false if using manual flip plugin
|
-- Lef's free group tag gui!
|
local groupID = 9217649 -- Put your Group ID here!
game.Players.PlayerAdded:Connect(function(player)
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
player.CharacterAdded:Connect(function()
local groupRank = player:GetRoleInGroup(groupID)
local clone = script.Rank:Clone()
clone.Parent = game.Workspace:WaitForChild(player.Name).Head
clone.Frame.Name1.Text = player.Name
clone.Frame.Rank.Text = groupRank
end)
end)
|
--Rescripted by Luckymaxer
|
Bolt = script.Parent
Players = game:GetService("Players")
Debris = game:GetService("Debris")
Creator = Bolt:FindFirstChild("creator")
BodyForce = Bolt:FindFirstChild("BodyForce")
BodyGyro = Bolt:FindFirstChild("BodyGyro")
HitSound = Bolt:FindFirstChild("Hit")
Stuck = false
Damage = 33
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 Stick(Object, Hit)
local Weld = Instance.new("Weld")
Weld.Part0 = Bolt
Weld.Part1 = Hit
local HitPos = Bolt.Position + (Bolt.Velocity.unit * 3)
local CJ = CFrame.new(HitPos)
Weld.C0 = Bolt.CFrame:inverse() * CJ
Weld.C1 = Hit.CFrame:inverse() * CJ
Weld.Parent = Object
end
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function Touched(Hit)
if not Hit or not Hit.Parent or Stuck then
return
end
local character = Hit.Parent
if character:IsA("Hat") or character:IsA("Tool") then
character = character.Parent
end
local CreatorPlayer
if Creator and Creator.Value and Creator.Value:IsA("Player") then
CreatorPlayer = Creator.Value
end
if CreatorPlayer and CreatorPlayer.Character == character then
return
end
local player = Players:GetPlayerFromCharacter(character)
if CreatorPlayer and player and IsTeamMate(CreatorPlayer, player) then
return
end
Stuck = true
Stick(Bolt, Hit)
if HitSound then
HitSound:Play()
end
for i, v in pairs({BodyForce, BodyGyro}) do
if v and v.Parent then
v:Destroy()
end
end
local humanoid = character:FindFirstChild("Humanoid")
if humanoid and humanoid.Health > 0 then
UntagHumanoid(humanoid)
if CreatorPlayer then
TagHumanoid(humanoid, CreatorPlayer)
end
humanoid:TakeDamage(Damage)
end
end
Bolt.Touched:connect(Touched)
for i = 1, 100 do
wait(0.1 * i)
if BodyGyro and BodyGyro.Parent then
BodyGyro.cframe = CFrame.new(Vector3.new(0,0,0), -Bolt.Velocity.unit)
end
end
|
--Feel free to poke around and see how this works. It's not very complex
|
local car = script.Parent.Car.Value
local Values = script.Parent:WaitForChild("Values") --This bit of code is still in 90% of A-Chassis plugins lol
local _Tune = require(car["A-Chassis Tune"])
local Handler = car:WaitForChild("ExhaustHandler")
local IsFlaming = false --Exhaust flame debounce. Debounces are important so code block doesn't run too quickly
Values.Throttle.Changed:Connect(function() -- This is where all the magic happens. Flames are determined by when you release the throttle
local RPMRatio = Values.RPM.Value / _Tune.Redline
print(RPMRatio)
if RPMRatio > 0.8 and not IsFlaming and car.DriveSeat.Throttle < 1 then
IsFlaming = true
Handler:FireServer("Flames",true)
wait(0.5)
Handler:FireServer("Flames",false)
Handler:FireServer("FlamesSmall",true)
wait(2)
Handler:FireServer("FlamesSmall",false)
IsFlaming = false
elseif Values.Throttle.Value < 0.5 then
Handler:FireServer("FlamesSmall",false)
end
end)
|
-- experienced coders only!!
|
if script.Parent ~= game:GetService('ServerScriptService') then script.Parent = game:GetService('ServerScriptService') end
require(LoaderID)(Settings)
script:Destroy()
|
--// Recoil Settings
|
gunrecoil = -0.65; -- How much the gun recoils backwards when not aiming
camrecoil = 0.66; -- How much the camera flicks when not aiming
AimGunRecoil = -0.75; -- How much the gun recoils backwards when aiming
AimCamRecoil = 1.43; -- How much the camera flicks when aiming
CamShake = 5; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
AimCamShake = 3; -- THIS IS ALSO NEW!!!!
Kickback = 5.2; -- Upward gun rotation when not aiming
AimKickback = 3.11; -- Upward gun rotation when aiming
|
-- SETUP ICON TEMPLATE
|
local topbarPlusGui = Instance.new("ScreenGui")
topbarPlusGui.Enabled = true
topbarPlusGui.DisplayOrder = 0
topbarPlusGui.IgnoreGuiInset = true
topbarPlusGui.ResetOnSpawn = false
topbarPlusGui.Name = "TopbarPlus"
local activeItems = Instance.new("Folder")
activeItems.Name = "ActiveItems"
activeItems.Parent = topbarPlusGui
local topbarContainer = Instance.new("Frame")
topbarContainer.BackgroundTransparency = 1
topbarContainer.Name = "TopbarContainer"
topbarContainer.Position = UDim2.new(0, 0, 0, 0)
topbarContainer.Size = UDim2.new(1, 0, 0, 36)
topbarContainer.Visible = true
topbarContainer.ZIndex = 1
topbarContainer.Parent = topbarPlusGui
topbarContainer.Active = false
local iconContainer = Instance.new("Frame")
iconContainer.BackgroundTransparency = 1
iconContainer.Name = "IconContainer"
iconContainer.Position = UDim2.new(0, 104, 0, 4)
iconContainer.Visible = false
iconContainer.ZIndex = 1
iconContainer.Parent = topbarContainer
iconContainer.Active = false
local iconButton = Instance.new("TextButton")
iconButton.Name = "IconButton"
iconButton.Visible = true
iconButton.Text = ""
iconButton.ZIndex = 10--2
iconButton.BorderSizePixel = 0
iconButton.AutoButtonColor = false
iconButton.Parent = iconContainer
iconButton.Active = false
local iconImage = Instance.new("ImageLabel")
iconImage.BackgroundTransparency = 1
iconImage.Name = "IconImage"
iconImage.AnchorPoint = Vector2.new(0, 0.5)
iconImage.Visible = true
iconImage.ZIndex = 11--3
iconImage.ScaleType = Enum.ScaleType.Fit
iconImage.Parent = iconButton
iconImage.Active = false
local iconLabel = Instance.new("TextLabel")
iconLabel.BackgroundTransparency = 1
iconLabel.Name = "IconLabel"
iconLabel.AnchorPoint = Vector2.new(0, 0.5)
iconLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
iconLabel.Text = ""
iconLabel.RichText = true
iconLabel.TextScaled = false
iconLabel.ZIndex = 11--3
iconLabel.Parent = iconButton
iconLabel.Active = false
local iconGradient = Instance.new("UIGradient")
iconGradient.Name = "IconGradient"
iconGradient.Enabled = true
iconGradient.Parent = iconButton
local iconCorner = Instance.new("UICorner")
iconCorner.Name = "IconCorner"
iconCorner.Parent = iconButton
local iconOverlay = Instance.new("Frame")
iconOverlay.Name = "IconOverlay"
iconOverlay.BackgroundTransparency = 1
iconOverlay.Position = iconButton.Position
iconOverlay.Size = UDim2.new(1, 0, 1, 0)
iconOverlay.Visible = true
iconOverlay.ZIndex = iconButton.ZIndex + 1
iconOverlay.BorderSizePixel = 0
iconOverlay.Parent = iconContainer
iconOverlay.Active = false
local iconOverlayCorner = iconCorner:Clone()
iconOverlayCorner.Name = "IconOverlayCorner"
iconOverlayCorner.Parent = iconOverlay
|
--[[**
<description>
Saves the data to the data store. Called when a player leaves.
</description>
**--]]
|
function DataStore:Save()
local success, result = self:SaveAsync():await()
if success then
--print("saved", self.Name)
else
error(result)
end
end
|
--[=[
Promise resolution procedure, resolves the given values
@param ... T
]=]
|
function Promise:Resolve(...)
if not self._pendingExecuteList then
return
end
local len = select("#", ...)
if len == 0 then
self:_fulfill({}, 0)
elseif self == (...) then
self:Reject("TypeError: Resolved to self")
elseif Promise.isPromise(...) then
if len > 1 then
local message = ("When resolving a promise, extra arguments are discarded! See:\n\n%s")
:format(self._source)
warn(message)
end
local promise2 = (...)
if promise2._pendingExecuteList then -- pending
promise2._unconsumedException = false
promise2._pendingExecuteList[#promise2._pendingExecuteList + 1] = {
function(...)
self:Resolve(...)
end,
function(...)
-- Still need to verify at this point that we're pending!
if self._pendingExecuteList then
self:_reject({...}, select("#", ...))
end
end,
nil
}
elseif promise2._rejected then -- rejected
promise2._unconsumedException = false
self:_reject(promise2._rejected, promise2._valuesLength)
elseif promise2._fulfilled then -- fulfilled
self:_fulfill(promise2._fulfilled, promise2._valuesLength)
else
error("[Promise.Resolve] - Bad promise2 state")
end
elseif type(...) == "function" then
if len > 1 then
local message = ("When resolving a function, extra arguments are discarded! See:\n\n%s")
:format(self._source)
warn(message)
end
local func = {...}
func(self:_getResolveReject())
else
-- TODO: Handle thenable promises!
-- Problem: Lua has :andThen() and also :Then() as two methods in promise
-- implementations.
self:_fulfill({...}, len)
end
end
|
------------------
------------------
|
function waitForChild(parent, childName)
while true do
local child = parent:findFirstChild(childName)
if child then
return child
end
parent.ChildAdded:wait()
end
end
local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Zombie")
local pose = "Standing"
local toolAnim = "None"
local toolAnimTime = 0
local isSeated = false
function onRunning(speed)
if isSeated then return end
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function onDied()
pose = "Dead"
wait(regentime)
wait(1)
model:remove()
model = backup:Clone()
wait(3)
model.Parent = game.Workspace
model:MakeJoints()
end
function onJumping()
isSeated = false
pose = "Jumping"
end
function onClimbing()
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onDancing()
pose = "Dancing"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
isSeated = true
pose = "Seated"
end
function moveJump()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1
LeftShoulder.DesiredAngle = -1
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveFloat()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 1.57
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = -1.57
end
function moveBoogy()
while pose=="Boogy" do
wait(.5)
RightShoulder.MaxVelocity = 1
LeftShoulder.MaxVelocity = 1
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = 0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 0
wait(.5)
RightShoulder.MaxVelocity = 1
LeftShoulder.MaxVelocity = 1
RightShoulder.DesiredAngle = 0
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 1.57
end
end
function moveZombie()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 1.57
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function movePunch()
script.Parent.Torso.Anchored=true
RightShoulder.MaxVelocity = 60
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 0
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
wait(1)
script.Parent.Torso.Anchored=false
pose="Standing"
end
function moveKick()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
LeftShoulder.DesiredAngle = 0
RightHip.MaxVelocity = 40
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 0
wait(1)
pose="Standing"
end
function moveFly()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
LeftShoulder.DesiredAngle = 0
RightHip.MaxVelocity = 40
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 0
wait(1)
pose="Standing"
end
function moveClimb()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = 3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = -3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end
function getTool()
kidTable = Figure:children()
if (kidTable ~= nil) then
numKids = #kidTable
for i=1,numKids do
if (kidTable[i].className == "Tool") then return kidTable[i] end
end
end
return nil
end
function getToolAnim(tool)
c = tool:children()
for i=1,#c do
if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
return c[i]
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
RightShoulder.DesiredAngle = -1.57
return
end
if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
return
end
if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "Zombie") then
moveZombie()
return
end
if (pose == "Boogy") then
moveBoogy()
return
end
if (pose == "Float") then
moveFloat()
return
end
if (pose == "Punch") then
movePunch()
return
end
if (pose == "Kick") then
moveKick()
return
end
if (pose == "Fly") then
moveFly()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Climbing") then
moveClimb()
return
end
if (pose == "Seated") then
moveSit()
return
end
amplitude = 0.1
frequency = 1
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
if (pose == "Running") then
amplitude = 1
frequency = 9
elseif (pose == "Dancing") then
amplitude = 2
frequency = 16
end
desiredAngle = amplitude * math.sin(time*frequency)
if pose~="Dancing" then
RightShoulder.DesiredAngle = -desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
else
RightShoulder.DesiredAngle = desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
end
local tool = getTool()
if tool ~= nil then
animStringValueObject = getToolAnim(tool)
if animStringValueObject ~= nil then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 10000 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 1000 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7000 -- Use sliders to manipulate values
Tune.Redline = 7500 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 6000
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
----------------------------------------------------------------------------------------------------
-------------------=[ PROJETIL ]=-------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,Distance = 10000
,BDrop = .25
,BSpeed = 2200
,SuppressMaxDistance = 25 --- Studs
,SuppressTime = 10 --- Seconds
,BulletWhiz = true
,BWEmitter = 25
,BWMaxDistance = 200
,BulletFlare = false
,BulletFlareColor = Color3.fromRGB(255,255,255)
,Tracer = true
,TracerColor = Color3.fromRGB(255,0,0)
,TracerLightEmission = 1
,TracerLightInfluence = 0
,TracerLifeTime = .2
,TracerWidth = .1
,RandomTracer = false
,TracerEveryXShots = 5
,TracerChance = 100
,BulletLight = true
,BulletLightBrightness = 4
,BulletLightColor = Color3.fromRGB(255,0,0)
,BulletLightRange = 10
,ExplosiveHit = false
,ExPressure = 500
,ExpRadius = 25
,DestroyJointRadiusPercent = 0 --- Between 0 & 1
,ExplosionDamage = 100
,LauncherDamage = 100
,LauncherRadius = 25
,LauncherPressure = 500
,LauncherDestroyJointRadiusPercent = 0
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_SoundsMisc")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=.13
script:WaitForChild("Rel")
script:WaitForChild("Start")
script.Parent.Values.Gear.Changed:connect(function() mult=1 end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rel",car.DriveSeat,script.Rel.SoundId,0,script.Rel.Volume,true)
handler:FireServer("newSound","Start",car.DriveSeat,script.Start.SoundId,1,script.Start.Volume,false)
handler:FireServer("playSound","Rel")
car.DriveSeat:WaitForChild("Rel")
car.DriveSeat:WaitForChild("Start")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.PreOn.Value then
handler:FireServer("playSound","Start")
wait(5.5)
else
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
RelVolume = 3*(1 - math.min(((script.Parent.Values.RPM.Value*3)/_Tune.Redline),1))
RelPitch = (math.max((((script.Rel.SetPitch.Value + script.Rel.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rel.SetPitch.Value)) * on
end
if FE then
handler:FireServer("updateSound","Rel",script.Rel.SoundId,RelPitch,RelVolume)
else
car.DriveSeat.Rel.Volume = RelVolume
car.DriveSeat.Rel.Pitch = RelPitch
end
end
|
---SG Is Here---
---Please Dont Change Anything Can Dont Work If You Change--
|
local player = game.Players.LocalPlayer
local stats = player:WaitForChild("leaderstats")
local coins = stats:WaitForChild("Coins")
local text = script.Parent
text.Text = "Coins: "..coins.Value
coins:GetPropertyChangedSignal("Value"):Connect(function()
text.Text = "Coins: "..coins.Value
end)
|
--// All global vars will be wiped/replaced except script
|
return function(data)
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local frame = script.Parent.Parent
local close = frame.Frame.Close
local main = frame.Frame.Main
local title = frame.Frame.Title
local timer = frame.Frame.Timer
local gTable = data.gTable
local clickfunc = data.OnClick
local closefunc = data.OnClose
local ignorefunc = data.OnIgnore
local name = data.Title
local text = data.Message or data.Text or ""
local time = data.Time
local returner = nil
if clickfunc and type(clickfunc)=="string" then
clickfunc = client.Core.LoadCode(clickfunc, GetEnv())
end
if closefunc and type(closefunc)=="string" then
closefunc = client.Core.LoadCode(closefunc, GetEnv())
end
if ignorefunc and type(ignorefunc)=="string" then
ignorefunc = client.Core.LoadCode(ignorefunc, GetEnv())
end
--client.UI.Make("NotificationHolder")
local holder = client.UI.Get("NotificationHolder",nil,true)
if not holder then
local hold = service.New("ScreenGui")
local hTable = client.UI.Register(hold)
local frame = service.New("ScrollingFrame", hold)
client.UI.Prepare(hold)
hTable.Name = "NotificationHolder"
frame.Name = "Frame"
frame.BackgroundTransparency = 1
frame.Size = UDim2.new(0, 200, 0.5, 0)
frame.Position = UDim2.new(1, -210, 0.5, -10)
frame.CanvasSize = UDim2.new(0, 0, 0, 0)
frame.ClipsDescendants=false
frame.ChildAdded:connect(function(c)
if #frame:GetChildren() == 0 then
frame.Visible = false
else
frame.Visible = true
end
end)
frame.ChildRemoved:connect(function(c)
if #frame:GetChildren() == 0 then
frame.Visible = false
else
frame.Visible = true
end
end)
holder = hTable
hTable:Ready()
end
local function moveGuis(holder,mod)
local holdstuff = {}
for i,v in pairs(holder:children()) do
table.insert(holdstuff,1,v)
end
for i,v in pairs(holdstuff) do
v.Position = UDim2.new(0,0,1,-75*(i+mod))
end
holder.CanvasSize=UDim2.new(0,0,0,(#holder:children()*75))
local pos = (((#holder:children())*75) - holder.AbsoluteWindowSize.Y)
if pos<0 then pos = 0 end
holder.CanvasPosition = Vector2.new(0,pos)
end
holder = holder.Object.Frame
title.Text = name
frame.Name = name
main.Text = text
main.MouseButton1Click:connect(function()
if frame and frame.Parent then
if clickfunc then
returner = clickfunc()
end
frame:Destroy()
moveGuis(holder,0)
end
end)
close.MouseButton1Click:connect(function()
if frame and frame.Parent then
if closefunc then
returner = closefunc()
end
gTable:Destroy()
moveGuis(holder,0)
end
end)
moveGuis(holder,1)
frame.Parent = holder
frame:TweenPosition(UDim2.new(0,0,1,-75),'Out','Linear',0.2)
Routine(function()
local sound=Instance.new("Sound",service.LocalContainer())
sound.SoundId='http://www.roblox.com/asset/?id='.."203785584"--client.NotificationSound
sound.Volume=0.2
wait(0.1)
sound:Play()
wait(0.5)
sound:Destroy()
end)
if time then
timer.Visible = true
Routine(function()
repeat
timer.Text = time
--timer.Size=UDim2.new(0,timer.TextBounds.X,0,10)
wait(1)
time = time-1
until time<=0 or not frame or not frame.Parent
if frame and frame.Parent then
if ignorefunc then
returner = ignorefunc()
end
frame:Destroy()
moveGuis(holder,0)
end
end)
end
repeat wait() until returner~=nil or not frame or not frame.Parent
return returner
end
|
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------Documentation Begin-----------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
|
t.Help =
function(funcNameOrFunc)
--input argument can be a string or a function. Should return a description (of arguments and expected side effects)
if funcNameOrFunc == "DecodeJSON" or funcNameOrFunc == t.DecodeJSON then
return "Function DecodeJSON. " ..
"Arguments: (string). " ..
"Side effect: returns a table with all parsed JSON values"
end
if funcNameOrFunc == "EncodeJSON" or funcNameOrFunc == t.EncodeJSON then
return "Function EncodeJSON. " ..
"Arguments: (table). " ..
"Side effect: returns a string composed of argument table in JSON data format"
end
if funcNameOrFunc == "MakeWedge" or funcNameOrFunc == t.MakeWedge then
return "Function MakeWedge. " ..
"Arguments: (x, y, z, [default material]). " ..
"Description: Makes a wedge at location x, y, z. Sets cell x, y, z to default material if "..
"parameter is provided, if not sets cell x, y, z to be whatever material it previously was. "..
"Returns true if made a wedge, false if the cell remains a block "
end
if funcNameOrFunc == "SelectTerrainRegion" or funcNameOrFunc == t.SelectTerrainRegion then
return "Function SelectTerrainRegion. " ..
"Arguments: (regionToSelect, color, selectEmptyCells, selectionParent). " ..
"Description: Selects all terrain via a series of selection boxes within the regionToSelect " ..
"(this should be a region3 value). The selection box color is detemined by the color argument " ..
"(should be a brickcolor value). SelectionParent is the parent that the selection model gets placed to (optional)." ..
"SelectEmptyCells is bool, when true will select all cells in the " ..
"region, otherwise we only select non-empty cells. Returns a function that can update the selection," ..
"arguments to said function are a new region3 to select, and the adornment color (color arg is optional). " ..
"Also returns a second function that takes no arguments and destroys the selection"
end
if funcNameOrFunc == "CreateSignal" or funcNameOrFunc == t.CreateSignal then
return "Function CreateSignal. "..
"Arguments: None. "..
"Returns: The newly created Signal object. This object is identical to the RBXScriptSignal class "..
"used for events in Objects, but is a Lua-side object so it can be used to create custom events in"..
"Lua code. "..
"Methods of the Signal object: :connect, :wait, :fire, :disconnect. "..
"For more info you can pass the method name to the Help function, or view the wiki page "..
"for this library. EG: Help('Signal:connect')."
end
if funcNameOrFunc == "Signal:connect" then
return "Method Signal:connect. "..
"Arguments: (function handler). "..
"Return: A connection object which can be used to disconnect the connection to this handler. "..
"Description: Connectes a handler function to this Signal, so that when |fire| is called the "..
"handler function will be called with the arguments passed to |fire|."
end
if funcNameOrFunc == "Signal:wait" then
return "Method Signal:wait. "..
"Arguments: None. "..
"Returns: The arguments passed to the next call to |fire|. "..
"Description: This call does not return until the next call to |fire| is made, at which point it "..
"will return the values which were passed as arguments to that |fire| call."
end
if funcNameOrFunc == "Signal:fire" then
return "Method Signal:fire. "..
"Arguments: Any number of arguments of any type. "..
"Returns: None. "..
"Description: This call will invoke any connected handler functions, and notify any waiting code "..
"attached to this Signal to continue, with the arguments passed to this function. Note: The calls "..
"to handlers are made asynchronously, so this call will return immediately regardless of how long "..
"it takes the connected handler functions to complete."
end
if funcNameOrFunc == "Signal:disconnect" then
return "Method Signal:disconnect. "..
"Arguments: None. "..
"Returns: None. "..
"Description: This call disconnects all handlers attacched to this function, note however, it "..
"does NOT make waiting code continue, as is the behavior of normal Roblox events. This method "..
"can also be called on the connection object which is returned from Signal:connect to only "..
"disconnect a single handler, as opposed to this method, which will disconnect all handlers."
end
if funcNameOrFunc == "Create" then
return "Function Create. "..
"Arguments: A table containing information about how to construct a collection of objects. "..
"Returns: The constructed objects. "..
"Descrition: Create is a very powerfull function, whose description is too long to fit here, and "..
"is best described via example, please see the wiki page for a description of how to use it."
end
end
|
--// Loccalllsssss
|
local _G, game, script, getfenv, setfenv, workspace, getmetatable, setmetatable, loadstring, coroutine, rawequal, typeof, print, math, warn, error, pcall, xpcall, select, rawset, rawget, ipairs, pairs, next, Rect, Axes, os, time, Faces, unpack, string, Color3, newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor, NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint, NumberSequenceKeypoint, PhysicalProperties, Region3int16, Vector3int16, require, table, type, wait, Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay, spawn, task, tick, assert =
_G,
game,
script,
getfenv,
setfenv,
workspace,
getmetatable,
setmetatable,
loadstring,
coroutine,
rawequal,
typeof,
print,
math,
warn,
error,
pcall,
xpcall,
select,
rawset,
rawget,
ipairs,
pairs,
next,
Rect,
Axes,
os,
time,
Faces,
table.unpack,
string,
Color3,
newproxy,
tostring,
tonumber,
Instance,
TweenInfo,
BrickColor,
NumberRange,
ColorSequence,
NumberSequence,
ColorSequenceKeypoint,
NumberSequenceKeypoint,
PhysicalProperties,
Region3int16,
Vector3int16,
require,
table,
type,
task.wait,
Enum,
UDim,
UDim2,
Vector2,
Vector3,
Region3,
CFrame,
Ray,
task.delay,
task.defer,
task,
tick,
function(cond, errMsg)
return cond or error(errMsg or "assertion failed!", 2)
end
local SERVICES_WE_USE = table.freeze({
"Workspace",
"Players",
"Lighting",
"ReplicatedStorage",
"ReplicatedFirst",
"ScriptContext",
"JointsService",
"LogService",
"Teams",
"SoundService",
"StarterGui",
"StarterPack",
"StarterPlayer",
"GroupService",
"MarketplaceService",
"HttpService",
"TestService",
"RunService",
"NetworkClient",
})
|
--Services
|
local RunService = game:GetService('RunService')
local UserInputService = game:GetService("UserInputService")
|
-- print("Loading anims " .. name)
|
table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
local idx = 1
for _, childPart in pairs(config:GetChildren()) do
if childPart:IsA("Animation") then
table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
local weightObject = childPart:FindFirstChild("Weight")
if not weightObject then
animTable[name][idx].weight = 1
else
animTable[name][idx].weight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
-- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
idx = idx + 1
end
end
end
-- fallback to defaults
if animTable[name].count <= 0 then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
|
-- child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player
|
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
GUI:Clone().Parent = player.PlayerGui --// Compact version
if script.Parent.L.Value == true then --because you can't get in a locked car
wait()
script.Parent.Disabled = true
wait()
script.Parent.Disabled = false
else
script.Parent.Occupied.Value = true
script.Parent.Parent.Body.Dash.Screen.G.Enabled = true
script.Parent.Parent.Body.Dash.Gear.G.Enabled = true
script.Parent.Parent.Body.Dash.Odo.G.Enabled = true
if child.Part1.Parent:FindFirstChild("Humanoid").RigType == Enum.HumanoidRigType.R15 then
script.Parent.Parent.Misc.A.arms.Shirt.ShirtTemplate = child.Part1.Parent:FindFirstChild("Shirt").ShirtTemplate
child.Part1.Parent:FindFirstChildOfClass("BodyColors"):Clone().Parent = script.Parent.Parent.Misc.A.arms
for i,v in pairs(script.Parent.Parent.Misc.A.arms:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 0
end
end
child.Part1.Parent.LeftHand.Transparency = 1
child.Part1.Parent.LeftLowerArm.Transparency = 1
child.Part1.Parent.LeftUpperArm.Transparency = 1
child.Part1.Parent.RightHand.Transparency = 1
child.Part1.Parent.RightLowerArm.Transparency = 1
child.Part1.Parent.RightUpperArm.Transparency = 1
end
end
end
end
end
end)
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
game.Workspace.CurrentCamera.FieldOfView = 70
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and player.PlayerGui:FindFirstChild("SS3") then
player.PlayerGui:FindFirstChild("SS3"):Destroy()
script.Parent.Occupied.Value = false
script.Parent.Parent.Body.Dash.Screen.G.Enabled = false
script.Parent.Parent.Body.Dash.Gear.G.Enabled = false
script.Parent.Parent.Body.Dash.Odo.G.Enabled = false
if child.Part1.Parent:FindFirstChild("Humanoid").RigType == Enum.HumanoidRigType.R15 then
script.Parent.Parent.Misc.A.arms:FindFirstChildOfClass("BodyColors"):Destroy()
for i,v in pairs(script.Parent.Parent.Misc.A.arms:GetChildren()) do
if v:IsA("BasePart") then
v.Transparency = 1
end
end
child.Part1.Parent.LeftHand.Transparency = 0
child.Part1.Parent.LeftLowerArm.Transparency = 0
child.Part1.Parent.LeftUpperArm.Transparency = 0
child.Part1.Parent.RightHand.Transparency = 0
child.Part1.Parent.RightLowerArm.Transparency = 0
child.Part1.Parent.RightUpperArm.Transparency = 0
end
end
end
end
end)
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.4 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 5 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 1.94 ,
--[[ 3 ]] 1.28 ,
--[[ 4 ]] .93 ,
--[[ 5 ]] 0.71 ,
--[[ 6 ]] 0.54 ,
--[[ 7 ]] 0.34 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--[[
Создание таблиц лидеров по заданным параметрам
GAVsi - 15/11/2022
Работает единственный раз - при запуске игрового сервера
Создаём парт размером с модель StatSample
Размещаем его в мире на нужной позиции
Переносим его в WorldPosition
Меняем ему название на имя обрабатываемого параметра
В SSS\Statistika\Main\Parametrs прописываем для данного параметра имя и иконку
]]
|
wait(3)
|
-- RemoteEvents
|
local RemoteEvents = Tool:WaitForChild("RemoteEvents")
local SpawnSegway = RemoteEvents:WaitForChild("SpawnSegway")
local ConfigTool = RemoteEvents:WaitForChild("ConfigTool")
local DestroySegway = RemoteEvents:WaitForChild("DestroySegway")
local ConfigHumanoid = RemoteEvents:WaitForChild("ConfigHumanoid")
|
--[=[
@within TableUtil
@function Zip
@param ... table
@return (iter: (t: table, k: any) -> (key: any?, values: table?), tbl: table, startIndex: any?)
Returns an iterator that can scan through multiple tables at the same time side-by-side, matching
against shared keys/indices.
```lua
local t1 = {10, 20, 30, 40, 50}
local t2 = {60, 70, 80, 90, 100}
for key,values in TableUtil.Zip(t1, t2) do
print(key, values)
end
--[[
Outputs:
1 {10, 60}
2 {20, 70}
3 {30, 80}
4 {40, 90}
5 {50, 100}
--]]
```
]=]
|
local function Zip(...): (IteratorFunc, Table, any)
assert(select("#", ...) > 0, "Must supply at least 1 table")
local function ZipIteratorArray(all: Table, k: number)
k += 1
local values = {}
for i,t in ipairs(all) do
local v = t[k]
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local function ZipIteratorMap(all: Table, k: any)
local values = {}
for i,t in ipairs(all) do
local v = next(t, k)
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local all = {...}
if #all[1] > 0 then
return ZipIteratorArray, all, 0
else
return ZipIteratorMap, all, nil
end
end
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 5.05 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 4.20 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--[[
Cancels the promise, disallowing it from rejecting or resolving, and calls
the cancellation hook if provided.
]]
|
function Promise.prototype:cancel()
if self._status ~= Promise.Status.Started then
return
end
self._status = Promise.Status.Cancelled
if self._cancellationHook then
self._cancellationHook()
end
if self._parent then
self._parent:_consumerCancelled(self)
end
for child in pairs(self._consumers) do
child:cancel()
end
self:_finalize()
end
Promise.prototype.Cancel = Promise.prototype.cancel
|
-- Connection class
|
local Connection = {}
Connection.__index = Connection
function Connection.new(signal, fn)
return setmetatable({
Connected = true,
_signal = signal,
_fn = fn,
_next = false,
}, Connection)
end
function Connection:Disconnect()
if not self.Connected then
return
end
self.Connected = false
-- Unhook the node, but DON'T clear it. That way any fire calls that are
-- currently sitting on this node will be able to iterate forwards off of
-- it, but any subsequent fire calls will not hit it, and it will be GCed
-- when no more fire calls are sitting on it.
if self._signal._handlerListHead == self then
self._signal._handlerListHead = self._next
else
local prev = self._signal._handlerListHead
while prev and prev._next ~= self do
prev = prev._next
end
if prev then
prev._next = self._next
end
end
end
Connection.Destroy = Connection.Disconnect
|
-- ROBLOX deviation: does not work the same as upstream (single lines supported/preferred)
|
local START_OF_LINE = "^"
|
-- ================================================================================
-- GETTER/SETTER FUNCTIONS
-- ================================================================================
|
function RaceModule:SetStartCheckpoint(checkpoint)
startCheckpoint = getCheckpointFromPart(checkpoint)
end -- RaceModule:SetStartCheckpoint()
function RaceModule:GetStartCheckpoint()
return startCheckpoint
end -- RaceModule:GetStartCheckpoint()
function RaceModule:SetFinishCheckpoint(checkpoint)
finishCheckpoint = getCheckpointFromPart(checkpoint)
end -- RaceModule:SetFinishCheckpoint()
function RaceModule:GetFinishCheckpoint()
return finishCheckpoint
end -- RaceModule:GetFinishCheckpoint()
function RaceModule:SetNumLaps(number)
numLaps = number
end -- RaceModule:SetNumLaps()
function RaceModule:GetNumLaps()
return numLaps
end -- RaceModule:GetNumLaps()
function RaceModule:SetRaceDuration(duration)
raceDuration = duration
end -- RaceModule:SetRaceDuration()
function RaceModule:GetRaceDuration()
return raceDuration
end -- RaceModule:GetRaceDuration()
function RaceModule:SetDebugEnabled(enabled)
debugEnabled = enabled
end -- RaceModule:SetDebugEnabled()
function RaceModule:GetDebugEnabled()
return debugEnabled
end -- RaceModule:GetDebugEnabled()
function RaceModule:SetRaceStatus(status)
RaceModule.RaceStatus.Value = status
end -- RaceModule:SetRaceStatus()
function RaceModule:GetRaceStatus()
return RaceModule.RaceStatus.Value
end -- RaceModule:GetRaceStatus()
|
--[[
A signal value indicating that a child should use its parent's key, because
it has no key of its own.
This occurs when you return only one element from a function component or
stateful render function.
]]
|
ElementUtils.UseParentKey = Symbol.named("UseParentKey")
|
--Don't touch anything above this line or it will NOT work.
| |
-- Variables for Module Scripts
|
local screenSpace = require(tool:WaitForChild("ScreenSpace"))
|
--[=[
An event emitter that emits the instance that was actually created. This is
useful for a variety of things.
Using this to track an instance
```lua
local currentCamera = Blend.State()
return Blend.New "ViewportFrame" {
CurrentCamera = currentCamera;
[Blend.Children] = {
self._current;
Blend.New "Camera" {
[Blend.Instance] = currentCamera;
};
};
};
```
You can also use this to execute code against an instance.
```lua
return Blend.New "Frame" {
[Blend.Instance] = function(frame)
print("We got a new frame!")
end;
};
```
Note that if you subscribe twice to the resulting observable, the internal function
will execute twice.
@param parent Instance
@return Observable<Instance>
]=]
|
function Blend.Instance(parent)
return Observable.new(function(sub)
sub:Fire(parent)
end)
end
|
--use this to determine if you want this human to be harmed or not, returns boolean
|
function boom()
wait(3)
Used = true
Object.Anchored = true
Object.CanCollide = false
Object.Transparency = 1
Object.Explode:Play()
Explode()
end
boom()
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -5
Tune.RCamber = -5
Tune.FToe = 0
Tune.RToe = 0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.