prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[Engine]]
|
local fFD = _Tune.FinalDrive*_Tune.FDMult
local fFDr = fFD*30/math.pi
local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
local wDRatio = wDia*math.pi/60
local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
local cfYRot = CFrame.Angles(0,math.pi,0)
local rtTwo = (2^.5)/2
--Horsepower Curve
local fgc_h=_Tune.Horsepower/100
local fgc_n=_Tune.PeakRPM/1000
local fgc_a=_Tune.PeakSharpness
local fgc_c=_Tune.CurveMult
function FGC(x)
x=x/1000
return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1))))
end
local PeakFGC = FGC(_Tune.PeakRPM)
--Plot Current Horsepower
function GetCurve(x,gear)
local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0)
return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling
end
--Output Cache
local CacheTorque = true
local HPCache = {}
local HPInc = 100
if CacheTorque then
for gear,ratio in pairs(_Tune.Ratios) do
local hpPlot = {}
for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do
local tqPlot = {}
tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
hpPlot[rpm] = tqPlot
end
table.insert(HPCache,hpPlot)
end
end
--Powertrain
--Update RPM
function RPM()
--Neutral Gear
if _CGear==0 then _ClutchOn = false end
--Car Is Off
local revMin = _Tune.IdleRPM
if not _IsOn then
revMin = 0
_CGear = 0
_ClutchOn = false
_GThrot = _Tune.IdleThrottle/100
end
--Determine RPM
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9)
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
else
if _GThrot-(_Tune.IdleThrottle/100)>0 then
if _RPM>_Tune.Redline then
_RPM = _RPM-_Tune.RevBounce*2
else
_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100)
end
else
_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
end
end
--Rev Limiter
_spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2])
if _RPM>_Tune.Redline then
if _CGear<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
end
--Apply Power
function Engine()
--Get Torque
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
if CacheTorque then
local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)]
_HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
_OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
else
_HP,_OutTorque = GetCurve(_RPM,_CGear)
end
local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
if _CGear==-1 then iComp=-iComp end
_OutTorque = _OutTorque*math.max(1,(1+iComp))
else
_HP,_OutTorque = 0,0
end
--Automatic Transmission
if _TMode == "Auto" and _IsOn then
_ClutchOn = true
if _CGear == 0 then _CGear = 1 end
if _CGear >= 1 then
if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = -1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
_CGear=math.max(_CGear-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
_CGear=math.max(_CGear-1,1)
end
end
end
else
if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = 1
end
end
end
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not script.Parent.IsOn.Value then on=0 end
local throt = _GThrot
if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end
--Apply TCS
local tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = _GBrake
if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
if tqABS < 1 then
_ABSActive = true
end
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
-- BannedPlayerKicking fires right before a banned player is kicked
-- from the game, sending the Player and the payload from data stores
-- (see below for the format of this table). It is recommended that you
-- hook this event up to some analytics solution.
| |
--!strict
|
local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type PredicateFunction<T> = (value: T, index: number, array: Array<T>) -> boolean
return function<T>(array: Array<T>, predicate: PredicateFunction<T>): T | nil
for i = 1, #array do
local element = array[i]
if predicate(element, i, array) then
return element
end
end
return nil
end
|
-- End of OrbitalCamera additions
|
local PlayersService = game:GetService('Players')
local VRService = game:GetService("VRService")
local RootCameraCreator = require(script.Parent)
local UP_VECTOR = Vector3.new(0, 1, 0)
local XZ_VECTOR = Vector3.new(1, 0, 1)
local ZERO_VECTOR2 = Vector2.new(0, 0)
local VR_PITCH_FRACTION = 0.25
local Vector3_new = Vector3.new
local CFrame_new = CFrame.new
local math_min = math.min
local math_max = math.max
local math_atan2 = math.atan2
local math_rad = math.rad
local math_abs = math.abs
|
-- Place this code in a LocalScript
|
local Gui = script.parent.Parent -- Your BillboardGui object here
local ShakeIntensity = 1 -- Adjust the intensity of the shake effect
local function ShakeScreen()
local Camera = game.Workspace.CurrentCamera
if Camera then
game:GetService("CameraShake"):Shake(Camera, "Rotation", ShakeIntensity)
end
end
Gui.MouseButton1Down:Connect(ShakeScreen)
|
-- May return NaN or inf or -inf
-- This is a way of finding the angle between the two vectors:
|
local function findAngleBetweenXZVectors(vec2, vec1)
return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
end
local function CreateClassicCamera()
local module = RootCameraCreator()
local tweenAcceleration = math.rad(220)
local tweenSpeed = math.rad(0)
local tweenMaxSpeed = math.rad(250)
local timeBeforeAutoRotate = 2
local lastThumbstickRotate = nil
local numOfSeconds = 0.7
local currentSpeed = 0
local maxSpeed = 0.1
local thumbstickSensitivity = 1
local lastThumbstickPos = ZERO_VECTOR2
local ySensitivity = 0.8
local lastVelocity = nil
local lastUpdate = tick()
module.LastUserPanCamera = tick()
function module:Update()
local now = tick()
local timeDelta = (now - lastUpdate)
local userPanningTheCamera = (self.UserPanningTheCamera == true)
local camera = workspace.CurrentCamera
local player = PlayersService.LocalPlayer
local humanoid = self:GetHumanoid()
local cameraSubject = camera and camera.CameraSubject
local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat')
local isOnASkateboard = cameraSubject and cameraSubject:IsA('SkateboardPlatform')
if lastUpdate == nil or now - lastUpdate > 1 then
module:ResetCameraLook()
self.LastCameraTransform = nil
end
if lastUpdate then
local gamepadRotation = self:UpdateGamepad()
if self:ShouldUseVRRotation() then
self.RotateInput = self.RotateInput + self:GetVRRotationInput()
else
-- Cap out the delta to 0.1 so we don't get some crazy things when we re-resume from
local delta = math.min(0.1, now - lastUpdate)
if gamepadRotation ~= ZERO_VECTOR2 then
userPanningTheCamera = true
self.RotateInput = self.RotateInput + (gamepadRotation * delta)
end
local angle = 0
if not (isInVehicle or isOnASkateboard) then
angle = angle + (self.TurningLeft and -120 or 0)
angle = angle + (self.TurningRight and 120 or 0)
end
if angle ~= 0 then
self.RotateInput = self.RotateInput + Vector2.new(math.rad(angle * delta), 0)
userPanningTheCamera = true
end
end
end
-- Reset tween speed if user is panning
if userPanningTheCamera then
tweenSpeed = 0
module.LastUserPanCamera = tick()
end
local userRecentlyPannedCamera = now - module.LastUserPanCamera < timeBeforeAutoRotate
local subjectPosition = self:GetSubjectPosition()
if subjectPosition and player and camera then
local zoom = self:GetCameraZoom()
if zoom < 0.5 then
zoom = 0.5
end
if self:GetShiftLock() and not self:IsInFirstPerson() then
-- We need to use the right vector of the camera after rotation, not before
local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput)
local offset = ((newLookVector * XZ_VECTOR):Cross(UP_VECTOR).unit * 1.75)
if IsFiniteVector3(offset) then
subjectPosition = subjectPosition + offset
end
else
if self.LastCameraTransform and not userPanningTheCamera then
local isInFirstPerson = self:IsInFirstPerson()
if (isInVehicle or isOnASkateboard) and lastUpdate and humanoid and humanoid.Torso then
if isInFirstPerson then
if self.LastSubjectCFrame and (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then
local y = -findAngleBetweenXZVectors(self.LastSubjectCFrame.lookVector, cameraSubject.CFrame.lookVector)
if IsFinite(y) then
self.RotateInput = self.RotateInput + Vector2.new(y, 0)
end
tweenSpeed = 0
end
elseif not userRecentlyPannedCamera then
local forwardVector = humanoid.Torso.CFrame.lookVector
if isOnASkateboard then
forwardVector = cameraSubject.CFrame.lookVector
end
tweenSpeed = clamp(0, tweenMaxSpeed, tweenSpeed + tweenAcceleration * timeDelta)
local percent = clamp(0, 1, tweenSpeed * timeDelta)
if self:IsInFirstPerson() then
percent = 1
end
local y = findAngleBetweenXZVectors(forwardVector, self:GetCameraLook())
if IsFinite(y) and math.abs(y) > 0.0001 then
self.RotateInput = self.RotateInput + Vector2.new(y * percent, 0)
end
end
end
end
end
local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput)
self.RotateInput = ZERO_VECTOR2
camera.Focus = UserInputService.VREnabled and self:GetVRFocus(subjectPosition, timeDelta) or CFrame.new(subjectPosition)
camera.CoordinateFrame = CFrame.new(camera.Focus.p - (zoom * newLookVector), camera.Focus.p) + Vector3.new(0, self:GetCameraHeight(), 0)
self.LastCameraTransform = camera.CoordinateFrame
self.LastCameraFocus = camera.Focus
if isInVehicle or isOnASkateboard and cameraSubject:IsA('BasePart') then
self.LastSubjectCFrame = cameraSubject.CFrame
else
self.LastSubjectCFrame = nil
end
end
lastUpdate = now
end
return module
end
return CreateClassicCamera
|
--[=[
@within Comm
@private
@interface Server
.BindFunction (parent: Instance, name: string, fn: FnBind, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
.WrapMethod (parent: Instance, tbl: table, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
.CreateSignal (parent: Instance, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteSignal
Server Comm
]=]
--[=[
@within Comm
@private
@interface Client
.GetFunction (parent: Instance, name: string, usePromise: boolean, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): (...: any) -> any
.GetSignal (parent: Instance, name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?): ClientRemoteFunction
Client Comm
]=]
|
function Comm.Server.BindFunction(parent: Instance, name: string, func: FnBind, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
assert(IS_SERVER, "BindFunction must be called from the server")
local folder = GetCommSubFolder(parent, "RF"):Expect("Failed to get Comm RF folder")
local rf = Instance.new("RemoteFunction")
rf.Name = name
local hasInbound = type(inboundMiddleware) == "table" and #inboundMiddleware > 0
local hasOutbound = type(outboundMiddleware) == "table" and #outboundMiddleware > 0
local function ProcessOutbound(player, ...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(outboundMiddleware) 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
if hasInbound and hasOutbound then
local function OnServerInvoke(player, ...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return ProcessOutbound(player, func(player, table.unpack(args, 1, args.n)))
end
rf.OnServerInvoke = OnServerInvoke
elseif hasInbound then
local function OnServerInvoke(player, ...)
local args = table.pack(...)
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return func(player, table.unpack(args, 1, args.n))
end
rf.OnServerInvoke = OnServerInvoke
elseif hasOutbound then
local function OnServerInvoke(player, ...)
return ProcessOutbound(player, func(player, ...))
end
rf.OnServerInvoke = OnServerInvoke
else
rf.OnServerInvoke = func
end
rf.Parent = folder
return rf
end
function Comm.Server.WrapMethod(parent: Instance, tbl: {}, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
assert(IS_SERVER, "WrapMethod must be called from the server")
local fn = tbl[name]
assert(type(fn) == "function", "Value at index " .. name .. " must be a function; got " .. type(fn))
return Comm.Server.BindFunction(parent, name, function(...) return fn(tbl, ...) end, inboundMiddleware, outboundMiddleware)
end
function Comm.Server.CreateSignal(parent: Instance, name: string, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?)
assert(IS_SERVER, "CreateSignal must be called from the server")
local folder = GetCommSubFolder(parent, "RE"):Expect("Failed to get Comm RE folder")
local rs = RemoteSignal.new(folder, name, inboundMiddleware, outboundMiddleware)
return rs
end
function Comm.Client.GetFunction(parent: Instance, name: string, usePromise: boolean, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?)
assert(not IS_SERVER, "GetFunction must be called from the client")
local folder = GetCommSubFolder(parent, "RF"):Expect("Failed to get Comm RF folder")
local rf = folder:WaitForChild(name, WAIT_FOR_CHILD_TIMEOUT)
assert(rf ~= nil, "Failed to find RemoteFunction: " .. name)
local hasInbound = type(inboundMiddleware) == "table" and #inboundMiddleware > 0
local hasOutbound = type(outboundMiddleware) == "table" and #outboundMiddleware > 0
local function ProcessOutbound(args)
for _,middlewareFunc in ipairs(outboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return table.unpack(args, 1, args.n)
end
if hasInbound then
if usePromise then
return function(...)
local args = table.pack(...)
return Promise.new(function(resolve, reject)
local success, res = pcall(function()
if hasOutbound then
return table.pack(rf:InvokeServer(ProcessOutbound(args)))
else
return table.pack(rf:InvokeServer(table.unpack(args, 1, args.n)))
end
end)
if success then
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(res))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
resolve(table.unpack(res, 1, res.n))
else
reject(res)
end
end)
end
else
return function(...)
local res
if hasOutbound then
res = table.pack(rf:InvokeServer(ProcessOutbound(table.pack(...))))
else
res = table.pack(rf:InvokeServer(...))
end
for _,middlewareFunc in ipairs(inboundMiddleware) do
local middlewareResult = table.pack(middlewareFunc(res))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
end
return table.unpack(res, 1, res.n)
end
end
else
if usePromise then
return function(...)
local args = table.pack(...)
return Promise.new(function(resolve, reject)
local success, res = pcall(function()
if hasOutbound then
return table.pack(rf:InvokeServer(ProcessOutbound(args)))
else
return table.pack(rf:InvokeServer(table.unpack(args, 1, args.n)))
end
end)
if success then
resolve(table.unpack(res, 1, res.n))
else
reject(res)
end
end)
end
else
if hasOutbound then
return function(...)
return rf:InvokeServer(ProcessOutbound(table.pack(...)))
end
else
return function(...)
return rf:InvokeServer(...)
end
end
end
end
end
function Comm.Client.GetSignal(parent: Instance, name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?)
assert(not IS_SERVER, "GetSignal must be called from the client")
local folder = GetCommSubFolder(parent, "RE"):Expect("Failed to get Comm RE folder")
local re = folder:WaitForChild(name, WAIT_FOR_CHILD_TIMEOUT)
assert(re ~= nil, "Failed to find RemoteEvent: " .. name)
return ClientRemoteSignal.new(re, inboundMiddleware, outboundMiddleware)
end
|
--// Patrol Mode
|
PatrolPosR = CFrame.new();
PatrolPosL = CFrame.new();
|
-- Buttons
|
local tutorialBackButton = tutorialGUI:WaitForChild("BackButton")
local exitButtonPlay = playGUI:WaitForChild("ExitButton")
local exitButtonTutorial = tutorialGUI:WaitForChild("ExitButton")
local pressTutorial = playGUI:WaitForChild("Tutorial")
local pressGame = playGUI:WaitForChild("PlayGame")
local function exit()
tutorialGUI.Visible = false
playGUI.Visible = false
end
local function openPlayGUI()
tutorialGUI.Visible = false
playGUI.Visible = true
end
local function openTutorialGUI()
tutorialGUI.Visible = true
playGUI.Visible = false
end
local function triggerNewGame()
-- call the remote event to fire the bindable event
ClientTriggerGame:FireServer()
exit()
end
exitButtonPlay.MouseButton1Click:Connect(exit)
exitButtonTutorial.MouseButton1Click:Connect(exit)
tutorialBackButton.MouseButton1Click:Connect(openPlayGUI)
pressGame.MouseButton1Click:Connect(triggerNewGame)
pressTutorial.MouseButton1Click:Connect(openTutorialGUI)
proximityPlay.Triggered:Connect(openPlayGUI)
toggleRideHUD.OnClientEvent:Connect(exit)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v2 = setmetatable({}, v1);
v2.__index = v2;
local l__Enum_UserInputType_None__1 = Enum.UserInputType.None;
function v2.new()
local v3 = setmetatable(v1.new(), v2);
v3.forwardValue = 0;
v3.backwardValue = 0;
v3.leftValue = 0;
v3.rightValue = 0;
v3.activeGamepad = l__Enum_UserInputType_None__1;
v3.gamepadConnectedConn = nil;
v3.gamepadDisconnectedConn = nil;
return v3;
end;
local l__UserInputService__2 = game:GetService("UserInputService");
local u3 = Vector3.new(0, 0, 0);
function v2.Enable(p1, p2)
if not l__UserInputService__2.GamepadEnabled then
return false;
end;
if p2 == p1.enabled then
return true;
end;
p1.forwardValue = 0;
p1.backwardValue = 0;
p1.leftValue = 0;
p1.rightValue = 0;
p1.moveVector = u3;
p1.isJumping = false;
if p2 then
p1.activeGamepad = p1:GetHighestPriorityGamepad();
if p1.activeGamepad == l__Enum_UserInputType_None__1 then
return false;
end;
p1:BindContextActions();
p1:ConnectGamepadConnectionListeners();
else
p1:UnbindContextActions();
p1:DisconnectGamepadConnectionListeners();
p1.activeGamepad = l__Enum_UserInputType_None__1;
end;
p1.enabled = p2;
return true;
end;
function v2.GetHighestPriorityGamepad(p3)
local v4 = l__Enum_UserInputType_None__1;
for v5, v6 in pairs((l__UserInputService__2:GetConnectedGamepads())) do
if v6.Value < v4.Value then
v4 = v6;
end;
end;
return v4;
end;
local l__ContextActionService__4 = game:GetService("ContextActionService");
function v2.BindContextActions(p4)
if p4.activeGamepad == l__Enum_UserInputType_None__1 then
return false;
end;
l__ContextActionService__4:BindActivate(p4.activeGamepad, Enum.KeyCode.ButtonR2);
l__ContextActionService__4:BindAction("jumpAction", function(p5, p6, p7)
p4.isJumping = p6 == Enum.UserInputState.Begin;
end, false, Enum.KeyCode.ButtonA);
l__ContextActionService__4:BindAction("moveThumbstick", function(p8, p9, p10)
if p4.activeGamepad ~= p10.UserInputType then
return;
end;
if p10.KeyCode ~= Enum.KeyCode.Thumbstick1 then
return;
end;
if p9 == Enum.UserInputState.Cancel then
p4.moveVector = u3;
return;
end;
if not (p10.Position.magnitude > 0.2) then
p4.moveVector = u3;
return;
end;
p4.moveVector = Vector3.new(p10.Position.X, 0, -p10.Position.Y);
end, false, Enum.KeyCode.Thumbstick1);
return true;
end;
function v2.UnbindContextActions(p11)
if p11.activeGamepad ~= l__Enum_UserInputType_None__1 then
l__ContextActionService__4:UnbindActivate(p11.activeGamepad, Enum.KeyCode.ButtonR2);
end;
l__ContextActionService__4:UnbindAction("moveThumbstick");
l__ContextActionService__4:UnbindAction("jumpAction");
end;
function v2.OnNewGamepadConnected(p12)
local v7 = p12:GetHighestPriorityGamepad();
if v7 == p12.activeGamepad then
return;
end;
if v7 == l__Enum_UserInputType_None__1 then
warn("Gamepad:OnNewGamepadConnected found no connected gamepads");
p12:UnbindContextActions();
return;
end;
if p12.activeGamepad ~= l__Enum_UserInputType_None__1 then
l__ContextActionService__4:UnbindActivate(p12.activeGamepad, Enum.KeyCode.ButtonR2);
end;
p12.activeGamepad = v7;
l__ContextActionService__4:BindActivate(p12.activeGamepad, Enum.KeyCode.ButtonR2);
end;
function v2.OnCurrentGamepadDisconnected(p13)
if p13.activeGamepad ~= l__Enum_UserInputType_None__1 then
l__ContextActionService__4:UnbindActivate(p13.activeGamepad, Enum.KeyCode.ButtonR2);
end;
local v8 = p13:GetHighestPriorityGamepad();
if p13.activeGamepad ~= l__Enum_UserInputType_None__1 and v8 == p13.activeGamepad then
warn("Gamepad:OnCurrentGamepadDisconnected found the supposedly disconnected gamepad in connectedGamepads.");
p13:UnbindContextActions();
p13.activeGamepad = l__Enum_UserInputType_None__1;
return;
end;
if v8 == l__Enum_UserInputType_None__1 then
p13:UnbindContextActions();
p13.activeGamepad = l__Enum_UserInputType_None__1;
return;
end;
p13.activeGamepad = v8;
l__ContextActionService__4:BindActivate(p13.activeGamepad, Enum.KeyCode.ButtonR2);
end;
function v2.ConnectGamepadConnectionListeners(p14)
p14.gamepadConnectedConn = l__UserInputService__2.GamepadConnected:Connect(function(p15)
p14:OnNewGamepadConnected();
end);
p14.gamepadDisconnectedConn = l__UserInputService__2.GamepadDisconnected:Connect(function(p16)
if p14.activeGamepad == p16 then
p14:OnCurrentGamepadDisconnected();
end;
end);
end;
function v2.DisconnectGamepadConnectionListeners(p17)
if p17.gamepadConnectedConn then
p17.gamepadConnectedConn:Disconnect();
p17.gamepadConnectedConn = nil;
end;
if p17.gamepadDisconnectedConn then
p17.gamepadDisconnectedConn:Disconnect();
p17.gamepadDisconnectedConn = nil;
end;
end;
return v2;
|
-- listen for jumping and landing and apply sway and camera mvoement to the viewmodel
|
humanoid.StateChanged:connect(function(oldstate, newstate)
if isfirstperson == true and includejumpsway == true then -- dont apply camera/viewmodel changes if we aren't in first person
if newstate == Enum.HumanoidStateType.Landed then
-- animate the camera's landing "thump"
--
-- tween a dummy cframe value for camera recoil
local camedit = Instance.new("CFrameValue")
camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(-0.75)*swaysize,0,0)
local landedrecoil = tweenservice:Create(camedit, TweenInfo.new((0.03*6)/sensitivity, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecoil:Play() ; game.Debris:AddItem(landedrecoil, 2)
landedrecoil.Completed:Connect(function()
camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0.225)*swaysize,0,0)
local landedrecovery = tweenservice:Create(camedit, TweenInfo.new((0.03*24)/sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecovery:Play(); game.Debris:AddItem(landedrecovery, 3)
end)
-- apply the camera adjustments
spawn(function()
for i = 1,60 do
camera.CFrame = camera.CFrame*camedit.Value
runservice.Heartbeat:Wait()
end
end)
-- animate the jump sway to make the viewmodel thump down on landing
local viewmodelrecoil = tweenservice:Create(jumpswaygoal, TweenInfo.new(0.15/sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)*CFrame.Angles(-math.rad(5)*swaysize,0,0)}) ; viewmodelrecoil:Play(); game.Debris:AddItem(viewmodelrecoil, 2)
viewmodelrecoil.Completed:Connect(function()
local viewmodelrecovery = tweenservice:Create(jumpswaygoal, TweenInfo.new(0.7/sensitivity, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; viewmodelrecovery:Play() ; game.Debris:AddItem(viewmodelrecovery, 2)
end)
elseif newstate == Enum.HumanoidStateType.Freefall then
-- animate jump sway when the character is falling or jumping
local viewmodeljump = tweenservice:Create(jumpswaygoal, TweenInfo.new(0.5/sensitivity, Enum.EasingStyle.Sine), {Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(7.5)*swaysize,0,0)}) ; viewmodeljump:Play() ; game.Debris:AddItem(viewmodeljump, 2)
end
end
end)
|
--////////////////////////////// Include
--//////////////////////////////////////
|
local ChatConstants = require(ReplicatedModules:WaitForChild("ChatConstants"))
local ChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local Speaker = require(modulesFolder:WaitForChild("Speaker"))
local Util = require(modulesFolder:WaitForChild("Util"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
|
-- ====================
-- BURST FIRE
-- Enable the gun to do burst firing like Assault Rifle
-- ====================
|
BurstFireEnabled = false;
BulletPerBurst = 3;
BurstRate = 0.075; --In second
|
--[=[
@param value any
@return any
Unpacks the arguments returned by either `SerializeArgs` or `DeserializeArgs`.
]=]
|
function Ser.UnpackArgs(value: Args): ...any
return table.unpack(value, 1, value.n)
end
return Ser
|
--[[
Singleton controller that manages alerts - small messages that display in the top left hand corner for the user.
]]
|
local TweenService = game:GetService("TweenService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Constants = require(ReplicatedStorage.Source.Common.Constants)
local baseAlertElement = ReplicatedStorage.UserInterface.AlertElement
local tweenInfo = TweenInfo.new(1)
local AlertController = {}
|
-- Legacy implementation renamed
|
function CameraUtils.GetAngleBetweenXZVectors(v1, v2)
return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z)
end
function CameraUtils.RotateVectorByAngleAndRound(camLook, rotateAngle, roundAmount)
if camLook.Magnitude > 0 then
camLook = camLook.unit
local currAngle = math.atan2(camLook.z, camLook.x)
local newAngle = round((math.atan2(camLook.z, camLook.x) + rotateAngle) / roundAmount) * roundAmount
return newAngle - currAngle
end
return 0
end
|
-- подсветка выбранного
|
me=script.Parent
wait(5)
old=me.Value
new=old
while true do
wait()
new = me.Value
if new ~= old then
-- print(old,"<>",new)
if old ~= "" then
tmp1 = me.Parent.imgChar.frmChar:FindFirstChild(old)
tmp1.ImageButton.ImageColor3 = Color3.fromRGB(255,255,255)
tmp1.ImageButton.ImageTransparency=0
end
if new ~= "" then
tmp1 = me.Parent.imgChar.frmChar:FindFirstChild(new)
tmp1.ImageButton.ImageColor3 = Color3.fromRGB(255,0,0)
tmp1.ImageButton.ImageTransparency=0.5
end
old = new
end
end
|
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees
|
local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)
local TOUCH_ADJUST_AREA_UP = math.rad(30)
local TOUCH_ADJUST_AREA_DOWN = math.rad(-15)
local TOUCH_SENSITIVTY_ADJUST_MAX_Y = 2.1
local TOUCH_SENSITIVTY_ADJUST_MIN_Y = 0.5
local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4
local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local TOUCH_SENSITIVTY = Vector2.new(0.00945 * math.pi, 0.003375 * math.pi)
local MOUSE_SENSITIVITY = Vector2.new( 0.002 * math.pi, 0.0015 * math.pi )
local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)
local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20
local PAN_SENSITIVITY = 20
local ZOOM_SENSITIVITY_CURVATURE = 0.5
local abs = math.abs
local sign = math.sign
local FFlagUserCameraToggle do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserCameraToggle")
end)
FFlagUserCameraToggle = success and result
end
local FFlagUserFixZoomInZoomOutDiscrepancy do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixZoomInZoomOutDiscrepancy")
end)
FFlagUserFixZoomInZoomOutDiscrepancy = success and result
end
local FFlagUserFixGamepadCameraTracking do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixGamepadCameraTracking")
end)
FFlagUserFixGamepadCameraTracking = success and result
end
local Util = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local CameraToggleStateController = require(script.Parent:WaitForChild("CameraToggleStateController"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
|
--[[**
ensures Roblox PhysicalProperties type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.PhysicalProperties = primitive("PhysicalProperties")
|
--[[Steering]]
|
function Steering(dt)
local deltaTime = (60/(1/dt))
--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
_GSteerC = (_GSteerC+((_GSteerT-_GSteerC)*(_Tune.LeanSpeed*deltaTime)))
--Apply Steering
bike.Body.bal.LeanGyro.cframe = CFrame.new(bike.Body.bal.CFrame.p,bike.Body.bal.CFrame.p+bike.Body.bal.CFrame.lookVector)*CFrame.Angles(0,0,((_GSteerC*_Tune.LeanProgressiveness)*(math.rad(_Tune.MaxLean)/(bike.DriveSeat.Velocity.Magnitude+_Tune.LeanProgressiveness))-(_GSteerC*math.rad(_Tune.MaxLean))))
--Apply Low Speed Steering
bike.FrontSection.TripleTreeHinge.SteeringGyro.CFrame=bike.Body.SteeringHinge.CFrame*CFrame.Angles(math.rad(_GSteerT*_Tune.SteerAngle),0,0)
bike.FrontSection.TripleTreeHinge.SteeringGyro.MaxTorque = Vector3.new(_Tune.SteerMaxTorque*((math.max((_Tune.LowSpeedCut-bike.DriveSeat.Velocity.Magnitude)/_Tune.LowSpeedCut,0))^2),0,0)
end
if UserInputService.TouchEnabled then
local Buttons = script.Parent:WaitForChild("Buttons")
local Left = Buttons:WaitForChild("Left")
local Right = Buttons:WaitForChild("Right")
local Brake = Buttons:WaitForChild("Brake")
local Gas = Buttons:WaitForChild("Gas")
local Downshift = Buttons.Downshift
local Upshift = Buttons.Upshift
local Handbrake = Buttons:WaitForChild("Handbrake")
local Thread = coroutine.wrap(function()
while true do
wait(0.5)
if _TMode == "Manual" or _TMode == "DCT" then
Downshift.Visible = true
Upshift.Visible = true
else
Downshift.Visible = false
Upshift.Visible = false
end
end
end)
Thread()
Buttons.Visible = true
local function LeftTurn(Touch, GPE)
if Touch.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
end
Left.InputBegan:Connect(LeftTurn)
Left.InputEnded:Connect(LeftTurn)
--Left.InputChanged:Connect(LeftTurn)
local function RightTurn(Touch, GPE)
if Touch.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
end
Right.InputBegan:Connect(RightTurn)
Right.InputEnded:Connect(RightTurn)
--Right.InputChanged:Connect(RightTurn)
local function TouchThrottle(input, GPE)
if input.UserInputState == Enum.UserInputState.Begin then
_InThrot = 1
_TTick = tick()
else
_InThrot = _Tune.IdleThrottle/100
_BTick = tick()
end
end
Gas.InputBegan:Connect(TouchThrottle)
Gas.InputEnded:Connect(TouchThrottle)
--Gas.InputChanged:Connect(TouchThrottle)
local function TouchBrake(input, GPE)
if input.UserInputState == Enum.UserInputState.Begin then
_InBrake = 1
else
_InBrake = 0
end
end
Brake.InputBegan:Connect(TouchBrake)
Brake.InputEnded:Connect(TouchBrake)
--Brake.InputChanged:Connect(TouchBrake)
local function TouchHandbrake(input, GPE)
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if bike.DriveSeat.Velocity.Magnitude > 5 then
_PBrake = false
end
end
end
Handbrake.InputBegan:Connect(TouchHandbrake)
Handbrake.InputEnded:Connect(TouchHandbrake)
local function TouchDownshift(input, GPE)
if ((_IsOn and ((_TMode == "Auto" and _CGear <= 1) and _Tune.AutoShiftVers == "New") or _TMode == "DCT") or _TMode == "Manual") and input.UserInputState == Enum.UserInputState.Begin then
if not _ShiftDn then
_ShiftDn = true
end
end
end
Downshift.InputBegan:Connect(TouchDownshift)
local function TouchUpshift(input, GPE)
if ((_IsOn and ((_TMode == "Auto" and _CGear < 1) and _Tune.AutoShiftVers == "New") or _TMode == "DCT") or _TMode == "Manual") and input.UserInputState == Enum.UserInputState.Begin then
if not _ShiftUp then
_ShiftUp = true
end
end
end
Upshift.InputBegan:Connect(TouchUpshift)
end
|
-- Local Variables
|
local IntermissionRunning = false
local EnoughPlayers = false
local GameRunning = false
local Events = game.ReplicatedStorage.Events
local CaptureFlag = Events.CaptureFlag
local ReturnFlag = Events.ReturnFlag
|
--// Firemode Settings
|
CanSelectFire = false;
BurstEnabled = false;
SemiEnabled = false;
AutoEnabled = false;
BoltAction = false;
ExplosiveEnabled = true;
|
--[[ Local Constants ]]
|
--
local UNIT_Z = Vector3.new(0,0,1)
local X1_Y0_Z1 = Vector3.new(1,0,1) --Note: not a unit vector, used for projecting onto XZ plane
local THUMBSTICK_DEADZONE = 0.2
local DEFAULT_DISTANCE = 12.5 -- Studs
local PORTRAIT_DEFAULT_DISTANCE = 25 -- Studs
local FIRST_PERSON_DISTANCE_THRESHOLD = 1.0 -- Below this value, snap into first person
local CAMERA_ACTION_PRIORITY = Enum.ContextActionPriority.Default.Value
|
-- @outline // PRIVATE VARIABLES
|
local REQUEST_INTERVAL = .1
local MAX_THROTTLE_TIME = 10
local LastUpdate = tick()
local Pool = {}
|
---[[ Window Settings ]]
|
module.MinimumWindowSize = UDim2.new(0.3, 0, 0.25, 0)
module.MaximumWindowSize = UDim2.new(1, 0, 1, 0) -- Should always be less than the full screen size.
module.DefaultWindowPosition = UDim2.new(0, 0, 0, 0)
local extraOffset = (7 * 2) + (5 * 2) -- Extra chatbar vertical offset
module.DefaultWindowSizePhone = UDim2.new(0.5, 0, 0.5, extraOffset)
module.DefaultWindowSizeTablet = UDim2.new(0.4, 0, 0.3, extraOffset)
module.DefaultWindowSizeDesktop = UDim2.new(0.3, 0, 0.25, extraOffset)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "Blood rise" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--[[Controls]]
|
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
--Input Handler
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and ((_IsOn and ((_TMode=="Auto" and _CGear<=1) and _Tune.AutoShiftVers == "New") or _TMode=="DCT") or _TMode=="Manual") and input.UserInputState == Enum.UserInputState.Begin then
if not _ShiftDn then _ShiftDn = true end
--Shift Up [Manual Transmission]
elseif (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and ((_IsOn and ((_TMode=="Auto" and _CGear<1) and _Tune.AutoShiftVers == "New") or _TMode=="DCT") or _TMode=="Manual") and input.UserInputState == Enum.UserInputState.Begin then
if not _ShiftUp then _ShiftUp = true end
--Toggle Clutch
elseif (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClPressing = false
end
--Toggle PBrake
elseif input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if bike.DriveSeat.Velocity.Magnitude>5 then _PBrake = false end
end
--Toggle Transmission
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
--Throttle
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin and _IsOn then
_InThrot = 1
_TTick = tick()
else
_InThrot = _Tune.IdleThrottle/100
_BTick = tick()
end
--Brake
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_InBrake = 1
else
_InBrake = 0
end
--Steer Left
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
--Steer Right
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_InThrot = _Tune.IdleThrottle/100
_TTick = tick()
_InBrake = 0
_GSteerT = 0
end
--Toggle TCS
elseif _Tune.TCS and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then _TCS = not _TCS end
--Toggle ABS
elseif _Tune.ABS and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then _ABS = not _ABS end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
--Gamepad Throttle
elseif input.KeyCode == _CTRL["ContlrThrottle"] then
if _IsOn then
_InThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
if _InThrot > _Tune.IdleThrottle/100 then _TTick = tick() else _BTick = tick() end
else
_InThrot = _Tune.IdleThrottle/100
_BTick = tick()
end
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_InBrake = input.Position.Z
end
end
else
_InThrot = _Tune.IdleThrottle/100
_GSteerT = 0
_InBrake = 0
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
--| Main |--
|
Remote.PhongDev.OnServerEvent:Connect(function(LocalPlayer)
--| Sound |--
delay(0.9, function()
local Sound = Replicated.Access.Sounds.Transform:Clone()
Sound.Parent = LocalPlayer.Character.PrimaryPart
Sound:Play()
Debris:AddItem(Sound, 3)
end)
--| Anchor HumanoidRootPart |--
spawn(function()
LocalPlayer.Character.PrimaryPart.Anchored = true
wait(4) -- time when done animation
LocalPlayer.Character.PrimaryPart.Anchored = false
end)
--| Health |--
delay(2.05, function()
local Humanoid = LocalPlayer.Character:FindFirstChild("Humanoid")
Humanoid.Health += Humanoid.MaxHealth/3
end)
--| Speed |--
delay(4, function()
local Humanoid = LocalPlayer.Character:FindFirstChild("Humanoid")
local Speed = Humanoid.WalkSpeed * 2.5
Humanoid.WalkSpeed += Speed
wait(Cooldown.Value)
Humanoid.WalkSpeed -= Speed -- default speed
end)
end)
|
-- switch animation
|
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
currentAnimSpeed = 1.0
|
--To Do:
-- Sanity Checks
|
local CurrentSeats = {}
local SeatsInteractingPlayers = {} --Each seat has a table of players containing the last interacting time from each playere
module = {}
function module.AddSeat(Seat)
print("Adding seat")
local EnterEvent = Instance.new("BindableEvent")
local ExitEvent = Instance.new("BindableEvent")
table.insert(CurrentSeats,Seat)
script.NewSeat:FireAllClients(Seat)
--Connect seat in listener
local C1 = Seat.ChildAdded:Connect(function(Obj)
if Obj.Name == "SeatWeld" then
if Obj.Part1 then
if Obj.Part1.Name == "HumanoidRootPart" then
local Player = game.Players:GetPlayerFromCharacter(Obj.Part1.Parent)
if Player then
print("Enter event fired")
EnterEvent:Fire(Player)
end
end
end
end
end)
local C2 = Seat.ChildRemoved:Connect(function(Obj)
if Obj.Name == "SeatWeld" then
if Obj.Part1 then
if Obj.Part1.Name == "HumanoidRootPart" then
local Player = game.Players:GetPlayerFromCharacter(Obj.Part1.Parent)
if Player then
print("Enter event fired")
ExitEvent:Fire(Player)
end
end
end
end
end)
--Clean up after the seat is destroyed
Seat.AncestryChanged:connect(function()
if not Seat:IsDescendantOf(game) then
C1:Disconnect()
C2:Disconnect()
EnterEvent:Destroy()
ExitEvent:Destroy()
SeatsInteractingPlayers[Seat] = nil
for i,v in pairs(CurrentSeats) do
if v == Seat then
v = nil
end
end
end
end)
return EnterEvent,ExitEvent
end
function module.SeatCharacter(HRP,Seat)
local sw = Instance.new("Weld")
sw.Part0, sw.Part1 = Seat, HRP
sw.C0, sw.C1 = CFrame.new(0, 0.5, 0, 1, 0, -0, 0, 0, 1, 0, -1, -0), CFrame.new(0, Seat.Size.Y*-.5+HRP.Size.Y*-.5, 0, 1, 0, -0, 0, 0, 1, 0, -1, -0)
sw.Name = "SeatWeld"
sw.Parent = Seat
end
script.GetSeats.OnServerInvoke = function(Player)
return CurrentSeats
end
script.GetInSeat.OnServerEvent:Connect(function(Player,Seat)
if not Seat:FindFirstChild("SeatWeld") then
if Player.Character ~= nil then
local HRP = Player.Character:FindFirstChild("HumanoidRootPart")
if HRP then
local Dist = (HRP.Position - Seat.Position).magnitude
if Dist<=10 then
module.SeatCharacter(HRP,Seat)
end
end
end
end
end)
|
--// Damage Settings
|
BaseDamage = 46; -- Torso Damage
LimbDamage = 39; -- Arms and Legs
ArmorDamage = 39; -- How much damage is dealt against armor (Name the armor "Armor")
HeadDamage = 73; -- If you set this to 100, there's a chance the player won't die because of the heal script
|
--// # key, ManOn
|
mouse.KeyDown:connect(function(key)
if key=="h" then
veh.Lightbar.middle.Man:Play()
veh.Lightbar.middle.Wail.Volume = 0
veh.Lightbar.middle.Yelp.Volume = 0
veh.Lightbar.middle.Priority.Volume = 0
script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
veh.Lightbar.MAN.Transparency = 0
end
end)
|
--// Firemode Shot Customization
|
BurstNum = 3;
ShotNum = 5;
|
--Turn Control------------------------------------------------------------------------
|
YArrow = script.Parent.YellowTurn.YLamp
GArrow = script.Parent.BimodalArrow.Lamp
FYellow = script.Parent.BimodalArrow.YLamp
DYArrow = script.Parent.YellowTurn.YDynamicLight
DGArrow = script.Parent.BimodalArrow.DynamicLight
DFYellow = script.Parent.BimodalArrow.YDynamicLight
function TurnActive()
if Turn.Value == 0 then
GArrow.Enabled = false
YArrow.Enabled = false
FYellow.Enabled = false
DGArrow.Enabled = false
DYArrow.Enabled = false
DFYellow.Enabled = false
elseif Turn.Value == 1 then
GArrow.Enabled = true
YArrow.Enabled = false
FYellow.Enabled = false
DGArrow.Enabled = true
DYArrow.Enabled = false
DFYellow.Enabled = false
elseif Turn.Value == 2 then
GArrow.Enabled = false
YArrow.Enabled = true
FYellow.Enabled = false
DGArrow.Enabled = false
DYArrow.Enabled = true
DFYellow.Enabled = false
elseif Turn.Value == 3 then
GArrow.Enabled = false
FYellow.Enabled = false
YArrow.Enabled = false
DGArrow.Enabled = false
DFYellow.Enabled = false
DYArrow.Enabled = false
end
end
Turn.Changed:connect(TurnActive)
|
--[[script.Parent.TratarFeridasAberto.Tourniquet.MouseButton1Down:Connect(function()
if Saude.Variaveis.Doer.Value == false then
if Target.Value == "N/A" then
Functions.Energetic:FireServer()
Timer.Barra.Size = UDim2.new(0,0,1,0)
TS:Create(Timer.Barra, TweenInfo.new(2), {Size = UDim2.new(1,0,1,0)}):Play()
else
--FunctionsMulti.Energetic:FireServer()
end
end
end)]]
| |
-- Text size default properties
|
defaults.TextScaled = true
defaults.TextScaleRelativeTo = "Frame" -- "Frame" or "Screen" If Frame, will scale relative to vertical size of the parent frame. If Screen, will scale relative to vertical size of the ScreenGui.
defaults.TextScale = 0.25 -- If you want the frame to have a nominal count of n lines of text, make this value 1 / n. For four lines, 1 / 4 = 0.25.
defaults.TextSize = 20 -- Only applicable if TextScaled = false
|
-- Modules
|
local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local RaceManager = require(ReplicatedModuleScripts:FindFirstChild("RaceManager"))
|
--[[
Turn off
]]
|
function Cell:Kill()
self.Alive = false
self.Part.Material = "SmoothPlastic"
self.Part.BrickColor = BrickColor.new("Earth green")
end
return Cell
|
-- print("Distance from "..character.Name.." = "..distance)
|
if distance <= 8*radius then
torso.Velocity = (torso.Position - position).unit * 300;
human:takeDamage(300-(distance-radius)*(300/radius))
-- If player died
|
-- ALEX WAS HERE LOL
|
local v1 = {};
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
end)();
function v1.Currency(p1, p2, p3, p4)
local v2 = u1.Saving.Get(p1);
if not v2 then
return;
end;
if not p2 or p2 ~= p2 then
return print("Prevented possible NaN for giving coins", true);
end;
p3 = p3 or "Energy";
p2 = math.round(p2 or 0);
local v3 = v2[p3];
if v3 == -1 then
v3 = 0;
v2[p3] = 0;
end;
v2[p3] = p4 and v2[p3] + p2 or math.clamp(v2[p3] + p2, 0, p3 == "Gems" and u1.Settings.MaxGems or u1.Settings.MaxEnergy);
local v4 = v2[p3] - v3;
return v4 ~= v3, v4;
end;
function v1.Slots(p5, p6)
local v5 = u1.Saving.Get(p5);
if not v5 then
return;
end;
p6 = math.round(p6 or 0);
v5.MaxSlots = math.clamp(v5.MaxSlots + p6, 1, u1.Settings.MaxSlots);
--print(v5.MaxSlots ~= v5.MaxSlots)
return true
end;
function v1.SkipFurtune(plr)
local v2 = u1.Saving.Get(plr);
if not v2 then
return;
end;
v2.FurtuneWheel = 0
return true
end
return v1;
|
-- connect up
|
function stopLoopedSounds()
sRunning:Stop()
sClimbing:Stop()
sSwimming:Stop()
end
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Swimming:connect(onSwimming)
Humanoid.Climbing:connect(onClimbing)
Humanoid.Jumping:connect(function(state) onStateNoStop(state, sJumping) prevState = "Jump" end)
Humanoid.GettingUp:connect(function(state) stopLoopedSounds() onStateNoStop(state, sGettingUp) prevState = "GetUp" end)
Humanoid.FreeFalling:connect(function(state) stopLoopedSounds() onStateFall(state, sFreeFalling) prevState = "FreeFall" end)
Humanoid.FallingDown:connect(function(state) stopLoopedSounds() end)
Humanoid.StateChanged:connect(function(old, new)
if not (new.Name == "Dead" or
new.Name == "Running" or
new.Name == "RunningNoPhysics" or
new.Name == "Swimming" or
new.Name == "Jumping" or
new.Name == "GettingUp" or
new.Name == "Freefall" or
new.Name == "FallingDown") then
stopLoopedSounds()
end
end)
|
--// Unused (Don't delete)
|
RestMode = false;
AttachmentsEnabled = true;
UIScope = false;
CanSlideLock = true;
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
service = nil;
return function(p1)
local l__mouse__1 = service.Players.LocalPlayer:GetMouse();
local v2 = client.UI.Make("Window", {
Name = "Paint",
Title = "Paint",
Icon = client.MatIcons.Palette
});
local v3 = v2:Add("Frame", {
Size = UDim2.new(1, 0, 0, 28),
Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1
});
local v4 = v3:Add("TextLabel", {
Size = UDim2.new(0, 100, 1, -8),
Position = UDim2.new(1, -180, 0, 4),
Text = "Pixels: 0",
TextXAlignment = "Right",
BackgroundTransparency = 1
});
local v5 = v2:Add("ScrollingFrame", {
Position = UDim2.new(0, 0, 0, 30),
Size = UDim2.new(1, 0, 1, -30),
BackgroundColor3 = Color3.new(1, 1, 1),
ClipsDescendants = true
});
local u1 = v5:Add("Frame", {
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(0, 4, 0, 4),
BackgroundColor3 = Color3.new(0, 0, 0),
BackgroundTransparency = 0,
Visible = false
});
v5.MouseEnter:Connect(function()
u1.Visible = true;
end);
v5.MouseLeave:Connect(function()
u1.Visible = false;
end);
local u2 = false;
v5.MouseMoved:Connect(function(p2, p3)
local v6 = Vector2.new(math.abs(p2 - v5.AbsolutePosition.X), math.abs(p3 - v5.AbsolutePosition.Y - 36));
u1.Position = UDim2.new(0, v6.X, 0, v6.Y);
if u2 == false then
return;
end;
local v7 = u1:Clone();
v7.Name = "Pixel";
v7.Parent = v5;
v4.Text = "Pixels: " .. tostring(v4.Text:sub(9) + 1);
end);
local v8 = v3:Add("TextButton", {
Size = UDim2.new(0, 70, 1, -8),
Position = UDim2.new(1, -75, 0, 4),
Text = "Clear",
TextXAlignment = "Center",
OnClick = function()
for v9, v10 in pairs((v5:GetChildren())) do
if v10.Name == "Pixel" then
v10:Destroy();
end;
end;
v4.Text = "Pixels: 0";
end
});
v3:Add("TextLabel", {
Text = " Color: ",
Size = UDim2.new(0, 90, 1, -8),
Position = UDim2.new(0, 5, 0, 4),
BackgroundTransparency = 0.25,
TextXAlignment = "Left",
Children = { {
Class = "TextButton",
Text = "",
Size = UDim2.new(0, 40, 1, -6),
Position = UDim2.new(1, -45, 0, 3),
BackgroundColor3 = Color3.new(0, 0, 0),
TextTransparency = 0,
BackgroundTransparency = 0,
BorderPixelSize = 1,
BorderColor3 = Color3.fromRGB(100, 100, 100),
OnClick = function(p4)
local v11 = client.UI.Make("ColorPicker", {
Color = Color3.new(0, 0, 0)
});
p4.BackgroundColor3 = v11;
u1.BackgroundColor3 = v11;
end
} }
});
local v12 = v3:Add("TextLabel", {
Text = " Size: ",
BackgroundTransparency = 0,
Size = UDim2.new(0, 70, 1, -8),
Position = UDim2.new(0, 100, 0, 4),
TextXAlignment = "Left",
Children = {
TextBox = {
Text = "",
PlaceholderText = "4",
Size = UDim2.new(0, 26, 1, 0),
Position = UDim2.new(1, -31, 0, 0),
BackgroundTransparency = 1,
TextXAlignment = "Right",
ClipsDescendants = true,
TextChanged = function(p5, p6, p7)
if tonumber(p5) then
if not (tonumber(p5) < 100) then
u1.Size = UDim2.new(0, 99, 0, 99);
return;
end;
else
return;
end;
u1.Size = UDim2.new(0, p5, 0, p5);
end
}
}
});
v2:Ready();
service.UserInputService.InputBegan:Connect(function(p8)
if p8.UserInputType == Enum.UserInputType.MouseButton1 then
u2 = true;
end;
end);
service.UserInputService.InputEnded:Connect(function(p9)
if p9.UserInputType == Enum.UserInputType.MouseButton1 then
u2 = false;
end;
end);
end;
|
-- Management of which options appear on the Roblox User Settings screen
|
do
local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts")
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow)
PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow)
PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic)
end
function CameraModule.new()
local self = setmetatable({},CameraModule)
-- Current active controller instances
self.activeCameraController = nil
self.activeOcclusionModule = nil
self.activeTransparencyController = nil
self.activeMouseLockController = nil
self.currentComputerCameraMovementMode = nil
-- Connections to events
self.cameraSubjectChangedConn = nil
self.cameraTypeChangedConn = nil
-- Adds CharacterAdded and CharacterRemoving event handlers for all current players
for _,player in pairs(Players:GetPlayers()) do
self:OnPlayerAdded(player)
end
-- Adds CharacterAdded and CharacterRemoving event handlers for all players who join in the future
Players.PlayerAdded:Connect(function(player)
self:OnPlayerAdded(player)
end)
self.activeTransparencyController = TransparencyController.new()
self.activeTransparencyController:Enable(true)
if not UserInputService.TouchEnabled then
self.activeMouseLockController = MouseLockController.new()
local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent()
if toggleEvent then
toggleEvent:Connect(function()
self:OnMouseLockToggled()
end)
end
end
self:ActivateCameraController(self:GetCameraControlChoice())
self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode)
self:OnCurrentCameraChanged() -- Does initializations and makes first camera controller
RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end)
-- Connect listeners to camera-related properties
for _, propertyName in pairs(PLAYER_CAMERA_PROPERTIES) do
Players.LocalPlayer:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnLocalPlayerCameraPropertyChanged(propertyName)
end)
end
for _, propertyName in pairs(USER_GAME_SETTINGS_PROPERTIES) do
UserGameSettings:GetPropertyChangedSignal(propertyName):Connect(function()
self:OnUserGameSettingsPropertyChanged(propertyName)
end)
end
game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
self:OnCurrentCameraChanged()
end)
self.lastInputType = UserInputService:GetLastInputType()
UserInputService.LastInputTypeChanged:Connect(function(newLastInputType)
self.lastInputType = newLastInputType
end)
return self
end
function CameraModule:GetCameraMovementModeFromSettings()
local cameraMode = Players.LocalPlayer.CameraMode
-- Lock First Person trumps all other settings and forces ClassicCamera
if cameraMode == Enum.CameraMode.LockFirstPerson then
return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic)
end
local devMode, userMode
if UserInputService.TouchEnabled then
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
else
devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevComputerCameraMode)
userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
end
if devMode == Enum.DevComputerCameraMovementMode.UserChoice then
-- Developer is allowing user choice, so user setting is respected
return userMode
end
return devMode
end
function CameraModule:ActivateOcclusionModule( occlusionMode )
local newModuleCreator = nil
if occlusionMode == Enum.DevCameraOcclusionMode.Zoom then
newModuleCreator = Poppercam
elseif occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
newModuleCreator = Invisicam
else
warn("CameraScript ActivateOcclusionModule called with unsupported mode")
return
end
-- First check to see if there is actually a change. If the module being requested is already
-- the currently-active solution then just make sure it's enabled and exit early
if self.activeOcclusionModule and self.activeOcclusionModule:GetOcclusionMode() == occlusionMode then
if not self.activeOcclusionModule:GetEnabled() then
self.activeOcclusionModule:Enable(true)
end
return
end
-- Save a reference to the current active module (may be nil) so that we can disable it if
-- we are successful in activating its replacement
local prevOcclusionModule = self.activeOcclusionModule
-- If there is no active module, see if the one we need has already been instantiated
self.activeOcclusionModule = instantiatedOcclusionModules[newModuleCreator]
-- If the module was not already instantiated and selected above, instantiate it
if not self.activeOcclusionModule then
self.activeOcclusionModule = newModuleCreator.new()
if self.activeOcclusionModule then
instantiatedOcclusionModules[newModuleCreator] = self.activeOcclusionModule
end
end
-- If we were successful in either selecting or instantiating the module,
-- enable it if it's not already the currently-active enabled module
if self.activeOcclusionModule then
local newModuleOcclusionMode = self.activeOcclusionModule:GetOcclusionMode()
-- Sanity check that the module we selected or instantiated actually supports the desired occlusionMode
if newModuleOcclusionMode ~= occlusionMode then
warn("CameraScript ActivateOcclusionModule mismatch: ",self.activeOcclusionModule:GetOcclusionMode(),"~=",occlusionMode)
end
-- Deactivate current module if there is one
if prevOcclusionModule then
-- Sanity check that current module is not being replaced by itself (that should have been handled above)
if prevOcclusionModule ~= self.activeOcclusionModule then
prevOcclusionModule:Enable(false)
else
warn("CameraScript ActivateOcclusionModule failure to detect already running correct module")
end
end
-- Occlusion modules need to be initialized with information about characters and cameraSubject
-- Invisicam needs the LocalPlayer's character
-- Poppercam needs all player characters and the camera subject
if occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then
-- Optimization to only send Invisicam what we know it needs
if Players.LocalPlayer.Character then
self.activeOcclusionModule:CharacterAdded(Players.LocalPlayer.Character, Players.LocalPlayer )
end
else
-- When Poppercam is enabled, we send it all existing player characters for its raycast ignore list
for _, player in pairs(Players:GetPlayers()) do
if player and player.Character then
self.activeOcclusionModule:CharacterAdded(player.Character, player)
end
end
self.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject)
end
-- Activate new choice
self.activeOcclusionModule:Enable(true)
end
end
|
--// Hash: 86b950b579449b6aff2d1d571d12200b2726731a82186aa2b9985f46462fa08b79dc3d6c13dbe66462887159f5dc645e
-- Decompiled with the Synapse X Luau decompiler.
|
local l1 = "pc"
game:GetService("UserInputService").InputBegan:Connect(function(obj: InputObject)
if obj.UserInputType == Enum.UserInputType.None then l1 = "pc" end
if obj.UserInputType == Enum.UserInputType.Gamepad1 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad2 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad3 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad4 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad5 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad6 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad7 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Gamepad8 then l1 = "console" end
if obj.UserInputType == Enum.UserInputType.Touch then l1 = "mobile" end
if obj.UserInputType == Enum.UserInputType.Keyboard then l1 = "pc" end
end)
local v16
local v21
local v19
local v20
local v22, v23
|
--Set the orientation with Y taking precedence, then Z.
|
function Meta:SetOrientationYZ(upVector, backVector)
self.topVector = upVector.unit;
self.rightVector = self.topVector:Cross(backVector).unit;
self.backVector = self.rightVector:Cross(self.topVector);
end
function Meta:VectorToObjectSpace(v)
return v:Dot(self.rightVector), v:Dot(self.topVector), v:Dot(self.backVector);
end
function Meta:VectorToWorldSpace(v)
return v.x * self.rightVector + v.y * self.topVector + v.z * self.backVector;
end
function Meta.new()
local self = setmetatable({}, Meta);
return self;
end
return Meta;
|
--[=[
@within Gamepad
@prop State GamepadState
@readonly
Maps KeyCodes to the matching InputObjects within the gamepad.
These can be used to directly read the current input state of
a given part of the gamepad. For most cases, the given methods
and properties of `Gamepad` should make use of this table quite
rare, but it is provided for special use-cases that might occur.
:::note Do Not Cache
These state objects will change if the active gamepad changes.
Because a player might switch up gamepads during playtime, it cannot
be assumed that these state objects will always be the same. Thus
they should be accessed directly from this `State` table anytime they
need to be used.
:::
```lua
local leftThumbstick = gamepad.State[Enum.KeyCode.Thumbstick1]
print(leftThumbstick.Position)
-- It would be better to use gamepad:GetThumbstick(Enum.KeyCode.Thumbstick1),
-- but this is just an example of direct state access.
```
]=]
| |
--// Servic
|
local rp = game:GetService('ReplicatedStorage')
local plr = game:GetService('Players').LocalPlayer
local UIS = game:GetService('UserInputService')
repeat task.wait() until plr.Character
local char = plr.Character
local hum,hroot = char:WaitForChild('Humanoid'), char:WaitForChild('HumanoidRootPart')
local remoteFold = rp.remoteFold
remoteFold['Client'].OnClientEvent:Connect(function(Data)
-- Module , ModuleFunction(Passed Data)
if Data.M and Data.F then
local Module = require(Data.M) -- M -> Module, F -> Function
Module[Data.F](Data)
end
--print('client', Data)
--print(Data)
end)
|
--- Hides the command bar
|
function Window:Hide()
return self:SetVisible(false)
end
|
--[[ Constants ]]
|
--
local DEFAULT_MOUSE_LOCK_CURSOR = "rbxasset://textures/MouseLockedCursor.png"
local CONTEXT_ACTION_NAME = "MouseLockSwitchAction"
local MOUSELOCK_ACTION_PRIORITY = Enum.ContextActionPriority.Default.Value
local Util = require(script.Parent:WaitForChild("CameraUtils"))
|
---Explosive Settings---
|
elseif Settings.Mode == "Explosive" and Settings.FireModes.Semi == true then
Gui.FText.Text = "Semi"
Settings.Mode = "Semi"
elseif Settings.Mode == "Explosive" and Settings.FireModes.Semi == false and Settings.FireModes.Burst == true then
Gui.FText.Text = "Burst"
Settings.Mode = "Burst"
elseif Settings.Mode == "Explosive" and Settings.FireModes.Semi == false and Settings.FireModes.Burst == false and Settings.FireModes.Auto == true then
Gui.FText.Text = "Auto"
Settings.Mode = "Auto"
end
Update_Gui()
end
if (key == "t") and Equipped and (not NVG or ArmaClone.AimPart:FindFirstChild("NVAim") == nil) then
if Aiming then
if ArmaClone:FindFirstChild("AimPart2") ~= nil then
if AimPartMode == 1 then
AimPartMode = 2
tweenFoV(Settings.ChangeFOV[2],120)
if Settings.FocusOnSight2 and Aiming then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
if Settings.ZoomAnim then
ZoomAnim()
Sprint()
end
elseif AimPartMode == 2 then
AimPartMode = 1
tweenFoV(Settings.ChangeFOV[1],120)
if Settings.FocusOnSight and Aiming then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
if Settings.ZoomAnim then
UnZoomAnim()
Sprint()
end
end
else
if AimPartMode == 1 then
AimPartMode = 2
tweenFoV(Settings.ChangeFOV[2], 120)
if Settings.FocusOnSight2 and Aiming then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
if Settings.ZoomAnim then
ZoomAnim()
Sprint()
end
elseif AimPartMode == 2 then
AimPartMode = 1
tweenFoV(Settings.ChangeFOV[1], 120)
if Settings.FocusOnSight and Aiming then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
if Settings.ZoomAnim then
UnZoomAnim()
Sprint()
end
end
end
else
if AimPartMode == 1 then
AimPartMode = 2
if Settings.FocusOnSight2 and Aiming then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
if Settings.ZoomAnim then
ZoomAnim()
Sprint()
end
elseif AimPartMode == 2 then
AimPartMode = 1
if Settings.FocusOnSight and Aiming then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
if Settings.ZoomAnim then
UnZoomAnim()
Sprint()
end
end
end
end
if (key == "[") and Equipped then
if Zeroing.Value > Zeroing.MinValue then
Zeroing.Value = Zeroing.Value - 50
ArmaClone.Handle.Click:play()
Update_Gui()
end
end
if (key == "]" ) and Equipped then
if Zeroing.Value < Zeroing.MaxValue then
Zeroing.Value = Zeroing.Value + 50
ArmaClone.Handle.Click:play()
Update_Gui()
end
end
if (key == "r") and Equipped and stance > -2 then
CancelReload = false
if StoredAmmo.Value > 0 and Settings.Mode ~= "Explosive" and not Reloading and Settings.ReloadType == 1 then
if Settings.IncludeChamberedBullet and Ammo.Value == Settings.Ammo + 1 or not Settings.IncludeChamberedBullet and Ammo.Value == Settings.Ammo and Chambered.Value == true then
return
end
MouseHeld = false
Can_Shoot = false
Reloading = true
if Safe then
Safe = false
stance = 0
Evt.Stance:FireServer(stance,Settings,Anims)
IdleAnim()
Update_Gui()
wait(.25)
end
ReloadAnim()
if Chambered.Value == false and slideback == true and Settings.FastReload == true then
ChamberBKAnim()
elseif Chambered.Value == false and slideback == false and Settings.FastReload == true then
ChamberAnim()
end
Sprint()
Update_Gui()
Can_Shoot = true
Reloading = false
elseif StoredAmmo.Value > 0 and Settings.Mode ~= "Explosive" and not Reloading and Settings.ReloadType == 2 then
if Settings.IncludeChamberedBullet and Ammo.Value == Settings.Ammo + 1 or not Settings.IncludeChamberedBullet and Ammo.Value == Settings.Ammo and Chambered.Value == true or CancelReload then
Sprint()
Update_Gui()
return
end
MouseHeld = false
Can_Shoot = false
Reloading = true
if Safe then
Safe = false
stance = 0
Evt.Stance:FireServer(stance)
Sprint()
Update_Gui()
wait(.25)
end
for i = 1,Settings.Ammo - Ammo.Value do
if StoredAmmo.Value > 0 and not CancelReload and Ammo.Value < Settings.Ammo and not AnimDebounce then
ShellInsertAnim()
end
end
if Chambered.Value == false and slideback == true and Settings.FastReload == true then
ChamberBKAnim()
elseif Chambered.Value == false and slideback == false and Settings.FastReload == true then
ChamberAnim()
end
Update_Gui()
Sprint()
CancelReload = false
Can_Shoot = true
Reloading = false
elseif StoredAmmo.Value > 0 and Settings.Mode ~= "Explosive" and Reloading and Settings.ReloadType == 2 and AnimDebounce then
if not CancelReload then
CancelReload = true
Sprint()
Update_Gui()
wait(.25)
end
elseif not Reloading and GLAmmo.Value > 0 and Settings.Mode == "Explosive" and GLChambered.Value == false then
MouseHeld = false
Can_Shoot = false
Reloading = true
GLReloadAnim()
GLChambered.Value = true
Sprint()
Update_Gui()
Can_Shoot = true
Reloading = false
end
end
if (key == "f") and Equipped and not Reloading and stance > -2 then
MouseHeld = false
Can_Shoot = false
Reloading = true
if Safe then
Safe = false
stance = 0
Evt.Stance:FireServer(stance,Settings,Anims)
IdleAnim()
Update_Gui()
--wait(.25)
end
if not slideback then
ChamberAnim()
else
ChamberBKAnim()
end
Sprint()
Update_Gui()
Can_Shoot = true
Reloading = false
end
if (key == "m") and Equipped and Settings.CanCheckMag and not Reloading and stance > -2 then
MouseHeld = false
Can_Shoot = false
Reloading = true
if Safe then
Safe = false
stance = 0
Evt.Stance:FireServer(stance,Settings,Anims)
IdleAnim()
Update_Gui()
--wait(.25)
end
CheckAnim()
Sprint()
Update_Gui()
Can_Shoot = true
Reloading = false
end
if (key == Enum.KeyCode.LeftAlt) and Equipped then
local O = true
if O == true then
O = false
Can_Shoot = false
elseif O == false then
O = true
Can_Shoot = true
end
end
if (key == "h") and Equipped and ArmaClone:FindFirstChild("LaserPoint") then
if ServerConfig.RealisticLaser and ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
if not LaserAtivo and not IRmode then
LaserAtivo = not LaserAtivo
IRmode = not IRmode
if LaserAtivo then
Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
Pointer = Instance.new('Part')
Pointer.Shape = 'Ball'
Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
Pointer.Parent = ArmaClone.LaserPoint
Pointer.CanCollide = false
Pointer.Color = ArmaClone.LaserPoint.Color
Pointer.Material = Enum.Material.Neon
if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
Pointer.Transparency = 1
end
LaserSP = Instance.new('Attachment')
LaserSP.Parent = ArmaClone.LaserPoint
LaserEP = Instance.new('Attachment')
LaserEP.Parent = ArmaClone.LaserPoint
Laser = Instance.new('Beam')
Laser.Parent = ArmaClone.LaserPoint
Laser.Transparency = NumberSequence.new(0)
Laser.LightEmission = 1
Laser.LightInfluence = 0
Laser.Attachment0 = LaserSP
Laser.Attachment1 = LaserEP
Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
Laser.FaceCamera = true
Laser.Width0 = 0.01
Laser.Width1 = 0.01
if ServerConfig.RealisticLaser then
Laser.Enabled = false
end
else
Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
Pointer:Destroy()
LaserSP:Destroy()
LaserEP:Destroy()
Laser:Destroy()
end
elseif LaserAtivo and IRmode then
IRmode = not IRmode
elseif LaserAtivo and not IRmode then
LaserAtivo = not LaserAtivo
if LaserAtivo then
Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
Pointer = Instance.new('Part')
Pointer.Shape = 'Ball'
Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
Pointer.Parent = ArmaClone.LaserPoint
Pointer.CanCollide = false
Pointer.Color = ArmaClone.LaserPoint.Color
Pointer.Material = Enum.Material.Neon
if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
Pointer.Transparency = 1
end
LaserSP = Instance.new('Attachment')
LaserSP.Parent = ArmaClone.LaserPoint
LaserEP = Instance.new('Attachment')
LaserEP.Parent = ArmaClone.LaserPoint
Laser = Instance.new('Beam')
Laser.Parent = ArmaClone.LaserPoint
Laser.Transparency = NumberSequence.new(0)
Laser.LightEmission = 1
Laser.LightInfluence = 0
Laser.Attachment0 = LaserSP
Laser.Attachment1 = LaserEP
Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
Laser.FaceCamera = true
Laser.Width0 = 0.01
Laser.Width1 = 0.01
if ServerConfig.RealisticLaser then
Laser.Enabled = false
end
else
Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
Pointer:Destroy()
LaserSP:Destroy()
LaserEP:Destroy()
Laser:Destroy()
end
end
else
LaserAtivo = not LaserAtivo
if LaserAtivo then
Evt.SVLaser:FireServer(Vector3.new(0,0,0),1,ArmaClone.LaserPoint.Color,ArmaClient)
Pointer = Instance.new('Part')
Pointer.Shape = 'Ball'
Pointer.Size = Vector3.new(0.2, 0.2, 0.2)
Pointer.Parent = ArmaClone.LaserPoint
Pointer.CanCollide = false
Pointer.Color = ArmaClone.LaserPoint.Color
Pointer.Material = Enum.Material.Neon
if ArmaClone.LaserPoint:FindFirstChild("IR") ~= nil then
Pointer.Transparency = 1
end
LaserSP = Instance.new('Attachment')
LaserSP.Parent = ArmaClone.LaserPoint
LaserEP = Instance.new('Attachment')
LaserEP.Parent = ArmaClone.LaserPoint
Laser = Instance.new('Beam')
Laser.Parent = ArmaClone.LaserPoint
Laser.Transparency = NumberSequence.new(0)
Laser.LightEmission = 1
Laser.LightInfluence = 0
Laser.Attachment0 = LaserSP
Laser.Attachment1 = LaserEP
Laser.Color = ColorSequence.new(ArmaClone.LaserPoint.Color,IRmode)
Laser.FaceCamera = true
Laser.Width0 = 0.01
Laser.Width1 = 0.01
if ServerConfig.RealisticLaser then
Laser.Enabled = false
end
else
Evt.SVLaser:FireServer(Vector3.new(0,0,0),2,nil,ArmaClient,IRmode)
Pointer:Destroy()
LaserSP:Destroy()
LaserEP:Destroy()
Laser:Destroy()
end
end
ArmaClone.Handle.Click:play()
end
if (key == "j") and Equipped and ArmaClone:FindFirstChild("FlashPoint") then
LanternaAtiva = not LanternaAtiva
ArmaClone.Handle.Click:play()
if LanternaAtiva then
Evt.SVFlash:FireServer(true,ArmaClient,ArmaClone.FlashPoint.Light.Angle,ArmaClone.FlashPoint.Light.Brightness,ArmaClone.FlashPoint.Light.Color,ArmaClone.FlashPoint.Light.Range)
ArmaClone.FlashPoint.Light.Enabled = true
else
Evt.SVFlash:FireServer(false,ArmaClient,nil,nil,nil,nil)
ArmaClone.FlashPoint.Light.Enabled = false
end
end
if (key == "u") and Equipped and ArmaClone:FindFirstChild("Silenciador") then
Silencer.Value = not Silencer.Value
ArmaClone.Handle.Click:play()
if Silencer.Value == true then
ArmaClone.Silenciador.Transparency = 0
ArmaClone.SmokePart.FlashFX.Brightness = 0
ArmaClone.SmokePart:FindFirstChild("FlashFX[Flash]").Rate = 0
Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)
else
ArmaClone.Silenciador.Transparency = 1
ArmaClone.SmokePart.FlashFX.Brightness = 5
ArmaClone.SmokePart:FindFirstChild("FlashFX[Flash]").Rate = 1000
Evt.SilencerEquip:FireServer(ArmaClient,Silencer.Value)
end
end
if (key == "b") and Equipped and BipodEnabled and ArmaClone:FindFirstChild("BipodPoint") then
Bipod = not Bipod
if Bipod == true then
if ArmaClone.BipodPoint:FindFirstChild("BipodDeploy") ~= nil then
ArmaClone.BipodPoint.BipodDeploy:play()
end
else
if ArmaClone.BipodPoint:FindFirstChild("BipodRetract") ~= nil then
ArmaClone.BipodPoint.BipodRetract:play()
end
end
end
if (key == "n") and Laserdebounce == false then
if Player.Character then
local helmet = Player.Character:FindFirstChild("Helmet")
if helmet then
local nvg = helmet:FindFirstChild("Up")
if nvg then
Laserdebounce = true
delay(.8,function()
NVG = not NVG
if Aiming and ArmaClone.AimPart:FindFirstChild("NVAim") ~= nil then
if NVG then
tweenFoV(70,120)
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
else
if AimPartMode == 1 then
tweenFoV(Settings.ChangeFOV[1],120)
if Settings.FocusOnSight then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
elseif AimPartMode == 2 then
tweenFoV(Settings.ChangeFOV[2],120)
if Settings.FocusOnSight2 then
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.75),{ImageTransparency = 0}):Play()
else
TS:Create(StatusClone.Efeitos.Aim,TweenInfo.new(.3),{ImageTransparency = 1}):Play()
end
end
end
end
Laserdebounce = false
end)
end
end
end
end
end)
|
--[[
Returns a boolean about whether the `assetType` is actually an Accessory type.
This function is called right before a split in functionality is required
between different types of assets, such as equipping.
See related function `isClassicClothing`.
]]
|
local MerchBooth = script:FindFirstAncestor("MerchBooth")
local t = require(MerchBooth.Packages.t)
function isAccessory(assetType: Enum.AssetType): boolean
assert(t.enum(Enum.AssetType)(assetType))
if string.find(assetType.Name, "Accessory") or assetType == Enum.AssetType.Hat then
return true
end
return false
end
return isAccessory
|
-- Objects
|
local folder
local settingsDir = script.Settings
function getSetting (name)
return settingsDir and settingsDir:FindFirstChild(name) and settingsDir[name].Value
end
|
--if SignalValues.Signal1.Value == 2 then
-- SignalValues.Signal1.Value = 3
--end
--if SignalValues.Signal2.Value == 2 then
-- SignalValues.Signal2.Value = 3
--end
--if SignalValues.Signal2a.Value == 2 then
-- SignalValues.Signal2a.Value = 3
--end
--if SignalValues.Signal1a.Value == 2 then
-- SignalValues.Signal1a.Value = 3
--end
--if TurnValues.TurnSignal1.Value == 2 then
-- TurnValues.TurnSignal1.Value = 3
--end
--if TurnValues.TurnSignal1a.Value == 2 then
-- TurnValues.TurnSignal1a.Value = 3
--end
--if TurnValues.TurnSignal2.Value == 2 then
-- TurnValues.TurnSignal2.Value = 3
--end
--if TurnValues.TurnSignal2a.Value == 2 then
-- TurnValues.TurnSignal2a.Value = 3
--end
| |
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function MaterialTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
end;
function MaterialTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:disconnect();
Connections[ConnectionKey] = nil;
end;
end;
|
-- Determine the gun elevation and tilt
|
function determineNewDirections(targetVector)
local targElev = 0;
local targRot = 0;
local turretMain = parts.TurretRing2;
-- Vector normal to the plane which is the turret ring
local turretNormal = turretMain.CFrame.lookVector;
local angleFromNormal = turretNormal:Dot(targetVector);
-- Determine gun elevation
targElev = math.pi/2 - math.acos(angleFromNormal);
-- Projection of target vector onto the turret plane
local targetProjection = (targetVector - (angleFromNormal*turretNormal)).unit;
local forwardVector = ( (turretMain.CFrame - turretMain.CFrame.p) -- Orientation only of brick
* CFrame.new(0, -1, 0)).p; -- Translated down 1
-- Determine angle between forward vector and the projected target vector
targRot = math.acos(forwardVector:Dot(targetProjection));
-- Determine the sign of the angle
local vectorCross = forwardVector:Cross(targetProjection);
-- If the cross product is opposite to the normal vector, make the angle negative
if (vectorCross:Dot(turretNormal) < 0) then
targRot = -targRot;
end
-- Put rotation and elevation into an array
local rotations = {};
rotations[1] = targElev;
rotations[2] = targRot;
return rotations;
end
function sign(input)
if (input < 0) then
return -1;
else
return 1;
end
end
|
--[=[
@interface Service
.Init: function?
.Start: function?
.Destroy: function?
@within ServiceBag
]=]
| |
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["Cryo"]["Cryo"])
return Package
|
--[[ Roblox Services ]]
|
--
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Workspace = game:GetService("Workspace")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local VRService = game:GetService("VRService")
|
--Variables
|
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local healthbar = script.Parent:WaitForChild("HealthBar")
|
---Camera
|
function Camera()
local cam=workspace.CurrentCamera
local CRot=0
local CBack=0
local CUp=0
local look=0
local camChange = 0
local function CamUpdate()
if not pcall (function()
camChange=DPadUp
if GMode==2 then
if math.abs(RStickX)>.1 then
local sPos=1
if RStickX<0 then sPos=-1 end
CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-60
else
CRot=0
end
if math.abs(RStickY)>.1 then
local sPos=1
if RStickY<0 then sPos=-1 end
CUp=math.min(sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*-75,30)
else
CUp=0
end
else
if CRot>look then
CRot=math.max(look,CRot-20)
elseif CRot<look then
CRot=math.min(look,CRot+20)
end
CUp=0
end
CBack=-180*ButtonR3
cam.CameraSubject=car.DriveSeat
cam.FieldOfView=70
if GMode==0 then
cam.CameraType=Enum.CameraType.Custom
player.CameraMaxZoomDistance=400
else
cam.CameraType = "Scriptable"
local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500)
local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-((car.DriveSeat.CFrame*CFrame.Angles(math.rad(CUp),math.rad(CRot+CBack),0)).lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed)
cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position)
end
end) then
cam.FieldOfView=70
cam.CameraSubject=player.Character.Humanoid
cam.CameraType=Enum.CameraType.Custom
player.CameraMaxZoomDistance=400
run:UnbindFromRenderStep("CamUpdate")
end
end
mouse.KeyDown:connect(function(key)
if key=="z" then
look=50
elseif key=="x" then
look=-180
elseif key=="c" then
look=-50
end
end)
mouse.KeyUp:connect(function(key)
if key=="z" and look==50 then
look=0
elseif key=="x" and (look==-160 or look==-180) then
look=0
elseif key=="c" and look==-50 then
look=0
end
end)
--run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate)
--table.insert(Binded,"CamUpdate")
table.insert(Binded,CamUpdate)
end
Camera()
|
-- The Possibilities are endless with this, Feel free to add so many awesome features to your timer script, like playing sounds, displaying UI, doing background stuff and even saving player data!
-- Be sure to place me in your GUI, do not place me inside any parent except for the GUI!
|
-- If you have questions view SSessionHandler script! :)
Session.Changed:Connect(UpdateStatus) -- Remove this if you remove UpdateStatus() , Fires upon Session Data Value changing in replicated storage
Timer.Changed:Connect(UpdateTimer) -- Remove this if you remove UpdateTimer() , Fires upon Timer Data Value changing in replicated storage
|
----- TOOL DATA -----
-- How much damage a bullet does
|
local Damage = 100
|
-- Etc
|
local DESTROY_ON_DEATH = getValueFromConfig("DestroyOnDeath")
local RAGDOLL_ENABLED = getValueFromConfig("RagdollEnabled")
local DEATH_DESTROY_DELAY = 5
local PATROL_WALKSPEED = 8
local MIN_REPOSITION_TIME = 2
local MAX_REPOSITION_TIME = 10
local MAX_PARTS_PER_HEARTBEAT = 50
local ATTACK_STAND_TIME = 1
local HITBOX_SIZE = Vector3.new(5, 3, 5)
local SEARCH_DELAY = 1
local ATTACK_RANGE = 3
local ATTACK_DELAY = 1
local ATTACK_MIN_WALKSPEED = 8
local ATTACK_MAX_WALKSPEED = 15
|
-- if the player steps in a vehicle
|
camera:GetPropertyChangedSignal("CameraSubject"):Connect(function()
if camera.CameraSubject:IsA("VehicleSeat") then
camera.CameraSubject = humanoid
end
end)
|
--[[Transmission]]
|
Tune.TransModes = {"Semi","Auto"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.21 -- [TRANSMISSION CALCULATIONS FOR NERDS]
Tune.Ratios = { -- SPEED [SPS] = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
--[[Reverse]] 5.000 ,-- WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
--[[Neutral]] 0 ,
--[[ 1 ]] 3.519 ,
--[[ 2 ]] 2.320 ,
--[[ 3 ]] 1.700 ,
--[[ 4 ]] 1.400 ,
--[[ 5 ]] 0.907 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--[=[
Like trim, but only applied to the beginning of the setring
@param str string
@param pattern string? -- Defaults to whitespace
@return string
]=]
|
function String.trimFront(str: string, pattern: string?): string
pattern = pattern or "%s";
return (str:gsub("^"..pattern.."*(.-)"..pattern.."*", "%1"))
end
|
------------------------------------------
--Digets
|
function Click0()
Input = Input..0
print("0")
script.Parent.B0.ClickS:Play()
script.Parent.B0.Decal.Texture = "http://www.roblox.com/asset/?id=2767674"
wait(0.1)
script.Parent.B0.Decal.Texture = "http://www.roblox.com/asset/?id=2761903"
end
script.Parent.B0.ClickDetector.MouseClick:connect(Click0)
function Click1()
Input = Input..1
print("1")
script.Parent.B1.Decal.Texture = "http://www.roblox.com/asset/?id=2767677"
script.Parent.B0.ClickS:Play()
wait(0.1)
script.Parent.B1.Decal.Texture = "http://www.roblox.com/asset/?id=2761913"
end
script.Parent.B1.ClickDetector.MouseClick:connect(Click1)
function Click2()
Input = Input..2
print("2")
script.Parent.B0.ClickS:Play()
script.Parent.B2.Decal.Texture = "http://www.roblox.com/asset/?id=2767680"
wait(0.1)
script.Parent.B2.Decal.Texture = "http://www.roblox.com/asset/?id=2761922"
end
script.Parent.B2.ClickDetector.MouseClick:connect(Click2)
function Click3()
Input = Input..3
print("3")
script.Parent.B0.ClickS:Play()
script.Parent.B3.Decal.Texture = "http://www.roblox.com/asset/?id=2767686"
wait(0.1)
script.Parent.B3.Decal.Texture = "http://www.roblox.com/asset/?id=2761927"
end
script.Parent.B3.ClickDetector.MouseClick:connect(Click3)
function Click4()
Input = Input..4
print("4")
script.Parent.B0.ClickS:Play()
script.Parent.B4.Decal.Texture = "http://www.roblox.com/asset/?id=2767693"
wait(0.1)
script.Parent.B4.Decal.Texture = "http://www.roblox.com/asset/?id=2761938"
end
script.Parent.B4.ClickDetector.MouseClick:connect(Click4)
function Click5()
Input = Input..5
print("5")
script.Parent.B0.ClickS:Play()
script.Parent.B5.Decal.Texture = "http://www.roblox.com/asset/?id=2767695"
wait(0.1)
script.Parent.B5.Decal.Texture = "http://www.roblox.com/asset/?id=2761943"
end
script.Parent.B5.ClickDetector.MouseClick:connect(Click5)
function Click6()
Input = Input..6
print("6")
script.Parent.B0.ClickS:Play()
script.Parent.B6.Decal.Texture = "http://www.roblox.com/asset/?id=2767699"
wait(0.1)
script.Parent.B6.Decal.Texture = "http://www.roblox.com/asset/?id=2761948"
end
script.Parent.B6.ClickDetector.MouseClick:connect(Click6)
function Click7()
Input = Input..7
print("7")
script.Parent.B0.ClickS:Play()
script.Parent.B7.Decal.Texture = "http://www.roblox.com/asset/?id=2767701"
wait(0.1)
script.Parent.B7.Decal.Texture = "http://www.roblox.com/asset/?id=2761956"
end
script.Parent.B7.ClickDetector.MouseClick:connect(Click7)
function Click8()
Input = Input..8
print("8")
script.Parent.B0.ClickS:Play()
script.Parent.B8.Decal.Texture = "http://www.roblox.com/asset/?id=2767707"
wait(0.1)
script.Parent.B8.Decal.Texture = "http://www.roblox.com/asset/?id=2761961"
end
script.Parent.B8.ClickDetector.MouseClick:connect(Click8)
function Click9()
Input = Input..9
print("9")
script.Parent.B0.ClickS:Play()
script.Parent.B9.Decal.Texture = "http://www.roblox.com/asset/?id=2767714"
wait(0.1)
script.Parent.B9.Decal.Texture = "http://www.roblox.com/asset/?id=2761971"
end
script.Parent.B9.ClickDetector.MouseClick:connect(Click9)
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
oldAnim = "idle"
currentlyPlayingEmote = false
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
-- clean up walk if there is one
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop()
runAnimTrack:Destroy()
runAnimTrack = nil
end
return oldAnim
end
function getHeightScale()
if Humanoid then
if not Humanoid.AutomaticScalingEnabled then
return 1
end
local scale = Humanoid.HipHeight / HumanoidHipHeight
if AnimationSpeedDampeningObject == nil then
AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
end
if AnimationSpeedDampeningObject ~= nil then
scale = 1 + (Humanoid.HipHeight - HumanoidHipHeight) * AnimationSpeedDampeningObject.Value / HumanoidHipHeight
end
return scale
end
return 1
end
local smallButNotZero = 0.0001
function setRunSpeed(speed)
local speedScaled = speed * 1
local heightScale = getHeightScale()
local runSpeed = speedScaled / heightScale
if runSpeed ~= currentAnimSpeed then
if runSpeed < 0.35 then
currentAnimTrack:AdjustWeight(1.0)
runAnimTrack:AdjustWeight(smallButNotZero)
elseif runSpeed < .66 then
local weight = ((runSpeed - 0.66) / 0.66)
currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero)
runAnimTrack:AdjustWeight(weight + smallButNotZero)
else
currentAnimTrack:AdjustWeight(smallButNotZero)
runAnimTrack:AdjustWeight(1.0)
end
currentAnimSpeed = runSpeed
runAnimTrack:AdjustSpeed(runSpeed)
currentAnimTrack:AdjustSpeed(runSpeed)
end
end
function setAnimationSpeed(speed)
if currentAnim == "walk" then
setRunSpeed(speed)
else
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
if currentAnim == "walk" then
if userNoUpdateOnLoop == true then
if runAnimTrack.Looped ~= true then
runAnimTrack.TimePosition = 0.0
end
if currentAnimTrack.Looped ~= true then
currentAnimTrack.TimePosition = 0.0
end
else
runAnimTrack.TimePosition = 0.0
currentAnimTrack.TimePosition = 0.0
end
else
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
if currentAnimTrack.Looped then
-- Allow the emote to loop
return
end
repeatAnim = "idle"
currentlyPlayingEmote = false
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Humanoid)
setAnimationSpeed(animSpeed)
end
end
end
function rollAnimation(animName)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
return idx
end
local function switchToAnim(anim, animName, transitionTime, humanoid)
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop(transitionTime)
runAnimTrack:Destroy()
if userNoUpdateOnLoop == true then
runAnimTrack = nil
end
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
-- check to see if we need to blend a walk/run animation
if animName == "walk" then
local runAnimName = "run"
local runIdx = rollAnimation(runAnimName)
runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
runAnimTrack.Priority = Enum.AnimationPriority.Core
runAnimTrack:Play(transitionTime)
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
local anim = animTable[animName][idx].anim
switchToAnim(anim, animName, transitionTime, humanoid)
currentlyPlayingEmote = false
end
function playEmote(emoteAnim, transitionTime, humanoid)
switchToAnim(emoteAnim, emoteAnim.Name, transitionTime, humanoid)
currentlyPlayingEmote = true
end
|
-- Setup
|
local StealthLava = script.Parent
local Avatar = nil
local Hold = nil
local AvatarBody = {"Pants", "Script", "LocalScript"}
local AvatarHead = {"Script"}
local ExcludedNames = {"Health", "HealthScript v3.1", "RobloxTeam", "Sound", "Animate"}
local ExcludedClasses = {"Humanoid"}
|
--[[
Poppercam - Occlusion module that brings the camera closer to the subject when objects are blocking the view.
--]]
|
wait(999999999999999999999)
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local TransformExtrapolator = {} do
TransformExtrapolator.__index = TransformExtrapolator
local CF_IDENTITY = CFrame.new()
local function cframeToAxis(cframe)
local axis, angle = cframe:toAxisAngle()
return axis*angle
end
local function axisToCFrame(axis)
local angle = axis.magnitude
if angle > 1e-5 then
return CFrame.fromAxisAngle(axis, angle)
end
return CF_IDENTITY
end
local function extractRotation(cf)
local _, _, _, xx, yx, zx, xy, yy, zy, xz, yz, zz = cf:components()
return CFrame.new(0, 0, 0, xx, yx, zx, xy, yy, zy, xz, yz, zz)
end
function TransformExtrapolator.new()
return setmetatable({
lastCFrame = nil,
}, TransformExtrapolator)
end
function TransformExtrapolator:Step(dt, currentCFrame)
local lastCFrame = self.lastCFrame or currentCFrame
self.lastCFrame = currentCFrame
local currentPos = currentCFrame.p
local currentRot = extractRotation(currentCFrame)
local lastPos = lastCFrame.p
local lastRot = extractRotation(lastCFrame)
-- Estimate velocities from the delta between now and the last frame
-- This estimation can be a little noisy.
local dp = (currentPos - lastPos)/dt
local dr = cframeToAxis(currentRot*lastRot:inverse())/dt
local function extrapolate(t)
local p = dp*t + currentPos
local r = axisToCFrame(dr*t)*currentRot
return r + p
end
return {
extrapolate = extrapolate,
posVelocity = dp,
rotVelocity = dr,
}
end
function TransformExtrapolator:Reset()
self.lastCFrame = nil
end
end
|
-- Define the function to open or close the window with gene-alike effect
|
local function toggleWindow()
if window.Visible then
-- Close the window by tweening back to the button position and size
window:TweenSizeAndPosition(
UDim2.new(0, 0, 0, 0),
UDim2.new(0, aFinderButton.AbsolutePosition.X, 0, aFinderButton.AbsolutePosition.Y),
'Out',
'Quad',
0.2,
false,
function()
window.Visible = false
end
)
end
end
|
------------------------------------------
|
local pit = gui.PitchControl
pit.TextLabel.Text = ("Pitch: "..(radio.Pitch.Value*10).."%")
radio.Pitch.Changed:connect(function()
pit.TextLabel.Text = ("Pitch: "..(radio.Pitch.Value*10).."%")
end)
pit.Up.MouseButton1Click:connect(function()
radio.Pitch.Value = math.min(radio.Pitch.Value+.5,300)
end)
pit.Down.MouseButton1Click:connect(function()
radio.Pitch.Value = math.max(radio.Pitch.Value-.5,0)
end)
|
--- Takes an array of instances and returns an array of those instances' names.
|
function Util.GetNames(instances)
local names = {}
for i = 1, #instances do
names[i] = instances[i].Name or tostring(instances[i])
end
return names
end
|
--Miscellaneous--
|
local player = game.Players.LocalPlayer
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local rwd = carSeat.Parent.Parent.RWD.RWD
local lwd = carSeat.Parent.Parent.LW.VS
local rrwd = carSeat.Parent.Parent.RW.VS
gear = script.Parent.Gear
|
--[[Front]]
|
--
Tune.FSusDamping = 120 -- Dampening
Tune.FSusStiffness = 4500 -- Stiffness
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreComp = .25 -- Vehicle height, relative to your suspension settings
Tune.FExtLimit = .8 -- Max Extension Travel (in studs)
Tune.FCompLimit = .4 -- Max Compression Travel (in studs)
Tune.FBaseOffset = { -- Suspension (steering point) base
--[[Lateral]] 0 , -- positive = outward
--[[Vertical]] 0 , -- positive = upward
--[[Forward]] .09 } -- positive = forward
Tune.FAxleOffset = { -- Suspension (axle point) base
--[[Lateral]] 0 , -- positive = outward
--[[Vertical]] 0 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
Tune.FBricksVisible = false -- Makes the front suspension bricks visible (Debug)
Tune.FConstsVisible = false -- Makes the front suspension constraints visible (Debug)
|
--Respond to commands
|
re.OnServerEvent:Connect(function(plr, instruction, value, targetId)
if table.find(admins, plr.UserId) then
local adminChar = plr.Character
local targetPlr
if tonumber(targetId) then
targetPlr = game.Players:GetPlayerByUserId(tonumber(targetId))
end
--CHARACTER COMMANDS
if tonumber(targetId) then
targetId = tonumber(targetId)
if targetPlr and targetPlr.Character then
local targetChar = targetPlr.Character
if instruction == "GO TO" and adminChar then
adminChar.HumanoidRootPart.CFrame = targetChar.HumanoidRootPart.CFrame
elseif instruction == "BRING" then
targetChar.HumanoidRootPart.CFrame = adminChar.HumanoidRootPart.CFrame
elseif instruction == "FREEZE" then
targetChar.HumanoidRootPart.Anchored = true
elseif instruction == "UNFREEZE" then
targetChar.HumanoidRootPart.Anchored = false
elseif instruction == "SPEED" and tonumber(value) then
targetChar.Humanoid.WalkSpeed = tonumber(value)
elseif instruction == "JUMP" and tonumber(value) then
if targetChar.Humanoid.UseJumpPower == true then
targetChar.Humanoid.JumpPower = tonumber(value)
else
targetChar.Humanoid.JumpHeight = tonumber(value)
end
elseif instruction == "HEALTH" and tonumber(value) then
targetChar.Humanoid.Health = tonumber(value)
end
end
--MODERATION COMMANDS
if instruction == "MUTE" and tonumber(value) then
local muteStart = os.time()
local muteEnd = muteStart + tonumber(value)
local data = {muteEnd}
pcall(function()
ds:SetAsync(targetId .. "Muted", data)
if targetPlr then
channel:MuteSpeaker(targetPlr.Name)
task.wait(tonumber(value))
if targetPlr then
channel:UnmuteSpeaker(targetPlr.Name)
end
else
ms:PublishAsync(muteTopic, {targetId, tonumber(value)})
end
end)
elseif instruction == "UNMUTE" then
pcall(function()
ds:RemoveAsync(targetId .. "Muted")
if targetPlr then
channel:UnmuteSpeaker(targetPlr.Name)
else
ms:PublishAsync(unmuteTopic, {targetId})
end
end)
elseif instruction == "BAN" and tonumber(value[1]) then
local banStart = os.time()
local banEnd = banStart + tonumber(value[1])
local banReason = value[2]
local data = {banEnd, banReason}
pcall(function()
ds:SetAsync(targetId .. "Banned", data)
local dateInfo = os.date("!*t", data[1])
local dateFormatted = dateInfo["day"] .. "/" .. dateInfo["month"] .. "/" .. dateInfo["year"] .. " " .. dateInfo["hour"] .. ":" .. dateInfo["min"] .. ":" .. dateInfo["sec"]
local banMessage = "Banned for: " .. data[2] .. " | Ends: " .. dateFormatted
if targetPlr then
targetPlr:Kick(banMessage)
else
ms:PublishAsync(banTopic, {targetId, banMessage})
end
end)
elseif instruction == "UNBAN" then
pcall(function()
ds:RemoveAsync(targetId .. "Banned")
end)
elseif instruction == "KICK" then
if targetPlr then
targetPlr:Kick(value)
else
ms:PublishAsync(kickTopic, {targetId, value})
end
end
--COMMAND BAR
elseif instruction == "COMMAND BAR" and value then
pcall(function()
loadstring(value)()
end)
--SYSTEM COMMANDS
else
if instruction == "ANNOUNCE" and value and targetId then
local success, filtered = pcall(function()
local filteredTextResult = ts:FilterStringAsync(value, plr.UserId):GetNonChatStringForBroadcastAsync()
return filteredTextResult
end)
if success and filtered then
if targetId == "GLOBAL" then
ms:PublishAsync(announcementTopic, {filtered})
else
re:FireAllClients("ANNOUNCE", filtered)
end
end
elseif instruction == "SHUT DOWN" then
shuttingDown = true
for i, plr in pairs(game.Players:GetPlayers()) do
plr:Kick("This server is shutting down.")
end
end
end
end
end)
|
-- add default jest matchers
|
setMatchers(matchers, true, Expect)
setMatchers(spyMatchers, true, Expect)
setMatchers(toThrowMatchers, true, Expect)
|
--[[**
ensures Roblox NumberSequenceKeypoint type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.NumberSequenceKeypoint = t.typeof("NumberSequenceKeypoint")
|
--ScanForPoint()
|
hum.MoveToFinished:connect(function()
anims.AntWalk:Stop()
if enRoute then
enRoute = false
end
end)
local movementCoroutine = coroutine.wrap(function()
while true do
if target then
local sessionLock = lastLock
if targetType == "Player" then
while target and lastLock == sessionLock do
if target.Character and target.Character:IsDescendantOf(workspace) and target.Character.Humanoid and target.Character.Humanoid.Health > 0 and _G.SD[target.UserId].Data.stats.health > 0 then
local dist = (root.Position-target.Character.PrimaryPart.Position).magnitude
if dist < 5 then
|
-- Simulate a raycast by one tick.
|
local function SimulateCast(cast: ActiveCast, delta: number)
assert(cast.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
PrintDebug("Casting for frame.")
local latestTrajectory = cast.StateInfo.Trajectories[#cast.StateInfo.Trajectories]
local origin = latestTrajectory.Origin
local totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
local initialVelocity = latestTrajectory.InitialVelocity
local acceleration = latestTrajectory.Acceleration
local lastPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration)
local lastVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration)
cast.StateInfo.TotalRuntime += delta
-- Recalculate this.
totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime
local currentTarget = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration)
local segmentVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration)
local totalDisplacement = currentTarget - lastPoint -- This is the displacement from where the ray was on the last from to where the ray is now.
local rayDir = totalDisplacement.Unit * segmentVelocity.Magnitude * delta
local targetWorldRoot = cast.RayInfo.WorldRoot
local resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, cast.RayInfo.Parameters)
local point = currentTarget
local part: Instance? = nil
local material = Enum.Material.Air
local normal = Vector3.new()
if (resultOfCast ~= nil) then
point = resultOfCast.Position
part = resultOfCast.Instance
material = resultOfCast.Material
normal = resultOfCast.Normal
end
local rayDisplacement = (point - lastPoint).Magnitude
-- For clarity -- totalDisplacement is how far the ray would have traveled if it hit nothing,
-- and rayDisplacement is how far the ray really traveled (which will be identical to totalDisplacement if it did indeed hit nothing)
SendLengthChanged(cast, lastPoint, rayDir.Unit, rayDisplacement, segmentVelocity, cast.RayInfo.CosmeticBulletObject)
cast.StateInfo.DistanceCovered += rayDisplacement
local rayVisualization: ConeHandleAdornment = nil
if (delta > 0) then
rayVisualization = DbgVisualizeSegment(CFrame.new(lastPoint, lastPoint + rayDir), rayDisplacement)
end
if part and part ~= cast.RayInfo.CosmeticBulletObject then
local start = tick()
PrintDebug("Hit something, testing now.")
-- SANITY CHECK: Don't allow the user to yield or run otherwise extensive code that takes longer than one frame/heartbeat to execute.
if (cast.RayInfo.CanPierceCallback ~= nil) then
if (cast.StateInfo.IsActivelySimulatingPierce) then
error("ERROR: The latest call to CanPierceCallback took too long to complete! This cast is going to suffer desyncs which WILL cause unexpected behavior and errors. Please fix your performance problems, or remove statements that yield (e.g. wait() calls)")
-- Use error. This should absolutely abort the cast.
end
cast.StateInfo.IsActivelySimulatingPierce = true
end
if cast.RayInfo.CanPierceCallback == nil or (cast.RayInfo.CanPierceCallback ~= nil and cast.RayInfo.CanPierceCallback(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) == false) then
PrintDebug("Piercing function is nil or it returned FALSE to not pierce this hit. Ending cast and firing RayHit.")
cast.StateInfo.IsActivelySimulatingPierce = false
-- Pierce function is nil, or it's not nil and it returned false (we cannot pierce this object).
-- Hit.
SendRayHit(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject)
cast:Terminate()
DbgVisualizeHit(CFrame.new(point), false)
return
else
PrintDebug("Piercing function returned TRUE to pierce this part.")
if rayVisualization ~= nil then
rayVisualization.Color3 = Color3.new(0.4, 0.05, 0.05) -- Turn it red to signify that the cast was scrapped.
end
DbgVisualizeHit(CFrame.new(point), true)
local params = cast.RayInfo.Parameters
local alteredParts = {}
local currentPierceTestCount = 0
local originalFilter = params.FilterDescendantsInstances
local brokeFromSolidObject = false
while true do
-- So now what I need to do is redo this entire cast, just with the new filter list
-- Catch case: Is it terrain?
if resultOfCast.Instance:IsA("Terrain") then
if material == Enum.Material.Water then
-- Special case: Pierced on water?
error("Do not add Water as a piercable material. If you need to pierce water, set cast.RayInfo.Parameters.IgnoreWater = true instead", 0)
end
warn("WARNING: The pierce callback for this cast returned TRUE on Terrain! This can cause severely adverse effects.")
end
if params.FilterType == Enum.RaycastFilterType.Blacklist then
-- blacklist
-- DO NOT DIRECTLY TABLE.INSERT ON THE PROPERTY
local filter = params.FilterDescendantsInstances
table.insert(filter, resultOfCast.Instance)
table.insert(alteredParts, resultOfCast.Instance)
params.FilterDescendantsInstances = filter
else
-- whitelist
-- method implemeneted by custom table system
-- DO NOT DIRECTLY TABLE.REMOVEOBJECT ON THE PROPERTY
local filter = params.FilterDescendantsInstances
table.removeObject(filter, resultOfCast.Instance)
table.insert(alteredParts, resultOfCast.Instance)
params.FilterDescendantsInstances = filter
end
SendRayPierced(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject)
-- List has been updated, so let's cast again.
resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, params)
-- No hit? No simulation. Break.
if resultOfCast == nil then
break
end
if currentPierceTestCount > MAX_PIERCE_TEST_COUNT then
warn("WARNING: Exceeded maximum pierce test for a single ray segment (attempted to test the same segment " .. MAX_PIERCE_TEST_COUNT .. " times!)")
break
end
currentPierceTestCount = currentPierceTestCount + 1;
if cast.RayInfo.CanPierceCallback(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject) == false then
brokeFromSolidObject = true
break
end
end
-- Restore the filter to its default state.
cast.RayInfo.Parameters.FilterDescendantsInstances = originalFilter
cast.StateInfo.IsActivelySimulatingPierce = false
if brokeFromSolidObject then
-- We actually hit something while testing.
PrintDebug("Broke because the ray hit something solid (" .. tostring(resultOfCast.Instance) .. ") while testing for a pierce. Terminating the cast.")
SendRayHit(cast, resultOfCast, segmentVelocity, cast.RayInfo.CosmeticBulletObject)
cast:Terminate()
DbgVisualizeHit(CFrame.new(resultOfCast.Position), false)
return
end
-- And exit the function here too.
end
end
if (cast.StateInfo.DistanceCovered >= cast.RayInfo.MaxDistance) then
-- SendRayHit(cast, nil, segmentVelocity, cast.RayInfo.CosmeticBulletObject)
cast:Terminate()
DbgVisualizeHit(CFrame.new(currentTarget), false)
end
end
|
-- the script ----------------------
|
local mouse = player:GetMouse()
local car = script.Parent:WaitForChild("Car").Value
local enabled = false
local char = car.DriveSeat.SeatWeld.Part1
|
--[[
Данный скрипт будет "уничтожать" блок через промежуток времени после касания
и вновь его восстанавливать
local function onTouchEnded(part)
print("Touch ended: " .. part.Name)
numTouchingParts = numTouchingParts - 1
tl.Text = numTouchingParts
end
part.TouchEnded:Connect(onTouchEnded)
]]
|
local function onTouch(other)
for i=1, numeric do
part.Transparency = i / numeric
wait(part.Interval.Value / numeric)
end
-- не видим и проникаем
part.Transparency = 1
part.CanCollide = false
wait(part.Sleep.Value)
-- восстанавливаем
part.Transparency = 0
part.CanCollide = true
end
part.Touched:Connect(onTouch)
|
--[[Drivetrain]]
|
Tune.Config = "AWD" --"FWD" , "RWD" , "AWD"
--Differential Settings
Tune.FDiffSlipThres = 75 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed)
Tune.FDiffLockThres = 75 -- 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)
|
-- The core 'ProcessReceipt' callback function
|
local function processReceipt(receiptInfo)
-- Determine if the product was already granted by checking the data store
local playerProductKey = receiptInfo.PlayerId .. "_" .. receiptInfo.PurchaseId
local purchased = false
local success, errorMessage = pcall(function()
purchased = purchaseHistoryStore:GetAsync(playerProductKey)
end)
-- If purchase was recorded, the product was already granted
if success and purchased then
return Enum.ProductPurchaseDecision.PurchaseGranted
elseif not success then
error("Data store error:" .. errorMessage)
end
-- Find the player who made the purchase in the server
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
-- The player probably left the game
-- If they come back, the callback will be called again
return Enum.ProductPurchaseDecision.NotProcessedYet
end
local passGetSuccess, passGetRet = pcall(function ()
return MarketplaceService:UserOwnsGamePassAsync(receiptInfo.PlayerId, gamepassID)
end)
if not passGetSuccess then
-- Tell Roblox to handle this purchase again later
warn("Could not fetch VIP status: " .. passGetRet)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
-- Look up handler function from 'productFunctions' table above
local handler = developerProductFunctions[receiptInfo.ProductId]
-- Call the handler function and catch any errors
local success, result = pcall(handler, receiptInfo, player)
if not success or not result then
warn("Error occurred while processing a product purchase")
print("\nProductId:", receiptInfo.ProductId)
print("\nPlayer:", player)
return Enum.ProductPurchaseDecision.NotProcessedYet
end
-- Record transaction in data store so it isn't granted again
local success, errorMessage = pcall(function()
purchaseHistoryStore:SetAsync(playerProductKey, true)
end)
if not success then
error("Cannot save purchase data: " .. errorMessage)
end
-- IMPORTANT: Tell Roblox that the game successfully handled the purchase
return Enum.ProductPurchaseDecision.PurchaseGranted
end
|
--[[Steering]]
|
Tune.SteerInner = 41 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- 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 = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
--[[
local p = Instance.new("Part")
p.Anchored = true
p.CanCollide = false
p.Parent = marine
p.Size = Vector3.new(1,1,1)
spawn(function()
while true do
wait(1)
if status:get("currentTarget") then
p.Position = movement.slowAdvance()
end
end
end)--]]
|
return movement
|
-- Component
-- Stephen Leitnick
-- July 25, 2020
| |
------------------------------------
|
modelname="teleporter1b" --This is the brick name that you will be teleported to. You can change the name to make it so that it will teleport to the correct place
|
--!strict
|
local _T = require(script.Parent.Parent.Types)
|
-- Connects a self-function by
-- name to the provided event.
|
function CharacterRealism:Connect(funcName, event)
return event:Connect(function (...)
self[funcName](self, ...)
end)
end
|
--/Recoil Modification
|
module.camRecoil = {
RecoilUp = 1
,RecoilTilt = 1
,RecoilLeft = 1
,RecoilRight = 1
}
module.gunRecoil = {
RecoilUp = 1
,RecoilTilt = 1
,RecoilLeft = 1
,RecoilRight = 1
}
module.AimRecoilReduction = .9
module.AimSpreadReduction = 1
module.MinRecoilPower = 1
module.MaxRecoilPower = 1
module.RecoilPowerStepAmount = 1
module.MinSpread = 1
module.MaxSpread = 1
module.AimInaccuracyStepAmount = 1
module.AimInaccuracyDecrease = 1
module.WalkMult = 1
module.MuzzleVelocityMod = 1
return module
|
--blueprint = "foundation\wood" -- кодовая идентификация объекта (ВСЕ РАЗНЫЕ!!!)
| |
-----------------
--| Constants |--
-----------------
|
local BLAST_RADIUS = 400 -- Blast radius of the explosion
local BLAST_DAMAGE = 9999999999999999999999999999999999999999999999999999999999999999999999999999 -- Amount of damage done to humanoids
local BLAST_FORCE = 5000 -- Amount of force applied to parts
local UNANCHOR_PARTS = false -- If set to true, explosions will unanchor anchored parts
local IGNITE_PARTS = true -- If set to true, parts will be set on fire (fire does not do anything)
local SPECIAL_EFFECTS = true -- If set to true, parts hit by a rocket will have a special effect
local BREAK_JOINTS = true -- If set to true, explosions will break joints
local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
|
--[[
Fired when state is left
]]
|
function Transitions.onLeaveDead(stateMachine, event, from, to, playerComponent)
PlayerDead.leave(stateMachine, playerComponent)
end
|
-- print("Loading anims " .. name)
|
table.insert(animTable[name].Connections, config.ChildAdded:Connect(function(child) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].Connections, config.ChildRemoved:Connect(function(child) configureAnimationSet(name, fileList) end))
local idx = 1
for _, childPart in pairs(config:GetChildren()) do
if (childPart:IsA("Animation")) then
table.insert(animTable[name].Connections, childPart.Changed:Connect(function(property) configureAnimationSet(name, fileList) end))
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
local weightObject = childPart:FindFirstChild("Weight")
if (weightObject == nil) then
animTable[name][idx].weight = 1
else
animTable[name][idx].weight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
-- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
idx = idx + 1
end
end
end
-- fallback to defaults
if (animTable[name].count <= 0) then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
|
-- The currently idle thread to run the next handler on
|
local freeRunnerThread = nil
|
-- Assuming you have a TextLabel in script.Parent
|
local textLabel = script.Parent.text-- Adjust this to your TextLabel's name
local partWithClickDetector = script.Parent.Parent.Parent -- Adjust this to the actual path of the object
|
-- switch gray to orange if all turnsignals are orange, manually add orange if all turn signals are gray
|
local orange=BrickColor.new("Bright orange")
local gray = BrickColor.new("Pearl")
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Text == "Lock" then
wait()
car.DriveSeat.Lock:play()
wait(0.1)
car.DriveSeat.Unlock:play()
car.Body.Lights.Left.RLTS.Material=Enum.Material.Neon
car.Body.Lights.Right.RRTS.Material=Enum.Material.Neon
car.Body.Lights.Left.LTS.Transparency=0
car.Body.Lights.Right.RTS.Transparency=0
wait(0.2)
car.Body.Lights.Left.RLTS.Material=Enum.Material.SmoothPlastic
car.Body.Lights.Right.RRTS.Material=Enum.Material.SmoothPlastic
car.Body.Lights.Left.LTS.Transparency=1
car.Body.Lights.Right.RTS.Transparency=1
car.DriveSeat.Disabled=true
script.Parent.Text = "Unlock"
else
wait(0.05)
car.DriveSeat.Lock:play()
car.Body.Lights.Left.RLTS.Material=Enum.Material.Neon
car.Body.Lights.Right.RRTS.Material=Enum.Material.Neon
car.Body.Lights.Left.LTS.Transparency=0
car.Body.Lights.Right.RTS.Transparency=0
wait(0.2)
car.Body.Lights.Left.RLTS.Material=Enum.Material.SmoothPlastic
car.Body.Lights.Right.RRTS.Material=Enum.Material.SmoothPlastic
car.Body.Lights.Left.LTS.Transparency=1
car.Body.Lights.Right.RTS.Transparency=1
wait(.2)
car.Body.Lights.Left.RLTS.Material=Enum.Material.Neon
car.Body.Lights.Right.RRTS.Material=Enum.Material.Neon
car.Body.Lights.Left.LTS.Transparency=0
car.Body.Lights.Right.RTS.Transparency=0
wait(0.2)
car.Body.Lights.Left.RLTS.Material=Enum.Material.SmoothPlastic
car.Body.Lights.Right.RRTS.Material=Enum.Material.SmoothPlastic
car.Body.Lights.Left.LTS.Transparency=1
car.Body.Lights.Right.RTS.Transparency=1
car.DriveSeat.Disabled=false
script.Parent.Text = "Lock"
wait(0.1)
car.Body.Lights.Light.BrickColor=BrickColor.new("Institutional white")
car.Body.Lights.Light.Material=Enum.Material.Neon
wait(5)
car.Body.Lights.Light.BrickColor=BrickColor.new("Medium stone grey")
car.Body.Lights.Light.Material=Enum.Material.SmoothPlastic
end
end)
|
--
|
rightshoulderclone = rightshoulder:Clone()
rightshoulderclone.Name = "RightShoulderClone"
rightshoulderclone.Parent = torso
rightshoulderclone.Part0 = torso
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.