prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--[[ ___ _______ _ _______ / _ |____/ ___/ / ___ ____ ___ (_)__ /__ __/ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< / / /_/ |_| \___/_//_/\_,_/___/___/_/___/ /_/ SecondLogic @ Inspare Avxnturador @ Novena ]]
local FE = workspace.FilteringEnabled local car = script.Parent.Car.Value local handler = car:WaitForChild("AC6_FE_Sounds") local _Tune = require(car["A-Chassis Tune"]) local BOVact = 0 local BOVact2 = 0
--script.Parent.VV.Velocity = script.Parent.VV.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.VVV.Velocity = script.Parent.VVV.CFrame.lookVector *script.Parent.Speed.Value script.Parent.W.Velocity = script.Parent.W.CFrame.lookVector *script.Parent.Speed.Value
--- DONT TOUCH ---
local UIS = game:GetService("UserInputService") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local Values = script.Parent.Parent:WaitForChild("Values") local car = script.Parent.Parent.Car.Value local DriveSeat = car:WaitForChild("DriveSeat") local Tune = require(car:WaitForChild("A-Chassis Tune")) local IsOn = Values.Parent:WaitForChild("IsOn") local LightEvent = car:WaitForChild("LightEvent") local LI = script.Values.Left local RI = script.Values.Right local H = script.Values.Hazard local RL = script.Values.RunningLights local HL = script.Values.Headlights local setup = false local current_seq_seg = 1 local flashing = false local parklightActive = false local drlActive = false local fogActive = false local popupsActive = false local gui_tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0) local indgui_tweeninfo = TweenInfo.new(Indicator_Flash_Rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0) function input(key, gameprocessed) if not gameprocessed then if key.KeyCode == Headlights then if HL.Value == 0 then HL.Value = 1 LightEvent:FireServer("Headlights", Low_Beam_Brightness, 0.2, 48, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) LightEvent:FireServer("RearLights", Rear_Light_Type, Rear_Light_Brightness, 0.2, Trunk_Lights) if fogActive then LightEvent:FireServer("FogLights", Fog_Light_Brightness, 0.02, Fog_Light_Type) TweenService:Create(script.Parent.FogLights, gui_tweeninfo, {ImageTransparency = 0}):Play() end TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, {ImageTransparency = 0}):Play() elseif HL.Value == 1 then HL.Value = 2 LightEvent:FireServer("Headlights", High_Beam_Brightness, 0.02, 60, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, {ImageTransparency = 1}):Play() TweenService:Create(script.Parent.HighBeams, gui_tweeninfo, {ImageTransparency = 0}):Play() elseif HL.Value == 2 then HL.Value = 0 LightEvent:FireServer("Headlights", 0, 1, 60, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) if not parklightActive then LightEvent:FireServer("RearLights", Rear_Light_Type, 0, 1, Trunk_Lights) end LightEvent:FireServer("FogLights", 0, 1, Fog_Light_Type) TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, {ImageTransparency = 1}):Play() TweenService:Create(script.Parent.HighBeams, gui_tweeninfo, {ImageTransparency = 1}):Play() TweenService:Create(script.Parent.FogLights, gui_tweeninfo, {ImageTransparency = 1}):Play() end if Plate_Lights then if HL.Value >= 1 then LightEvent:FireServer("PlateLights", true, Plate_Light_Type) else LightEvent:FireServer("PlateLights", false, Plate_Light_Type) end end elseif key.KeyCode == Popups then if Popups_Enabled then if popupsActive == false then LightEvent:FireServer("Popups", true, Popups_Enabled, Popup_Hinge_Angle) popupsActive = true else LightEvent:FireServer("Popups", false, Popups_Enabled, Popup_Hinge_Angle) popupsActive = false end end elseif key.KeyCode == RunningLights then if Running_Light_Location ~= "Custom DRL" then if not parklightActive then parklightActive = true TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, {ImageTransparency = 0}):Play() else parklightActive = false TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, {ImageTransparency = 1}):Play() end else if not drlActive then drlActive = true LightEvent:FireServer("CustomDRL", drlActive, CustomDRL_Type) TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, {ImageTransparency = 0}):Play() else drlActive = false LightEvent:FireServer("CustomDRL", drlActive, CustomDRL_Type) TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, {ImageTransparency = 1}):Play() end end if HL.Value == 0 then LightEvent:FireServer("Headlights", 0, 1, 60, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) if parklightActive or drlActive then LightEvent:FireServer("RearLights", Rear_Light_Type, Rear_Light_Brightness, 0.2, Trunk_Lights) elseif not parklightActive or drlActive then LightEvent:FireServer("RearLights", Rear_Light_Type, 0, 1, Trunk_Lights) end end elseif key.KeyCode == FogLights then if HL.Value > 0 then if not fogActive then LightEvent:FireServer("FogLights", Fog_Light_Brightness, 0.02, Fog_Light_Type) TweenService:Create(script.Parent.FogLights, gui_tweeninfo, {ImageTransparency = 0}):Play() fogActive = true else LightEvent:FireServer("FogLights", 0, 1, Fog_Light_Type) TweenService:Create(script.Parent.FogLights, gui_tweeninfo, {ImageTransparency = 1}):Play() fogActive = false end else if not fogActive then fogActive = true else fogActive = false end end elseif key.KeyCode == Flash then if not flashing then end elseif key.KeyCode == SignalLeft then if not LI.Value then LI.Value = true script.StackOn:Play() else LI.Value = false script.StackOff:Play() end elseif key.KeyCode == SignalRight then if not RI.Value then RI.Value = true script.StackOn:Play() else RI.Value = false script.StackOff:Play() end elseif key.KeyCode == Hazards then if not H.Value then H.Value = true else H.Value = false end end end end function autoLight() local dusk = {16, 18} local night = {18, 6.2} local timenow = game.Lighting:GetMinutesAfterMidnight() / 60 if timenow >= dusk[1] and timenow <= dusk[2] then HL.Value = 0 parklightActive = true LightEvent:FireServer("Headlights", Low_Beam_Brightness, 0.2, 48, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) LightEvent:FireServer("RearLights", Rear_Light_Type, Rear_Light_Brightness, 0.2, Trunk_Lights) TweenService:Create(script.Parent.ParkLights, gui_tweeninfo, {ImageTransparency = 0}):Play() elseif timenow > night[1] or (timenow >= 0 and timenow <= night[2]) then HL.Value = 1 LightEvent:FireServer("Headlights", Low_Beam_Brightness, 0.02, 48, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) LightEvent:FireServer("RearLights", Rear_Light_Type, Rear_Light_Brightness, 0.2, Trunk_Lights) TweenService:Create(script.Parent.LowBeams, gui_tweeninfo, {ImageTransparency = 0}):Play() else HL.Value = 0 LightEvent:FireServer("Headlights", 0, 1, 0, parklightActive, Popups_Enabled, Headlight_Type, HL.Value) LightEvent:FireServer("RearLights", Rear_Light_Type, 0, 1, Trunk_Lights) end end function brakes() if Values.Brake.Value > 0.01 then LightEvent:FireServer("BrakeLights", Rear_Light_Type, Brake_Light_Brightness, 0.02, Trunk_Lights) else LightEvent:FireServer("BrakeLights", Rear_Light_Type, 0, 1, Trunk_Lights) end end function reverse() if Values.Gear.Value == -1 then LightEvent:FireServer("Reverse", Reverse_Light_Type, Reverse_Light_Brightness, 0.02, Trunk_Lights) else LightEvent:FireServer("Reverse", Reverse_Light_Type, 0, 1, Trunk_Lights) end end function leavedriveseat() LightEvent:FireServer("IndsOnLeave", LI.Value, RI.Value, H.Value, Sequential_Indicators, Sequential_Segments, Indicator_Flash_Rate, Indicator_Type) end
--[=[ Mounts the instance to the props. This handles mounting children, and events. The contract is that the props table is turned into observables. Note the following. * Keys of strings are turned into properties * If this can be turned into an observable, it will be used to subscribe to this event * Otherwise, we assign directly * Keys of functions are invoked on the instance in question * `(instance, value) -> Observable * If this returns an observable (or can be turned into one), we subscribe the event immediately * Keys of numbers (array components) are treated as implicit children * If the key is [Blend.Children] then we invoke mountChildren on it. ```lua maid:GiveTask(Blend.mount(frame, { BackgroundTransparency = 1; -- All items named InventoryItem Blend.Find "InventoryItem" { -- Apply the following properties Blend.New "UIScale" { Scale = 0.5; }; }; })) ``` @param instance Instance @param props table @return Maid ]=]
function Blend.mount(instance, props) assert(typeof(instance) == "Instance", "Bad instance") local maid = Maid.new() local parent = nil local dependentObservables = {} for key, value in pairs(props) do if type(key) == "string" then if key == "Parent" then parent = value else local observable = Blend.toPropertyObservable(value) if observable then maid:GiveTask(observable:Subscribe(function(result) task.spawn(function() instance[key] = result end) end)) else task.spawn(function() instance[key] = value end) end end elseif type(key) == "function" then local observable = Blend.toEventObservable(key(instance, value)) if Observable.isObservable(observable) then table.insert(dependentObservables, {observable, value}) else warn(("Unable to apply event listener %q"):format(tostring(key))) end elseif type(key) == "number" then -- Treat this as an implicit children contract -- Thus, we don't need an explicit [Blend.Children] call. table.insert(dependentObservables, { Blend.Children(instance, value), value }) else warn(("Unable to apply property %q"):format(tostring(key))) end end -- Subscribe dependentObservables (which includes adding children) for _, event in pairs(dependentObservables) do maid:GiveTask(event[1]:Subscribe(Blend.toEventHandler(event[2]))) end if parent then local observable = Blend.toPropertyObservable(parent) if observable then maid:GiveTask(observable:Subscribe(function(result) instance.Parent = result end)) else instance.Parent = parent end end return maid end return Blend
--Unlock
pages.donor["AG Unlock"].Unlock.MouseButton1Down:Connect(function() main.marketplaceService:PromptGamePassPurchase(main.player, main.products.Donor) end)
--Automatic Gauge Scaling
if autoscaling then local Drive={} if _Tune.Config == "FWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("FL")~= nil then table.insert(Drive,car.Wheels.FL) end if car.Wheels:FindFirstChild("FR")~= nil then table.insert(Drive,car.Wheels.FR) end if car.Wheels:FindFirstChild("F")~= nil then table.insert(Drive,car.Wheels.F) end end if _Tune.Config == "RWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("RL")~= nil then table.insert(Drive,car.Wheels.RL) end if car.Wheels:FindFirstChild("RR")~= nil then table.insert(Drive,car.Wheels.RR) end if car.Wheels:FindFirstChild("R")~= nil then table.insert(Drive,car.Wheels.R) end end local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end Drive = nil for i,v in pairs(UNITS) do v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive) v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20) end end for i=0,revEnd*2 do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Tach ln.Rotation = 45 + i * 275 / (revEnd*2) ln.Num.Text = i/2 ln.Num.Rotation = -ln.Rotation if i*500>=math.floor(_pRPM/500)*500 then ln.Frame.BackgroundColor3 = Color3.new(1,0,0) if i<revEnd*2 then ln2 = ln:clone() ln2.Parent = script.Parent.Tach ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2) ln2.Num:Destroy() ln2.Visible=false end end if i%2==0 then ln.Frame.Size = UDim2.new(0,3,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) ln.Num.Visible = false else ln.Num:Destroy() end ln.Visible=false end local lns = Instance.new("Frame",script.Parent.Speedo) lns.Name = "lns" lns.BackgroundTransparency = 1 lns.BorderSizePixel = 0 lns.Size = UDim2.new(0,0,0,0) for i=1,90 do local ln = script.Parent.ln:clone() ln.Parent = lns ln.Rotation = 45 + 225*(i/90) if i%2==0 then ln.Frame.Size = UDim2.new(0,2,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) else ln.Frame.Size = UDim2.new(0,3,0,5) end ln.Num:Destroy() ln.Visible=true end for i,v in pairs(UNITS) do local lnn = Instance.new("Frame",script.Parent.Speedo) lnn.BackgroundTransparency = 1 lnn.BorderSizePixel = 0 lnn.Size = UDim2.new(0,0,0,0) lnn.Name = v.units if i~= 1 then lnn.Visible=false end for i=0,v.maxSpeed,v.spInc do local ln = script.Parent.ln:clone() ln.Parent = lnn ln.Rotation = 45 + 225*(i/v.maxSpeed) ln.Num.Text = i ln.Num.TextSize = 14 ln.Num.Rotation = -ln.Rotation ln.Frame:Destroy() ln.Num.Visible=true ln.Visible=true end end if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end script.Parent.Parent.IsOn.Changed:connect(function() if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end end) script.Parent.Parent.Values.RPM.Changed:connect(function() script.Parent.Tach.Needle.Rotation = 45 + 275 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000)) end) script.Parent.Parent.Values.Gear.Changed:connect(function() local gearText = script.Parent.Parent.Values.Gear.Value if gearText == 0 then gearText = "N" elseif gearText == -1 then gearText = "R" end script.Parent.Gear.Text = gearText end) script.Parent.Parent.Values.TCS.Changed:connect(function() if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCS.Value then script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0) script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0) if script.Parent.Parent.Values.TCSActive.Value then wait(2) script.Parent.TCS.Visible = not script.Parent.TCS.Visible else wait(2) script.Parent.TCS.Visible = false end else script.Parent.TCS.Visible = true script.Parent.TCS.TextColor3 = Color3.new(1,0,0) script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0) end else script.Parent.TCS.Visible = false end end) script.Parent.Parent.Values.TCSActive.Changed:connect(function() if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = true else wait() script.Parent.TCS.Visible = false end else script.Parent.TCS.Visible = false end end) script.Parent.TCS.Changed:connect(function() if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait() script.Parent.TCS.Visible = true end else if script.Parent.TCS.Visible then script.Parent.TCS.Visible = false end end end) script.Parent.Parent.Values.ABS.Changed:connect(function() if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABS.Value then script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0) script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0) if script.Parent.Parent.Values.ABSActive.Value then wait() script.Parent.ABS.Visible = not script.Parent.ABS.Visible else wait() script.Parent.ABS.Visible = false end else script.Parent.ABS.Visible = true script.Parent.ABS.TextColor3 = Color3.new(1,0,0) script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0) end else script.Parent.ABS.Visible = false end end) script.Parent.Parent.Values.ABSActive.Changed:connect(function() if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = not script.Parent.ABS.Visible elseif not script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = true else wait() script.Parent.ABS.Visible = false end else script.Parent.ABS.Visible = false end end) script.Parent.ABS.Changed:connect(function() if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = not script.Parent.ABS.Visible elseif not script.Parent.Parent.Values.ABS.Value then wait() script.Parent.ABS.Visible = true end else if script.Parent.ABS.Visible then script.Parent.ABS.Visible = false end end end) function PBrake() script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value end script.Parent.Parent.Values.PBrake.Changed:connect(PBrake) function Gear() if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then script.Parent.TMode.Text = "A/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0) elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then script.Parent.TMode.Text = "S/T" script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255) else script.Parent.TMode.Text = "M/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5) end end script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear) script.Parent.Parent.Values.Velocity.Changed:connect(function(property) script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed) script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) script.Parent.Speed.MouseButton1Click:connect(function() if currentUnits==#UNITS then currentUnits = 1 else currentUnits = currentUnits+1 end for i,v in pairs(script.Parent.Speedo:GetChildren()) do v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns" end script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) wait(0) Gear() PBrake()
-- elseif EntityData.All[equippedTool.name] and EntityData.All[equippedTool.name].netLevel then -- if targetPart.Parent:IsA("Model") and targetPart.Parent ~= workspace then -- if EntityData.All[targetPart.Parent.Name] and EntityData.All[targetPart.Parent.Name].netLevel <= EntityData.All[equippedTool.name].netLevel and --(targetPart.Position - player.Character.PrimaryPart.Position).magnitude <= 15 then -- GiveItemToPlayer(targetPart.Parent.Name, player) -- targetPart.Parent:Destroy() -- end -- end -- elseif equippedTool.Name == "" then -- insert here -- else -- if equippedTool doesn't match anything
--end end)
-- print("Wha " .. pose)
stopAllAnimations() amplitude = 0.1 frequency = 1 setAngles = true end --if (setAngles) then -- local desiredAngle = amplitude * math.sin(time * frequency) -- RightShoulder:SetDesiredAngle(desiredAngle + climbFudge) -- LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge) -- RightHip:SetDesiredAngle(-desiredAngle) -- LeftHip:SetDesiredAngle(-desiredAngle) --end -- Tool Animation handling local tool = getTool() if tool and tool:FindFirstChild("Handle") then local animStringValueObject = getToolAnim(tool) if animStringValueObject then toolAnim = animStringValueObject.Value -- message recieved, delete StringValue animStringValueObject.Parent = nil toolAnimTime = time + .3 end if time > toolAnimTime then toolAnimTime = 0 toolAnim = "None" end animateTool() else stopToolAnimations() toolAnim = "None" toolAnimInstance = nil toolAnimTime = 0 end end
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "k" then --Camera controls if cam == ("car") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Custom") cam = ("freeplr") Camera.FieldOfView = 70 elseif cam == ("freeplr") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Attach") cam = ("lockplr") Camera.FieldOfView = 45 elseif cam == ("lockplr") then Camera.CameraSubject = carSeat Camera.CameraType = ("Custom") cam = ("car") Camera.FieldOfView = 70 end elseif key == "u" then --Window controls if windows == false then winfob.Visible = true windows = true else windows = false winfob.Visible = false end elseif key == "[" then -- volume down if carSeat.Parent.MP.Volume.Value > 0 then carSeat.Parent.MP.Volume.Value = carSeat.Parent.MP.Volume.Value - 2 end elseif key == "]" then -- volume up if carSeat.Parent.MP.Volume.Value < 100 then carSeat.Parent.MP.Volume.Value = carSeat.Parent.MP.Volume.Value + 2 end end end) winfob.FL.Lock.MouseButton1Click:connect(function() --Window if carSeat.WindowFL.Value == false then carSeat.WindowFL.Value = true carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle - 0.20 else carSeat.WindowFL.Value = false carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FL.Window.SS.Motor.DesiredAngle + 0.20 end end) winfob.FR.Lock.MouseButton1Click:connect(function() --Window if carSeat.WindowFR.Value == false then carSeat.WindowFR.Value = true carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle + 0.20 else carSeat.WindowFR.Value = false carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.FR.Window.SS.Motor.DesiredAngle - 0.20 end end) winfob.RL.Lock.MouseButton1Click:connect(function() --Window if carSeat.WindowRL.Value == false then carSeat.WindowRL.Value = true carSeat.Parent.Misc.RL.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.RL.Window.SS.Motor.DesiredAngle - 0.20 else carSeat.WindowRL.Value = false carSeat.Parent.Misc.RL.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.RL.Window.SS.Motor.DesiredAngle + 0.20 end end) winfob.RR.Lock.MouseButton1Click:connect(function() --Window if carSeat.WindowRR.Value == false then carSeat.WindowRR.Value = true carSeat.Parent.Misc.RR.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.RR.Window.SS.Motor.DesiredAngle + 0.20 else carSeat.WindowRR.Value = false carSeat.Parent.Misc.RR.Window.SS.Motor.DesiredAngle = carSeat.Parent.Misc.RR.Window.SS.Motor.DesiredAngle - 0.20 end end) HUB.Limiter.MouseButton1Click:connect(function() --Ignition if carSeat.IsOn.Value == false then carSeat.IsOn.Value = true carSeat.Startup:Play() wait(1) else carSeat.IsOn.Value = false end end) TR.SN.MouseButton1Click:connect(function() --Show tracker names script.Parent.Names.Value = true end) TR.HN.MouseButton1Click:connect(function() --Hide tracker names script.Parent.Names.Value = false end) carSeat.Indicator.Changed:connect(function() if carSeat.Indicator.Value == true then script.Parent.Indicator:Play() else script.Parent.Indicator2:Play() end end) carSeat.LI.Changed:connect(function() if carSeat.LI.Value == true then carSeat.Parent.Body.Dash.DashSc.G.Left.Visible = true script.Parent.HUB.Left.Visible = true else carSeat.Parent.Body.Dash.DashSc.G.Left.Visible = false script.Parent.HUB.Left.Visible = false end end) carSeat.RI.Changed:connect(function() if carSeat.RI.Value == true then carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = true script.Parent.HUB.Right.Visible = true else carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = false script.Parent.HUB.Right.Visible = false end end) carSeat.Parent.MP.Volume.Changed:connect(function() INFO.Music.Volume.Text = (carSeat.Parent.MP.Volume.Value*10).."%" end) while wait() do carSeat.Parent.Body.Dash.DashSc.G.Time.Text = game.Lighting.TimeOfDay carSeat.Parent.Body.Dash.Scr.G.Time.Text = game.Lighting.TimeOfDay carSeat.Parent.Body.Dash.DashSc.G.Speed.Text = math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88))) if game.ReplicatedStorage:FindFirstChild("WeatherResources") ~= nil then carSeat.Parent.Body.Dash.Scr.G.Temperature.Text = game.ReplicatedStorage.WeatherResources.Weather.Current.Temperature.Value carSeat.Parent.Body.Dash.Scr.G.Weather.Text = game.ReplicatedStorage.WeatherResources.Weather.Current.Weather.Value elseif game.ReplicatedStorage:FindFirstChild("WeatherResources") == nil then carSeat.Parent.Body.Dash.Scr.G.Temperature.Text = ":(" carSeat.Parent.Body.Dash.Scr.G.Weather.Text = "TTP Plugin not found" end end
--[[Weight and CG]]
Tune.Weight = 5000 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 6 , --[[Height]] 3.5 , --[[Length]] 14 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members
-- Set whether BubbleChat is enabled
function GuiController:setBubbleChatEnabled(bubbleChatEnabled: boolean) Chat.BubbleChatEnabled = bubbleChatEnabled end
--outdoor ambieant
local var local amplitudeO = 90 local offsetO = 100
-- Teleport variables
local START_AREA = game.Workspace.StartSpawn local RIDE_PLATFORM = game.Workspace.Cart local activePlayers = {} local function equipTool(player, equip) local character = player.Character if character and character.Humanoid then local humanoid = character.Humanoid if equip then local weaponCopy = blasterWeapon:Clone() weaponCopy.Parent = player.Backpack humanoid:EquipTool(weaponCopy) else humanoid:UnequipTools() for _, item in ipairs(player.Backpack:GetChildren()) do if item.Name == "Blaster" then item:Destroy() end end end end end local function teleportPlayers(players, target, displayHUD) for i, player in ipairs(players) do -- Make sure the character exists and its HumanoidRootPart exists if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then -- Add an offset of 5 for each character player.Character.HumanoidRootPart.CFrame = target.CFrame + Vector3.new(0, i * 5, 0) ToggleRideHUD:FireClient(player, displayHUD) equipTool(player, displayHUD) end end end function PlayerManager:getNumberOfPlayers() return #activePlayers end function PlayerManager:displayEndScreen(whatStatus, transitionTime) for i, player in ipairs(activePlayers) do ClientEndGame:FireClient(player, whatStatus, transitionTime) end end function PlayerManager:addPlayerToGame(player) if not table.find(activePlayers, player) then table.insert(activePlayers, player) RideQueueUpdate:FireClient(player, "IN_QUEUE") end end function PlayerManager:movePlayersToGame() local target = RIDE_PLATFORM.PrimaryPart teleportPlayers(activePlayers, target, true) end function PlayerManager:removePlayersFromGame() local target = START_AREA teleportPlayers(activePlayers, target, false) activePlayers = {} end return PlayerManager
-- LIGHT SETTINGS --[[ LIGHT TYPES: - Halogen - LED ]]
-- local Low_Beam_Brightness = 2.25 local High_Beam_Brightness = 3.15 local Fog_Light_Brightness = 1.75 local Rear_Light_Brightness = 1.5 local Brake_Light_Brightness = 2.5 local Reverse_Light_Brightness = 1 local Headlight_Type = "Halogen" local Indicator_Type = "Halogen" local Fog_Light_Type = "Halogen" local Plate_Light_Type = "Halogen" local Rear_Light_Type = "Halogen" local Reverse_Light_Type = "Halogen" local Running_Light_Location = "Low Beam / Indicators" -- Where your running lights will luminate. ("Low Beam / Indicators" and "Low Beam". LED DRLS or any DRL in a differnet position go in the Running model, change the string to "Custom DRL") local Fade_Time = 0.35 -- How long it takes for the light to fully turn on. (works only with Halogen, default is 0.35 seconds) local Indicator_Flash_Rate = 0.3 -- Rate of change between each indicator state. (in seconds) local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups) local Auto_Lights = true -- Enables the automatic turning on or off of the lights based on the time of day. (Not Working Yet)
--local humanoid = hit.Parent:findFirstChild("Humanoid") -- if math.random(1,100)==1 and humanoid==nil then -- hit:BreakJoints() -- end
if hit.Name~=ball.Name and exploded==false then exploded=true local ballp=ball.Position explode() wait() ball:Destroy() if hit.Parent and hit.Parent:FindFirstChildWhichIsA("Humanoid") then hit.Parent.Humanoid:TakeDamage(math.random(12,16)) end --else -- local ricochetpart = Instance.new("Part") -- ricochetpart.Position = ballp -- ricochetpart.Anchored = true -- ricochetpart.CanCollide = false -- ricochetpart.Transparency = 1 -- ricochetpart.Size = Vector3.new(0.1,0.1,0.1) -- ricochetpart.Parent = workspace -- ricochetpart.Name = "ricochetpart" -- --local ricochetpartsound = ricochetsound:Clone() -- local ricochetpartsound = Instance.new("Sound") -- ricochetpartsound.SoundId = ("rbxassetid://3727467442") -- ricochetpartsound.Parent = ricochetpart -- ricochetpartsound:Play() -- game.Debris:AddItem(ricochetpart, 1) --end --explodebutdontdestroy() --explode()
--[[ Function called upon entering the state ]]
function PlayerPostGame.enter(stateMachine, playerComponent) end
--[[for x = 1, 50 do s.Pitch = s.Pitch + 0.01 s:play() wait(0.001) end]]
for x = 50, 135 do s:play() wait(0.001) end for x = 50, 150 do s.Pitch = s.Pitch - 0.0020 s:play() wait(0.001) end wait() end
--[[ Hi future me, I wonder how far you came since you edited this text. Treat urself with the 20 dollars under the monitor ur welcome --]]
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) return plrData.Classes.Base.Scholar.Obtained.Value ~= true end
-- Creates a new timer and keeps track of it's time in the timeLeft value
local gameTimer = Timer.new() local DisplayValues = ReplicatedStorage:FindFirstChild("DisplayValues") local TimeLeft = DisplayValues.TimeLeft
-- declarations
local Figure = script.Parent local Torso = waitForChild(Figure, "Torso") local RightShoulder = waitForChild(Torso, "Right Shoulder") local LeftShoulder = waitForChild(Torso, "Left Shoulder") local RightHip = waitForChild(Torso, "Right Hip") local LeftHip = waitForChild(Torso, "Left Hip") local Neck = waitForChild(Torso, "Neck") local Humanoid = nil -- Hack to Animate a Humanoid, no mateer what Humanoid is .Named. if true then local list = Figure:GetChildren() -- temp var. for x = 1, #list do local temp = list[x] if (temp.className == "Humanoid") then Humanoid = temp.Name end -- found Humanoid end -- Parts end -- Discard list local Humanoid = Figure[Humanoid]
--[[ This module contains the various actions a user can perform with Selfie Mode. Each of these actions is rendered as a button along the ActionBar. The `name` and `description` correspond to the text displayed in a tooltip when hovering the action. The `icon` is the default image for the button, and `activeIcon` is what is used when the action is in an "active" state ]]
local enums = require(script.enums) local types = require(script.types) export type Action = types.Action export type State = types.State return { -- Enums Action = enums.Action, -- Functions getAction = require(script.getAction), actionToggled = require(script.Actions.actionToggled), actionActivated = require(script.Actions.actionActivated), actionDeactivated = require(script.Actions.actionDeactivated), filterChanged = require(script.Actions.filterChanged), poseChanged = require(script.Actions.poseChanged), isActionActive = require(script.Selectors.isActionActive), getActiveSubAction = require(script.Selectors.getActiveSubAction), reducer = require(script.reducer), -- Action definitions actions = require(script.Definitions), }
--script:WaitForChild('FootstepSounds').Parent = sounds
local materials = script.Parent:WaitForChild('FootstepSounds') local plr = script.Parent repeat wait() until plr local char = plr local hum = char.Humanoid local hrp = hum.RootPart local walking hum.Running:connect(function(speed) if speed > hum.WalkSpeed/2 then walking = true else walking = false end end) function getMaterial() local material = script.Parent.Head.Footstep end local lastmat local debounce = false runtime.Heartbeat:connect(function() if walking and debounce == false then local material = getMaterial() if material ~= lastmat and lastmat ~= nil then materials[lastmat].Playing = false end local materialSound = materials[material]:Clone() materialSound.Playing = true lastmat = material debounce = true wait(1.5) debounce = false materialSound:Destroy() else for _,sound in pairs(materials:GetChildren()) do sound.Playing = false end end end)
--//Client Animations
IdleAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() -- require(script).FakeRightPos (For fake arms) | require(script).RightArmPos (For real arms) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).LeftPos}):Play() -- require(script).FakeLeftPos (For fake arms) | require(script).LeftArmPos (For real arms) end; StanceDown = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.3) end; StanceUp = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -1.85, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(.8,-0.6,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15))}):Play() wait(0.3) end; Patrol = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.75, -.9, -1.6) * CFrame.Angles(math.rad(-80), math.rad(-70), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.75,0.75,-1) * CFrame.Angles(math.rad(-90),math.rad(-45),math.rad(-25))}):Play() wait(0.3) end; SprintAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.3) end; EquipAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play() wait(0.1) objs[5].Handle:WaitForChild("AimUp"):Play() ts:Create(objs[2],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).RightPos}):Play() ts:Create(objs[3],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).LeftPos}):Play() wait(0.5) end; ZoomAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play() ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2, 0.21, 0)*CFrame.Angles(0, 0, math.rad(90))*CFrame.new(0.225, -0.75, 0)}):Play() wait(0.3) end; UnZoomAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play() ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new()}):Play() wait(0.3) end; ChamberAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.165, -1.5) * CFrame.Angles(math.rad(-115), math.rad(-10), math.rad(10))}):Play() ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(-0.15,0.05,-1.2) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play() wait(0.35) objs[5].Bolt:WaitForChild("SlidePull"):Play() ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(-0.15,-0.275,-1.175) * CFrame.Angles(math.rad(-120),math.rad(15),math.rad(15))}):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play() wait(0.3) objs[5].Bolt:WaitForChild("SlideRelease"):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() end; ChamberBKAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, -0.465, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.1,-0.15,-1.115) * CFrame.Angles(math.rad(-110),math.rad(25),math.rad(0))}):Play() wait(0.3) objs[5].Bolt:WaitForChild("SlideRelease"):Play() ts:Create(objs[3],TweenInfo.new(0.15),{C1 = CFrame.new(0.1,-0.15,-1.025) * CFrame.Angles(math.rad(-100),math.rad(30),math.rad(0))}):Play() ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play() wait(0.15) end; CheckAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(.35) local MagC = objs[5]:WaitForChild("Mag"):clone() objs[5].Mag.Transparency = 1 MagC.Parent = objs[5] MagC.Name = "MagC" MagC.Transparency = 0 local MagCW = Instance.new("Motor6D") MagCW.Part0 = MagC MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm") MagCW.Parent = MagC MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame) ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagOut"):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.15,0.475,-1.5) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(0))}):Play() wait(1.5) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() MagC:Destroy() objs[5].Mag.Transparency = 0 wait(0.3) end; ShellInsertAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-115), math.rad(-2), math.rad(9))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.55,-0.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() wait(0.3) objs[5].Handle:WaitForChild("ShellInsert"):Play() ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-110), math.rad(-2), math.rad(9))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.6,-0.3,-1.1) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() objs[6].Value = objs[6].Value - 1 objs[7].Value = objs[7].Value + 1 wait(0.3) end; ReloadAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-0.875, 0, -1.35) * CFrame.Angles(math.rad(-100), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play() objs[5].Mag.Transparency = 1 objs[5].Handle:WaitForChild("MagOut"):Play() local MagC = objs[5]:WaitForChild("Mag"):clone() MagC.Parent = objs[5] MagC.Name = "MagC" MagC.Transparency = 0 local MagCW = Instance.new("Motor6D") MagCW.Part0 = MagC MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm") MagCW.Parent = MagC MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame) ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(-0.2, 0.5, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))}):Play() wait(1.5) ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[2],TweenInfo.new(0.1),{C1 = CFrame.new(-0.875, 0, -1.125) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() MagC:Destroy() objs[5].Mag.Transparency = 0 if (objs[6].Value - (objs[8].Ammo - objs[7].Value)) < 0 then objs[7].Value = objs[7].Value + objs[6].Value objs[6].Value = 0 --Evt.Recarregar:FireServer(objs[5].Value) elseif objs[7].Value <= 0 then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) --Evt.Recarregar:FireServer(objs[5].Value) objs[7].Value = objs[8].Ammo objs[9] = false elseif objs[7].Value > 0 and objs[9] and objs[8].IncludeChamberedBullet then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) - 1 --objs[10].Recarregar:FireServer(objs[6].Value) objs[7].Value = objs[8].Ammo + 1 elseif objs[7].Value > 0 and objs[9] and not objs[8].IncludeChamberedBullet then objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) --Evt.Recarregar:FireServer(objs[5].Value) objs[7].Value = objs[8].Ammo end wait(0.55) end; GLReloadAnim = function(char, speed, objs) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0, -1.25) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.2,1.25,-1.9) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Launcher:WaitForChild("Launcher"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,-0.65) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() objs[5].Handle:WaitForChild("MagOut"):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,-0.6) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() wait(0.1) ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,-0.4) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() wait(0.1) ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,-0.75,-0.35) * CFrame.Angles(math.rad(30),math.rad(0),math.rad(0))}):Play() wait(0.1) ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,-1.50,-0.75) * CFrame.Angles(math.rad(60),math.rad(0),math.rad(0))}):Play() wait(0.1) ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,-2.50,-1.50) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(0))}):Play() wait(0.1) ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(-2,-2.50,2) * CFrame.Angles(math.rad(90),math.rad(0),math.rad(0))}):Play() wait(0.4) ts:Create(objs[2],TweenInfo.new(0.5),{C1 = CFrame.new(-0.875, 0, -1.35) * CFrame.Angles(math.rad(-100), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play() wait(0.9) ts:Create(objs[2],TweenInfo.new(0.4),{C1 = CFrame.new(-0.875, 0, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play() ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.2,0.9,-1.75) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.235,-0.215,-0.05) * CFrame.Angles(math.rad(15),math.rad(0),math.rad(0))}):Play() wait(0.45) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.2,0.9,-1.75) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2,-0.275,-0.0) * CFrame.Angles(math.rad(15),math.rad(0),math.rad(0))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.275,1.4,-1.75) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,-0.25) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.275,1.4,-1.95) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,-0.45) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() wait(0.3) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.275,1.4,-2.15) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,-0.65) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() wait(0.7) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.2,1.4,-1.75) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() wait(0.5) ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.2,0.95,-1.75) * CFrame.Angles(math.rad(-110),math.rad(0),math.rad(7.5))}):Play() ts:Create(objs[5].Launcher:WaitForChild("Launcher"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() ts:Create(objs[5].Shell:WaitForChild("Shell"),TweenInfo.new(0.3),{C1 = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))}):Play() objs[5].Handle:WaitForChild("MagIn"):Play() wait(0.65) end;
--[[ The Module ]]
-- local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController")) local Keyboard = setmetatable({}, BaseCharacterController) Keyboard.__index = Keyboard function Keyboard.new(CONTROL_ACTION_PRIORITY) local self = setmetatable(BaseCharacterController.new(), Keyboard) self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY self.textFocusReleasedConn = nil self.textFocusGainedConn = nil self.windowFocusReleasedConn = nil self.forwardValue = 0 self.backwardValue = 0 self.leftValue = 0 self.rightValue = 0 self.jumpEnabled = true return self end function Keyboard:Enable(enable) if not UserInputService.KeyboardEnabled then return false end if enable == self.enabled then -- Module is already in the state being requested. True is returned here since the module will be in the state -- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate -- no action was necessary. False indicates failure to be in requested/expected state. return true end self.forwardValue = 0 self.backwardValue = 0 self.leftValue = 0 self.rightValue = 0 self.moveVector = ZERO_VECTOR3 self.jumpRequested = false self:UpdateJump() if enable then self:BindContextActions() self:ConnectFocusEventListeners() else self:UnbindContextActions() self:DisconnectFocusEventListeners() end self.enabled = enable return true end function Keyboard:UpdateMovement(inputState) if inputState == Enum.UserInputState.Cancel then self.moveVector = ZERO_VECTOR3 else self.moveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue) end end function Keyboard:UpdateJump() self.isJumping = self.jumpRequested end function Keyboard:BindContextActions() -- Note: In the previous version of this code, the movement values were not zeroed-out on UserInputState. Cancel, now they are, -- which fixes them from getting stuck on. -- We return ContextActionResult.Pass here for legacy reasons. -- Many games rely on gameProcessedEvent being false on UserInputService.InputBegan for these control actions. local handleMoveForward = function(actionName, inputState, inputObject) self.forwardValue = (inputState == Enum.UserInputState.Begin) and -1 or 0 self:UpdateMovement(inputState) return Enum.ContextActionResult.Pass end local handleMoveBackward = function(actionName, inputState, inputObject) self.backwardValue = (inputState == Enum.UserInputState.Begin) and 1 or 0 self:UpdateMovement(inputState) return Enum.ContextActionResult.Pass end local handleMoveLeft = function(actionName, inputState, inputObject) self.leftValue = (inputState == Enum.UserInputState.Begin) and -1 or 0 self:UpdateMovement(inputState) return Enum.ContextActionResult.Pass end local handleMoveRight = function(actionName, inputState, inputObject) self.rightValue = (inputState == Enum.UserInputState.Begin) and 1 or 0 self:UpdateMovement(inputState) return Enum.ContextActionResult.Pass end local handleJumpAction = function(actionName, inputState, inputObject) self.jumpRequested = self.jumpEnabled and (inputState == Enum.UserInputState.Begin) self:UpdateJump() return Enum.ContextActionResult.Pass end -- TODO: Revert to KeyCode bindings so that in the future the abstraction layer from actual keys to -- movement direction is done in Lua ContextActionService:BindActionAtPriority("moveForwardAction", handleMoveForward, false, self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward) ContextActionService:BindActionAtPriority("moveBackwardAction", handleMoveBackward, false, self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward) ContextActionService:BindActionAtPriority("moveLeftAction", handleMoveLeft, false, self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft) ContextActionService:BindActionAtPriority("moveRightAction", handleMoveRight, false, self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight) ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false, self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump) end function Keyboard:UnbindContextActions() ContextActionService:UnbindAction("moveForwardAction") ContextActionService:UnbindAction("moveBackwardAction") ContextActionService:UnbindAction("moveLeftAction") ContextActionService:UnbindAction("moveRightAction") ContextActionService:UnbindAction("jumpAction") end function Keyboard:ConnectFocusEventListeners() local function onFocusReleased() self.moveVector = ZERO_VECTOR3 self.forwardValue = 0 self.backwardValue = 0 self.leftValue = 0 self.rightValue = 0 self.jumpRequested = false self:UpdateJump() end local function onTextFocusGained(textboxFocused) self.jumpRequested = false self:UpdateJump() end self.textFocusReleasedConn = UserInputService.TextBoxFocusReleased:Connect(onFocusReleased) self.textFocusGainedConn = UserInputService.TextBoxFocused:Connect(onTextFocusGained) self.windowFocusReleasedConn = UserInputService.WindowFocused:Connect(onFocusReleased) end function Keyboard:DisconnectFocusEventListeners() if self.textFocusReleasedCon then self.textFocusReleasedCon:Disconnect() self.textFocusReleasedCon = nil end if self.textFocusGainedConn then self.textFocusGainedConn:Disconnect() self.textFocusGainedConn = nil end if self.windowFocusReleasedConn then self.windowFocusReleasedConn:Disconnect() self.windowFocusReleasedConn = nil end end return Keyboard
-- Decompiled with the Synapse X Luau decompiler.
client = nil; service = nil; return function(p1) local v1 = client.UI.Make("Window", { Name = "CreateCard", Title = "Create Card", Size = { 400, 330 }, AllowMultiple = false, OnClose = function() end }); if v1 then v1:Add("TextLabel", { Text = "List Name: ", BackgroundTransparency = 1, Size = UDim2.new(0, 80, 0, 30), Position = UDim2.new(0, 10, 0, 10), TextXAlignment = "Right" }):Copy("TextLabel", { Text = "Card Name: ", Position = UDim2.new(0, 10, 0, 50) }):Copy("TextLabel", { Text = "Card Desc: ", Position = UDim2.new(0, 10, 0, 90) }); local v2 = v1:Add("TextBox", { Text = "", BackgroundTransparency = 0.5, Position = UDim2.new(0, 90, 0, 10), Size = UDim2.new(1, -100, 0, 30), BackgroundColor3 = v1.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.2), TextWrapped = true }); local v3 = { Text = "Create", Size = UDim2.new(0, 70, 0, 30), Position = UDim2.new(0, 10, 1, -40) }; local u1 = false; local u2 = v2:Copy("TextBox", { Position = UDim2.new(0, 90, 0, 50) }); local u3 = v2:Copy("TextBox", { Position = UDim2.new(0, 90, 0, 90), Size = UDim2.new(1, -100, 1, -100) }); function v3.OnClick() if not u1 then u1 = true; v1:Destroy(); client.Remote.Send("TrelloOperation", { Action = "MakeCard", List = v2.Text, Name = u2.Text, Desc = u3.Text }); end; end; local v4 = v1:Add("TextButton", v3); local l__gTable__5 = v1.gTable; v1:Ready(); end; end;
--[[ Returns the item prefab matching the given itemId and category, and errors if it doesn't exist. itemId must match the name of the item prefab. --]]
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ContainerByCategory = require(ReplicatedStorage.Source.SharedConstants.ContainerByCategory) local ItemCategory = require(ReplicatedStorage.Source.SharedConstants.ItemCategory)
--[[ Server Module --]]
local Settings = { --, not ; ? | server module!! BulletHoleTexture = 'http://www.roblox.com/asset/?id=64291961' ,Damage = {35, 45} ,OneHanded = false --DONT USE YET ,FakeArms = true ,FakeArmTransparency = 0 ,RightPos = CFrame.new(-1,0.7,0.45) * CFrame.Angles(math.rad(-90), 0, 0) ,LeftPos = CFrame.new(0.8,0.8,0.3) * CFrame.Angles(math.rad(-90), math.rad(45), 0) } return Settings
--script.Parent.SS.Velocity = script.Parent.SS.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.SSS.Velocity = script.Parent.SSS.CFrame.lookVector *script.Parent.Speed.Value script.Parent.T.Velocity = script.Parent.T.CFrame.lookVector *script.Parent.Speed.Value
-- Load tool completely
local Indicator = Tool:WaitForChild 'Loaded'; while not Indicator.Value do Indicator.Changed:Wait(); end;
--[[ Private Functions ]]
-- local function disableButton() JumpButton.Visible = false OnInputEnded() end local function enableButton() if Humanoid and ExternallyEnabled then if ExternallyEnabled then if Humanoid.JumpPower > 0 then JumpButton.Visible = true end end end end local function updateEnabled() if JumpPower > 0 and JumpStateEnabled then enableButton() else disableButton() end end local function humanoidChanged(prop) if prop == "JumpPower" then JumpPower = Humanoid.JumpPower updateEnabled() elseif prop == "Parent" then if not Humanoid.Parent then HumChangeConnection:disconnect() end end end local function humandoidStateEnabledChanged(state, isEnabled) if state == Enum.HumanoidStateType.Jumping then JumpStateEnabled = isEnabled updateEnabled() end end local function characterAdded(newCharacter) if HumChangeConnection then HumChangeConnection:disconnect() end -- rebind event to new Humanoid Humanoid = nil repeat Humanoid = MasterControl:GetHumanoid() wait() until Humanoid and Humanoid.Parent == newCharacter HumChangeConnection = Humanoid.Changed:connect(humanoidChanged) HumStateConnection = Humanoid.StateEnabledChanged:connect(humandoidStateEnabledChanged) JumpPower = Humanoid.JumpPower JumpStateEnabled = Humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping) updateEnabled() end local function setupCharacterAddedFunction() CharacterAddedConnection = LocalPlayer.CharacterAdded:connect(characterAdded) if LocalPlayer.Character then characterAdded(LocalPlayer.Character) end end
--[[Run]]
--Print Version local ver=require(car["A-Chassis Tune"].README) print("Novena: AC6T Loaded - Build "..ver) --Runtime Loops -- ~60 c/s game["Run Service"].Stepped:connect(function() --Steering Steering() --RPM RPM() --Suspension if not workspace:PGSIsEnabled() and _Tune.SusEnabled then Suspension() end --Power Engine() --Update External Values _IsOn = script.Parent.IsOn.Value _InControls = script.Parent.ControlsOpen.Value script.Parent.Values.Gear.Value = _CGear script.Parent.Values.RPM.Value = _RPM script.Parent.Values.Boost.Value = (_Boost/2)*_TPsi script.Parent.Values.Horsepower.Value = _HP script.Parent.Values.HpNatural.Value = _NH script.Parent.Values.HpBoosted.Value = _BH*(_Boost/2) script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM script.Parent.Values.TqNatural.Value = _NT script.Parent.Values.TqBoosted.Value = _BT*(_Boost/2) script.Parent.Values.TransmissionMode.Value = _TMode script.Parent.Values.Throttle.Value = _GThrot*_GThrotShift script.Parent.Values.Brake.Value = _GBrake script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100))) script.Parent.Values.SteerT.Value = _GSteerT script.Parent.Values.PBrake.Value = _PBrake script.Parent.Values.TCS.Value = _TCS script.Parent.Values.TCSActive.Value = _TCSActive script.Parent.Values.TCSAmt.Value = 1-_TCSAmt script.Parent.Values.ABS.Value = _ABS script.Parent.Values.ABSActive.Value = _ABSActive script.Parent.Values.MouseSteerOn.Value = _MSteer script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity end) --15 c/s while wait(.0667) do --Automatic Transmission if _TMode == "Auto" then Auto() end --Flip if _Tune.AutoFlip then Flip() end end
--local Oldtargpos = targpos
local OldPos = torsoPos * 2 local origin = CFrame.new(torsoPos) local Logic = 0 local OldX = 100 local OldZ = 0 local Xdir = 100 local Zdir = 0 local ClimbingLadder = false local FreeFalling = false local GraphicsOn = script.GraphicsToggle.Value -- Only set at start
--- water
workspace.Terrain.WaterTransparency = 1 workspace.Terrain.WaterReflectance = 0.2 sky = script.Sky sky.Parent = Lighting local Blur = Instance.new("BlurEffect") Blur.Parent = game.Lighting Blur.Size = 25 wait(0.1) Blur.Size = 24 wait(0.1) Blur.Size = 23 wait(0.1) Blur.Size = 22 wait(0.1) Blur.Size = 21 wait(0.1) Blur.Size = 20 wait(0.1) Blur.Size = 19 wait(0.1) Blur.Size = 18 wait(0.1) Blur.Size = 17 wait(0.1) Blur.Size = 16 wait(0.1) Blur.Size = 15 wait(0.1) Blur.Size = 14 wait(0.1) Blur.Size = 13 wait(0.1) Blur.Size = 12 wait(0.1) Blur.Size = 11 wait(0.1) Blur.Size = 10 wait(0.1) Blur.Size = 9 wait(0.1) Blur.Size = 8 wait(0.1) Blur.Size = 7 wait(0.1) Blur.Size = 6 wait(0.1) Blur.Size = 5 wait(0.1) Blur.Size = 4 wait(0.1) Blur.Size = 3 wait(0.1) Blur.Size = 2 wait(0.1) Blur.Size = 1 wait(0.1) Blur.Size = 0 print('Loading..Bloom') wait(2) print('Loading..Lens Flares') print("Done!") while wait(1) do for i,v in pairs(game.Players:GetPlayers()) do if v.PlayerGui:FindFirstChild("LensFlareGui") == nil then gui = script.LensFlareGui:Clone() gui.Parent = v.PlayerGui end end end
------------------------------------------------------------------------ -- prepares error message for display, for limits exceeded -- * used only in checklimit() ------------------------------------------------------------------------
function luaY:errorlimit(fs, limit, what) local msg = (fs.f.linedefined == 0) and string.format("main function has more than %d %s", limit, what) or string.format("function at line %d has more than %d %s", fs.f.linedefined, limit, what) luaX:lexerror(fs.ls, msg, 0) end
-- returns the angles needed to have the npc look at a target
local function lookAt(target) local eye = (hrp.CFrame * CFrame.new(0, 3, 0)):pointToObjectSpace(target).unit; local horizontal = -math.atan2(eye.x, -eye.z); local vertical = math.asin(eye.y); local goal = Vector3.new(); if not (math.abs(horizontal) > settings.horizontalRange or math.abs(vertical) > settings.verticalRange) then local hsign, habs = math.sign(horizontal), math.abs(horizontal); local hneck, hwaist = habs*0.5, habs*0.5; if (hwaist > settings.maxHorizontalWaist) then local remainder = hwaist - settings.maxHorizontalWaist; hwaist = settings.maxHorizontalWaist; hneck = math.clamp(hneck + remainder, 0, settings.maxHorizontalHead); end goal = Vector3.new(hsign*hneck, hsign*hwaist, vertical); end return goal; end
--[[ * Reduce the number of edits by eliminating semantically trivial equalities. * @param {Array.<Array.<number|string>>} diffs Array of diff tuples. --]]
local function diff_cleanupSemantic(diffs: Array<Diff>) local changes = false local equalities = {} -- Stack of indices where equalities are found. local equalitiesLength = 0 -- Keeping our own length var is faster. local lastEquality = nil -- Always equal to diffs[equalities[equalitiesLength]][2] local pointer = 1 -- Index of current position. -- Number of characters that changed prior to the equality. local length_insertions1 = 0 local length_deletions1 = 0 -- Number of characters that changed after the equality. local length_insertions2 = 0 local length_deletions2 = 0 while diffs[pointer] do if diffs[pointer][1] == DIFF_EQUAL then -- Equality found. equalitiesLength = equalitiesLength + 1 equalities[equalitiesLength] = pointer length_insertions1 = length_insertions2 length_deletions1 = length_deletions2 length_insertions2 = 0 length_deletions2 = 0 lastEquality = diffs[pointer][2] else -- An insertion or deletion. if diffs[pointer][1] == DIFF_INSERT then length_insertions2 = length_insertions2 + #diffs[pointer][2] else length_deletions2 = length_deletions2 + #diffs[pointer][2] end -- Eliminate an equality that is smaller or equal to the edits on both -- sides of it. if lastEquality and #lastEquality <= max(length_insertions1, length_deletions1) and #lastEquality <= max(length_insertions2, length_deletions2) then -- Duplicate record. tinsert(diffs, equalities[equalitiesLength], Diff.new(DIFF_DELETE, lastEquality)) -- Change second copy to insert. diffs[equalities[equalitiesLength] + 1][1] = DIFF_INSERT -- Throw away the equality we just deleted. equalitiesLength = equalitiesLength - 1 -- Throw away the previous equality (it needs to be reevaluated). equalitiesLength = equalitiesLength - 1 pointer = (equalitiesLength > 0) and equalities[equalitiesLength] or 0 length_insertions1, length_deletions1 = 0, 0 -- Reset the counters. length_insertions2, length_deletions2 = 0, 0 lastEquality = nil changes = true end end pointer = pointer + 1 end -- Normalize the diff. if changes then _diff_cleanupMerge(diffs) end _diff_cleanupSemanticLossless(diffs) -- Find any overlaps between deletions and insertions. -- e.g: <del>abcxxx</del><ins>xxxdef</ins> -- -> <del>abc</del>xxx<ins>def</ins> -- e.g: <del>xxxabc</del><ins>defxxx</ins> -- -> <ins>def</ins>xxx<del>abc</del> -- Only extract an overlap if it is as big as the edit ahead or behind it. pointer = 2 while diffs[pointer] do if diffs[pointer - 1][1] == DIFF_DELETE and diffs[pointer][1] == DIFF_INSERT then local deletion = diffs[pointer - 1][2] local insertion = diffs[pointer][2] local overlap_length1 = _diff_commonOverlap(deletion, insertion) local overlap_length2 = _diff_commonOverlap(insertion, deletion) if overlap_length1 >= overlap_length2 then if overlap_length1 >= #deletion / 2 or overlap_length1 >= #insertion / 2 then -- Overlap found. Insert an equality and trim the surrounding edits. tinsert(diffs, pointer, Diff.new(DIFF_EQUAL, strsub(insertion, 1, overlap_length1))) diffs[pointer - 1][2] = strsub(deletion, 1, #deletion - overlap_length1) diffs[pointer + 1][2] = strsub(insertion, overlap_length1 + 1) pointer = pointer + 1 end else if overlap_length2 >= #deletion / 2 or overlap_length2 >= #insertion / 2 then -- Reverse overlap found. -- Insert an equality and swap and trim the surrounding edits. tinsert(diffs, pointer, Diff.new(DIFF_EQUAL, strsub(deletion, 1, overlap_length2))) diffs[pointer - 1] = { DIFF_INSERT, strsub(insertion, 1, #insertion - overlap_length2) } diffs[pointer + 1] = { DIFF_DELETE, strsub(deletion, overlap_length2 + 1) } pointer = pointer + 1 end end pointer = pointer + 1 end pointer = pointer + 1 end end
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent local debounce = true local tool = game.ServerStorage.Snowball-- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage hitPart.Touched:Connect(function(hit) if debounce == true then if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:FindFirstChild(hit.Parent.Name) if plr then debounce = false hitPart.BrickColor = BrickColor.new("Bright red") tool:Clone().Parent = plr.Backpack wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again debounce = true hitPart.BrickColor = BrickColor.new("Bright green") end end end end)
--
script.Parent.Handle2.Hinge1.Transparency = 0 script.Parent.Handle2.Interactive1.Transparency = 0 script.Parent.Handle2.Part1.Transparency = 0
-- Ring5 descending
for l = 1,#lifts5 do if (lifts5[l].className == "Part") then lifts5[l].BodyPosition.position = Vector3.new((lifts5[l].BodyPosition.position.x),(lifts5[l].BodyPosition.position.y-8),(lifts5[l].BodyPosition.position.z)) end end wait(0.1) for p = 1,#parts5 do parts5[p].CanCollide = false end wait(0.1) wait(1) localdeb.Value = false foreigndeb.Value = false end end script.Parent.Touched:connect(onTouched)
--Physics and maintaining height--
core.spawn(function() while myHuman.Health > 0 do if engineRunning then flight.physics() flight.maintainHeight(desiredHeight,target) end wait() end end)
--!strict
local function slice(str: string, startIndexStr: string | number, lastIndexStr: (string | number)?): string local strLen, invalidBytePosition = utf8.len(str) assert(strLen ~= nil, ("string `%s` has an invalid byte at position %s"):format(str, tostring(invalidBytePosition))) local startIndex = tonumber(startIndexStr) assert(typeof(startIndex) == "number", "startIndexStr should be a number") if startIndex + strLen < 0 then -- then |start index| is greater than string length startIndex = 1 end if startIndex > strLen then return "" end -- if no last index length set, go to str length + 1 local lastIndex = strLen + 1 if lastIndexStr ~= nil then -- ROBLOX FIXME: add parseInt to encapsulate this logic and use it here local NaN = 0 / 0 lastIndex = tonumber(lastIndexStr) or NaN -- this works because 0 is truthy in Lua end assert(typeof(lastIndex) == "number", "lastIndexStr should convert to number") if lastIndex > strLen then lastIndex = strLen + 1 end local startIndexByte = utf8.offset(str, startIndex) -- get char length of charset retunred at offset local lastIndexByte = utf8.offset(str, lastIndex) - 1 return string.sub(str, startIndexByte, lastIndexByte) end return slice
--RangeWarned --* called when the server notifies that the client attempted --* to start a dialogue that was too far away (ConversationDistance).
function Interface.RangeWarned() end
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 3.06 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 2.04 , --[[ 3 ]] 1.38 , --[[ 4 ]] 1.03 , --[[ 5 ]] 0.81 , --[[ 6 ]] 0.64 , } Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- fn cst_flt_rdr(string src, int len, fn func) -- @len - Length of type for reader -- @func - Reader callback
local function cst_flt_rdr(len, func) return function(S) local flt = func(S.source, S.index) S.index = S.index + len return flt end end local function stm_instructions(S) local size = S:s_int() local code = {} for i = 1, size do local ins = S:s_ins() local op = bit.band(ins, 0x3F) local args = OPCODE_T[op] local mode = OPCODE_M[op] local data = {value = ins, op = OPCODE_RM[op], A = bit.band(bit.rshift(ins, 6), 0xFF)} if args == 'ABC' then data.B = bit.band(bit.rshift(ins, 23), 0x1FF) data.C = bit.band(bit.rshift(ins, 14), 0x1FF) data.is_KB = mode.b == 'OpArgK' and data.B > 0xFF -- post process optimization data.is_KC = mode.c == 'OpArgK' and data.C > 0xFF elseif args == 'ABx' then data.Bx = bit.band(bit.rshift(ins, 14), 0x3FFFF) data.is_K = mode.b == 'OpArgK' elseif args == 'AsBx' then data.sBx = bit.band(bit.rshift(ins, 14), 0x3FFFF) - 131071 end code[i] = data end return code end local function stm_constants(S) local size = S:s_int() local consts = {} for i = 1, size do local tt = stm_byte(S) local k if tt == 1 then k = stm_byte(S) ~= 0 elseif tt == 3 then k = S:s_num() elseif tt == 4 then k = stm_lstring(S) end consts[i] = k -- offset +1 during instruction decode end return consts end local function stm_subfuncs(S, src) local size = S:s_int() local sub = {} for i = 1, size do sub[i] = stm_lua_func(S, src) -- offset +1 in CLOSURE end return sub end local function stm_lineinfo(S) local size = S:s_int() local lines = {} for i = 1, size do lines[i] = S:s_int() end return lines end local function stm_locvars(S) local size = S:s_int() local locvars = {} for i = 1, size do locvars[i] = {varname = stm_lstring(S), startpc = S:s_int(), endpc = S:s_int()} end return locvars end local function stm_upvals(S) local size = S:s_int() local upvals = {} for i = 1, size do upvals[i] = stm_lstring(S) end return upvals end function stm_lua_func(S, psrc) local proto = {} local src = stm_lstring(S) or psrc -- source is propagated proto.source = src -- source name S:s_int() -- line defined S:s_int() -- last line defined proto.numupvals = stm_byte(S) -- num upvalues proto.numparams = stm_byte(S) -- num params stm_byte(S) -- vararg flag stm_byte(S) -- max stack size proto.code = stm_instructions(S) proto.const = stm_constants(S) proto.subs = stm_subfuncs(S, src) proto.lines = stm_lineinfo(S) stm_locvars(S) stm_upvals(S) -- post process optimization for _, v in ipairs(proto.code) do if v.is_K then v.const = proto.const[v.Bx + 1] -- offset for 1 based index else if v.is_KB then v.const_B = proto.const[v.B - 0xFF] end if v.is_KC then v.const_C = proto.const[v.C - 0xFF] end end end return proto end function stm_lua_bytecode(src) -- func reader local rdr_func -- header flags local little local size_int local size_szt local size_ins local size_num local flag_int -- stream object local stream = { -- data index = 1, source = src, } assert(stm_string(stream, 4) == '\27Lua', 'invalid Lua signature') assert(stm_byte(stream) == 0x51, 'invalid Lua version') assert(stm_byte(stream) == 0, 'invalid Lua format') little = stm_byte(stream) ~= 0 size_int = stm_byte(stream) size_szt = stm_byte(stream) size_ins = stm_byte(stream) size_num = stm_byte(stream) flag_int = stm_byte(stream) ~= 0 rdr_func = little and rd_int_le or rd_int_be stream.s_int = cst_int_rdr(size_int, rdr_func) stream.s_szt = cst_int_rdr(size_szt, rdr_func) stream.s_ins = cst_int_rdr(size_ins, rdr_func) if flag_int then stream.s_num = cst_int_rdr(size_num, rdr_func) elseif float_types[size_num] then stream.s_num = cst_flt_rdr(size_num, float_types[size_num][little and 'little' or 'big']) else error('unsupported float size') end return stm_lua_func(stream, '@virtual') end local function close_lua_upvalues(list, index) for i, uv in pairs(list) do if uv.index >= index then uv.value = uv.store[uv.index] -- store value uv.store = uv uv.index = 'value' -- self reference list[i] = nil end end end local function open_lua_upvalue(list, index, stack) local prev = list[index] if not prev then prev = {index = index, store = stack} list[index] = prev end return prev end local function wrap_lua_variadic(...) return select('#', ...), {...} end local function on_lua_error(exst, err) local src = exst.source local line = exst.lines[exst.pc - 1] local psrc, pline, pmsg = string.match(err or '', '^(.-):(%d+):%s+(.+)') local fmt = '%s:%i: [%s:%i] %s' line = line or '0' psrc = psrc or '?' pline = pline or '0' pmsg = pmsg or err or '' error(string.format(fmt, src, line, psrc, pline, pmsg), 0) end local function exec_lua_func(exst) -- localize for easy lookup local code = exst.code local subs = exst.subs local env = exst.env local upvs = exst.upvals local vargs = exst.varargs -- state variables local stktop = -1 local openupvs = {} local stack = exst.stack local pc = exst.pc while true do local inst = code[pc] local op = inst.op pc = pc + 1 if op < 18 then if op < 8 then if op < 3 then if op < 1 then --[[LOADNIL]] for i = inst.A, inst.B do stack[i] = nil end elseif op > 1 then --[[GETUPVAL]] local uv = upvs[inst.B] stack[inst.A] = uv.store[uv.index] else --[[ADD]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end stack[inst.A] = lhs + rhs end elseif op > 3 then if op < 6 then if op > 4 then --[[SELF]] local A = inst.A local B = inst.B local index if inst.is_KC then index = inst.const_C else index = stack[inst.C] end stack[A + 1] = stack[B] stack[A] = stack[B][index] else --[[GETGLOBAL]] stack[inst.A] = env[inst.const] end elseif op > 6 then --[[GETTABLE]] local index if inst.is_KC then index = inst.const_C else index = stack[inst.C] end stack[inst.A] = stack[inst.B][index] else --[[SUB]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end stack[inst.A] = lhs - rhs end else --[[MOVE]] stack[inst.A] = stack[inst.B] end elseif op > 8 then if op < 13 then if op < 10 then --[[SETGLOBAL]] env[inst.const] = stack[inst.A] elseif op > 10 then if op < 12 then --[[CALL]] local A = inst.A local B = inst.B local C = inst.C local params local sz_vals, l_vals if B == 0 then params = stktop - A else params = B - 1 end sz_vals, l_vals = wrap_lua_variadic(stack[A](unpack(stack, A + 1, A + params))) if C == 0 then stktop = A + sz_vals - 1 else sz_vals = C - 1 end for i = 1, sz_vals do stack[A + i - 1] = l_vals[i] end else --[[SETUPVAL]] local uv = upvs[inst.B] uv.store[uv.index] = stack[inst.A] end else --[[MUL]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end stack[inst.A] = lhs * rhs end elseif op > 13 then if op < 16 then if op > 14 then --[[TAILCALL]] local A = inst.A local B = inst.B local params if B == 0 then params = stktop - A else params = B - 1 end close_lua_upvalues(openupvs, 0) return wrap_lua_variadic(stack[A](unpack(stack, A + 1, A + params))) else --[[SETTABLE]] local index, value if inst.is_KB then index = inst.const_B else index = stack[inst.B] end if inst.is_KC then value = inst.const_C else value = stack[inst.C] end stack[inst.A][index] = value end elseif op > 16 then --[[NEWTABLE]] stack[inst.A] = {} else --[[DIV]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end stack[inst.A] = lhs / rhs end else --[[LOADK]] stack[inst.A] = inst.const end else --[[FORLOOP]] local A = inst.A local step = stack[A + 2] local index = stack[A] + step local limit = stack[A + 1] local loops if step == math.abs(step) then loops = index <= limit else loops = index >= limit end if loops then stack[inst.A] = index stack[inst.A + 3] = index pc = pc + inst.sBx end end elseif op > 18 then if op < 28 then if op < 23 then if op < 20 then --[[LEN]] stack[inst.A] = #stack[inst.B] elseif op > 20 then if op < 22 then --[[RETURN]] local A = inst.A local B = inst.B local vals = {} local size if B == 0 then size = stktop - A + 1 else size = B - 1 end for i = 1, size do vals[i] = stack[A + i - 1] end close_lua_upvalues(openupvs, 0) return size, vals else --[[CONCAT]] local str = stack[inst.B] for i = inst.B + 1, inst.C do str = str .. stack[i] end stack[inst.A] = str end else --[[MOD]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end stack[inst.A] = lhs % rhs end elseif op > 23 then if op < 26 then if op > 24 then --[[CLOSE]] close_lua_upvalues(openupvs, inst.A) else --[[EQ]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end if (lhs == rhs) == (inst.A ~= 0) then pc = pc + code[pc].sBx end pc = pc + 1 end elseif op > 26 then --[[LT]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end if (lhs < rhs) == (inst.A ~= 0) then pc = pc + code[pc].sBx end pc = pc + 1 else --[[POW]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end stack[inst.A] = lhs ^ rhs end else --[[LOADBOOL]] stack[inst.A] = inst.B ~= 0 if inst.C ~= 0 then pc = pc + 1 end end elseif op > 28 then if op < 33 then if op < 30 then --[[LE]] local lhs, rhs if inst.is_KB then lhs = inst.const_B else lhs = stack[inst.B] end if inst.is_KC then rhs = inst.const_C else rhs = stack[inst.C] end if (lhs <= rhs) == (inst.A ~= 0) then pc = pc + code[pc].sBx end pc = pc + 1 elseif op > 30 then if op < 32 then --[[CLOSURE]] local sub = subs[inst.Bx + 1] -- offset for 1 based index local nups = sub.numupvals local uvlist if nups ~= 0 then uvlist = {} for i = 1, nups do local pseudo = code[pc + i - 1] if pseudo.op == OPCODE_RM[0] then -- @MOVE uvlist[i - 1] = open_lua_upvalue(openupvs, pseudo.B, stack) elseif pseudo.op == OPCODE_RM[4] then -- @GETUPVAL uvlist[i - 1] = upvs[pseudo.B] end end pc = pc + nups end stack[inst.A] = wrap_lua_func(sub, env, uvlist) else --[[TESTSET]] local A = inst.A local B = inst.B if (not stack[B]) == (inst.C ~= 0) then pc = pc + 1 else stack[A] = stack[B] end end else --[[UNM]] stack[inst.A] = -stack[inst.B] end elseif op > 33 then if op < 36 then if op > 34 then --[[VARARG]] local A = inst.A local size = inst.B if size == 0 then size = vargs.size stktop = A + size - 1 end for i = 1, size do stack[A + i - 1] = vargs.list[i] end else --[[FORPREP]] local A = inst.A local init, limit, step init = assert(tonumber(stack[A]), '`for` initial value must be a number') limit = assert(tonumber(stack[A + 1]), '`for` limit must be a number') step = assert(tonumber(stack[A + 2]), '`for` step must be a number') stack[A] = init - step stack[A + 1] = limit stack[A + 2] = step pc = pc + inst.sBx end elseif op > 36 then --[[SETLIST]] local A = inst.A local C = inst.C local size = inst.B local tab = stack[A] local offset if size == 0 then size = stktop - A end if C == 0 then C = inst[pc].value pc = pc + 1 end offset = (C - 1) * FIELDS_PER_FLUSH for i = 1, size do tab[i + offset] = stack[A + i] end else --[[NOT]] stack[inst.A] = not stack[inst.B] end else --[[TEST]] if (not stack[inst.A]) == (inst.C ~= 0) then pc = pc + 1 end end else --[[TFORLOOP]] local A = inst.A local func = stack[A] local state = stack[A + 1] local index = stack[A + 2] local base = A + 3 local vals stack[base + 2] = index stack[base + 1] = state stack[base] = func vals = {func(state, index)} for i = 1, inst.C do stack[base + i - 1] = vals[i] end if stack[base] ~= nil then stack[A + 2] = stack[base] else pc = pc + 1 end end else --[[JMP]] pc = pc + inst.sBx end exst.pc = pc end end function wrap_lua_func(state, env, upvals) local st_code = state.code local st_subs = state.subs local st_lines = state.lines local st_source = state.source local st_numparams = state.numparams local function exec_wrap(...) local stack = {} local varargs = {} local sizevarg = 0 local sz_args, l_args = wrap_lua_variadic(...) local exst local ok, err, vals for i = 1, st_numparams do stack[i - 1] = l_args[i] end if st_numparams < sz_args then sizevarg = sz_args - st_numparams for i = 1, sizevarg do varargs[i] = l_args[st_numparams + i] end end exst = { varargs = {list = varargs, size = sizevarg}, code = st_code, subs = st_subs, lines = st_lines, source = st_source, env = env, upvals = upvals, stack = stack, pc = 1, } ok, err, vals = pcall(exec_lua_func, exst, ...) if ok then return unpack(vals, 1, err) else on_lua_error(exst, err) end return -- explicit "return nothing" end return exec_wrap end return function(BCode, Env) return wrap_lua_func(stm_lua_bytecode(BCode), Env or getfenv(0)) end
-- This function is only called on clients
function BulletWeapon:simulateProjectile(firingPlayer, fireInfo, projectileIdx, randomGenerator) local localPlayerInitiatedShot = self.player == Players.LocalPlayer -- Retrieve config values local bulletSpeed = self:getConfigValue("BulletSpeed", 1000) local maxDistance = self:getConfigValue("MaxDistance", 2000) local trailLength = self:getConfigValue("TrailLength", nil) local trailLengthFactor = self:getConfigValue("TrailLengthFactor", 1) local showEntireTrailUntilHit = self:getConfigValue("ShowEntireTrailUntilHit", false) local gravityFactor = self:getConfigValue("GravityFactor", 0) local minSpread = self:getConfigValue("MinSpread", 0) local maxSpread = self:getConfigValue("MaxSpread", 0) local shouldMovePart = self:getConfigValue("ShouldMovePart", false) local explodeOnImpact = self:getConfigValue("ExplodeOnImpact", false) local blastRadius = self:getConfigValue("BlastRadius", 8) -- Cheat the origin of the shot back if gun tip in wall/object if self.tipAttach ~= nil then local tipCFrame = self.tipAttach.WorldCFrame local tipPos = tipCFrame.Position local tipDir = tipCFrame.LookVector local amountToCheatBack = math.abs((self.instance:FindFirstChild("Handle").Position - tipPos):Dot(tipDir)) + 1 local gunRay = Ray.new(tipPos - tipDir.Unit * amountToCheatBack, tipDir.Unit * amountToCheatBack) local hitPart, hitPoint = Roblox.penetrateCast(gunRay, self:getIgnoreList(localPlayerInitiatedShot)) if hitPart and math.abs((tipPos - hitPoint).Magnitude) > 0 then fireInfo.origin = hitPoint - tipDir.Unit * 0.1 fireInfo.dir = tipDir.Unit end end local origin, dir = fireInfo.origin, fireInfo.dir dir = Roblox.applySpread(dir, randomGenerator, math.rad(minSpread), math.rad(maxSpread)) -- Initialize variables for visuals/particle effects local bulletEffect = self.bulletEffectTemplate:Clone() bulletEffect.CFrame = CFrame.new(origin, origin + dir) bulletEffect.Parent = workspace.CurrentCamera CollectionService:AddTag(bulletEffect, "WeaponsSystemIgnore") local leadingParticles = bulletEffect:FindFirstChild("LeadingParticles", true) local attachment0 = bulletEffect:FindFirstChild("Attachment0") local trailParticles = nil if attachment0 then trailParticles = attachment0:FindFirstChild("TrailParticles") end local hitAttach = bulletEffect:FindFirstChild("HitEffect") local hitParticles = bulletEffect:FindFirstChild("HitParticles", true) local numHitParticles = self:getConfigValue("NumHitParticles", 3) local hitSound = bulletEffect:FindFirstChild("HitSound", true) local flyingSound = bulletEffect:FindFirstChild("Flying", true) local muzzleFlashTime = self:getConfigValue("MuzzleFlashTime", 0.03) local muzzleFlashShown = false local beamThickness0 = self:getConfigValue("BeamWidth0", 1.5) local beamThickness1 = self:getConfigValue("BeamWidth1", 1.8) local beamFadeTime = self:getConfigValue("BeamFadeTime", nil) -- Enable beam trails for projectile local beam0 = bulletEffect:FindFirstChild("Beam0") if beam0 then beam0.Enabled = true end local beam1 = bulletEffect:FindFirstChild("Beam1") if beam1 then beam1.Enabled = true end -- Emit muzzle particles local muzzleParticles = bulletEffect:FindFirstChild("MuzzleParticles", true) local numMuzzleParticles = self:getConfigValue("NumMuzzleParticles", 50) if muzzleParticles then muzzleParticles.Parent.CFrame = CFrame.new(origin, origin + dir) local numSteps = 5 for _ = 1, numSteps do muzzleParticles.Parent.Velocity = Vector3.new(localRandom:NextNumber(-10, 10), localRandom:NextNumber(-10, 10), localRandom:NextNumber(-10, 10)) muzzleParticles:Emit(numMuzzleParticles / numSteps) end end -- Show muzzle flash if self.tipAttach and self.muzzleFlash0 and self.muzzleFlash1 and self.muzzleFlashBeam and projectileIdx == 1 then local minFlashRotation, maxFlashRotation = self:getConfigValue("MuzzleFlashRotation0", -math.pi), self:getConfigValue("MuzzleFlashRotation1", math.pi) local minFlashSize, maxFlashSize = self:getConfigValue("MuzzleFlashSize0", 1), self:getConfigValue("MuzzleFlashSize1", 1) local flashRotation = localRandom:NextNumber(minFlashRotation, maxFlashRotation) local flashSize = localRandom:NextNumber(minFlashSize, maxFlashSize) local baseCFrame = self.tipAttach.CFrame * CFrame.Angles(0, 0, flashRotation) self.muzzleFlash0.CFrame = baseCFrame * CFrame.new(flashSize * -0.5, 0, 0) * CFrame.Angles(0, math.pi, 0) self.muzzleFlash1.CFrame = baseCFrame * CFrame.new(flashSize * 0.5, 0, 0) * CFrame.Angles(0, math.pi, 0) self.muzzleFlashBeam.Enabled = true self.muzzleFlashBeam.Width0 = flashSize self.muzzleFlashBeam.Width1 = flashSize muzzleFlashShown = true end -- Play projectile flying sound if flyingSound then flyingSound:Play() end -- Enable trail particles if trailParticles then trailParticles.Enabled = true end -- Set up parabola for projectile path local parabola = Parabola.new() parabola:setPhysicsLaunch(origin, dir * bulletSpeed, nil, 35 * -gravityFactor) -- More samples for higher gravity since path will be more curved but raycasts can only be straight lines if gravityFactor > 0.66 then parabola:setNumSamples(3) elseif gravityFactor > 0.33 then parabola:setNumSamples(2) else parabola:setNumSamples(1) end -- Set up/initialize variables used in steppedCallback local stepConn = nil local pTravelDistance = 0 -- projected travel distance so far if projectile never stops local startTime = tick() local didHit = false local stoppedMotion = false local stoppedMotionAt = 0 local timeSinceStart = 0 local flyingVisualEffectsFinished = false -- true if all particle effects shown while projectile is flying are done local visualEffectsFinishTime = math.huge local visualEffectsLingerTime = 0 -- max time any visual effect needs to finish if beamFadeTime then visualEffectsLingerTime = beamFadeTime end local hitInfo = { sid = fireInfo.id, pid = projectileIdx, maxDist = maxDistance, part = nil, p = nil, n = nil, m = Enum.Material.Air, d = 1e9, } local steppedCallback = function(dt) local now = tick() timeSinceStart = now - startTime local travelDist = bulletSpeed * dt -- distance projectile has travelled since last frame trailLength = trailLength or travelDist * trailLengthFactor -- Note: the next three variables are all in terms of distance from starting point (which should be tip of current weapon) local projBack = pTravelDistance - trailLength -- furthest back part of projectile (including the trail effect, so will be the start of the trail effect if any) local projFront = pTravelDistance -- most forward part of projectile local maxDist = hitInfo.maxDist or 0 -- before it collides, this is the max distance the projectile can travel. After it collides, this is the hit point -- This will make trailing beams render from tip of gun to wherever projectile is until projectile is destroyed if showEntireTrailUntilHit then projBack = 0 end -- Validate projBack and projFront projBack = math.clamp(projBack, 0, maxDist) projFront = math.clamp(projFront, 0, maxDist) if not didHit then -- Check if bullet hit since last frame local castProjBack, castProjFront = projFront, projFront + travelDist parabola:setDomain(castProjBack, castProjFront) local hitPart, hitPoint, hitNormal, hitMaterial, hitT = parabola:findPart(self.ignoreList) if hitPart then didHit = true projFront = castProjBack + hitT * (castProjFront - castProjBack) -- set projFront to point along projectile arc where an object was hit parabola:setDomain(projBack, projFront) -- update parabola domain to match new projFront -- Update hitInfo hitInfo.part = hitPart hitInfo.p = hitPoint hitInfo.n = hitNormal hitInfo.m = hitMaterial hitInfo.d = (hitPoint - origin).Magnitude hitInfo.t = hitT hitInfo.maxDist = projFront -- since the projectile hit, maxDist is now the hitPoint instead of maxDistance -- Register hit on clients self:onHit(hitInfo) -- Notify the server that this projectile hit something from client that initiated the shot -- Show hit indicators on gui of client that shot projectile if localPlayerInitiatedShot then local hitInfoClone = {} for hitInfoKey, value in pairs(hitInfo) do hitInfoClone[hitInfoKey] = value end self.weaponsSystem.getRemoteEvent("WeaponHit"):FireServer(self.instance, hitInfoClone) end -- Deal with all effects that start/stop/change on hit -- Disable trail particles if trailParticles then trailParticles.Enabled = false end -- Stop bullet flying sound if flyingSound and flyingSound.IsPlaying then flyingSound:Stop() end -- Hide the actual projectile model if bulletEffect then bulletEffect.Transparency = 1 end -- Stop emitting leading particles if leadingParticles then leadingParticles.Rate = 0 visualEffectsLingerTime = math.max(visualEffectsLingerTime, leadingParticles.Lifetime.Max) end -- Show the explosion on clients for explosive projectiles if explodeOnImpact then local explosion = Instance.new("Explosion") explosion.Position = hitPoint + (hitNormal * 0.5) explosion.BlastRadius = blastRadius explosion.BlastPressure = 0 -- no blast pressure because the real explosion happens on server explosion.ExplosionType = Enum.ExplosionType.NoCraters explosion.DestroyJointRadiusPercent = 0 explosion.Visible = true if localPlayerInitiatedShot then -- Trigger hit indicators on client that initiated the shot if the explosion hit another player/humanoid explosion.Hit:Connect(function(explodedPart, hitDist) local humanoid = self.weaponsSystem.getHumanoid(explodedPart) if humanoid and explodedPart.Name == "UpperTorso" and humanoid:GetState() ~= Enum.HumanoidStateType.Dead and self.weaponsSystem.gui and explodedPart.Parent ~= self.player.Character and self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(humanoid), self.player) then self.weaponsSystem.gui:OnHitOtherPlayer(self:calculateDamage(hitInfo.d), humanoid) end end) end explosion.Parent = workspace end -- Make sure hitAttach is in correct position before showing hit effects if hitAttach and beam0 and beam0.Attachment1 then parabola:renderToBeam(beam0) hitAttach.CFrame = beam0.Attachment1.CFrame * CFrame.Angles(0, math.rad(90), 0) end -- Show hit particle effect local hitPartColor = hitPart and hitPart.Color or Color3.fromRGB(255, 255, 255) if hitPart and hitPart:IsA("Terrain") then hitPartColor = workspace.Terrain:GetMaterialColor(hitMaterial or Enum.Material.Sand) end if hitInfo.h and hitInfo.h:IsA("Humanoid") and hitParticles and numHitParticles > 0 and hitPart then -- Show particle effect for hitting a player/humanoid hitParticles.Color = ColorSequence.new(Color3.fromRGB(255, 255, 255)) hitParticles:Emit(numHitParticles) visualEffectsLingerTime = math.max(visualEffectsLingerTime, hitParticles.Lifetime.Max) elseif (not hitInfo.h or not hitInfo.h:IsA("Humanoid")) and hitParticles and numHitParticles > 0 then -- Show particle effect for hitting anything else if hitPart and self:getConfigValue("HitParticlesUsePartColor", true) then local existingSeq = hitParticles.Color local newKeypoints = {} for i, keypoint in pairs(existingSeq.Keypoints) do local newColor = keypoint.Value if newColor == Color3.fromRGB(255, 0, 255) then newColor = hitPartColor end newKeypoints[i] = ColorSequenceKeypoint.new(keypoint.Time, newColor) end hitParticles.Color = ColorSequence.new(newKeypoints) end hitParticles:Emit(numHitParticles) visualEffectsLingerTime = math.max(visualEffectsLingerTime, hitParticles.Lifetime.Max) end -- Play hit sound if hitSound then hitSound:Play() visualEffectsLingerTime = math.max(visualEffectsLingerTime, hitSound.TimeLength) end -- Manage/show decals, billboards, and models (such as an arrow) that appear where the projectile hit (only if the hit object was not a humanoid/player) local hitPointObjectSpace = hitPart.CFrame:pointToObjectSpace(hitPoint) local hitNormalObjectSpace = hitPart.CFrame:vectorToObjectSpace(hitNormal) if not NO_BULLET_DECALS and hitPart and not hitPart.Parent or not hitPart.Parent:FindFirstChildOfClass("Humanoid") and hitPointObjectSpace and hitNormalObjectSpace and self.hitMarkTemplate then -- Clone hitMark (this contains all the decals/billboards/models to show on the hit surface) local hitMark = self.hitMarkTemplate:Clone() hitMark.Parent = hitPart CollectionService:AddTag(hitMark, "WeaponsSystemIgnore") -- Move/align hitMark to the hit surface local incomingVec = parabola:sampleVelocity(1).Unit if self:getConfigValue("AlignHitMarkToNormal", true) then -- Make hitMark face straight out from surface where projectile hit (good for decals) local forward = hitNormalObjectSpace local up = incomingVec local right = -forward:Cross(up).Unit up = forward:Cross(right) local orientationCFrame = CFrame.fromMatrix(hitPointObjectSpace + hitNormalObjectSpace * 0.05, right, up, -forward) hitMark.CFrame = hitPart.CFrame:toWorldSpace(orientationCFrame) else -- Make hitmark appear stuck in the hit surface from the direction the projectile came from (good for things like arrows) hitMark.CFrame = hitPart.CFrame * CFrame.new(hitPointObjectSpace, hitPointObjectSpace + hitPart.CFrame:vectorToObjectSpace(incomingVec)) end -- Weld hitMark to the hitPart local weld = Instance.new("WeldConstraint") weld.Part0 = hitMark weld.Part1 = hitPart weld.Parent = hitMark -- Fade glow decal over time local glowDecal = hitMark:FindFirstChild("Glow") if glowDecal then coroutine.wrap(function() local heartbeat = RunService.Heartbeat for i = 0, 1, 1/60 do heartbeat:Wait() glowDecal.Transparency = (i ^ 2) end end)() end -- Set bullethole decal color and fade over time local bulletHole = hitMark:FindFirstChild("BulletHole") if bulletHole then bulletHole.Color3 = hitPartColor TweenService:Create( bulletHole, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false, 4), { Transparency = 1 } ):Play() end -- Fade impact billboard's size and transparency over time local impactBillboard = hitMark:FindFirstChild("ImpactBillboard") if impactBillboard then local impact = impactBillboard:FindFirstChild("Impact") local impactTween = TweenService:Create( impact, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), { Size = UDim2.new(1, 0, 1, 0) } ) impactTween.Completed:Connect(function() TweenService:Create( impact, TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), { Size = UDim2.new(0.5, 0, 0.5, 0), ImageTransparency = 1 } ):Play() end) impactTween:Play() end -- Destroy hitMark in 5 seconds Debris:AddItem(hitMark, 5) end flyingVisualEffectsFinished = true visualEffectsFinishTime = now + visualEffectsLingerTime end end -- Will enter this if-statement if projectile hit something or maxDistance has been reached if projFront >= maxDist then if not stoppedMotion then stoppedMotion = true stoppedMotionAt = now end -- Stop particle effects if projectile didn't hit anything and projBack has reached the end if projBack >= maxDist and not flyingVisualEffectsFinished then flyingVisualEffectsFinished = true visualEffectsFinishTime = now + visualEffectsLingerTime end end -- Update parabola domain parabola:setDomain(projBack, projFront) -- Continue updating pTravelDistance until projBack has reached maxDist (this helps with some visual effects) if projBack < maxDist then pTravelDistance = math.max(0, timeSinceStart * bulletSpeed) end -- Update visual effects each frame -- Update CFrame/velocity of projectile if the projectile uses a model (such as rocket or grenade) if shouldMovePart then local bulletPos = parabola:samplePoint(1) local bulletVelocity = parabola:sampleVelocity(1) bulletEffect.CFrame = CFrame.new(bulletPos, bulletPos + bulletVelocity) bulletEffect.Velocity = bulletVelocity.Unit * bulletSpeed end -- Update thickness and render trailing beams local thickness0 = beamThickness0 local thickness1 = beamThickness1 if beamFadeTime then -- Fade out trail beams if projectile is no longer moving (hit something or reached max distance) local timeSinceEnd = stoppedMotion and (now - stoppedMotionAt) or 0 local fadeAlpha = math.clamp(timeSinceEnd / beamFadeTime, 0, 1) thickness0 = thickness0 * (1 - fadeAlpha) thickness1 = thickness1 * (1 - fadeAlpha) end if beam0 then beam0.Width0 = thickness0 beam0.Width1 = thickness1 parabola:renderToBeam(beam0) end if beam1 then beam1.Width0 = thickness0 beam1.Width1 = thickness1 parabola:renderToBeam(beam1) end -- Disable muzzle flash after muzzleFlashTime seconds have passed if muzzleFlashShown and timeSinceStart > muzzleFlashTime and self.muzzleFlashBeam then self.muzzleFlashBeam.Enabled = false muzzleFlashShown = false end -- Destroy projectile and attached visual effects when visual effects are done showing or max bullet time has been reached local timeSinceParticleEffectsFinished = now - visualEffectsFinishTime if (flyingVisualEffectsFinished and timeSinceParticleEffectsFinished > 0) or timeSinceStart > MAX_BULLET_TIME then if bulletEffect then bulletEffect:Destroy() bulletEffect = nil end stepConn:Disconnect() end end stepConn = RunService.Heartbeat:Connect(steppedCallback) -- Get rid of charge on chargeable weapons if not IsServer and self.usesCharging then self.charge = math.clamp(self.charge - self:getConfigValue("FireDischarge", 1), 0, 1) end end function BulletWeapon:calculateDamage(travelDistance) local zeroDamageDistance = self:getConfigValue("ZeroDamageDistance", 10000) local fullDamageDistance = self:getConfigValue("FullDamageDistance", 1000) local distRange = zeroDamageDistance - fullDamageDistance local falloff = math.clamp(1 - (math.max(0, travelDistance - fullDamageDistance) / math.max(1, distRange)), 0, 1) return math.max(self:getConfigValue("HitDamage", 10) * falloff, 0) end function BulletWeapon:applyDamage(hitInfo) local damage = self:calculateDamage(hitInfo.d) if damage <= 0 then return end self.weaponsSystem.doDamage(hitInfo.h, damage, nil, self.player) end function BulletWeapon:onHit(hitInfo) local hitPoint = hitInfo.p local hitNormal = hitInfo.n local hitPart = hitInfo.part if hitPart and hitPart.Parent then local humanoid = self.weaponsSystem.getHumanoid(hitPart) hitInfo.h = humanoid or hitPart if IsServer and (not hitInfo.h:IsA("Humanoid") or self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(hitInfo.h), self.player)) then self:applyDamage(hitInfo) elseif hitInfo.h:IsA("Humanoid") and hitInfo.h:GetState() ~= Enum.HumanoidStateType.Dead and self.weaponsSystem.gui and self.player == Players.LocalPlayer and self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(hitInfo.h), self.player) then -- Show hit indicators on gui of client that shot projectile if players are not on same team self.weaponsSystem.gui:OnHitOtherPlayer(self:calculateDamage(hitInfo.d), hitInfo.h) end end -- Create invisible explosion on server that deals damage to anything caught in the explosion if IsServer and self:getConfigValue("ExplodeOnImpact", false) then local blastRadius = self:getConfigValue("BlastRadius", 8) local blastPressure = self:getConfigValue("BlastPressure", 10000) local blastDamage = self:getConfigValue("BlastDamage", 100) local explosion = Instance.new("Explosion") explosion.Position = hitPoint + (hitNormal * 0.5) explosion.BlastRadius = blastRadius explosion.BlastPressure = blastPressure explosion.ExplosionType = Enum.ExplosionType.NoCraters explosion.DestroyJointRadiusPercent = 0 explosion.Visible = false explosion.Hit:Connect(function(explodedPart, hitDist) local damageMultiplier = (1 - math.clamp((hitDist / blastRadius), 0, 1)) local damageToDeal = blastDamage * damageMultiplier local humanoid = self.weaponsSystem.getHumanoid(explodedPart) if humanoid then if explodedPart.Name == "UpperTorso" and humanoid:GetState() ~= Enum.HumanoidStateType.Dead and self.weaponsSystem.playersOnDifferentTeams(self.weaponsSystem.getPlayerFromHumanoid(humanoid), self.player) then -- Do damage to players/humanoids self.weaponsSystem.doDamage(humanoid, damageToDeal, nil, self.player) end elseif not CollectionService:HasTag(explodedPart, "WeaponsSystemIgnore") then -- Do damage to a part (sends damage to breaking system) self.weaponsSystem.doDamage(explodedPart, damageToDeal, nil, self.player) end end) explosion.Parent = workspace end end function BulletWeapon:fire(origin, dir, charge) if not self:isCharged() then return end BaseWeapon.fire(self, origin, dir, charge) end function BulletWeapon:onFired(firingPlayer, fireInfo, fromNetwork) if not IsServer and firingPlayer == Players.LocalPlayer and fromNetwork then return end local cooldownTime = self:getConfigValue("ShotCooldown", 0.1) local fireMode = self:getConfigValue("FireMode", "Semiautomatic") local isSemiAuto = fireMode == "Semiautomatic" local isBurst = fireMode == "Burst" if isBurst and not self.burstFiring then self.burstIdx = 0 self.burstFiring = true elseif isSemiAuto then self.triggerDisconnected = true end -- Calculate cooldown time for burst firing if self.burstFiring then self.burstIdx = self.burstIdx + 1 if self.burstIdx >= self:getConfigValue("NumBurstShots", 3) then self.burstFiring = false self.triggerDisconnected = true else cooldownTime = self:getConfigValue("BurstShotCooldown", nil) or cooldownTime end end self.nextFireTime = tick() + cooldownTime BaseWeapon.onFired(self, firingPlayer, fireInfo, fromNetwork) end function BulletWeapon:onConfigValueChanged(valueName, newValue, oldValue) BaseWeapon.onConfigValueChanged(self, valueName, newValue, oldValue) if valueName == "ShotEffect" then self.bulletEffectTemplate = ShotsFolder:FindFirstChild(self:getConfigValue("ShotEffect", "Bullet")) if self.bulletEffectTemplate then local config = self.bulletEffectTemplate:FindFirstChildOfClass("Configuration") if config then self:importConfiguration(config) end local beam0 = self.bulletEffectTemplate:FindFirstChild("Beam0") if beam0 then coroutine.wrap(function() ContentProvider:PreloadAsync({ beam0 }) end)() end end elseif valueName == "HitMarkEffect" then self.hitMarkTemplate = HitMarksFolder:FindFirstChild(self:getConfigValue("HitMarkEffect", "BulletHole")) if self.hitMarkTemplate then local config = self.hitMarkTemplate:FindFirstChildOfClass("Configuration") if config then self:importConfiguration(config) end end elseif valueName == "CasingEffect" then self.casingTemplate = CasingsFolder:FindFirstChild(self:getConfigValue("CasingEffect", "")) if self.casingTemplate then local config = self.casingTemplate:FindFirstChildOfClass("Configuration") if config then self:importConfiguration(config) end end elseif valueName == "ChargeRate" then self.usesCharging = newValue ~= nil end end function BulletWeapon:onActivatedChanged() BaseWeapon.onActivatedChanged(self) if not IsServer then -- Reload if no ammo left in clip if self.equipped and self:getAmmoInWeapon() <= 0 then self:reload() return end -- Fire weapon if self.activated and self.player == localPlayer and self:canFire() and tick() > self.nextFireTime then self:doLocalFire() end -- Reenable trigger after activated changes to false if not self.activated and self.triggerDisconnected and not self.burstFiring then self.triggerDisconnected = false end end end function BulletWeapon:onRenderStepped(dt) BaseWeapon.onRenderStepped(self, dt) if not self.tipAttach then return end if not self.equipped then return end local tipCFrame = self.tipAttach.WorldCFrame if self.player == Players.LocalPlayer then -- Retrieve aim point from camera and update player's aim animation local aimTrack = self:getAnimTrack(self:getConfigValue("AimTrack", "RifleAim")) local aimZoomTrack = self:getAnimTrack(self:getConfigValue("AimZoomTrack", "RifleAimDownSights")) if aimTrack then local aimDir = tipCFrame.LookVector local gunLookRay = Ray.new(tipCFrame.p, aimDir * 500) local _, gunHitPoint = Roblox.penetrateCast(gunLookRay, self.ignoreList) if self.weaponsSystem.aimRayCallback then local _, hitPoint = Roblox.penetrateCast(self.weaponsSystem.aimRayCallback(), self.ignoreList) self.aimPoint = hitPoint else self.aimPoint = gunHitPoint end if not aimTrack.IsPlaying and not self.reloading then aimTrack:Play(0.15) coroutine.wrap(function() -- prevent player from firing until gun is fully out wait(self:getConfigValue("StartupTime", 0.2)) self.startupFinished = true end)() end if aimZoomTrack and not self.reloading then if not aimZoomTrack.IsPlaying then aimZoomTrack:Play(0.15) end aimZoomTrack:AdjustSpeed(0.001) if self.weaponsSystem.camera:isZoomed() then if aimTrack.WeightTarget ~= 0 then aimZoomTrack:AdjustWeight(1) aimTrack:AdjustWeight(0) end elseif aimTrack.WeightTarget ~= 1 then aimZoomTrack:AdjustWeight(0) aimTrack:AdjustWeight(1) end end local MIN_ANGLE = -80 local MAX_ANGLE = 80 local aimYAngle = math.deg(self.recoilIntensity) if self.weaponsSystem.camera.enabled then -- Gets pitch and recoil from camera to figure out how high/low to aim the gun aimYAngle = math.deg(self.weaponsSystem.camera:getRelativePitch() + self.weaponsSystem.camera.currentRecoil.Y + self.recoilIntensity) end local aimTimePos = 2 * ((aimYAngle - MIN_ANGLE) / (MAX_ANGLE - MIN_ANGLE)) aimTrack:AdjustSpeed(0.001) aimTrack.TimePosition = math.clamp(aimTimePos, 0.001, 1.97) if aimZoomTrack then aimZoomTrack.TimePosition = math.clamp(aimTimePos, 0.001, 1.97) end -- Update recoil (decay over time) local recoilDecay = self:getConfigValue("RecoilDecay", 0.825) self.recoilIntensity = math.clamp(self.recoilIntensity * recoilDecay, 0, math.huge) else warn("no aimTrack") end end end function BulletWeapon:setChargingParticles(charge) local ratePerCharge = self:getConfigValue("ChargingParticlesRatePerCharge", 20) local rate = ratePerCharge * charge for _, v in pairs(self.chargingParticles) do v.Rate = rate end end function BulletWeapon:onStepped(dt) if not self.tipAttach then return end if not self.equipped then return end BaseWeapon.onStepped(self, dt) local now = tick() local chargingSound = self:getSound("Charging") local dischargingSound = self:getSound("Discharging") if self.usesCharging then -- Update charge amount local chargeBefore = self.charge self:handleCharging(dt) local chargeDelta = self.charge - chargeBefore -- Update charge particles if chargeDelta > 0 then self:setChargingParticles(self.charge) else self:setChargingParticles(0) end -- Play charging sounds if chargingSound then if chargingSound.Looped then if chargeDelta < 0 then chargingSound:Stop() else if not chargingSound.Playing and self.charge < 1 and chargeDelta > 0 then chargingSound:Play() end chargingSound.PlaybackSpeed = self.chargeSoundPitchMin + (self.charge * (self.chargeSoundPitchMax - self.chargeSoundPitchMin)) end else if chargeDelta > 0 and self.charge <= 1 and not chargingSound.Playing then chargingSound.TimePosition = chargingSound.TimeLength * self.charge chargingSound:Play() elseif chargeDelta <= 0 and chargingSound.Playing then chargingSound:Stop() end end end if dischargingSound then if dischargingSound.Looped then if chargeDelta > 0 then dischargingSound:Stop() else if not dischargingSound.Playing and self.charge > 0 then dischargingSound:Play() end dischargingSound.PlaybackSpeed = self.chargeSoundPitchMin + (self.charge * (self.chargeSoundPitchMax - self.chargeSoundPitchMin)) end else if chargeDelta < 0 and self.charge >= 0 and not dischargingSound.Playing then dischargingSound.TimePosition = dischargingSound.TimeLength * self.charge dischargingSound:Play() elseif chargeDelta >= 0 and dischargingSound.Playing then dischargingSound:Stop() end end end -- Play charge/discharge completed sounds and particle effects if chargeBefore < 1 and self.charge >= 1 then local chargeCompleteSound = self:getSound("ChargeComplete") if chargeCompleteSound then chargeCompleteSound:Play() end if chargingSound and chargingSound.Playing then chargingSound:Stop() end if self.chargeCompleteParticles then self.chargeCompleteParticles:Emit(self:getConfigValue("NumChargeCompleteParticles", 25)) end end if chargeBefore > 0 and self.charge <= 0 then local dischargeCompleteSound = self:getSound("DischargeComplete") if dischargeCompleteSound then dischargeCompleteSound:Play() end if dischargingSound and dischargingSound.Playing then dischargingSound:Stop() end if self.dischargeCompleteParticles then self.dischargeCompleteParticles:Emit(self:getConfigValue("NumDischargeCompleteParticles", 25)) end end self:renderCharge() else if chargingSound then chargingSound:Stop() end if dischargingSound then dischargingSound:Stop() end end if self.usesCharging and self.chargeGlowPart then self.chargeGlowPart.Transparency = 1 - self.charge end -- Fire weapon if it is fully charged if self:canFire() and now > self.nextFireTime then self:doLocalFire() end end function BulletWeapon:handleCharging(dt) local chargeDelta local shouldCharge = self.activated or self.burstFiring or self:getConfigValue("ChargePassively", false) if self.reloading or self.triggerDisconnected then shouldCharge = false end if shouldCharge then chargeDelta = self:getConfigValue("ChargeRate", 0) * dt else chargeDelta = self:getConfigValue("DischargeRate", 0) * -dt end self.charge = math.clamp(self.charge + chargeDelta, 0, 1) end function BulletWeapon:isCharged() return not self.usesCharging or self.charge >= 1 end function BulletWeapon:canFire() return self.player == Players.LocalPlayer and (self.burstFiring or self.activated) and not self.triggerDisconnected and not self.reloading and self:isCharged() and self.startupFinished end function BulletWeapon:doLocalFire() if self.tipAttach then local tipCFrame = self.tipAttach.WorldCFrame local tipPos = tipCFrame.Position local aimDir = (self.aimPoint - tipPos).Unit self:fire(tipPos, aimDir, self.charge) end end return BulletWeapon
------- extreme math equations
local v = 30 local c = 50 local m = part:GetMass() if m< 20 then m = 20 end part.RotVelocity =Vector3.new(math.random(-v,v)/(m/c),math.random(-v,v)/(m/c),math.random(-v,v)/(m/c)) game:GetService("Debris"):AddItem(script.Parent,0.1)--penetration end local a = part.Parent:findFirstChild("Humanoid") local b = part.Parent.Parent:findFirstChild("Humanoid") local debrispart = Instance.new("Part") debrispart.Name="debrispart" debrispart.Size = Vector3.new(0.05,0.05,0.05) debrispart.BrickColor = part.BrickColor debrispart.Anchored=true debrispart.CanCollide = false debrispart.Transparency=1 debrispart.Position=positiono debrispart.Parent=game.Workspace if a == nil and b == nil then local thingy = script.debris:Clone() thingy.Color=ColorSequence.new(part.Color,part.Color) thingy.Parent=debrispart spawn(function() thingy:Emit(10) end) end if a ~= nil or b ~= nil then local thingy = script.blood:Clone() thingy.Parent=debrispart spawn(function() thingy:Emit(10) end) end game:GetService("Debris"):AddItem(debrispart,1) game:GetService("Debris"):AddItem(script.Parent,0.05) --[[if position ~= nil then end]]-- end end script.Parent.Touched:connect(hit)
--[[** Determines if the passed object is a Janitor. @param [t:any] Object The object you are checking. @returns [t:boolean] Whether or not the object is a Janitor. **--]]
function Janitor.Is(Object) return type(Object) == "table" and getmetatable(Object) == Janitor end
--[[ Display Names ]] --Uses DisplayNames instead of UserNames in chat messages
module.PlayerDisplayNamesEnabled = true
-- for i=1,3 do -- local s = Instance.new("Part") -- s.Shape = 1 -- block -- s.formFactor = 2 -- plate -- s.Size = Vector3.new(1,.4,1) -- s.BrickColor = ball.BrickColor -- local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1)) -- s.Velocity = 15 * v -- s.CFrame = CFrame.new(ball.Position + v, v) -- ball.BrickCleanup:clone().Parent = s -- s.BrickCleanup.Disabled = false -- s.Parent = game.Workspace
--R6
MakeWeld(car.Misc.Anims.R6.RightArm.Z,car.Misc.Anims.R6.RightArm.Y,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.RightArm.Y,car.DriveSeat,"Motor6D").Name="M" ModelWeld(misc.Anims.R6.RightArm.Parts,misc.Anims.R6.RightArm.Z) MakeWeld(car.Misc.Anims.R6.LeftArm.Z,car.Misc.Anims.R6.LeftArm.Y,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.LeftArm.Y,car.DriveSeat,"Motor6D").Name="M" ModelWeld(misc.Anims.R6.LeftArm.Parts,misc.Anims.R6.LeftArm.Z) MakeWeld(car.Misc.Anims.R6.LeftLeg.X,car.Misc.Anims.R6.LeftLeg.Z,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.LeftLeg.Z,car.DriveSeat,"Motor6D").Name="M" ModelWeld(misc.Anims.R6.LeftLeg.Parts,misc.Anims.R6.LeftLeg.X) MakeWeld(car.Misc.Anims.R6.RightLeg.X,car.Misc.Anims.R6.RightLeg.Z,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.RightLeg.Z,car.Misc.Anims.R6.RightLeg.I,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.RightLeg.I,car.DriveSeat,"Motor6D").Name="M" ModelWeld(misc.Anims.R6.RightLeg.Parts,misc.Anims.R6.RightLeg.X) MakeWeld(car.Misc.Anims.R6.Torso.Z,car.DriveSeat,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.Torso.X,car.Misc.Anims.R6.Torso.Z,"Motor6D").Name="M" ModelWeld(misc.Anims.R6.Torso.Parts,misc.Anims.R6.Torso.X) MakeWeld(car.Misc.Anims.R6.Head.X,car.Misc.Anims.R6.Head.Y,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.Head.Y,car.Misc.Anims.R6.Head.Z,"Motor6D").Name="M" MakeWeld(car.Misc.Anims.R6.Head.Z,car.Misc.Anims.R6.Torso.X,"Motor6D").Name="M" ModelWeld(misc.Anims.R6.Head.Parts,misc.Anims.R6.Head.X)
-----------------------------------------------------------------------------
script.Parent.Humanoid.HealthChanged:Connect(function() if script.Parent.Humanoid.Health <= 37 then Instance.new("Decal", script.Parent.Head) script.Parent.Head.Decal.Texture = "rbxassetid://176678128" script.Parent.Head.Decal.Face = "Front" end end)
--[[Brakes]]
Tune.ABSEnabled = true -- Implements ABS Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS) Tune.FBrakeForce = 3000 -- Front brake force Tune.RBrakeForce = 2500 -- Rear brake force Tune.PBrakeForce = 99999 -- Handbrake force Tune.FLgcyBForce = 41000 -- Front brake force [PGS OFF] Tune.RLgcyBForce = 36000 -- Rear brake force [PGS OFF] Tune.LgcyPBForce = 150000 -- Handbrake force [PGS OFF]
--local Text = thirstGui:WaitForChild("Back"):WaitForchild("Text")
local plr = game.Players.LocalPlayer repeat wait() until plr.Character -- waiting for player to load local UIS = game:GetService("UserInputService") local hum = plr.Character:WaitForChild("Humanoid") local maxThirst = 100 local maxHunger = 100 local thirstValue local hungerValue if plr:FindFirstChild("HungerVal") then hungerValue = plr.HungerVal hungerValue.Value = maxHunger else Instance.new("IntValue", plr).Name = "HungerVal" plr.HungerVal.Value = maxHunger hungerValue = plr.HungerVal end if plr:FindFirstChild("ThirstVal") then thirstValue = plr.ThirstVal thirstValue.Value = maxThirst else Instance.new("IntValue", plr).Name = "ThirstVal" plr.ThirstVal.Value = maxThirst thirstValue = plr.ThirstVal end local hungerValue = plr:WaitForChild("HungerVal") local Frame = thirstGui.Frame local TS = game:GetService("TweenService") thirstValue.Changed:connect(function() if thirstValue.Value > 60 then TS:Create(Frame.Sede,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,255),ImageTransparency = 1}):Play() elseif thirstValue.Value <= 0 then MedicSys.Fome:FireServer() elseif thirstValue.Value <= 30 then TS:Create(Frame.Sede,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,((thirstValue.Value/30)*255),((thirstValue.Value/60)*255)),ImageTransparency = 0}):Play() elseif thirstValue.Value <= 60 then TS:Create(Frame.Sede,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,((thirstValue.Value/60)*255)),ImageTransparency = 0}):Play() end end) hungerValue.Changed:connect(function() if hungerValue.Value > 60 then TS:Create(Frame.Fome,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,255),ImageTransparency = 1}):Play() elseif hungerValue.Value <= 0 then MedicSys.Fome:FireServer() elseif hungerValue.Value <= 30 then TS:Create(Frame.Fome,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,((hungerValue.Value/30)*255),((hungerValue.Value/60)*255)),ImageTransparency = 0}):Play() elseif hungerValue.Value <= 60 then TS:Create(Frame.Fome,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,((hungerValue.Value/60)*255)),ImageTransparency = 0}):Play() end end) while wait(ServerConfig.HungerWaitTime) do if thirstValue.Value - 1 >= 0 then thirstValue.Value = thirstValue.Value - 1 end if hungerValue.Value - 1 >= 0 then hungerValue.Value = hungerValue.Value - 1 end end
-- Show highlight on currently equipped tool in toolbar
EquippedVal.Changed:connect(function() for i,v in pairs(UiFrame:GetChildren()) do if v:IsA('ImageButton') then v.BorderSizePixel = 1 end end if EquippedVal.Value then local imageButton = UiFrame:FindFirstChild(EquippedVal.Value.Name) if imageButton then imageButton.BorderSizePixel = 4 end end end) for i,v in pairs(UiFrame:GetChildren()) do if v:IsA("ImageButton") then v.MouseButton1Click:Connect(function() local slotRequested = SlotsFolder:FindFirstChild(v.Name) if slotRequested then -- if there is such a slot -- if they're requesting the same slot if EquippedVal.Value == slotRequested then EquippedVal.Value = nil -- unequip the tool else EquippedVal.Value = slotRequested -- equip the tool end end end) end end game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
--[ FUNCTIONS ]--
if not AFKEvent then AFKEvent = Instance.new("RemoteEvent") AFKEvent.Parent = game.ReplicatedStorage AFKEvent.Name = "AFK" end local updateAFK = function(player,enable) local GUI = player.Character:WaitForChild("HumanoidRootPart"):WaitForChild("OverheadGui") local AFKTagT = GUI:WaitForChild("Username") if enable then AFKTagT.Text = "AFK | "..player.Name.." (@"..player.DisplayName..")" else AFKTagT.Text = player.Name.." (@"..player.DisplayName..")" end end AFKEvent.OnServerEvent:Connect(function(player,enable) AFKStatus[player] = enable updateAFK(player,enable) end)
--[=[ Connects a handler to a ScriptSignal object, but only allows that connection to run once. Any `:Fire` calls called afterwards won't trigger anything. ```lua ScriptSignal:ConnectOnce(function() print("Connection fired") end) ScriptSignal:Fire() ScriptSignal:Fire() -- "Connection fired" is only fired once ``` @param handler (...: any) -> () @ignore ]=]
function ScriptSignal:ConnectOnce( handler: (...any) -> () ) assert( typeof(handler) == 'function', "Must be function" ) local connection connection = self:Connect(function(...) connection:Disconnect() handler(...) end) end
-- Functions
local function getRotationBetween(u, v, axis) local dot, uxv = u:Dot(v), u:Cross(v) if (dot < -0.99999) then return CFrame.fromAxisAngle(axis, math.pi) end return CFrame.new(0, 0, 0, uxv.x, uxv.y, uxv.z, 1 + dot) end
-- ================================================================================ -- LOCAL FUNCTIONS -- ================================================================================
local function BoostSetup() local Speedometer = gui:WaitForChild("Speedometer") local Bar = Speedometer:WaitForChild("Bar") local SpeedBar = Bar:WaitForChild("SpeedBar") function GuiController:UpdateBoost(boostAmount) local boostPercentage = math.clamp(boostAmount/engine._settings.BoostAmount, 0, 1) Bar.Position = UDim2.new(-1 + boostPercentage, 0, 0, 0) SpeedBar.Position = UDim2.new(1 - 1*boostPercentage, 0, 0, 0) end end -- BoostSetup()
-- ROBLOX upstream: https://github.com/facebook/jest/blob/v27.4.7/packages/expect/src/index.ts
--[[ Roblox Services ]]
-- local UserInputService = game:GetService("UserInputService") local PathfindingService = game:GetService("PathfindingService") local Players = game:GetService("Players") local DebrisService = game:GetService('Debris') local StarterGui = game:GetService("StarterGui") local Workspace = game:GetService("Workspace") local CollectionService = game:GetService("CollectionService") local GuiService = game:GetService("GuiService")
--------------------------------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------------------------------- -- Event Handlers
function OnRayHit(cast, raycastResult, segmentVelocity, cosmeticBulletObject) -- This function will be connected to the Caster's "RayHit" event. local hitPart = raycastResult.Instance local hitPoint = raycastResult.Position local normal = raycastResult.Normal if hitPart ~= nil and hitPart.Parent ~= nil then -- Test if we hit something local humanoid: Humanoid = hitPart.Parent:FindFirstChildOfClass("Humanoid") -- Is there a humanoid? if humanoid then TagHumanoid(humanoid, hitPart.Parent.Parent) humanoid.Health -= 100 end MakeParticleFX(hitPoint, normal) -- Particle FX end end function OnRayPierced(cast, raycastResult, segmentVelocity, cosmeticBulletObject) -- You can do some really unique stuff with pierce behavior - In reality, pierce is just the module's way of asking "Do I keep the bullet going, or do I stop it here?" -- You can make use of this unique behavior in a manner like this, for instance, which causes bullets to be bouncy. local position = raycastResult.Position local normal = raycastResult.Normal local newNormal = Reflect(normal, segmentVelocity.Unit) cast:SetVelocity(newNormal * segmentVelocity.Magnitude) -- It's super important that we set the cast's position to the ray hit position. Remember: When a pierce is successful, it increments the ray forward by one increment. -- If we don't do this, it'll actually start the bounce effect one segment *after* it continues through the object, which for thin walls, can cause the bullet to almost get stuck in the wall. cast:SetPosition(position) -- Generally speaking, if you plan to do any velocity modifications to the bullet at all, you should use the line above to reset the position to where it was when the pierce was registered. end function OnRayUpdated(cast, segmentOrigin, segmentDirection, length, segmentVelocity, cosmeticBulletObject) -- Whenever the caster steps forward by one unit, this function is called. -- The bullet argument is the same object passed into the fire function. if cosmeticBulletObject == nil then return end local bulletLength = cosmeticBulletObject.Size.Z / 2 -- This is used to move the bullet to the right spot based on a CFrame offset local baseCFrame = CFrame.new(segmentOrigin, segmentOrigin + segmentDirection) cosmeticBulletObject.CFrame = baseCFrame * CFrame.new(0, 0, -(length - bulletLength)) end function OnRayTerminated(cast) local cosmeticBullet = cast.RayInfo.CosmeticBulletObject if cosmeticBullet ~= nil then -- This code here is using an if statement on CastBehavior.CosmeticBulletProvider so that the example gun works out of the box. -- In your implementation, you should only handle what you're doing (if you use a PartCache, ALWAYS use ReturnPart. If not, ALWAYS use Destroy. if CastBehavior.CosmeticBulletProvider ~= nil then CastBehavior.CosmeticBulletProvider:ReturnPart(cosmeticBullet) else cosmeticBullet:Destroy() end end end MouseEvent.OnServerEvent:Connect(function (clientThatFired, mousePoint) if not CanFire then return end CanFire = false local mouseDirection = (mousePoint - FirePointObject.WorldPosition).Unit for i = 1, BULLETS_PER_SHOT do Fire(mouseDirection) end if FIRE_DELAY > 0.03 then wait(FIRE_DELAY) end CanFire = true end) Caster.RayHit:Connect(OnRayHit) Caster.RayPierced:Connect(OnRayPierced) Caster.LengthChanged:Connect(OnRayUpdated) Caster.CastTerminating:Connect(OnRayTerminated) Tool.Equipped:Connect(function () CastParams.FilterDescendantsInstances = {Tool.Parent, CosmeticBulletsFolder} end)
-- Denotes property change handlers in an instance's property table.
export type OnChangeKey = Symbol & { -- name: "OnChange" (add this when Luau supports singleton types) key: string }
-- Buy case #1
BuyCasesEvents.Case1.OnServerEvent:Connect(function(player, PricePoints, PriceGems, PointsBuy) if PointsBuy == true then if player.DataFolder.Points.Value >= PricePoints then player.DataFolder.Points.Value -= PricePoints print(PricePoints) --Transaction Completed player.Inventory.BatCase1.Value += 1 --Choose the case else MessagesEvents.NotEnoughPoints:FireClient(player) end elseif PointsBuy == false then if player.DataFolder.Gems.Value >= PriceGems then player.DataFolder.Gems.Value -= PriceGems print(PriceGems) --Transaction Completed player.Inventory.BatCase1.Value += 1 --Case else MessagesEvents.NotEnoughPoints:FireClient(player) end end end) OpenCasesEvents.OpenCase1.OnServerEvent:Connect(function(player) if player.Inventory.BatCase1.Value > 0 then player.Inventory.BatCase1.Value -= 1 OpenCasesEvents.OpenCase1:FireClient(player) else MessagesEvents.CaseNotOwned:FireClient(player) end end)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- API
ModuleAPI = {} c = workspace.CurrentCamera player = game.Players.LocalPlayer rs = game:GetService("RunService") function checkArgs(...) -- Generic Function for checking if arguments exist / are the correct type. local args = {...} local function useVowel(name) local vowels = {"a","e","i","o","u"} for _,v in pairs(vowels) do if string.sub(string.lower(name),1,1) == v then return true end end return false end for i = 1,#args,2 do local s = "Argument "..(i/2+.5) local var,f = args[i], args[i+1] if var == nil then return error(s.." missing or nil") end local vt = type(var) if type(f) == "function" then local r,t = f(var) if not r then return error(s.." should be a"..(useVowel(t) and "n" or "").." "..t.." (not a"..(useVowel(vt) and "n" or "")..": "..vt..")") end elseif vt ~= f then return error(s.." should be a"..(useVowel(f) and "n" or "").." "..f.." (not a"..(useVowel(vt) and "n" or "")..": "..vt..")") end end end function ModuleAPI:GetScreenResolution() local mouse = player:GetMouse() if mouse then if mouse.ViewSizeX > 0 and mouse.ViewSizeY > 0 then return Vector2.new(mouse.ViewSizeX,mouse.ViewSizeY) end end if player.PlayerGui then local screenGui for _,v in pairs(player.PlayerGui:GetChildren()) do if v:IsA("ScreenGui") then screenGui = v end end if not screenGui then -- Not sure if this is possible assuming the scenario. But you never know. screenGui = Instance.new("ScreenGui",player.PlayerGui) wait(.1) -- Wait just a moment for the property to get set. end return screenGui.AbsoluteSize end return error("ERROR: Can't get client resolution") end function ModuleAPI:PointToScreenSpace(at) checkArgs(at,function(v) local is = pcall(function () return p.X,p.Y,p.Z end) return is or false,"Vector3" end) local resolution = ModuleAPI:GetScreenResolution() local point = c.CoordinateFrame:pointToObjectSpace(at) local aspectRatio = resolution.X / resolution.Y local hfactor = math.tan(math.rad(c.FieldOfView)/2) local wfactor = aspectRatio*hfactor local x = (point.x/point.z) / -wfactor local y = (point.y/point.z) / hfactor return Vector2.new(resolution.X*(0.5 + 0.5*x), resolution.Y*(0.5 + 0.5*y)) end function ModuleAPI:ScreenSpaceToWorld(x, y, depth) checkArgs(x,"number",y,"number",depth,"number") local resolution = ModuleAPI:GetScreenResolution() local aspectRatio = resolution.X / resolution.Y local hfactor = math.tan(math.rad(c.FieldOfView)/2) local wfactor = aspectRatio*hfactor local xf, yf = x/resolution.X*2 - 1, y/resolution.Y*2 - 1 local xpos = xf * -wfactor * depth local ypos = yf * hfactor * depth return Vector3.new(xpos, ypos, depth) end function ModuleAPI:GetDepthForWidth(partWidth, visibleSize) checkArgs(partWidth,"number",visibleSize,"number") local resolution = ModuleAPI:GetScreenResolution() local aspectRatio = resolution.X / resolution.Y local hfactor = math.tan(math.rad(c.FieldOfView)/2) local wfactor = aspectRatio*hfactor return (-0.5*resolution.X*partWidth/(visibleSize*wfactor)) end function ModuleAPI:Attach3D(guiObj,model) checkArgs( guiObj,function (v) return guiObj:IsA("GuiObject") or false,"GuiObject" end, model,function (v) return (model:IsA("Model") or model:IsA("BasePart")) or false,"Model or BasePart" end ) local index = {} local m = Instance.new("Model") m.Name = "" m.Parent = c objs = {} if model:IsA("BasePart") then local this = model:clone() this.Parent = m table.insert(objs,this) else local function recurse(obj) for _,v in pairs(obj:GetChildren()) do local part if v:IsA("BasePart") then part = v:clone() elseif v:IsA("Hat") and v:findFirstChild("Handle") then part = v.Handle:clone() end if part then local cf = part.CFrame part.Anchored = false part.Parent = m part.CFrame = cf if part:findFirstChild("Decal") and part.Transparency ~= 0 then part:Destroy() --elseif part.Name == "Head" then --part.Name = "H" end if part.Parent == m then table.insert(objs,part) end elseif not v:IsA("Model") and not v:IsA("Sound") and not v:IsA("Script") then v:clone().Parent = m else recurse(v) end end end recurse(model) end local primary = Instance.new("Part") primary.Anchored = true primary.Transparency = 1 primary.CanCollide = false primary.Name = "MODEL_CENTER" primary.FormFactor = "Custom" primary.Size = m:GetExtentsSize() primary.CFrame = CFrame.new(m:GetModelCFrame().p) primary.Parent = m m.PrimaryPart = primary for _,v in pairs(objs) do v.Anchored = false v.CanCollide = false v.Archivable = true local w = Instance.new("Weld",primary) w.Part0 = primary w.Part1 = v local CJ = CFrame.new(primary.Position) w.C0 = primary.CFrame:inverse()*CJ w.C1 = v.CFrame:inverse()*CJ v.Parent = m end CF = CFrame.new(0, 0, 0, -1, 0, -8.74227766e-008, 0, 1, 0, 8.74227766e-008, 0, -1) Active = false DistOffset = 0 function index:SetActive(b) checkArgs(b,"boolean") Active = b end function index:SetCFrame(cf) checkArgs(cf,function () local isCFrame = pcall(function () return cf:components() end) return isCFrame or false,"CFrame" end) CF = cf end function index:GetCFrame() return CF; end local function updateModel() primary.Anchored = false if Active then local posZ = ModuleAPI:GetDepthForWidth(primary.Size.magnitude, guiObj.AbsoluteSize.Y) local sizeX,sizeY = guiObj.AbsoluteSize.X,guiObj.AbsoluteSize.Y local posX,posY = guiObj.AbsolutePosition.X+(sizeX/2),guiObj.AbsolutePosition.Y+(sizeY/2) local pos = ModuleAPI:ScreenSpaceToWorld(posX,posY,posZ) local location = c.CoordinateFrame * CFrame.new(pos.X, pos.Y, posZ) primary.CFrame = location * CF else primary.CFrame = CFrame.new() end primary.Anchored = true end local con = rs.RenderStepped:connect(updateModel) function index:End() con:disconnect() pcall(function () m:Destroy() end) return end index.Object3D = m return index end function ModuleAPI:AdornScreenGuiToWorld(screenGui,depth) checkArgs(screenGui,function (v) return (screenGui:IsA("ScreenGui") or screenGui:IsA("BillboardGui")) or false,"ScreenGui or BillboardGui" end) local depth = type(depth) == "number" and depth or 1 local s = Instance.new("BillboardGui",screenGui.Parent) s.Name = screenGui.Name local adorn = Instance.new("Part",s) adorn.Name = screenGui.Name.."_Adornee" adorn.FormFactor = "Custom" adorn.Anchored = true adorn.CanCollide = false adorn.Size = Vector3.new() adorn.Transparency = 1 adorn.Locked = true local con local modifier = {} function modifier:SetDepth(n) checkArgs(n,"number") depth = n end function modifier:Reset() screenGui.Parent = s.Parent for _,v in pairs(s:GetChildren()) do v.Parent = screenGui end con:disconnect() adorn:Destroy() s:Destroy() end local function updateAdorn() local success,did = pcall(function () local res = ModuleAPI:GetScreenResolution() adorn.CFrame = c.CoordinateFrame s.Size = UDim2.new(0,res.X,0,res.Y) s.StudsOffset = Vector3.new(0,0,-depth) return true end) if not success or not did then warn(script:GetFullName()..": The adornee was destroyed! The gui has been reset.") modifier:Reset() end end con = rs.RenderStepped:connect(updateAdorn) s.Adornee = adorn for _,v in pairs(screenGui:GetChildren()) do v.Parent = s end screenGui.Parent = nil return s,modifier end return ModuleAPI
--Setup fast joiners
spawn(function() wait(1) for _,player in pairs(main.players:GetChildren()) do if not main.pd[player] and not settingUpPlayer[player] then playerAdded(player) end end end) return module
--- Maps arguments #2-n through callback and returns values as tuple
function Util.Each(callback, ...) local results = {} for i, value in ipairs({...}) do results[i] = callback(value) end return unpack(results) end
-- Remote Functions
local remoteEvents = game:GetService("ReplicatedStorage").Remotes.RemoteEvents local remoteFunctions = game:GetService("ReplicatedStorage").Remotes.RemoteFunctions
--//////////////////////////////////////////////////////////////////////////////////////////// --///////////////////////////////////////////////// Code to hook client UI up to server events --////////////////////////////////////////////////////////////////////////////////////////////
function DoChatBarFocus() if (not ChatWindow:GetCoreGuiEnabled()) then return end if (not ChatBar:GetEnabled()) then return end if (not ChatBar:IsFocused() and ChatBar:GetVisible()) then moduleApiTable:SetVisible(true) InstantFadeIn() ChatBar:CaptureFocus() moduleApiTable.ChatBarFocusChanged:fire(true) end end chatBarFocusChanged.Event:connect(function(focused) moduleApiTable.ChatBarFocusChanged:fire(focused) end) function DoSwitchCurrentChannel(targetChannel) if (ChatWindow:GetChannel(targetChannel)) then ChatWindow:SwitchCurrentChannel(targetChannel) end end function SendMessageToSelfInTargetChannel(message, channelName, extraData) local channelObj = ChatWindow:GetChannel(channelName) if (channelObj) then local messageData = { ID = -1, FromSpeaker = nil, SpeakerUserId = 0, OriginalChannel = channelName, IsFiltered = true, MessageLength = string.len(message), MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(message)), Message = trimTrailingSpaces(message), MessageType = ChatConstants.MessageTypeSystem, Time = os.time(), ExtraData = extraData, } channelObj:AddMessageToChannel(messageData) end end function chatBarFocused() if (not mouseIsInWindow) then DoBackgroundFadeIn() if (textIsFaded) then DoTextFadeIn() end end chatBarFocusChanged:Fire(true) end
-- initialize to idle
playAnimation("idle", 0.1, Humanoid) pose = "Standing" function populatehumanoids(mdl) if mdl.ClassName=="Humanoid" then table.insert(humanoids,mdl) end for i2,mdl2 in ipairs(mdl:GetChildren()) do populatehumanoids(mdl2) end end while Figure.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Figure.Head and Torso~=nil and Torso.Parent~=nil do local _,time=wait(0.1) humanoids={} populatehumanoids(game.Workspace) closesttarget=nil closestdist=sightrange local creator=Figure:FindFirstChild("creator") for i,h in ipairs(humanoids) do if h and h.Parent~=nil then if h.Health>0 and h.Parent.Name~=Figure.Name and h.Parent~=Figure then local plr=game.Players:GetPlayerFromCharacter(h.Parent) if creator==nil or plr==nil or creator.Value~=plr then local t=h.Parent:FindFirstChild("Torso") if t~=nil then local dist=(t.Position-Torso.Position).magnitude if dist<closestdist then closestdist=dist closesttarget=t end end end end end end if closesttarget~=nil then if not chasing then chasing=true Figure.canAttack.Value=true Humanoid.WalkSpeed=runspeed end Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget) if math.random()<.5 then --attack(time,closesttarget.Position) end else if chasing then chasing=false Figure.canAttack.Value=false Humanoid.WalkSpeed=wonderspeed end if time>nextrandom then nextrandom=time+3+(math.random()*5) local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40) Humanoid:MoveTo(randompos,game.Workspace.Terrain) end end if time>nextjump then nextjump=time+7+(math.random()*5) Humanoid.Jump=true end --animate(time) move(time) end wait(4) Figure:remove()
-- Decompiled with the Synapse X Luau decompiler.
client = nil; service = nil; return function(p1) local l__FromPlayer__1 = p1.FromPlayer; local l__SessionName__2 = p1.SessionName; local u1 = nil; local l__SessionKey__2 = p1.SessionKey; local u3 = {}; local u4 = nil; local l__CanManageUsers__5 = p1.CanManageUsers; local u6 = nil; local u7 = nil; local u8 = {}; local function u9(p2) local l__PlayerName__3 = p2.PlayerName; local v4 = false; if l__PlayerName__3 ~= "*SYSTEM*" then v4 = p2.PlayerDisplayName; end; local l__Message__5 = p2.Message; local v6 = nil; if l__PlayerName__3 == "* SYSTEM *" then v6 = u7:Add("Frame", { Size = UDim2.new(1, 0, 0, 25), BackgroundTransparency = 1, AutomaticSize = "Y", Children = { { ClassName = "Frame", Name = "CHATFRAME", Size = UDim2.new(1, -10, 1, -10), Position = UDim2.new(0, 5, 0, 5), BackgroundTransparency = 0.5, AutomaticSize = "Y", Children = { { ClassName = "TextLabel", Name = "PlayerName", Size = UDim2.new(0, 0, 0, 14), Position = UDim2.new(0, 1, 0, 1), Text = " " .. l__PlayerName__3, TextSize = "14", TextXAlignment = "Left", BackgroundTransparency = 1 }, { ClassName = "TextLabel", Name = "Message", Size = UDim2.new(1, 0, 0, 10), Position = UDim2.new(0, 0, 0, 14), Text = " " .. (l__Message__5 and "<font color='rgb(230,0,0)'>An error has occured</font>"), TextXAlignment = "Left", TextYAlignment = "Top", AutomaticSize = "Y", TextWrapped = true, TextScaled = false, RichText = true, BackgroundTransparency = 1 } } } } }); else u7:Add("Frame", { Size = UDim2.new(1, 0, 0, 50), BackgroundTransparency = 1, AutomaticSize = "Y", Children = { { ClassName = "Frame", Name = "CHATFRAME", Size = UDim2.new(1, -10, 1, -10), Position = UDim2.new(0, 5, 0, 5), BackgroundTransparency = 0.5, AutomaticSize = "Y", Children = { { ClassName = "ImageButton", Name = "Icon", Size = UDim2.new(0, 48, 0, 48), Position = UDim2.new(0, 1, 0, 1), Image = p2.Icon and 0 }, { ClassName = "TextLabel", Name = "PlayerName", Size = UDim2.new(1, -55, 0, 15), Position = UDim2.new(0, 55, 0, 0), Text = not v4 and l__PlayerName__3 or string.format("@%s (%s)", l__PlayerName__3, v4), TextSize = "14", TextXAlignment = "Left", BackgroundTransparency = 1 }, { ClassName = "TextLabel", Name = "Message", Size = UDim2.new(1, -55, 0, 10), Position = UDim2.new(0, 55, 0, 15), Text = l__Message__5, TextXAlignment = "Left", TextYAlignment = "Top", AutomaticSize = "Y", TextWrapped = true, TextScaled = false, RichText = true, BackgroundTransparency = 1 } } } } }); end; table.insert(u8, v6); if #u8 > 200 then u8[1]:Destroy(); table.remove(u8, 1); end; end; if client.UI.Get("PrivateChat" .. l__SessionName__2) then return; end; local v7 = { Name = "PrivateChat" .. l__SessionName__2, Title = "Private Chat", Icon = client.MatIcons.Forum, Size = { 500, 300 } }; local u10 = nil; function v7.OnClose() if u10 then u10:Disconnect(); end; client.Remote.Send("Session", l__SessionKey__2, "LeaveSession"); end; local v8 = client.UI.Make("Window", v7); u7 = v8:Add("ScrollingFrame", { Size = UDim2.new(1, -105, 1, -45), CanvasSize = UDim2.new(0, 0, 0, 0), BackgroundTransparency = 0.9 }); u1 = v8:Add("TextBox", { Text = "", PlaceholderText = "", Size = UDim2.new(1, -70, 0, 30), Position = UDim2.new(0, 5, 1, -35), ClearTextOnFocus = false, TextScaled = true }); u4 = v8:Add("ScrollingFrame", { Size = UDim2.new(0, 100, 1, -75), Position = UDim2.new(1, -100, 0, 0), BackgroundTransparency = 0.5, AutomaticCanvasSize = "Y" }); local v9 = { Text = "+", Size = UDim2.new(0, 30, 0, 30), Position = UDim2.new(1, -100, 1, -70) }; local function u11() local v10 = {}; local l__next__11 = next; local v12, v13 = service.Players:GetPlayers(); while true do local v14, v15 = l__next__11(v12, v13); if not v14 then break; end; local v16 = true; for v17, v18 in next, u3 do if v18.UserId == v15.UserId then v16 = false; break; end; end; if v16 then table.insert(v10, { Text = string.format("@%s (%s)", v15.Name, v15.DisplayName), Data = service.UnWrap(v15) }); end; end; local v19 = client.UI.Make("SelectionPrompt", { Name = "Add User", Options = v10 }); if v19 then client.Remote.Send("Session", l__SessionKey__2, "AddPlayerToSession", v19); end; end; local function u12(p3) u9({ PlayerName = "* SYSTEM *", Message = p3, Icon = 0 }); end; function v9.OnClick() if l__CanManageUsers__5 then u11(); return; end; u12("<i>You are not allowed to manage users</i>"); end; local v20 = v8:Add("TextButton", v9); local v21 = v8:Add("TextButton", { Text = "-", Size = UDim2.new(0, 30, 0, 30), Position = UDim2.new(1, -35, 1, -70), OnClick = function() if l__CanManageUsers__5 then if not u6 then return; end; else u12("<i>You are not allowed to manage users</i>"); return; end; client.Remote.Send("Session", l__SessionKey__2, "RemovePlayerFromSession", u6); u6 = nil; end }); local v22 = { Text = "Send", Size = UDim2.new(0, 60, 0, 30), Position = UDim2.new(1, -65, 1, -35) }; local function u13() local v23 = service.Trim(u1.Text); if v23 ~= "" then client.Remote.Send("Session", l__SessionKey__2, "SendMessage", v23); end; end; function v22.OnClick() u13(); u1.Text = ""; end; local v24 = v8:Add("TextButton", v22); local v25 = service.New("UIListLayout", { Parent = u7, FillDirection = "Vertical", HorizontalAlignment = "Left", VerticalAlignment = "Bottom", SortOrder = "LayoutOrder" }); v24.BackgroundColor3 = v24.BackgroundColor3:lerp(Color3.new(0, 0, 0), 0.1); u1.FocusLost:Connect(function(p4) if p4 then u13(); u1.Text = ""; u1:CaptureFocus(); end; end); v25:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() u7.CanvasSize = UDim2.new(0, 0, 0, v25.AbsoluteContentSize.Y); u7.CanvasPosition = Vector2.new(0, v25.AbsoluteContentSize.Y); end); if p1.History then for v26, v27 in ipairs(p1.History) do local l__Sender__28 = v27.Sender; u9({ PlayerName = l__Sender__28.Name, PlayerDisplayName = l__Sender__28.DisplayName, Message = v27.Message, Icon = l__Sender__28.Icon and 0 }); end; end; local function u14(p5) u4:ClearAllChildren(); u3 = p5; for v29, v30 in next, p5 do local v31 = u4:Add("TextButton", { Text = string.format("@%s (%s)", v30.Name, v30.DisplayName), Size = UDim2.new(1, 0, 0, 25), TextScaled = true, TextWarped = true, BackgroundTransparency = 1 }); if l__CanManageUsers__5 then local v32 = v31.BackgroundColor3:Lerp(Color3.fromRGB(9, 67, 255), 0.1); if v30.UserId and v30.UserId ~= service.Players.LocalPlayer.UserId then v31.MouseButton1Down:Connect(function() for v33, v34 in ipairs(u4:GetChildren()) do if v34:IsA("TextButton") or v34:IsA("Frame") then v34.BackgroundTransparency = 1; end; end; u6 = v30; v31.BackgroundTransparency = 0; v31.BackgroundColor3 = v32; end); end; end; end; u4.CanvasSize = UDim2.new(0, 0, 0, service.New("UIListLayout", { Parent = u4, FillDirection = "Vertical", HorizontalAlignment = "Center", VerticalAlignment = "Top", SortOrder = "LayoutOrder" }).AbsoluteContentSize.Y); end; u10 = service.Events.SessionData:Connect(function(p6, p7, ...) local v35 = { ... }; if l__SessionKey__2 == p6 then if p7 == "PlayerSentMessage" then local v36 = v35[1]; if u9 then u9({ PlayerName = v36.Name, PlayerDisplayName = v36.DisplayName, Message = v35[2], Icon = v36.Icon and 0 }); return; end; else if p7 == "UpdatePeerList" then u14(v35[1]); return; end; if p7 == "RemovedFromSession" then u12("<i>You have been removed from this chat session</i>"); return; end; if p7 == "AddedToSession" then u12("<i>You have been added to this chat session</i>"); end; end; end; end); client.Remote.Send("Session", l__SessionKey__2, "GetPeerList"); local l__gTable__37 = v8.gTable; v8:Ready(); end;
-- Dont touch
while wait() do script.Parent.Rotation = script.Parent.Rotation + 15 if script.Parent.Rotation == 360 then script.Parent.Rotation = 0 end end
-- enable the viewmodel system
local function enableviewmodel() isfirstperson = true if viewmodel.Parent ~= workspace.CurrentCamera then viewmodel.Parent = workspace.CurrentCamera end if rigtype == "R15" then -- disable character joints, enable viewmodel joints rightshoulderclone.Enabled = true leftshoulderclone.Enabled = true -- disable real shoulders leftshoulder.Enabled = true rightshoulder.Enabled = true -- rightshoulderclone.Part1 = rarm rightshoulderclone.Part0 = faketorso rightshoulderclone.Parent = faketorso -- leftshoulderclone.Part1 = larm leftshoulderclone.Part0 = faketorso leftshoulderclone.Parent = faketorso -- armtransparency = firstperson_arm_transparency else -- rightshoulderclone.Enabled = true leftshoulderclone.Enabled = true -- disable real shoulders leftshoulder.Enabled = false rightshoulder.Enabled = false -- rightshoulderclone.Part1 = rarm rightshoulderclone.Part0 = faketorso rightshoulderclone.Parent = faketorso -- leftshoulderclone.Part1 = larm leftshoulderclone.Part0 = faketorso leftshoulderclone.Parent = faketorso --larm.Anchored = true --rarm.Anchored = true -- armtransparency = firstperson_arm_transparency end end
-- Decompiled with the Synapse X Luau decompiler.
local v1 = require(script:FindFirstAncestor("MainUI").Modules.WindShake); v1:Init(); local v2, v3, v4 = ipairs(workspace.Lobby:GetDescendants()); while true do v2(v3, v4); if not v2 then break; end; v4 = v2; if v3:IsA("BasePart") and v3:GetAttribute("WindShake") then v1:AddObjectShake(v3); end; end;
-------------------------
mouse.KeyDown:connect(function (key) key = string.lower(key) if key == "r" then --Camera controls if cam == ("car") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Custom") cam = ("freeplr") Camera.FieldOfView = 70 elseif cam == ("freeplr") then Camera.CameraSubject = player.Character.Humanoid Camera.CameraType = ("Attach") cam = ("lockplr") Camera.FieldOfView = 45 elseif cam == ("lockplr") then Camera.CameraSubject = carSeat Camera.CameraType = ("Custom") cam = ("car") Camera.FieldOfView = 70 end elseif key == "" then --Window controls if windows == false then winfob.Visible = true windows = true else windows = false winfob.Visible = false end elseif key == "" then --Dash Screen Switch if carSeat.Parent.Body.Dash.DashSc.G.Unit.Visible == false then handler:FireServer('DashSwitch', true) else end elseif key == "" then --FM Screen Switch if carSeat.Parent.Body.Dash.Screen.G.Startup.Visible == false and carSeat.Parent.Body.Dash.Screen.G.Caution.Visible == false then handler:FireServer('FMSwitch', true) else end elseif key == "" then -- volume down if carSeat.Parent.Body.MP.Sound.Volume >= 0 then handler:FireServer('volumedown', true) end elseif key == "" then -- volume up if carSeat.Parent.Body.MP.Sound.Volume <= 10 then handler:FireServer('volumeup', true) end end end) HUB.Limiter.MouseButton1Click:connect(function() --Ignition if carSeat.IsOn.Value == false then carSeat.IsOn.Value = true carSeat.Startup:Play() wait(1) carSeat.Chime:Play() else carSeat.IsOn.Value = false end end) TR.SN.MouseButton1Click:connect(function() --Show tracker names script.Parent.Names.Value = true end) TR.HN.MouseButton1Click:connect(function() --Hide tracker names script.Parent.Names.Value = false end) winfob.mg.Play.MouseButton1Click:connect(function() --Play the next song handler:FireServer('updateSong', winfob.mg.Input.Text) end) winfob.mg.Stop.MouseButton1Click:connect(function() --Play the next song handler:FireServer('pauseSong') end) carSeat.Indicator.Changed:connect(function() if carSeat.Indicator.Value == true then script.Parent.Indicator:Play() else script.Parent.Indicator2:Play() end end) game.Lighting.Changed:connect(function(prop) if prop == "TimeOfDay" then handler:FireServer('TimeUpdate') end end) if game.Workspace.FilteringEnabled == true then handler:FireServer('feON') elseif game.Workspace.FilteringEnabled == false then handler:FireServer('feOFF') end carSeat.LI.Changed:connect(function() if carSeat.LI.Value == true then carSeat.Parent.Body.Dash.Spd.G.Indicator.Visible = true script.Parent.HUB.Left.Visible = true else carSeat.Parent.Body.Dash.Spd.G.Indicator.Visible = false script.Parent.HUB.Left.Visible = false end end) carSeat.RI.Changed:connect(function() if carSeat.RI.Value == true then carSeat.Parent.Body.Dash.Tac.G.Indicator.Visible = true script.Parent.HUB.Right.Visible = true else carSeat.Parent.Body.Dash.Tac.G.Indicator.Visible = false script.Parent.HUB.Right.Visible = false end end) for i,v in pairs(script.Parent:getChildren()) do if v:IsA('TextButton') then v.MouseButton1Click:connect(function() if carSeat.Windows:FindFirstChild(v.Name) then local v = carSeat.Windows:FindFirstChild(v.Name) if v.Value == true then handler:FireServer('updateWindows', v.Name, false) else handler:FireServer('updateWindows', v.Name, true) end end end) end end while wait() do if carSeat.Parent:FindFirstChild("Body") then carSeat.Parent.Body.Dash.DashSc.G.Modes.SpeedStats.Speed.Text = math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88))) end end
-- Waits for a new character to be added if the current one is invalid -- (Ensures that you don't have the old dead character after a respawn)
function UTIL.WaitForValidCharacter(player) local character = player.Character if not character or not character.Parent or not character:FindFirstChild('Humanoid') or character.Humanoid.Health <= 0 then player.CharacterAdded:wait() wait(0) --NOTE: Necessary for server scripts executing on the same event character = player.Character end return character end
------------------------------------------------------------------------------------------------------------
function configureAnimationSetOld(name, fileList) if (animTable[name] ~= nil) then for _, connection in pairs(animTable[name].connections) do connection:disconnect() end end animTable[name] = {} animTable[name].count = 0 animTable[name].totalWeight = 0 animTable[name].connections = {} local allowCustomAnimations = true local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end) if not success then allowCustomAnimations = true end -- check for config values local config = script:FindFirstChild(name) if (allowCustomAnimations and config ~= nil) then table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end)) local idx = 1 for _, childPart in pairs(config:GetChildren()) do if (childPart:IsA("Animation")) then table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end)) animTable[name][idx] = {} animTable[name][idx].anim = childPart local weightObject = childPart:FindFirstChild("Weight") if (weightObject == nil) then animTable[name][idx].weight = 1 else animTable[name][idx].weight = weightObject.Value end animTable[name].count = animTable[name].count + 1 animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight idx = idx + 1 end end end -- fallback to defaults if (animTable[name].count <= 0) then for idx, anim in pairs(fileList) do animTable[name][idx] = {} animTable[name][idx].anim = Instance.new("Animation") animTable[name][idx].anim.Name = name animTable[name][idx].anim.AnimationId = anim.id animTable[name][idx].weight = anim.weight animTable[name].count = animTable[name].count + 1 animTable[name].totalWeight = animTable[name].totalWeight + anim.weight -- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")") end end -- preload anims for i, animType in pairs(animTable) do for idx = 1, animType.count, 1 do Humanoid:LoadAnimation(animType[idx].anim) end end end
--[[ This function fixes a problem where when the Camera's CameraType is set back to Enum.CameraType.Custom, it snaps back to the last distance before we animated it. As such, if the user is zoomed far out, calling `focusCharacter()` will zoom in, and then once the animation finishes the camera snaps back to the distance it was at before. To work around this, we use this function to force the camera's zoom distance to the distance that the camera will be from the character when the animation completes. ]]
local function _setZoomDistanceHack(player: Player, distance: number, callback: () -> ()) local min = player.CameraMinZoomDistance local max = player.CameraMaxZoomDistance player.CameraMinZoomDistance = distance player.CameraMaxZoomDistance = distance callback() player.CameraMinZoomDistance = min player.CameraMaxZoomDistance = max end local function focusCharacter(player: Player, camera: Camera, offset: number?): RBXScriptSignal offset = if offset ~= nil then offset else 10 -- selene: allow(incorrect_standard_library_use) assert(offset) local character = player.Character local completed = Instance.new("BindableEvent") if character and character.PrimaryPart then local cameraType = camera.CameraType local motor = Otter.createSingleMotor(0) local direction = character:GetPrimaryPartCFrame().LookVector local goalPosition = camera.Focus.Position + (Vector3.new(offset, 0, offset) * direction) local goal = CFrame.lookAt(goalPosition, camera.Focus.Position) motor:onStep(function(alpha: number) camera.CFrame = camera.CFrame:Lerp(goal, alpha) end) motor:onComplete(function() completed:Fire() _setZoomDistanceHack(player, offset, function() camera.CameraType = cameraType -- Wait a frame to ensure the Camera has time to update based on the -- current max zoom distance before we leave this scope and reset it task.wait() end) end) camera.CameraType = Enum.CameraType.Scriptable motor:setGoal(Otter.spring(1, constants.Springs.Slowpoke)) end return completed.Event end return focusCharacter
--print('stun ending')
guiMain:Destroy() script.Parent:Destroy()
-- Define the function to open or close the window with gene-alike effect
local function toggleWindow() if window.Visible then window.Visible = false opened.Visible = false -- 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.5, false, function() window.Visible = false end ) end end
-- LOCAL
local tweenService = game:GetService("TweenService") local replicatedStorage = game:GetService("ReplicatedStorage") local debris = game:GetService("Debris") local userInputService = game:GetService("UserInputService") local httpService = game:GetService("HttpService") -- This is to generate GUIDs local runService = game:GetService("RunService") local textService = game:GetService("TextService") local guiService = game:GetService("GuiService") local starterGui = game:GetService("StarterGui") local players = game:GetService("Players") local IconController = require(script.IconController) local Signal = require(script.Signal) local Maid = require(script.Maid) local TopbarPlusGui = require(script.TopbarPlusGui) local TopbarPlusReference = require(script.TopbarPlusReference) local referenceObject = TopbarPlusReference.getObject() local Themes = require(script.Themes) local activeItems = TopbarPlusGui.ActiveItems local topbarContainer = TopbarPlusGui.TopbarContainer local iconTemplate = topbarContainer["IconContainer"] local DEFAULT_THEME = Themes.Default local THUMB_OFFSET = 55 local Icon = (referenceObject and require(referenceObject.Value)) or {} Icon.__index = Icon if not referenceObject then TopbarPlusReference.addToReplicatedStorage() end
-- 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 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 local smallButNotZero = 0.0001 function setRunSpeed(speed) if speed < 0.33 then currentAnimTrack:AdjustWeight(1.0) runAnimTrack:AdjustWeight(smallButNotZero) elseif speed < 0.66 then local weight = ((speed - 0.33) / 0.33) currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero) runAnimTrack:AdjustWeight(weight + smallButNotZero) else currentAnimTrack:AdjustWeight(smallButNotZero) runAnimTrack:AdjustWeight(1.0) end local speedScaled = speed * 1.25 runAnimTrack:AdjustSpeed(speedScaled) currentAnimTrack:AdjustSpeed(speedScaled) end function setAnimationSpeed(speed) if speed ~= currentAnimSpeed then currentAnimSpeed = speed if currentAnim == "walk" then setRunSpeed(speed) else currentAnimTrack:AdjustSpeed(currentAnimSpeed) end end end function keyFrameReachedFunc(frameName) if (frameName == "End") then if currentAnim == "walk" then runAnimTrack.TimePosition = 0.0 currentAnimTrack.TimePosition = 0.0 else local repeatAnim = currentAnim -- return to idle if finishing an emote if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then repeatAnim = "idle" 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 function playAnimation(animName, transitionTime, humanoid) local idx = rollAnimation(animName) local anim = animTable[animName][idx].anim -- 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() 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
-- Put in StarterPlayer > StarterCharacterScripts == Scripted By Conikku
local player = game.Players.LocalPlayer local character = workspace:WaitForChild(player.Name) local humanoid = character:WaitForChild("Humanoid") humanoid:SetStateEnabled(Enum.HumanoidStateType.Swimming,false)
-- message : (string) the text of error thrown -- stack : (string) the debug.traceback() of the where the error originated -- origin : (datatype) the container where the error came from
function ErrorReporter:Report(message, stack, origin) -- make sure that there isn't a circular loop of errors local success, result = pcall(function() if DEBUG_REPORTER then local debugMsg = table.concat({ "Received Error :", string.format("Message : (%s) - %s", type(message), message), string.format("Stack : (%s) - %s", type(stack), stack), string.format("Origin : (%s) - %s", type(origin), getFullPath(origin)), "***************************", }, "\n") print(debugMsg) end -- format the message and stack local strMessage = removePlayerNameFromStack(message) local strStack = removePlayerNameFromStack(stack) local strOrigin = removePlayerNameFromStack(getFullPath(origin)) -- report the error to all reporters if REPORT_TO_GOOGLE_ANALYTICS then local p = self._googleAnalyticsReporter:sendEvent(GAME_VERSION, strMessage, strStack) p:andThen(function() if PRINT_SUCCESSFUL_GOOGLE_ANALYTICS then print("** Successfully reported error to GoogleAnalytics **", "(Set Config.PRINT_SUCCESSFUL_GOOGLE_ANALYTICS to false to disable this message)") end end, function(err) warn("Error thrown while reporting to GA : ", err) end) end if REPORT_TO_PLAYFAB then local category = string.format("Errors-%s", GAME_VERSION) local value = { error = strMessage, stack = strMessage, origin = strOrigin, } self._playFabReporter:fireEvent(category, value) -- PlayFab will not work while testing in Studio. It will give you an error saying : -- `AnalyticsService can only be executed by game server.` -- This means that you have to be playing a published game to get any real data. -- But as far as this script cares, you successfully sent data to PlayFab. if PRINT_SUCCESSFUL_PLAYFAB then print("** Successfully reported error to PlayFab **", "(Set Config.PRINT_SUCCESSFUL_PLAYFAB to false to disable this message)") end end end) if not success then local warning = table.concat({ "Error Reporter threw an error :", tostring(result), "While reporting...", string.format("Message : (%s) - %s", type(message), message), string.format("Stack : (%s) - %s", type(stack), stack), string.format("Origin : (%s) - %s", type(origin), tostring(origin)), }, "\n") warn(warning) end end return ErrorReporter
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
function OnRunning(Speed) if Speed > 0.01 then PlayAnimation("Walk", 0.1, Humanoid) Pose = "Running" else PlayAnimation("Idle", 0.1, Humanoid) Pose = "Standing" end end function OnDied() Pose = "Dead" end function OnJumping() PlayAnimation("Jump", 0.1, Humanoid) JumpAnimTime = JumpAnimDuration Pose = "Jumping" end function OnClimbing(Speed) PlayAnimation("Climb", 0.1, Humanoid) SetAnimationSpeed(Speed / 12) Pose = "Climbing" end function OnGettingUp() Pose = "GettingUp" end function OnFreeFall() if JumpAnimTime <= 0 then PlayAnimation("Fall", FallTransitionTime, Humanoid) end Pose = "FreeFall" end function OnFallingDown() Pose = "FallingDown" end function OnSeated() Pose = "Seated" end function OnPlatformStanding() Pose = "PlatformStanding" end function OnSwimming(Speed) if Speed > 0 then Pose = "Running" else Pose = "Standing" end end function GetTool() for i, Tool in pairs(Figure:GetChildren()) do if Tool:IsA("Tool") then return Tool end end return nil end function GetToolAnim(Tool) for i, Anim in pairs(Tool:GetChildren()) do if string.lower(Anim.Name) == string.lower("ToolAnim") and Anim:IsA("StringValue") then return Anim end end return nil end function AnimateTool() if ToolAnim == "None" then PlayToolAnimation("ToolNone", ToolTransitionTime, Humanoid) return end if ToolAnim == "Slash" then PlayToolAnimation("ToolSlash", 0, Humanoid) return end if ToolAnim == "Lunge" then PlayToolAnimation("ToolLunge", 0, Humanoid) return end end function MoveSit() --RightShoulder.MaxVelocity = 0.15 --LeftShoulder.MaxVelocity = 0.15 --RightShoulder:SetDesiredAngle(3.14 / 2) --LeftShoulder:SetDesiredAngle(-3.14 / 2) --RightHip:SetDesiredAngle(3.14 / 2) --LeftHip:SetDesiredAngle(-3.14 / 2) RightHip:SetDesiredAngle(1) RightHip.CurrentAngle = RightHip.DesiredAngle LeftHip:SetDesiredAngle(-1) LeftHip.CurrentAngle = LeftHip.DesiredAngle end local LastTick = 0 function Move(Time) local Amplitude = 1 local Frequency = 1 local DeltaTime = (Time - LastTick) LastTick = Time local ClimbFudge = 0 local SetAngles = false if JumpAnimTime > 0 then JumpAnimTime = (JumpAnimTime - DeltaTime) end if Pose == "FreeFall" and JumpAnimTime <= 0 then PlayAnimation("Fall", FallTransitionTime, Humanoid) elseif Pose == "Seated" then StopAllAnimations() MoveSit() return elseif Pose == "Running" then PlayAnimation("Walk", 0.1, Humanoid) elseif Pose == "Dead" or Pose == "GettingUp" or Pose == "FallingDown" or Pose == "Seated" or Pose == "PlatformStanding" then
--sound.ScriptWestMinsterChimes.Disabled=true
sound.ScriptOff.Disabled=false wait(4) end wait() end
----------------SCRIPT--------------------------------------------------------------------------------------------------------------
if script.Disabled == false then script.Parent["READ ME"].Disabled = true end while true do wait(spawntime) local Part = game.Workspace.Handleone Part.Position = script.Parent.Position Part.Anchored = false Part.Parent = game.Workspace end
--[=[ Cleans up the BasicPane, invoking Maid:DoCleaning() on the BasicPane and setting the metatable to nil. ]=]
function BasicPane:Destroy() self._maid:DoCleaning() self._maid = nil setmetatable(self, nil) end return BasicPane
--// All global vars will be wiped/replaced except script
return function(data) local playergui = service.PlayerGui local localplayer = service.Players.LocalPlayer local gui = script.Parent.Parent local frame = gui.Frame --local cont = gui.Frame.Container local termCont = frame.termCont local serverCont = frame.serverCont local localCont = frame.localCont local logsCont = frame.logsCont local scriptCont = frame.scriptCont local errorCont = frame.errorCont local localTab = frame.localTab local scriptTab = frame.scriptTab local logsTab = frame.logsTab local termTab = frame.termTab local serverTab = frame.serverTab local errorTab = frame.errorTab local close = gui.Frame.Close local box = gui.Frame.Command local name = gui.Frame.Nameb local dragger = gui.Frame.Dragger local entry = gui.Entry local termLines = {} local localLines = {} local serverLines = {} local logsLines = {} local scriptLines = {} local errorLines = {} local function openLocal() localCont.Visible = true scriptCont.Visible = false logsCont.Visible = false termCont.Visible = false serverCont.Visible = false errorCont.Visible = false localTab.BackgroundTransparency = 0 scriptTab.BackgroundTransparency = 0.5 logsTab.BackgroundTransparency = 0.5 termTab.BackgroundTransparency = 0.5 serverTab.BackgroundTransparency = 0.5 errorTab.BackgroundTransparency = 0.5 end local function openScript() localCont.Visible = false scriptCont.Visible = true logsCont.Visible = false termCont.Visible = false serverCont.Visible = false errorCont.Visible = false localTab.BackgroundTransparency = 0.5 scriptTab.BackgroundTransparency = 0 logsTab.BackgroundTransparency = 0.5 termTab.BackgroundTransparency = 0.5 serverTab.BackgroundTransparency = 0.5 errorTab.BackgroundTransparency = 0.5 end local function openLogs() localCont.Visible = false scriptCont.Visible = false logsCont.Visible = true termCont.Visible = false serverCont.Visible = false errorCont.Visible = false localTab.BackgroundTransparency = 0.5 scriptTab.BackgroundTransparency = 0.5 logsTab.BackgroundTransparency = 0 termTab.BackgroundTransparency = 0.5 serverTab.BackgroundTransparency = 0.5 errorTab.BackgroundTransparency = 0.5 end local function openTerm() localCont.Visible = false scriptCont.Visible = false logsCont.Visible = false termCont.Visible = true serverCont.Visible = false errorCont.Visible = false localTab.BackgroundTransparency = 0.5 scriptTab.BackgroundTransparency = 0.5 logsTab.BackgroundTransparency = 0.5 termTab.BackgroundTransparency = 0 serverTab.BackgroundTransparency = 0.5 errorTab.BackgroundTransparency = 0.5 end local function openServer() localCont.Visible = false scriptCont.Visible = false logsCont.Visible = false termCont.Visible = false serverCont.Visible = true errorCont.Visible = false localTab.BackgroundTransparency = 0.5 scriptTab.BackgroundTransparency = 0.5 logsTab.BackgroundTransparency = 0.5 termTab.BackgroundTransparency = 0.5 serverTab.BackgroundTransparency = 0 errorTab.BackgroundTransparency = 0.5 end local function openErrors() localCont.Visible = false scriptCont.Visible = false logsCont.Visible = false termCont.Visible = false serverCont.Visible = false errorCont.Visible = true localTab.BackgroundTransparency = 0.5 scriptTab.BackgroundTransparency = 0.5 logsTab.BackgroundTransparency = 0.5 termTab.BackgroundTransparency = 0.5 serverTab.BackgroundTransparency = 0.5 errorTab.BackgroundTransparency = 0 end local function populate(cont,lines) cont:ClearAllChildren() local num = 0 for i,v in next,lines do local new,text,color = entry:Clone() if type(v) == "table" then text = v.Text color = v.Color else text = tostring(v) end new.Visible = true new.Text = tostring(text) new.Position = UDim2.new(0,0,0,num*20) new.Parent = cont new.TextColor3 = color or new.TextColor3 num = num+1 end cont.CanvasSize = UDim2.new(0, 0, 0, (num*20)) local glob = ((num*20) - cont.AbsoluteWindowSize.Y) if glob<0 then glob=0 end cont.CanvasPosition = Vector2.new(0,glob) end local function populateAll() populate(scriptCont,scriptLines) populate(logsCont,logsLines) populate(serverCont,serverLines) populate(termCont,termLines) populate(localCont,localLines) populate(errorCont,errorLines) end --name.Text = localplayer.userId.."@"..game.PlaceId.." ;/>" local function out(put,lines) table.insert(lines,put) if #lines>500 then table.remove(lines,1) end end local function formatOutput(tab) local new = {} for i,v in next,tab do if type(v) == "table" then local typ,color = v.messageType if typ == "Error" then color = Color3.new(1,0,0) elseif typ == "Info" then color = Color3.new(0,0,1) elseif typ == "Warning" then color = Color3.new(0,1,1) end table.insert(new,{ Text = v.message; Color = color; }) else table.insert(new,tostring(v)) end end return new end local function formatLogs(tab) local new = {} for i,v in next,tab do if type(v) == "table" then table.insert(new,{ Text = tostring(v.Text)..": "..tostring(v.Desc); }) else table.insert(new,tostring(v)) end end return new end service.Events.TerminalLive:connect(function(rData) local data = rData.Data local rType = rData.Type out(data,termLines) populate(termCont,termLines) end) local updater = service.StartLoop("TerminalLoop",1,function() service.Debounce("_TERMINAL_UPDATING",function() local data = client.Remote.Get("TerminalData") --termLines = data.Output serverLines = formatOutput(data.ServerLogs or {}) logsLines = formatLogs(data.AdminLogs or {}) scriptLines = formatLogs(data.ScriptLogs or {}) errorLines = formatLogs(data.ErrorLogs or {}) localLines = formatOutput(service.LogService:GetLogHistory() or {}) --populate(termCont,termLines) populate(scriptCont,scriptLines) populate(logsCont,logsLines) populate(errorCont,errorLines) populate(serverCont,serverLines) populate(localCont,localLines) end) end,true) box.FocusLost:connect(function(enterPressed) service.Debounce("_TERMINAL_BOX_FOCUSLOST",function() wait(0.1) if enterPressed and box.Text~="" then local com = box.Text box.Text = "" out(">"..com,termLines) populate(termCont,termLines) local ret = client.Remote.Get("Terminal",com,{ Time = tick(); }) if ret and type(ret) == "table" then for i,ent in next,ret do out(ent,termLines) end populate(termCont,termLines) end box:CaptureFocus() box.Text = "" end end) end) close.MouseButton1Click:connect(function() updater:Kill() client.Remote.Send("Session","Terminal",false) out("Disconnecting session...",termLines) populate(termCont,termLines) wait(0.5) gui:Destroy() end) localTab.MouseButton1Down:connect(openLocal) scriptTab.MouseButton1Down:connect(openScript) logsTab.MouseButton1Down:connect(openLogs) termTab.MouseButton1Down:connect(openTerm) serverTab.MouseButton1Down:connect(openServer) errorTab.MouseButton1Down:connect(openErrors) local mouse=service.Players.LocalPlayer:GetMouse() local nx,ny=frame.AbsoluteSize.X,frame.AbsoluteSize.Y--500,300 local dragging=false local defx,defy=nx,ny mouse.Move:connect(function(x,y) if dragging then nx=defx+(dragger.Position.X.Offset+20) ny=defy+(dragger.Position.Y.Offset+20) if nx<300 then nx=300 end if ny<200 then ny=200 end frame.Size=UDim2.new(0, nx, 0, ny) end end) dragger.DragBegin:connect(function(init) dragging = true frame.Active = false end) dragger.DragStopped:connect(function(x,y) frame.Active = true dragging = false defx = nx defy = ny dragger.Position = UDim2.new(1,-20,1,-20) populateAll() end) populateAll() gTable:Ready() end
-- Preload animations
function playAnimation(animName, transitionTime, Zombie) local idleFromEmote = (animName == "idle" and emoteNames[currentAnim] ~= nil) if (animName ~= currentAnim and not idleFromEmote) then if (currentAnimTrack ~= nil) then currentAnimTrack:Stop(transitionTime) currentAnimTrack:Destroy() end currentAnimSpeed = 1.0 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
--[[ -----------[ THEMES ]----------- - LIGHT THEME: If you want the light theme version of the board, replace line 1 with: require(2925075326).Parent = script.Parent - DARK THEME: If you want the dark theme version of the board, replace line 1 with: require(5799918029).Parent = script.Parent - RAINBOW THEME: If you want the rainbow theme version of the board, replace line 1 with: require(6872314867).Parent = script.Parent --]]
--[[** ensure value is an Instance and it's ClassName matches the given ClassName @param className The class name to check for @returns A function that will return true iff the condition is passed **--]]
function t.instanceOf(className, childTable) assert(t.string(className)) local childrenCheck if childTable ~= nil then childrenCheck = t.children(childTable) end return function(value) local instanceSuccess, instanceErrMsg = t.Instance(value) if not instanceSuccess then return false, instanceErrMsg or "" end if value.ClassName ~= className then return false, string.format("%s expected, got %s", className, value.ClassName) end if childrenCheck then local childrenSuccess, childrenErrMsg = childrenCheck(value) if not childrenSuccess then return false, childrenErrMsg end end return true end end t.instance = t.instanceOf
-- Represents any table.
export type GenericTable = {[any]: any}
-- NOTE: The Repeating Times, Reversing, And Delay Is OPTIONAL
local TweenGoals = { Rotation = 360 } script.Parent.Parent.Parent.Sound:Play() local create = TweenService:Create(script.Parent,TweeningInfo,TweenGoals) while true do create:Play() task.wait() script.Parent.Rotation = 0 end
-------------------- --| Script Logic |-- --------------------
Tool.Equipped:Connect(OnEquipped) Tool.Activated:Connect(OnActivated)
--[[ The task.wait() calls below are placeholders for calling asynchronous functions that would load parts of your game. --]]
local ContentProvider = game:GetService("ContentProvider") local LoadingScreen = require(script.Parent.LoadingScreen) local REQUIRED_ASSETS = { game.Workspace } LoadingScreen.enableAsync() LoadingScreen.updateDetailText("Preloading important assets...") ContentProvider:PreloadAsync(REQUIRED_ASSETS) LoadingScreen.updateDetailText("Initializing...") task.wait(1.5) LoadingScreen.updateDetailText("Loading user data...") task.wait(3) LoadingScreen.updateDetailText("Spawning character...") task.wait(3) LoadingScreen.updateDetailText("Finishing up...") task.wait(0.5) LoadingScreen.disableAsync()
--------AUDIENCE BACK LEFT--------
game.Workspace.audiencebackleft1.Part3.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.audiencebackleft1.Part6.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.audiencebackleft1.Part9.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-- title macro item
local item = {} function item:New(itemContainer, macroItem, pluginSettings, updatePluginSettings) itemContainer.TextLabel.Text = macroItem.Text function macroItem:UpdateText(text) itemContainer.TextLabel.Text = text end function macroItem:UpdateTheme(theme) itemContainer.TextLabel.TextColor3 = theme:GetColor(Enum.StudioStyleGuideColor.MainText) end end return item
-- Map storing Player -> Blocked user Ids.
local BlockedUserIdsMap = {} PlayersService.PlayerAdded:connect(function(newPlayer) for player, blockedUsers in pairs(BlockedUserIdsMap) do local speaker = ChatService:GetSpeaker(player.Name) if speaker then for i = 1, #blockedUsers do local blockedUserId = blockedUsers[i] if blockedUserId == newPlayer.UserId then speaker:AddMutedSpeaker(newPlayer.Name) end end end end end) PlayersService.PlayerRemoving:connect(function(removingPlayer) BlockedUserIdsMap[removingPlayer] = nil end) if FFlagUserChatAddServerSideChecks2 then EventFolder.SetBlockedUserIdsRequest.OnServerEvent:Connect(function(player, blockedUserIdsList) if type(blockedUserIdsList) ~= "table" then return end local prunedBlockedUserIdsList = {} local speaker = ChatService:GetSpeaker(player.Name) if speaker then for i = 1, math.min(#blockedUserIdsList, MAX_BLOCKED_SPEAKERS_PER_REQ) do if type(blockedUserIdsList[i]) == "number" then table.insert(prunedBlockedUserIdsList, blockedUserIdsList[i]) local blockedPlayer = PlayersService:GetPlayerByUserId(blockedUserIdsList[i]) if blockedPlayer then speaker:AddMutedSpeaker(blockedPlayer.Name) end end end -- We only want to store the first -- MAX_BLOCKED_SPEAKERS_PER_REQ number of ids as needed BlockedUserIdsMap[player] = prunedBlockedUserIdsList end end) elseif FFlagUserChatAddServerSideChecks then EventFolder.SetBlockedUserIdsRequest.OnServerEvent:Connect(function(player, blockedUserIdsList) if type(blockedUserIdsList) ~= "table" then return end BlockedUserIdsMap[player] = blockedUserIdsList local speaker = ChatService:GetSpeaker(player.Name) if speaker then for i = 1, math.min(#blockedUserIdsList, MAX_BLOCKED_SPEAKERS_PER_REQ) do if type(blockedUserIdsList[i]) == "number" then local blockedPlayer = PlayersService:GetPlayerByUserId(blockedUserIdsList[i]) if blockedPlayer then speaker:AddMutedSpeaker(blockedPlayer.Name) end end end end end) else EventFolder.SetBlockedUserIdsRequest.OnServerEvent:Connect(function(player, blockedUserIdsList) if type(blockedUserIdsList) ~= "table" then return end BlockedUserIdsMap[player] = blockedUserIdsList local speaker = ChatService:GetSpeaker(player.Name) if speaker then for i = 1, #blockedUserIdsList do if type(blockedUserIdsList[i]) == "number" then local blockedPlayer = PlayersService:GetPlayerByUserId(blockedUserIdsList[i]) if blockedPlayer then speaker:AddMutedSpeaker(blockedPlayer.Name) end end end end end) end EventFolder.GetInitDataRequest.OnServerInvoke = (function(playerObj) local speaker = ChatService:GetSpeaker(playerObj.Name) if not (speaker and speaker:GetPlayer()) then CreatePlayerSpeakerObject(playerObj) speaker = ChatService:GetSpeaker(playerObj.Name) end local data = {} data.Channels = {} data.SpeakerExtraData = {} for _, channelName in pairs(speaker:GetChannelList()) do local channelObj = ChatService:GetChannel(channelName) if (channelObj) then local channelData = { channelName, channelObj:GetWelcomeMessageForSpeaker(speaker), channelObj:GetHistoryLogForSpeaker(speaker), channelObj.ChannelNameColor, } table.insert(data.Channels, channelData) end end for _, oSpeakerName in pairs(ChatService:GetSpeakerList()) do local oSpeaker = ChatService:GetSpeaker(oSpeakerName) data.SpeakerExtraData[oSpeakerName] = oSpeaker.ExtraData end return data end) local function DoJoinCommand(speakerName, channelName, fromChannelName) local speaker = ChatService:GetSpeaker(speakerName) local channel = ChatService:GetChannel(channelName) if (speaker) then if (channel) then if (channel.Joinable) then if (not speaker:IsInChannel(channel.Name)) then speaker:JoinChannel(channel.Name) else speaker:SetMainChannel(channel.Name) local msg = ChatLocalization:FormatMessageToSend( "GameChat_SwitchChannel_NowInChannel", string.format("You are now chatting in channel: '%s'", channel.Name), "RBX_NAME", channel.Name) speaker:SendSystemMessage(msg, channel.Name) end else local msg = ChatLocalization:FormatMessageToSend( "GameChat_ChatServiceRunner_YouCannotJoinChannel", "You cannot join channel '" .. channelName .. "'.", "RBX_NAME", channelName) speaker:SendSystemMessage(msg, fromChannelName) end else local msg = ChatLocalization:FormatMessageToSend( "GameChat_ChatServiceRunner_ChannelDoesNotExist", "Channel '" .. channelName .. "' does not exist.", "RBX_NAME", channelName) speaker:SendSystemMessage(msg, fromChannelName) end end end local function DoLeaveCommand(speakerName, channelName, fromChannelName) local speaker = ChatService:GetSpeaker(speakerName) local channel = ChatService:GetChannel(channelName) if (speaker) then if (speaker:IsInChannel(channelName)) then if (channel.Leavable) then speaker:LeaveChannel(channel.Name) local msg = ChatLocalization:FormatMessageToSend( "GameChat_ChatService_YouHaveLeftChannel", string.format("You have left channel '%s'", channelName), "RBX_NAME", channel.Name) speaker:SendSystemMessage(msg, "System") else local msg = ChatLocalization:FormatMessageToSend( "GameChat_ChatServiceRunner_YouCannotLeaveChannel", ("You cannot leave channel '" .. channelName .. "'."), "RBX_NAME", channelName) speaker:SendSystemMessage(msg, fromChannelName) end else local msg = ChatLocalization:FormatMessageToSend( "GameChat_ChatServiceRunner_YouAreNotInChannel", ("You are not in channel '" .. channelName .. "'."), "RBX_NAME", channelName) speaker:SendSystemMessage(msg, fromChannelName) end end end ChatService:RegisterProcessCommandsFunction("default_commands", function(fromSpeaker, message, channel) if (string.sub(message, 1, 6):lower() == "/join ") then DoJoinCommand(fromSpeaker, string.sub(message, 7), channel) return true elseif (string.sub(message, 1, 3):lower() == "/j ") then DoJoinCommand(fromSpeaker, string.sub(message, 4), channel) return true elseif (string.sub(message, 1, 7):lower() == "/leave ") then DoLeaveCommand(fromSpeaker, string.sub(message, 8), channel) return true elseif (string.sub(message, 1, 3):lower() == "/l ") then DoLeaveCommand(fromSpeaker, string.sub(message, 4), channel) return true end return false end) if ChatSettings.GeneralChannelName and ChatSettings.GeneralChannelName ~= "" then local allChannel = ChatService:AddChannel(ChatSettings.GeneralChannelName) allChannel.Leavable = false allChannel.AutoJoin = true allChannel:RegisterGetWelcomeMessageFunction(function(speaker) if RunService:IsStudio() then return nil end local player = speaker:GetPlayer() if player then local success, canChat = pcall(function() return Chat:CanUserChatAsync(player.UserId) end) if success and not canChat then return "" end end end) end local systemChannel = ChatService:AddChannel("System") systemChannel.Leavable = false systemChannel.AutoJoin = true systemChannel.WelcomeMessage = ChatLocalization:FormatMessageToSend( "GameChat_ChatServiceRunner_SystemChannelWelcomeMessage", "This channel is for system and game notifications." ) systemChannel.SpeakerJoined:connect(function(speakerName) systemChannel:MuteSpeaker(speakerName) end) local function TryRunModule(module) if module:IsA("ModuleScript") then local ret = require(module) if (type(ret) == "function") then ret(ChatService) end end end local modules = Chat:WaitForChild("ChatModules") modules.ChildAdded:connect(function(child) local success, returnval = pcall(TryRunModule, child) if not success and returnval then print("Error running module " ..child.Name.. ": " ..returnval) end end) for _, module in pairs(modules:GetChildren()) do local success, returnval = pcall(TryRunModule, module) if not success and returnval then print("Error running module " ..module.Name.. ": " ..returnval) end end PlayersService.PlayerRemoving:connect(function(playerObj) if (ChatService:GetSpeaker(playerObj.Name)) then ChatService:RemoveSpeaker(playerObj.Name) end end)
--[[ The reconciler is the mechanism in Roact that constructs the virtual tree that later gets turned into concrete objects by the renderer. Roact's reconciler is constructed with the renderer as an argument, which enables switching to different renderers for different platforms or scenarios. When testing the reconciler itself, it's common to use `NoopRenderer` with spies replacing some methods. The default (and only) reconciler interface exposed by Roact right now uses `RobloxRenderer`. ]]
local function createReconciler(renderer) local reconciler local mountVirtualNode local updateVirtualNode local unmountVirtualNode --[[ Unmount the given virtualNode, replacing it with a new node described by the given element. Preserves host properties, depth, and legacyContext from parent. ]] local function replaceVirtualNode(virtualNode, newElement) local hostParent = virtualNode.hostParent local hostKey = virtualNode.hostKey local depth = virtualNode.depth local parent = virtualNode.parent -- If the node that is being replaced has modified context, we need to -- use the original *unmodified* context for the new node -- The `originalContext` field will be nil if the context was unchanged local context = virtualNode.originalContext or virtualNode.context local parentLegacyContext = virtualNode.parentLegacyContext -- If updating this node has caused a component higher up the tree to re-render -- and updateChildren to be re-entered then this node could already have been -- unmounted in the previous updateChildren pass. if not virtualNode.wasUnmounted then unmountVirtualNode(virtualNode) end local newNode = mountVirtualNode(newElement, hostParent, hostKey, context, parentLegacyContext) -- mountVirtualNode can return nil if the element is a boolean if newNode ~= nil then newNode.depth = depth newNode.parent = parent end return newNode end --[[ Utility to update the children of a virtual node based on zero or more updated children given as elements. ]] local function updateChildren(virtualNode, hostParent, newChildElements) if config.internalTypeChecks then internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #1 to be of type VirtualNode") end virtualNode.updateChildrenCount = virtualNode.updateChildrenCount + 1 local currentUpdateChildrenCount = virtualNode.updateChildrenCount local removeKeys = {} -- Changed or removed children for childKey, childNode in pairs(virtualNode.children) do local newElement = ElementUtils.getElementByKey(newChildElements, childKey) local newNode = updateVirtualNode(childNode, newElement) -- If updating this node has caused a component higher up the tree to re-render -- and updateChildren to be re-entered for this virtualNode then -- this result is invalid and needs to be disgarded. if virtualNode.updateChildrenCount ~= currentUpdateChildrenCount then if newNode and newNode ~= virtualNode.children[childKey] then unmountVirtualNode(newNode) end return end if newNode ~= nil then virtualNode.children[childKey] = newNode else removeKeys[childKey] = true end end for childKey in pairs(removeKeys) do virtualNode.children[childKey] = nil end -- Added children for childKey, newElement in ElementUtils.iterateElements(newChildElements) do local concreteKey = childKey if childKey == ElementUtils.UseParentKey then concreteKey = virtualNode.hostKey end if virtualNode.children[childKey] == nil then local childNode = mountVirtualNode( newElement, hostParent, concreteKey, virtualNode.context, virtualNode.legacyContext ) -- If updating this node has caused a component higher up the tree to re-render -- and updateChildren to be re-entered for this virtualNode then -- this result is invalid and needs to be discarded. if virtualNode.updateChildrenCount ~= currentUpdateChildrenCount then if childNode then unmountVirtualNode(childNode) end return end -- mountVirtualNode can return nil if the element is a boolean if childNode ~= nil then childNode.depth = virtualNode.depth + 1 childNode.parent = virtualNode virtualNode.children[childKey] = childNode end end end end local function updateVirtualNodeWithChildren(virtualNode, hostParent, newChildElements) updateChildren(virtualNode, hostParent, newChildElements) end local function updateVirtualNodeWithRenderResult(virtualNode, hostParent, renderResult) if Type.of(renderResult) == Type.Element or renderResult == nil or typeof(renderResult) == "boolean" then updateChildren(virtualNode, hostParent, renderResult) else error( ("%s\n%s"):format( "Component returned invalid children:", virtualNode.currentElement.source or "<enable element tracebacks>" ), 0 ) end end --[[ Unmounts the given virtual node and releases any held resources. ]] function unmountVirtualNode(virtualNode) if config.internalTypeChecks then internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #1 to be of type VirtualNode") end virtualNode.wasUnmounted = true local kind = ElementKind.of(virtualNode.currentElement) -- selene: allow(if_same_then_else) if kind == ElementKind.Host then renderer.unmountHostNode(reconciler, virtualNode) elseif kind == ElementKind.Function then for _, childNode in pairs(virtualNode.children) do unmountVirtualNode(childNode) end elseif kind == ElementKind.Stateful then virtualNode.instance:__unmount() elseif kind == ElementKind.Portal then for _, childNode in pairs(virtualNode.children) do unmountVirtualNode(childNode) end elseif kind == ElementKind.Fragment then for _, childNode in pairs(virtualNode.children) do unmountVirtualNode(childNode) end else error(("Unknown ElementKind %q"):format(tostring(kind)), 2) end end local function updateFunctionVirtualNode(virtualNode, newElement) local children = newElement.component(newElement.props) updateVirtualNodeWithRenderResult(virtualNode, virtualNode.hostParent, children) return virtualNode end local function updatePortalVirtualNode(virtualNode, newElement) local oldElement = virtualNode.currentElement local oldTargetHostParent = oldElement.props.target local targetHostParent = newElement.props.target assert(renderer.isHostObject(targetHostParent), "Expected target to be host object") if targetHostParent ~= oldTargetHostParent then return replaceVirtualNode(virtualNode, newElement) end local children = newElement.props[Children] updateVirtualNodeWithChildren(virtualNode, targetHostParent, children) return virtualNode end local function updateFragmentVirtualNode(virtualNode, newElement) updateVirtualNodeWithChildren(virtualNode, virtualNode.hostParent, newElement.elements) return virtualNode end --[[ Update the given virtual node using a new element describing what it should transform into. `updateVirtualNode` will return a new virtual node that should replace the passed in virtual node. This is because a virtual node can be updated with an element referencing a different component! In that case, `updateVirtualNode` will unmount the input virtual node, mount a new virtual node, and return it in this case, while also issuing a warning to the user. ]] function updateVirtualNode(virtualNode, newElement, newState: { [any]: any }?): { [any]: any }? if config.internalTypeChecks then internalAssert(Type.of(virtualNode) == Type.VirtualNode, "Expected arg #1 to be of type VirtualNode") end if config.typeChecks then assert( Type.of(newElement) == Type.Element or typeof(newElement) == "boolean" or newElement == nil, "Expected arg #2 to be of type Element, boolean, or nil" ) end -- If nothing changed, we can skip this update if virtualNode.currentElement == newElement and newState == nil then return virtualNode end if typeof(newElement) == "boolean" or newElement == nil then unmountVirtualNode(virtualNode) return nil end if virtualNode.currentElement.component ~= newElement.component then return replaceVirtualNode(virtualNode, newElement) end local kind = ElementKind.of(newElement) local shouldContinueUpdate = true if kind == ElementKind.Host then virtualNode = renderer.updateHostNode(reconciler, virtualNode, newElement) elseif kind == ElementKind.Function then virtualNode = updateFunctionVirtualNode(virtualNode, newElement) elseif kind == ElementKind.Stateful then shouldContinueUpdate = virtualNode.instance:__update(newElement, newState) elseif kind == ElementKind.Portal then virtualNode = updatePortalVirtualNode(virtualNode, newElement) elseif kind == ElementKind.Fragment then virtualNode = updateFragmentVirtualNode(virtualNode, newElement) else error(("Unknown ElementKind %q"):format(tostring(kind)), 2) end -- Stateful components can abort updates via shouldUpdate. If that -- happens, we should stop doing stuff at this point. if not shouldContinueUpdate then return virtualNode end virtualNode.currentElement = newElement return virtualNode end --[[ Constructs a new virtual node but not does mount it. ]] local function createVirtualNode(element, hostParent, hostKey, context, legacyContext) if config.internalTypeChecks then internalAssert( renderer.isHostObject(hostParent) or hostParent == nil, "Expected arg #2 to be a host object" ) internalAssert(typeof(context) == "table" or context == nil, "Expected arg #4 to be of type table or nil") internalAssert( typeof(legacyContext) == "table" or legacyContext == nil, "Expected arg #5 to be of type table or nil" ) end if config.typeChecks then assert(hostKey ~= nil, "Expected arg #3 to be non-nil") assert( Type.of(element) == Type.Element or typeof(element) == "boolean", "Expected arg #1 to be of type Element or boolean" ) end return { [Type] = Type.VirtualNode, currentElement = element, depth = 1, parent = nil, children = {}, hostParent = hostParent, hostKey = hostKey, updateChildrenCount = 0, wasUnmounted = false, -- Legacy Context API -- A table of context values inherited from the parent node legacyContext = legacyContext, -- A saved copy of the parent context, used when replacing a node parentLegacyContext = legacyContext, -- Context API -- A table of context values inherited from the parent node context = context or {}, -- A saved copy of the unmodified context; this will be updated when -- a component adds new context and used when a node is replaced originalContext = nil, } end local function mountFunctionVirtualNode(virtualNode) local element = virtualNode.currentElement local children = element.component(element.props) updateVirtualNodeWithRenderResult(virtualNode, virtualNode.hostParent, children) end local function mountPortalVirtualNode(virtualNode) local element = virtualNode.currentElement local targetHostParent = element.props.target local children = element.props[Children] assert(renderer.isHostObject(targetHostParent), "Expected target to be host object") updateVirtualNodeWithChildren(virtualNode, targetHostParent, children) end local function mountFragmentVirtualNode(virtualNode) local element = virtualNode.currentElement local children = element.elements updateVirtualNodeWithChildren(virtualNode, virtualNode.hostParent, children) end --[[ Constructs a new virtual node and mounts it, but does not place it into the tree. ]] function mountVirtualNode(element, hostParent, hostKey, context, legacyContext) if config.internalTypeChecks then internalAssert( renderer.isHostObject(hostParent) or hostParent == nil, "Expected arg #2 to be a host object" ) internalAssert( typeof(legacyContext) == "table" or legacyContext == nil, "Expected arg #5 to be of type table or nil" ) end if config.typeChecks then assert(hostKey ~= nil, "Expected arg #3 to be non-nil") assert( Type.of(element) == Type.Element or typeof(element) == "boolean", "Expected arg #1 to be of type Element or boolean" ) end -- Boolean values render as nil to enable terse conditional rendering. if typeof(element) == "boolean" then return nil end local kind = ElementKind.of(element) local virtualNode = createVirtualNode(element, hostParent, hostKey, context, legacyContext) if kind == ElementKind.Host then renderer.mountHostNode(reconciler, virtualNode) elseif kind == ElementKind.Function then mountFunctionVirtualNode(virtualNode) elseif kind == ElementKind.Stateful then element.component:__mount(reconciler, virtualNode) elseif kind == ElementKind.Portal then mountPortalVirtualNode(virtualNode) elseif kind == ElementKind.Fragment then mountFragmentVirtualNode(virtualNode) else error(("Unknown ElementKind %q"):format(tostring(kind)), 2) end return virtualNode end --[[ Constructs a new Roact virtual tree, constructs a root node for it, and mounts it. ]] local function mountVirtualTree(element, hostParent, hostKey) if config.typeChecks then assert(Type.of(element) == Type.Element, "Expected arg #1 to be of type Element") assert(renderer.isHostObject(hostParent) or hostParent == nil, "Expected arg #2 to be a host object") end if hostKey == nil then hostKey = "RoactTree" end local tree = { [Type] = Type.VirtualTree, [InternalData] = { -- The root node of the tree, which starts into the hierarchy of -- Roact component instances. rootNode = nil, mounted = true, }, } tree[InternalData].rootNode = mountVirtualNode(element, hostParent, hostKey) return tree end --[[ Unmounts the virtual tree, freeing all of its resources. No further operations should be done on the tree after it's been unmounted, as indicated by its the `mounted` field. ]] local function unmountVirtualTree(tree) local internalData = tree[InternalData] if config.typeChecks then assert(Type.of(tree) == Type.VirtualTree, "Expected arg #1 to be a Roact handle") assert(internalData.mounted, "Cannot unmounted a Roact tree that has already been unmounted") end internalData.mounted = false if internalData.rootNode ~= nil then unmountVirtualNode(internalData.rootNode) end end --[[ Utility method for updating the root node of a virtual tree given a new element. ]] local function updateVirtualTree(tree, newElement) local internalData = tree[InternalData] if config.typeChecks then assert(Type.of(tree) == Type.VirtualTree, "Expected arg #1 to be a Roact handle") assert(Type.of(newElement) == Type.Element, "Expected arg #2 to be a Roact Element") end internalData.rootNode = updateVirtualNode(internalData.rootNode, newElement) return tree end reconciler = { mountVirtualTree = mountVirtualTree, unmountVirtualTree = unmountVirtualTree, updateVirtualTree = updateVirtualTree, createVirtualNode = createVirtualNode, mountVirtualNode = mountVirtualNode, unmountVirtualNode = unmountVirtualNode, updateVirtualNode = updateVirtualNode, updateVirtualNodeWithChildren = updateVirtualNodeWithChildren, updateVirtualNodeWithRenderResult = updateVirtualNodeWithRenderResult, } return reconciler end return createReconciler