prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--Antiremoval
function onRemove(i) ra2 = ra la2 = la rl2 = rl ll2 = ll hd2 = hd if (wasUsed) then return end if (i:IsA("BasePart")) then if (i.Position.y < 0) then return end if (i == head) then head = i:clone() head.Parent = char head.BrickColor = bcolor head.Material = material hd = neck:clone() hd.Part0 = tors hd.Part1 = head hd.Parent = tors hum.Health = hum.MaxHealth hum.PlatformStand = true end if (i == tors) then tors = i:clone() tors.Parent = char tors.BrickColor = bcolor tors.Material = material hd = neck:clone() hd.Part0 = tors hd.Part1 = head hd.Parent = tors ra = rS:clone() ra.Part0 = tors ra.Part1 = rArm ra.Parent = tors la = lS:clone() la.Part0 = tors la.Part1 = lArm la.Parent = tors rl = rH:clone() rl.Part0 = tors rl.Part1 = rLeg rl.Parent = tors ll = lH:clone() ll.Part0 = tors ll.Part1 = lLeg ll.Parent = tors h = hum:clone() hum:remove() wait() h.Parent = char hum = h hum.Health = hum.MaxHealth hum.PlatformStand = true anim = char:findFirstChild("Animate") if (anim) then cl = anim:clone() anim:remove() wait() cl.Parent = char cl = nil end anim = char:findFirstChild("Sound") if (anim) then cl = anim:clone() anim:remove() wait() cl.Parent = char cl = nil end hum.Changed:connect(fullHealth) tors.ChildRemoved:connect(onRemove) end if (i == rArm) then rArm = i:clone() rArm.Parent = char rArm.Material = material rArm.BrickColor = bcolor ra = rS:clone() ra.Part0 = tors ra.Part1 = rArm ra.Parent = tors end if (i == lArm) then lArm = i:clone() lArm.Parent = char lArm.Material = material lArm.BrickColor = bcolor la = lS:clone() la.Part0 = tors la.Part1 = lArm la.Parent = tors end if (i == rLeg) then rLeg = i:clone() rLeg.Parent = char rLeg.Material = material rLeg.BrickColor = bcolor rl = rH:clone() rl.Part0 = tors rl.Part1 = rLeg rl.Parent = tors end if (i == lLeg) then lLeg = i:clone() lLeg.Parent = char lLeg.Material = material lLeg.BrickColor = bcolor ll = lH:clone() ll.Part0 = tors ll.Part1 = lLeg ll.Parent = tors end end if (i == ra) then if (rArm) then if (rArm.Parent == char) then rArm:remove() end end end if (i == la) then if (lArm) then if (lArm.Parent == char) then lArm:remove() end end end if (i == rl) then if (rLeg) then if (rLeg.Parent == char) then rLeg:remove() end end end if (i == ll) then if (lLeg) then if (lLeg.Parent == char) then lLeg:remove() end end end if (i == hd) then if (head) then if (head.Parent == char) then head:remove() end end end if (ra2 ~= ra or la2 ~= la or rl2 ~= rl or ll2 ~= ll or hd2 ~= hd) then anim = char:findFirstChild("Animate") if (anim) then cl = anim:clone() anim:remove() wait() cl.Parent = char cl = nil end --[[local ff = Instance.new("ForceField") ff.Parent = script.Parent wait(2) ff:remove()]] end end health = 0 function fullHealth() diff = health - hum.Health if (hum.Health < 20) then hum.Health = hum.MaxHealth end if (diff > 100) then hum.PlatformStand = true end end function onAdd(i) if (i:IsA("Explosion")) then local rad = i.BlastRadius * 1.5 local dist = (i.Position - tors.Position).magnitude if (dist <= rad) then local ff = Instance.new("ForceField") ff.Parent = char wait(0.2) ff:remove() end else i.ChildAdded:connect(onAdd) end end function onAddRecursive(dir) if (dir == nil) then return end local a = dir:children() local b = 0 for b = 1, #a do onAddRecursive(a[b]) a[b].ChildAdded:connect(onAdd) end end hum.Changed:connect(fullHealth) char.ChildRemoved:connect(onRemove) tors.ChildRemoved:connect(onRemove) onAddRecursive(workspace) workspace.ChildAdded:connect(onAdd)
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
script.Parent:WaitForChild("Speedo") script.Parent:WaitForChild("Tach") script.Parent:WaitForChild("ln") script.Parent:WaitForChild("Gear") script.Parent:WaitForChild("Speed") local car = script.Parent.Parent.Car.Value car.DriveSeat.HeadsUpDisplay = false local _Tune = require(car["A-Chassis Tune"]) local _pRPM = _Tune.PeakRPM local _lRPM = _Tune.Redline local revEnd = math.ceil(_lRPM/1000) 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 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 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 local maxSpeed = math.ceil(wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive) local spInc = math.max(math.ceil(maxSpeed/200)*20,20) for i=0,revEnd*2 do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Tach ln.Rotation = 45 + i * 225 / (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=true 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 = true else ln.Num:Destroy() end ln.Visible=true end for i=1,90 do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Speedo 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=0,maxSpeed,spInc do local ln = script.Parent.ln:clone() ln.Parent = script.Parent.Speedo ln.Rotation = 45 + 225*(i/maxSpeed) ln.Num.Text = i ln.Num.Rotation = -ln.Rotation ln.Frame:Destroy() ln.Num.Visible=true ln.Visible=true 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 + 225 * 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 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() script.Parent.TCS.Visible = not script.Parent.TCS.Visible else wait() 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 end) script.Parent.Parent.Values.TCSActive.Changed:connect(function() 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 end) script.Parent.TCS.Changed:connect(function() 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 end) script.Parent.Parent.Values.PBrake.Changed:connect(function() script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value end) script.Parent.Parent.Values.TransmissionMode.Changed:connect(function() 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) else script.Parent.TMode.Text = "M/T" script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5) end end) script.Parent.Parent.Values.Velocity.Changed:connect(function(property) script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,script.Parent.Parent.Values.Velocity.Value.Magnitude/maxSpeed) script.Parent.Speed.Text = math.floor(script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " SPS" end)
--// F key, Horn
mouse.KeyDown:connect(function(key) if key=="f" then veh.Lightbar.middle.Airhorn:Play() veh.Lightbar.middle.WailR.Volume = 0 veh.Lightbar.middle.YelpR.Volume = 0 veh.Lightbar.middle.PriorityR.Volume = 0 veh.Lightbar.middle.Wail.Volume = 0 veh.Lightbar.middle.Yelp.Volume = 0 veh.Lightbar.middle.Priority.Volume = 0 end end)
-- Other local variables
local numCheckpoints = 0 local checkpoints = {} local racers = {} local winner = nil
--Idk what i advise yet i has to test this first Self xD!
local cam_change = true-- if set to false it dont locks camera after pressing C local Plane_Name = "----"--the plane name.. used for the GUI. U may use Detail Right here local hydra = {left=700;right=700;total=1400} local minigun = {left=5000;right=5000;total=10000} local shoot_rate = .1 -- change this for the duration between the Shooting local smoke_at_gun = true --if set to false it doesnt give smoke
--Made by Stickmasterluke ;D
sp=script.Parent theface="http://www.roblox.com/asset?id=103838612" health=80 textureclosed="http://www.roblox.com/asset?id=103920391" textureopen="http://www.roblox.com/asset?id=103920471" storedface="" local debris=game:GetService("Debris") check=true sp.Equipped:connect(function(mouse) equipped=true if mouse~=nil then mouse.Icon="rbxasset://textures\\GunCursor.png" mouse.Button1Down:connect(function() local chr=sp.Parent if chr and check then local t=chr:FindFirstChild("Torso") local h=chr:FindFirstChild("Humanoid") local anim=sp:FindFirstChild("Eat") if anim and t and h and h.Health>0 and equipped and check then mouse.Icon="rbxasset://textures\\GunWaitCursor.png" check=false anim2=h:LoadAnimation(anim) anim2:Play() local handle=sp:FindFirstChild("Handle") if handle~=nil then local mesh=handle:FindFirstChild("Mesh") if mesh~=nil then mesh.TextureId=textureopen end end wait(2) local s=sp.Handle:FindFirstChild("Sound") if s~=nil and equipped and w~=nil then w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(-.3,0,math.pi/4) s:Play() game:GetService("Players").LocalPlayer.PlayerScripts.Energy.Energy.Value = game:GetService("Players").LocalPlayer.PlayerScripts.Energy.Energy.Value + 10 if game:GetService("Players").LocalPlayer.PlayerScripts.Energy.Energy.Value > 100 then game:GetService("Players").LocalPlayer.PlayerScripts.Energy.Energy.Value = 100 end else check=true return end wait(2) if h~=nil and h.Health>0 and equipped and w~=nil then h:TakeDamage(-math.min(health*.5,h.MaxHealth-h.Health)) head=nil face=nil local head=h.Parent:FindFirstChild("Head") if head~=nil then face=head:FindFirstChild("face") if face~=nil then storedface=face.Texture face.Texture=theface end end w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(.3,0,math.pi/4) else check=true return end wait(2) local s=sp.Handle:FindFirstChild("Sound") if s~=nil and equipped and w~=nil then w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(-.3,0,math.pi/4) s:Play() else check=true return end wait(2) if h~=nil and h.Health>0 and equipped and w~=nil then h:TakeDamage(-math.min(health*.5,h.MaxHealth-h.Health)) w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(0,0,math.pi/4) end wait(3) if mouse~=nil then mouse.Icon="rbxasset://textures\\GunCursor.png" end if face~=nil then face.Texture=storedface end local handle=sp:FindFirstChild("Handle") if handle~=nil then local mesh=handle:FindFirstChild("Mesh") if mesh~=nil then mesh.TextureId=textureclosed end end check=true end end end) end delay(0,function() local la=sp.Parent:FindFirstChild("Left Arm") if la~=nil then if spoon then spoon:remove() end spoon=Instance.new("Part") spoon.FormFactor="Custom" spoon.Name="Handle" spoon.Size=Vector3.new(.2,.2,1.3) spoon.TopSurface="Smooth" spoon.BottomSurface="Smooth" spoon.CanCollide=false local m=Instance.new("SpecialMesh") m.MeshId="http://www.roblox.com/asset?id=103919885" m.TextureId=textureopen m.Parent=spoon w=Instance.new("Motor") w.Part0=la w.Part1=spoon w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(0,0,math.pi/4) w.Parent=spoon debris:AddItem(spoon,600) spoon.Parent=game.Workspace end end) end) sp.Unequipped:connect(function() equipped=false if anim2 then anim2:Stop() end if face~=nil then face.Texture=storedface end local handle=sp:FindFirstChild("Handle") if handle~=nil then local mesh=handle:FindFirstChild("Mesh") if mesh~=nil then mesh.TextureId=textureclosed end end if spoon then spoon:remove() end end)
--// adaptive headlights. dont touch!
local adap function check(r,d) --check for oncoming humanoids or vehicles. adjusts accordingly local fp = workspace:FindPartOnRay(Ray.new(sen[r].RayEnd.CFrame.p,(sen[r].RayEnd.CFrame.p-sen[r].RayStart.CFrame.p).unit * d)) if fp then local d2 = (sen[r].RayEnd.CFrame.p - fp.CFrame.p).Magnitude
-- makes you bigger everytime your strength icreases
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(Character) local Humanoid = Character:FindFirstChild("Humanoid") player.Character.Humanoid.BodyDepthScale.Value = player.leaderstats.strength.Value/100 + 1 player.Character.Humanoid.BodyHeightScale.Value = player.leaderstats.strength.Value/100 + 1 player.Character.Humanoid.BodyWidthScale.Value = player.leaderstats.strength.Value/100 + 1 player.Character.Humanoid.HeadScale.Value = player.leaderstats.strength.Value/100 + 1 player.leaderstats.strength.Changed:connect(function() player.Character.Humanoid.BodyDepthScale.Value = player.leaderstats.strength.Value/100 + 1 player.Character.Humanoid.BodyHeightScale.Value = player.leaderstats.strength.Value/100 + 1 player.Character.Humanoid.BodyWidthScale.Value = player.leaderstats.strength.Value/100 + 1 player.Character.Humanoid.HeadScale.Value = player.leaderstats.strength.Value/100 + 1 end) end) end)
-- can consist of Semi, Auto and Burst. Firing mode is selected in table order
stats.FiringModes = {"Semi"} stats.BurstAmount = 0 stats.Range = 1337 stats.RPM = 60*4 stats.VerticalClimbMax = 0.7 stats.VerticalClimb = 0.25 return stats
--[[ Version ]]
module.MajorVersion = 0 module.MinorVersion = 8
----------------- --| Constants |-- -----------------
local BLAST_RADIUS = 6 local BLAST_PRESSURE = 500000 local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
--Lua primitives
t.boolean = primitive("boolean") t.coroutine = primitive("thread") t.callback = primitive("function") t.none = primitive("nil") t.string = primitive("string") t.table = primitive("table") t.userdata = primitive("userdata") function t.number(value) local valueType = typeof(value) if valueType == "number" then if value == value then return true else return false end else return false end end function t.nan(value) if value ~= value then return true else return false end end
-- Create a new ray info object. -- This is just a utility alias with some extra type checking.
function FastCast.newBehavior(): FastCastBehavior -- raycastParams, maxDistance, acceleration, canPierceFunction, cosmeticBulletTemplate, cosmeticBulletContainer, autoIgnoreBulletContainer return { RaycastParams = nil, Acceleration = Vector3.new(), MaxDistance = 1000, CanPierceFunction = nil, HighFidelityBehavior = FastCast.HighFidelityBehavior.Default, HighFidelitySegmentSize = 0.5, CosmeticBulletTemplate = nil, CosmeticBulletProvider = nil, CosmeticBulletContainer = nil, AutoIgnoreContainer = true } end local DEFAULT_DATA_PACKET = FastCast.newBehavior() function FastCast:Fire(origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior?): ActiveCast if castDataPacket == nil then castDataPacket = DEFAULT_DATA_PACKET end local cast = ActiveCastStatic.new(self, origin, direction, velocity, castDataPacket) cast.RayInfo.WorldRoot = self.WorldRoot return cast end
--Enum.SavedQualitySetting.Automatic
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character and game.Players.LocalPlayer.Character:FindFirstChild("Head") local Camera=game.Workspace.CurrentCamera if Camera:FindFirstChild("MotionBlur") then Camera.MotionBlur:Destroy() end local blur=Instance.new("BlurEffect") blur.Parent=Camera blur.Size=0 blur.Name="MotionBlur" local move_anim_speed = 3 local last_p = Vector3.new() local move_amm = 0 local aim_settings = { aim_amp = 0.5, aim_max_change = 4, aim_retract = 15, aim_max_deg = 20, } local last_va = 0 local last_va2 = 0 local view_velocity = {0, 0} local last_time = tick() game:GetService("RunService").RenderStepped:connect(function() local delta = tick() - last_time last_time = tick() local p_distance = ((Camera.CoordinateFrame.lookVector)).magnitude if p_distance == 0 then p_distance = 0.0001 end local p_height = Camera.CoordinateFrame.lookVector.y local view_angle if p_height ~= 0 then view_angle = math.deg(math.asin(math.abs(p_height) / p_distance)) * (math.abs(p_height) / p_height) else view_angle = 0 end local cam_cf = Camera.CoordinateFrame local looking_at = cam_cf * CFrame.new(0, 0, -100) local view_angle2 = math.deg(math.atan2(cam_cf.p.x - looking_at.p.x, cam_cf.p.z - looking_at.p.z)) + 180 local v_delta1, v_delta2 local dir1, dir2 = 0, 0 v_delta1 = math.abs(view_angle - last_va) if v_delta1 ~= 0 then dir1 = (view_angle - last_va) / v_delta1 end local va_check = {math.abs(view_angle2 - last_va2), 360 - math.abs(view_angle2 - last_va2)} if view_angle2 == last_va2 then dir2 = 0 v_delta2 = 0 elseif va_check[1] < va_check[2] then v_delta2 = va_check[1] dir2 = (view_angle2 - last_va2) / va_check[1] else v_delta2 = va_check[2] if last_va2 > view_angle2 then dir2 = 1 else dir2 = -1 end end last_va = view_angle last_va2 = view_angle2 view_velocity[1] = view_velocity[1] / (1 + (delta * aim_settings.aim_retract)) view_velocity[2] = view_velocity[2] / (1 + (delta * aim_settings.aim_retract)) local calc1 = v_delta1 * dir1 * aim_settings.aim_amp if calc1 ~= 0 then view_velocity[1] = view_velocity[1] + (math.abs(calc1)) * (calc1 / math.abs(calc1)) end local calc2 = v_delta2 * dir2 * aim_settings.aim_amp if calc2 ~= 0 then view_velocity[2] = view_velocity[2] + (math.abs(calc2)) * (calc2 / math.abs(calc2)) end if view_velocity[1] ~= 0 then view_velocity[1] = math.abs(view_velocity[1]) * (math.abs(view_velocity[1]) / view_velocity[1]) end if view_velocity[2] ~= 0 then view_velocity[2] = math.abs(view_velocity[2]) * (math.abs(view_velocity[2]) / view_velocity[2]) end local one=math.abs(math.rad(view_velocity[1])) local two=math.abs(math.rad(view_velocity[2])) local equation=math.max(one,two)*10 blur.Size=equation if game.Players.LocalPlayer.Character then if game.Players.LocalPlayer.Character:FindFirstChild("Torso") then if game.Players.LocalPlayer.Character.Torso.Position.Y <= -2000 then game.Players.LocalPlayer.Character.Humanoid.Health = 0 end end end end)
-- If needed, use this event to know when the Premium modal is closed
MarketplaceService.PromptPremiumPurchaseFinished:Connect(function(player) warn("Premium modal closed") end)
---- DISCORD WEBHOOK CONFIG IS IN SERVERSCRIPTSERVICE (report)
sendbtn.MouseButton1Click:Connect(function() if sendcheck == false then -- checks if it was sent recently sendcheck = true send:FireServer(message.Text, testage.Text, sendcheck) -- sends it to server from client (serverscriptservice) sendbtn.Text = "Sent!" -- Customize if you want wait(0.7)-- Customize if you want sendbtn.Text = "Check Your Channel!"-- Customize if you want wait(1.5)-- Customize if you want sendbtn.Text = "Send"-- Customize if you want cooldowntxt.Visible = true wait(70)-- Customize if you want sendcheck = false cooldowntxt.Visible = false end end) print("Config loaded")
-- Navigate SubPages (using NavigateButtons)
local function navigateNewPage(page, oldPos, newPos, direction, instantTween) local tweenTime if instantTween then tweenTime = 0 else tweenTime = 0.3 end local tweenInfo = TweenInfo.new(tweenTime, Enum.EasingStyle.Quad, Enum.EasingDirection.Out) local subPageNames = subPageOrders[page.Name] local pageOut if tonumber(oldPos) then pageOut = page[subPageNames[oldPos]] end local pageIn = page[subPageNames[newPos]] local startX if pageOut and pageOut:IsA("ScrollingFrame") then pageOut.ScrollBarImageTransparency = 1 end if pageIn:IsA("ScrollingFrame") then pageIn.ScrollBarImageTransparency = 0 end local searchBar = page:FindFirstChild("SearchBar") if searchBar then if pageIn.Size.Y.Scale < 0.85 then searchBar.Visible = true else searchBar.Visible = false end end -- for i,v in pairs(subPageNames) do local subPage = page[v] if subPage ~= pageIn and subPage ~= pageOut then subPage.Position = UDim2.new(-2,0,subPage.Position.Y.Scale,0) end end -- if direction == "Right" then startX = 1 elseif direction == "Left" then startX = -1 end local endX = startX*-1 page.NavigateButtons.TextLabel.Text = string.upper(pageIn.Name) pageIn.Position = UDim2.new(startX, 0, pageIn.Position.Y.Scale, pageIn.Position.Y.Offset) local tweenIn = main.tweenService:Create(pageIn, tweenInfo, {Position = UDim2.new(0,0,pageIn.Position.Y.Scale,0)}) tweenIn:Play() if pageOut then local tweenOut = main.tweenService:Create(pageOut, tweenInfo, {Position = UDim2.new(endX,0,pageOut.Position.Y.Scale,0)}) tweenOut:Play() spawn(function() tweenOut.Completed:Wait() if pageOut.Position.X.Scale == endX then pageOut.Position = UDim2.new(-2,0,pageOut.Position.Y.Scale,0) end end) end end for a,b in pairs(pages:GetChildren()) do if b:FindFirstChild("NavigateButtons") then local pos = 1 local pageX = 0 local subPages = subPageOrders[b.Name] for i,v in pairs(subPages) do local subPage = b[v] if i == 1 then b.NavigateButtons.TextLabel.Text = string.upper(v) else pageX = 1 end subPage.Position = UDim2.new(pageX,0,subPage.Position.Y.Scale,0) subPage.Visible = true end for c,d in pairs(b.NavigateButtons:GetChildren()) do if d:IsA("TextButton") then d.MouseButton1Down:Connect(function() local oldPos = pos if d.Name == "Right" then pos = pos + 1 if pos > #subPages then pos = 1 end elseif d.Name == "Left" then pos = pos - 1 if pos < 1 then pos = #subPages end end navigateNewPage(b, oldPos, pos, d.Name) end) end end end end for a,b in pairs(mainFrame.DragBar:GetChildren()) do if b:IsA("TextButton") then b.MouseButton1Down:Connect(function() if guiDe then guiDe = false if b.Name == "Minimise" then if b.TextLabel.Text == "-" then main.tweenService:Create(pages, TweenInfo.new(0.5), {Position = UDim2.new(0,0,-0.8,0)}):Play() b.TextLabel.Text = "+" else pages.Parent.Visible = true main.tweenService:Create(pages, TweenInfo.new(0.5), {Position = UDim2.new(0,0,0.1,0)}):Play() b.TextLabel.Text = "-" end elseif b.Name == "Close" then module:CloseMainFrame() elseif b.Name == "Back" then tweenPages(UDim2.new(1,0,0,0), pages.Home) end guiDe = true end end) end end
-- Make the main frame, which (mostly) covers the screen
MainFrame = NewGui('Frame', 'Backpack') MainFrame.Visible = false MainFrame.Parent = RobloxGui
--//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(.65,-0.75,-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.6),{C1 = CFrame.new(-1, -1, -0.5) * CFrame.Angles(math.rad(-160), math.rad(10), math.rad(0))}):Play() ts:Create(objs[3],TweenInfo.new(0.6),{C1 = CFrame.new(-.7, 0.85, -0.95) * CFrame.Angles(math.rad(20),math.rad(0),math.rad(0))}):Play() 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.475, -0.365, -0.8) * CFrame.Angles(math.rad(-85), math.rad(10), math.rad(-90))}):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.25) 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.25) 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(-1.975, -1.7, -2.5) * 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,-3.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play() wait(0.7) ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.265, -1.7) * 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[5].Handle:WaitForChild("ShellInsert"):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.8) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() wait(0.5) 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() 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.3),{C1 = CFrame.new(-0.4,0.275,-2.5) * CFrame.Angles(math.rad(-120),math.rad(0),math.rad(7.5))}):Play() wait(0.3) 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(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.3),{C1 = CFrame.new(-0.4,0.275,-2.5) * CFrame.Angles(math.rad(-120),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.8) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play() 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;
--[[ {Madwork} -[MadworkScriptSignal]--------------------------------------- WARNING: .NewArrayScriptConnection() has undefined behaviour when listeners disconnect listeners within "listener_table" before all listeners inside "listener_table" have been fired. WARNING #2: Always assume undefined listener invocation order for [ScriptSignal] class; Current implementation invokes In the backwards order of connection time. Functions: MadworkScriptSignal.NewArrayScriptConnection(listener_table, listener, disconnect_listener, disconnect_param) --> [ScriptConnection] listener_table [table] listener [function] disconnect_listener nil or [function] -- Yield-safe disconnect_param nil or [value] MadworkScriptSignal.NewScriptSignal() --> [ScriptSignal] Methods [ScriptSignal]: ScriptSignal:Connect(listener, disconnect_listener, disconnect_param) --> [ScriptConnection] listener(...) -- (listener functions can't yield) listener [function] disconnect_listener nil or [function] -- Yield-safe disconnect_param nil or [value] ScriptSignal:GetListenerCount() --> [number] ScriptSignal:Fire(...) -- Yield-safe ScriptSignal:FireUntil(continue_callback, ...) -- NOT YIELF-SAFE Methods [ScriptConnection]: ScriptConnection:Disconnect() -- Disconnect listener from signal --]]
--[=[ Errors if cancelled ]=]
function CancelToken:ErrorIfCancelled() if not self.PromiseCancelled:IsPending() then error("[CancelToken.ErrorIfCancelled] - Cancelled") end end
---------------------------------------------------------------------------- --- Prefab Basic Objects ------------------------------------------------- ---------------------------------------------------------------------------- --Droplet holder
local ScreenBlock = Instance.new("Part") ScreenBlock.Size = Vector3.new(2, 2, 2) ScreenBlock.Transparency = 1 ScreenBlock.Anchored = true ScreenBlock.CanCollide = false ScreenBlock.Parent = Camera local ScreenBlockCFrame = EMPTY_CFRAME RunService:BindToRenderStep("ScreenRainUpdate", Enum.RenderPriority.Camera.Value + 1, function() ScreenBlockCFrame = Camera.CFrame ScreenBlock.CFrame = ScreenBlockCFrame end)
--[=[ @param fn ConnectionFn @return SignalConnection Connects a function to the signal, which will be called anytime the signal is fired. ```lua signal:Connect(function(msg, num) print(msg, num) end) signal:Fire("Hello", 25) ``` ]=]
function Signal:Connect(fn) local connection = Connection.new(self, fn) if self._handlerListHead then connection._next = self._handlerListHead self._handlerListHead = connection else self._handlerListHead = connection end return connection end function Signal:GetConnections() local items = {} local item = self._handlerListHead while item do table.insert(items, item) item = item._next end return items end
--HOW TO USE: --1. Put the tool in ReplicatedStorage. --2. Change the item name to the tool's name.(Settings) --3. Change the item price to the price you want it to be.(Settings) --4. Change the currency name to the currency name you have in your leaderstats.(Settings)
-- Prunes any stories and test files that are included with the DevModule. These -- are not needed at runtime.
local function prune(instance: Instance) for _, descendant in ipairs(instance:GetDescendants()) do local name = descendant.Name if name:match(".story$") or name:match(".spec$") then descendant:Destroy() end end end local function getPackageVersion(package: ModuleScript) local version: StringValue = package:FindFirstChild(PACKAGE_VERSION_NAME) assert(version and version:IsA("StringValue"), PACKAGE_VERSION_OBJECT_MISSING :format(package.Name, PACKAGE_VERSION_NAME, package:GetFullName())) assert(version.Value ~= "", PACKAGE_VERSION_EMPTY:format(package.Name, version:GetFullName())) return version.Value end
-- !!! проверить перед установкой скрипта, чтобы не было такого скрипта!!!
me = script.Parent
-- @outline // FUNCTIONS
function Module.CreateModel() local Model = game.ReplicatedStorage.Assets.Models.Gun:Clone() Model.Parent = game.Workspace Module.Model = Model end
--Original script by Luckymaxer
Model = script.Parent local SoundLoop local Whinny sound = false Players = game:GetService("Players") Debris = game:GetService("Debris") RunService = game:GetService("RunService") Humanoid = Model:WaitForChild("Humanoid") Humanoid.Health = Humanoid.MaxHealth Seat = Model:WaitForChild("VehicleSeat") Torso = Model:WaitForChild("Torso") InteractiveControl = script:WaitForChild("InteractiveControl") Animations = { Walk = {Animation = script:WaitForChild("Walk"), FadeTime = nil, Weight = nil, Speed = 7}, Idle = {Animation = script:WaitForChild("Idle"), FadeTime = nil, Weight = nil, Speed = 1}, Ride = {Animation = script:WaitForChild("Ride"), FadeTime = 0.25, Weight = nil, Speed = nil}, Rear = {Animation = script:WaitForChild("Rearing"), FadeTime = 0.25, Weight = nil, Speed = 2}, Jump = {Animation = script:WaitForChild("Jump"), FadeTime = nil, Weight = nil, Speed = 4}, } Walking = false Rider = nil AngularVelocity = (Torso:FindFirstChild("BodyAngularVelocity") or Instance.new("BodyAngularVelocity")) AngularVelocity.Name = "BodyAngularVelocity" AngularVelocity.P = 1250 AngularVelocity.AngularVelocity = Vector3.new(0, 0, 0) AngularVelocity.maxTorque = Vector3.new(0, math.huge, 0) AngularVelocity.Parent = Torso Velocity = (Torso:FindFirstChild("BodyVelocity") or Instance.new("BodyVelocity")) Velocity.Name = "BodyVelocity" Velocity.maxForce = Vector3.new(math.huge, 0, math.huge) Velocity.Parent = Torso WalkTrack = Humanoid:LoadAnimation(Animations.Walk.Animation) IdleTrack = Humanoid:LoadAnimation(Animations.Idle.Animation) RearTrack = Humanoid:LoadAnimation(Animations.Rear.Animation) JumpTrack = Humanoid:LoadAnimation(Animations.Jump.Animation) Remotes = script:WaitForChild("Remotes") Remotes:ClearAllChildren() LastJump = 0 Disabled = false ServerControl = (Remotes:FindFirstChild("ServerControl") or Instance.new("RemoteFunction")) ServerControl.Name = "ServerControl" ServerControl.Parent = Remotes ClientControl = (Remotes:FindFirstChild("ClientControl") or Instance.new("RemoteFunction")) ClientControl.Name = "ClientControl" ClientControl.Parent = Remotes function OnServerInvoke(player, Mode, Value) if player ~= Rider or not Mode then return end if Mode == "Jump" then local Now = tick() if (Now - LastJump) >= 1 then LastJump = Now Humanoid.Jump = true local Animation = Animations.Jump JumpTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed) end elseif Mode == "Dismount" then Dismount() end end ServerControl.OnServerInvoke = OnServerInvoke Humanoid.Changed:connect(function(Property) if Property == "Sit" and Humanoid.Sit then Humanoid.Sit = false end end) Humanoid.Died:connect(function() Disabled = true Debris:AddItem(Model, 3) Model:BreakJoints() end) function InvokeClient(Mode, Value) local ClientReturn = nil pcall(function() ClientReturn = ClientControl:InvokeClient(Rider, Mode, Value) end) return ClientReturn end function Audio(ID, Location, Looped, Volume, Duration) local Sound = Instance.new("Sound", Location) Sound.SoundId = "http://www.roblox.com/asset/?id=" .. ID Sound.Volume = Volume Sound.Looped = Looped if Duration then game:GetService("Debris"):AddItem(Sound, Duration) end return Sound -- use as Audio(134973578, FrontTorso, true, 2) end function Animate(Time) if Humanoid.Health == 0 or Disabled then return end --Walking if not Walking and Torso.Velocity.magnitude > 1 then IdleTrack:Stop() local Animation = Animations.Walk WalkTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed) Walking = true end if Walking and Torso.Velocity.magnitude < 1 then WalkTrack:Stop() local Animation = Animations.Idle IdleTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed) Walking = false end --Motion if Seat.Throttle ~= -1 then Velocity.velocity = (Torso.CFrame.lookVector * Seat.Throttle * Humanoid.WalkSpeed*-1) AngularVelocity.AngularVelocity = Vector3.new(0, (2 * -Seat.Steer), 0)--steer speed else Velocity.velocity = Vector3.new(0,0, 0) --Erase for moonwalk Whinny = Audio(178645076, Torso, false, 3) if sound==false then sound = true local Animation = Animations.Rear RearTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed) Whinny:Play() Whinny.Volume = 10 Whinny.Pitch = 1 wait(2) sound = false end end --Sound if not SoundLoop then SoundLoop = Audio(134973578, Torso, true, 0) elseif Torso.Velocity.magnitude > 1 then if not SoundLoop.IsPlaying then SoundLoop:Play() end SoundLoop.Volume = 10 SoundLoop.Pitch = ((1.2 - .55) * (Torso.Velocity.Magnitude / script.Parent.MaxSpeed.Value)) + .55 else SoundLoop:Stop() end if JumpTrack.IsPlaying then SoundLoop:Stop() end end function Dismount() if Rider and Rider.Parent then local Character = Rider.Character if Character then local Humanoid = nil for i, v in pairs(Character:GetChildren()) do if v:IsA("Humanoid") then Humanoid = v break end end Humanoid:ChangeState(Enum.HumanoidStateType.Jumping) Humanoid.Jump = true end end end function PlayerSeated(Child) local function BreakWeld() Debris:AddItem(Child, 0.5) if Child and Child.Parent then Child:Destroy() end end if not Child:IsA("Weld") or not Child.Name == "SeatWeld" then return end if Child.Part0 ~= Seat or not Child.Part1 or not Child.Part1.Parent then return end Child.C1 = (Child.C1 * CFrame.new(0, 0.5, 0.375)) local character = Child.Part1.Parent local humanoid = character:FindFirstChild("Humanoid") if humanoid then local Animation = Animations.Ride RideTrack = humanoid:LoadAnimation(Animation.Animation) RideTrack:Play(Animation.FadeTime, Animation.Weight, Animation.Speed) end local Player = Players:GetPlayerFromCharacter(character) if not Player then BreakWeld() return end local PlayerGui = Player:FindFirstChild("PlayerGui") if not PlayerGui then BreakWeld() return end InteractiveControlCopy = InteractiveControl:Clone() local ServerCommunication = Instance.new("ObjectValue") ServerCommunication.Name = "ServerControl" ServerCommunication.Value = ServerControl ServerCommunication.Parent = InteractiveControlCopy InteractiveControlCopy.Disabled = false InteractiveControlCopy.Parent = PlayerGui Rider = Player end function PlayerDismounted(Child) if not Child:IsA("Weld") or not Child.Name == "SeatWeld" then return end if not Child.Part1 or not Child.Part1.Parent then return end local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent) if not Player or Player ~= Rider then return end if InteractiveControlCopy and InteractiveControlCopy.Parent then InteractiveControlCopy:Destroy() end if RideTrack then RideTrack:Stop() end Rider = nil end RunService.Heartbeat:connect(Animate) Seat.ChildAdded:connect(PlayerSeated) Seat.ChildRemoved:connect(PlayerDismounted)
--// GUI Variables
local PlayerGUI = Player:WaitForChild("PlayerGui") local MainUI = PlayerGUI:WaitForChild("MainUI") local PetUI = MainUI.PetsFrame local MultiDeleteFrame = PetUI.MultiDeleteFrame function UpdatePetsInMultiDelete(num) local amountofPets = tonumber(num) or #petsInMultiDelete if type(tonumber(amountofPets)) == "number" then MultiDeleteFrame.PetsSelected.Text = tostring(amountofPets).." Pets Selected" end end function MultiDeleteModule:AddPetToMultiDelete(pet) if pet ~= nil then if not table.find(petsInMultiDelete, pet) then table.insert(petsInMultiDelete, pet) UpdatePetsInMultiDelete() end end end function MultiDeleteModule:DeletePetInMultiDelete(pet) if pet ~= nil then local place = table.find(petsInMultiDelete, pet) if place then table.remove(petsInMultiDelete, tonumber(place)) UpdatePetsInMultiDelete() end end end function MultiDeleteModule:ResetMultiDeleteTable() petsInMultiDelete = {} end function MultiDeleteModule:GetMutliDeletePets() return petsInMultiDelete end return MultiDeleteModule
-- Function to handle player falling
local function handlePlayerFalling(player, floorPosition, previousPosition) local fallDistance = (floorPosition - previousPosition).Magnitude if fallDistance > MAX_FALL_DISTANCE then local damage = calculateFallDamage(fallDistance) -- Apply damage to the player -- Replace this line with your own code to apply damage to the player player.Character.Humanoid.Health = player.Character.Humanoid.Health - damage end end
--// Load Order List
local LoadingOrder = { --// Required by most modules "Variables"; "Functions"; --// Core functionality "Core"; "Remote"; "UI"; "Process"; --// Misc "Anti"; }
--> Dependencies
local GameConfig = require(ReplicatedStorage.GameConfig)
-- Generated by https://roblox-ts.github.io v0.0.34 -- Compiled May 9, 2019, 6:07 PM Coordinated Universal Time
local _exports = {}; local Connection; do Connection = {}; Connection.__index = { Fire = function(self, data) if self.Connected then self.Function(data); end; end; Disconnect = function(self) self.Connected = false; end; }; Connection.new = function(...) return Connection.constructor(setmetatable({}, Connection), ...); end; Connection.constructor = function(self, Function) self.Function = Function; self.Connected = true; return self; end; end; _exports.Connection = Connection; return _exports;
--[=[ Requires all the modules that are children of the given parent. This is an easy way to quickly load all controllers that might be in a folder. ```lua Knit.AddControllers(somewhere.Controllers) ``` ]=]
function KnitClient.AddControllers(parent: Instance): { Controller } local addedControllers = {} for _, v in parent:GetChildren() do if not v:IsA("ModuleScript") then continue end table.insert(addedControllers, require(v)) end return addedControllers end
--Made by Luckymaxer
Debris = game:GetService("Debris") ProjectileNames = {"MeshPart", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Ray", "Bullet", "ParticlePart"} Functions = { CreateConfiguration = (function(Configurations, Table) for i, v in pairs(Configurations:GetChildren()) do if string.find(v.ClassName, "Value") then Table[v.Name] = v:Clone() elseif v:IsA("Folder") or v:IsA("Configuration") then Table[v.Name] = Functions.CreateConfiguration(v, Table) end end return Table end), FindCharacterAncestor = (function(Object) if Object and Object ~= game:GetService("Workspace") then local Humanoid = Object:FindFirstChild("Humanoid") if Humanoid then return Object, Humanoid else return Functions.FindCharacterAncestor(Object.Parent) end end return nil end), CheckTableForString = (function(Table, String) for i, v in pairs(Table) do if string.lower(v) == string.lower(String) then return true end end return false end), CheckIntangible = (function(Hit) if Hit and Hit.Parent then if Functions.CheckTableForString(ProjectileNames, Hit.Name) then return true end local ObjectParent = Hit.Parent local Character = ObjectParent.Parent local Humanoid = Character:FindFirstChild("Humanoid") if Humanoid and Humanoid.Health > 0 and ObjectParent:IsA("Hat") then return true end end return false end), CastRay = (function(StartPos, Vec, Length, Ignore, DelayIfHit) local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore) if RayHit and Functions.CheckIntangible(RayHit) then if DelayIfHit then wait() end RayHit, RayPos, RayNormal = Functions.CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit) end return RayHit, RayPos, RayNormal end), IsTeamMate = (function(Player1, Player2) return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor) end), TagHumanoid = (function(humanoid, player) local Creator_Tag = Instance.new("ObjectValue") Creator_Tag.Name = "creator" Creator_Tag.Value = player Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end), UntagHumanoid = (function(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end), CheckTableForString = (function(Table, String) for i, v in pairs(Table) do if string.lower(v) == string.lower(String) then return true end end return false end), Clamp = (function(Number, Min, Max) return math.max(math.min(Max, Number), Min) end), GetPercentage = (function(Start, End, Number) return (((Number - Start) / (End - Start)) * 100) end), Round = (function(Number, RoundDecimal) local WholeNumber, Decimal = math.modf(Number) return ((Decimal >= RoundDecimal and math.ceil(Number)) or (Decimal < RoundDecimal and math.floor(Number))) end), } return Functions
-- https://developer.roblox.com/en-us/api-reference/class/DataStoreService
while true do local data = {} local tmp = game.Workspace.Servers:GetChildren() if tmp then -- получен список список серверов/объектов for a,b in pairs(tmp) do local server_code = b.Name local temp = b:GetChildren() local player_num = #temp local server_name= b.name.Value warn("------------------------") warn(server_code,player_num,server_name) if player_num < max_players then table.insert(data,{server_code,player_num,server_name})--Put new data in new table end end table.sort(data,function(a,b) return a[2] > b[2] end) end
-- A simple function to explode a specified part
function Explode(shell) local explosion = Instance.new("Explosion", workspace) explosion.Position = shell.Position explosion.BlastRadius = config.ExplosionRadius.Value shell:Destroy() end script.Parent.Throw.OnServerEvent:connect(function(player, mousePosition) if tool.Handle.Grenadee then tool.Handle.Grenadee:Play() end local handlePos = Vector3.new(tool.Handle.Position.X, 0, tool.Handle.Position.Z) -- remove Y from the equation, it's not needed local mousePos = Vector3.new(mousePosition.X, 0, mousePosition.Z) -- ditto local distance = (handlePos - mousePos).magnitude -- Get the distance between the handle and the mouse local altitude = mousePosition.Y - tool.Handle.Position.Y local angle = AngleOfReach(distance, altitude, config.GrenadeVelocity.Value) -- Calculate the angle tool.Handle.Transparency = 1 local grenade = tool.Handle:Clone() grenade.Parent = workspace grenade.Transparency = 0 grenade.CanCollide = true grenade.CFrame = tool.Handle.CFrame grenade.Velocity = (CFrame.new(grenade.Position, Vector3.new(mousePosition.X, grenade.Position.Y, mousePosition.Z)) * CFrame.Angles(angle, 0, 0)).lookVector * config.GrenadeVelocity.Value -- Throwing 'n stuff, it probably didn't need to be this long spawn(function() if config.ExplodeOnTouch.Value then grenade.Touched:connect(function(hit) if hit.Parent ~= tool.Parent and hit.CanCollide then -- Make sure what we're hitting is collidable Explode(grenade) end end) else wait(config.FuseTime.Value) Explode(grenade) end end) wait(config.Cooldown.Value) tool.Handle.Transparency = 0 end)
---------------------------------------------------------------------
local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace local exp = Instance.new("Explosion") exp.Position = Vector3.new( script.Parent.Position.X+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Y+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)), script.Parent.Position.Z+(math.random(-EXPLOSION_SPREAD,EXPLOSION_SPREAD)) ) exp.BlastPressure = 100000000 exp.BlastRadius = 10000000000 exp.Visible = false exp.Parent = workspace
-- How many times the walk speed the player is allowed to run -- before heating up. This also amounts to the distance a player -- can instantly teleport before this instantly overheats, -- multiplied by the TimeSpan.
config.SpeedToleranceRatio = 1.1
--[[Weight and CG]]
Tune.Weight = 1900 -- 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
-------------------------
local player = game.Players.LocalPlayer local char = player.Character or player.CharacterAdded:Wait() local timerStarted = false local UIS = game:GetService("UserInputService") local Values = script.Parent:WaitForChild("Values") local car = script.Parent.Car.Value local DriveSeat = car:WaitForChild("DriveSeat") local Started = car:WaitForChild("Started") local Update = car:WaitForChild("Update") local Tune = require(car:WaitForChild("A-Chassis Tune")) local Model = script.Model.Value local IsOn = Values.Parent:WaitForChild("IsOn") IsOn.Changed:Connect(function() if IsOn.Value then Started:FireServer(Model, IsOn) else Started:FireServer(Model, false) end end) DriveSeat.ChildAdded:Connect(function() if Tune.AutoStart == true then Started:FireServer(Model, true) else Started:FireServer(Model, false) end end) DriveSeat.ChildRemoved:Connect(function() Started:FireServer(Model, false) end) Values.RPM.Changed:Connect(function() Update:FireServer(Model, "RPM", Values.RPM.Value, Tune.Redline) end) Values.Gear.Changed:Connect(function() Update:FireServer(Model, "Gear", Values.Gear.Value) end) local cs = coroutine.create(function() while wait() do if speedUnit == "KPH" then script.Speed.Value = math.floor(char:WaitForChild("HumanoidRootPart").Velocity.Magnitude) Update:FireServer(Model, "Speed", math.floor(script.Speed.Value * ((10/12) * 1.09728))) elseif speedUnit == "MPH" then script.Speed.Value = math.floor(char:WaitForChild("HumanoidRootPart").Velocity.Magnitude) Update:FireServer(Model, "Speed", math.floor(script.Speed.Value * (10/12) * (60/88))) end end end) coroutine.resume(cs)
--[=[ Destroys the Touch input capturer. ]=]
function Touch:Destroy() self._trove:Destroy() end return Touch
-- goro7
local voteStates = game.ServerStorage.States.MapVote voteStates.CurrentlyVoting.Changed:connect(function() -- Adjust visiblity local newVal = voteStates.CurrentlyVoting.Value script.Parent.Image.Visible = newVal script.Parent.CountLabel.Visible = newVal script.Parent.MapName.Visible = newVal script.Parent.Count.Visible = newVal end) voteStates.Map3.Changed:connect(function() -- Update map name and image local newMap = voteStates.Map3.Value script.Parent.Image.Image = newMap.ImageAsset.Value script.Parent.MapName.Text = newMap.Name end) voteStates.Count3.Changed:connect(function() -- Update map count script.Parent.Count.Text = voteStates.Count3.Value end)
--// Functions
function Weld(L_31_arg1, L_32_arg2) local L_33_ = Instance.new("WeldConstraint", L_31_arg1) L_33_.Part0 = L_31_arg1 L_33_.Part1 = L_32_arg2 L_33_.Name = L_31_arg1.Name end
--[[Weld functions]]
local JS = game:GetService("JointsService") local PGS_ON = workspace:PGSIsEnabled() function MakeWeld(x,y,type,s) if type==nil then type="Weld" end local W=Instance.new(type,JS) W.Part0=x W.Part1=y W.C0=x.CFrame:inverse()*x.CFrame W.C1=y.CFrame:inverse()*x.CFrame if type=="Motor" and s~=nil then W.MaxVelocity=s end return W end function ModelWeld(a,b) if a:IsA("BasePart") then MakeWeld(b,a,"Weld") elseif a:IsA("Model") then for i,v in pairs(a:GetChildren()) do ModelWeld(v,b) end end end function UnAnchor(a) if a:IsA("BasePart") and a.Name ~= "MainPart" then a.Anchored=false end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end end
-- DONT EDIT NOTHING IN THE SCRIPT IF YOU DONT KNOW WHAT YOU DOING! -- zlpds
wait(1) local InputService=game:GetService("UserInputService") local Camera=game.Workspace.CurrentCamera local Player=game.Players.LocalPlayer local Character=Player.Character local Head=Character.Head local Torso=Character.Torso local RootPart=Character.HumanoidRootPart local RootJoint=RootPart.RootJoint local Neck=Torso.Neck Camera.FieldOfView=90 Camera.CameraType="Scriptable" InputService.MouseBehavior = Enum.MouseBehavior.LockCenter local v3=Vector3.new local cf=CFrame.new local components=cf().components local inverse=cf().inverse local fromAxisAngle=CFrame.fromAxisAngle local atan,atan2=math.atan,math.atan2 local acos=math.acos local function toAxisAngleFromVector(v) local z=v.z return z*z<0.99999 and v3(v.y,-v.x,0).unit*acos(-z) or v3() end local function AxisAngleLookOrientation(c,v,t) local c=c-c.p local rv=(inverse(c)*v).unit local rz=rv.z return rz*rz<0.99999 and c*fromAxisAngle(v3(rv.y,-rv.x,0),acos(-rz)*(t or 1)) or c end local function AxisAngleLookNew(v,t) local rv=v.unit local rz=rv.z return rz*rz<0.99999 and fromAxisAngle(v3(rv.y,-rv.x,0),acos(-rz)*(t or 1)) or cf() end local function AxisAngleLook(c,v,t) local rv=(inverse(c)*v).unit local rz=rv.z return rz*rz<0.99999 and c*fromAxisAngle(v3(rv.y,-rv.x,0),acos(-rz)*(t or 1)) or c end local Sensitivity=0.005 local CameraDirection=Vector3.new(0,0,1) local function EulerAnglesYX(l) local x,z=l.x,l.z return atan(l.y/(x*x+z*z)^0.5),-atan2(x,-z) end local function AnglesXY(l) local z=l.z return atan2(l.y,-z),-atan2(l.x,-z) end local function MouseMoved(Input) if Input.UserInputType==Enum.UserInputType.MouseMovement then local dx,dy=Input.Delta.x*Sensitivity,Input.Delta.y*Sensitivity local m2=dx*dx+dy*dy if m2>0 then CameraDirection=(AxisAngleLookOrientation(RootPart.CFrame,CameraDirection)*fromAxisAngle(v3(-dy,-dx,0),m2^0.5)).lookVector end local RootOrientation=RootPart.CFrame-RootPart.Position local RelativeDirection=RootOrientation:inverse()*CameraDirection local AngX,AngY=AnglesXY(RelativeDirection)--RootOrientation:inverse()* if AngX<-1.57*11/12 then local y,z,c,s=RelativeDirection.y,RelativeDirection.z,math.cos(-1.57*11/12-AngX),-math.sin(-1.57*11/12-AngX) z,y=z*c-y*s,z*s+y*c CameraDirection=RootOrientation*v3(RelativeDirection.x<0 and -(1-y*y-z*z)^0.5 or (1-y*y-z*z)^0.5,y,z) elseif AngX>1.57*11/12 then local y,z,c,s=RelativeDirection.y,RelativeDirection.z,math.cos(1.57*11/12-AngX),-math.sin(1.57*11/12-AngX) z,y=z*c-y*s,z*s+y*c CameraDirection=RootOrientation*v3(RelativeDirection.x<0 and -(1-y*y-z*z)^0.5 or (1-y*y-z*z)^0.5,y,z) end end end local Mouse=Player:GetMouse() local Zoom=-0.5 Mouse.KeyDown:connect(function(k) if k=="e" then Zoom=-0.5 elseif k=="q" then Zoom=-0.5 end end) InputService.InputChanged:connect(MouseMoved) Neck.C1=cf() local _ local DirectionBound=3.14159/3 local CurrentAngY=0 local function CameraUpdate() Camera.CameraType="Scriptable" local cx,cz=CameraDirection.x,CameraDirection.z local rvx,rvz=RootPart.Velocity.x,RootPart.Velocity.z if rvx*rvx+rvz*rvz>4 and cx*rvx+cz*rvz<-0.5*(cx*cx+cz*cz)^0.5*(rvx*rvx+rvz*rvz)^0.5 then DirectionBound=math.min(DirectionBound*0.9,math.abs(CurrentAngY*0.9)) else DirectionBound=DirectionBound*0.1+3.14159/3*0.9 end local AngX,AngY=EulerAnglesYX((RootPart.CFrame-RootPart.Position):inverse()*CameraDirection) if AngY>DirectionBound then RootPart.CFrame=RootPart.CFrame*CFrame.Angles(0,AngY-DirectionBound,0) elseif AngY<-DirectionBound then RootPart.CFrame=RootPart.CFrame*CFrame.Angles(0,AngY+DirectionBound,0) end _,CurrentAngY=EulerAnglesYX((RootPart.CFrame-RootPart.Position):inverse()*CameraDirection) local CameraOrientation=AxisAngleLookNew((RootPart.CFrame-RootPart.Position):inverse()*CameraDirection,1) Neck.C0=CFrame.new(0,1,0)*CameraOrientation*CFrame.new(0,0.5,0) local PreCam=AxisAngleLook(RootPart.CFrame*cf(0,1,0),RootPart.CFrame*v3(0,1,0)+CameraDirection)*CFrame.new(0,0.825,0) if Zoom==8 then local Part,Position=Workspace:findPartOnRay(Ray.new(PreCam.p,PreCam.lookVector*-8),Character) Camera.CoordinateFrame=PreCam*CFrame.new(0,0,(Position-PreCam.p).magnitude) else Camera.CoordinateFrame=PreCam*CFrame.new(0,0,Zoom) end end game:GetService("RunService").RenderStepped:connect(CameraUpdate)
-- Services
local playerService = game:GetService("Players") local marketplaceService = game:GetService("MarketplaceService")
------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- -- STATE CHANGE HANDLERS
function onRunning(speed) checkingSPEED(speed) local speedThreshold = 0.5 if speed > speedThreshold then local scale = 16.0 playAnimation("walk", 0.2, Humanoid) setAnimationSpeed(speed / scale) pose = "Running" else if emoteNames[currentAnim] == nil and not currentlyPlayingEmote then playAnimation("idle", 0.2, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) local scale = 5.0 playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / scale) 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
--bp.Position = shelly.PrimaryPart.Position
if not shellyGood then bp.Parent,bg.Parent= nil,nil return end bp.Parent = nil wait(math.random(3,8)) end local soundBank = game.ServerStorage.Sounds.NPC.Shelly:GetChildren() shelly.Health.Changed:connect(function() if shellyGood then bp.Parent,bg.Parent= nil,nil shelly.PrimaryPart.Transparency =1 shelly.PrimaryPart.CanCollide = false shelly.Shell.Transparency = 1 shelly.HitShell.Transparency = 0 shelly.HitShell.CanCollide = true shellyGood = false ostrich = tick() shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0)) local hitSound = soundBank[math.random(1,#soundBank)]:Clone() hitSound.PlayOnRemove = true hitSound.Parent = shelly.PrimaryPart wait() hitSound:Destroy() repeat wait() until tick()-ostrich > 10 shelly.PrimaryPart.Transparency = 0 shelly.PrimaryPart.CanCollide = true shelly.Shell.Transparency = 0 shelly.HitShell.Transparency = 1 shelly.HitShell.CanCollide = false bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart shellyGood = true end end) while true do if shellyGood then MoveShelly() else wait(1) end end
--[[] if mobile_is == false then mobile_is = true mobile_button = script.Parent.ParryButton mobile_button.Parent = plr.PlayerGui.PunchGui end mobile_button.MouseButton1Click:Connect(function() humanoid = plr.Character.Humanoid if humanoid.Parent.Parry.Value == false then humanoid.Parent.Parry.Value = true oldspeed = humanoid.WalkSpeed humanoid.WalkSpeed = 4 pstart = humanoid:LoadAnimation(animation.Parry.pstart) pstart:Play() ppidle = humanoid:LoadAnimation(animation.Parry.pidle) ppidle:Play() else humanoid.Parent.Parry.Value = false humanoid.WalkSpeed = oldspeed ppidle:Stop() pstart:Stop() end end)]]
end) script.Parent.Unequipped:Connect(function() attach.Parent = script.Parent motor6d:Remove() idle:Stop() equip:Stop() if humanoid.Parent.Parry.Value == true then humanoid.Parent.Parry.Value = false humanoid.WalkSpeed = oldspeed ppidle:Stop() pstart:Stop() end end) local i = 1 local deb = false script.Parent.Activated:Connect(function() if humanoid.Parent.Parry.Value == false then if deb == false then deb = true if i == 1 then p1 = humanoid:LoadAnimation(animation.Punches.p1) p1:Play() i = 2 wait(.2) Hitbox:HitStart() attach.swing:Play() attach.swing.PlaybackSpeed = .8 p1.Stopped:Wait() Hitbox:HitStop() deb = false attach.swing:Stop() elseif i == 2 then p2 = humanoid:LoadAnimation(animation.Punches.p2) p2:Play() i = 3 wait(.2) Hitbox:HitStart() attach.swing:Play() attach.swing.PlaybackSpeed = 1.1 p2.Stopped:Wait() Hitbox:HitStop() deb = false attach.swing:Stop() elseif i ==3 then p3 = humanoid:LoadAnimation(animation.Punches.p3) p3:Play() i = 4 wait(.2) Hitbox:HitStart() attach.swing:Play() attach.swing.PlaybackSpeed = 1 p3.Stopped:Wait() Hitbox:HitStop() deb = false attach.swing:Stop() elseif i ==4 then p4 = humanoid:LoadAnimation(animation.Punches.p4) p4:Play() oldspeed = script.Parent.Parent.Humanoid.WalkSpeed humanoid.WalkSpeed -= 10 i = 1 wait(.4) humanoid.AutoRotate = false Hitbox:HitStart() attach.swing.PlaybackSpeed = .8 attach.swing:Play() wait(.3) game.ReplicatedStorage.CamShakeEvent:FireClient(plr) attach.ground:Play() p4.Stopped:Wait() Hitbox:HitStop() humanoid.WalkSpeed = oldspeed deb = false attach.swing:Stop() end humanoid.AutoRotate = true end end end) game.ReplicatedStorage.Parry.OnServerEvent:Connect(function(plr,parent) humanoid = plr.Character.Humanoid if parent == script.Parent then if humanoid.Parent.Parry.Value == false then humanoid.Parent.Parry.Value = true oldspeed = humanoid.WalkSpeed humanoid.WalkSpeed = 4 pstart = humanoid:LoadAnimation(animation.Parry.pstart) pstart:Play() ppidle = humanoid:LoadAnimation(animation.Parry.pidle) ppidle:Play() else humanoid.WalkSpeed = oldspeed ppidle:Stop() pstart:Stop() wait(1) humanoid.Parent.Parry.Value = false end end end)
-- Tweening size function
local tweenPartSize = function(part, duration, direction, size) local tween = tweenService:Create(part, TweenInfo.new(duration, Enum.EasingStyle.Sine, direction), {Size = size}) tween:Play() return tween end
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false} local PreloadAnimsUserFlag = false local PreloadedAnims = {} local successPreloadAnim, msgPreloadAnim = pcall(function() PreloadAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserPreloadAnimations") end) if not successPreloadAnim then PreloadAnimsUserFlag = false end math.randomseed(tick()) function findExistingAnimationInSet(set, anim) if set == nil or anim == nil then return 0 end for idx = 1, set.count, 1 do if set[idx].anim.AnimationId == anim.AnimationId then return idx end end return 0 end function configureAnimationSet(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 = 0 for _, childPart in pairs(config:GetChildren()) do if (childPart:IsA("Animation")) then local newWeight = 1 local weightObject = childPart:FindFirstChild("Weight") if (weightObject ~= nil) then newWeight = weightObject.Value end animTable[name].count = animTable[name].count + 1 idx = animTable[name].count animTable[name][idx] = {} animTable[name][idx].anim = childPart animTable[name][idx].weight = newWeight animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, childPart.ChildAdded:connect(function(property) configureAnimationSet(name, fileList) end)) table.insert(animTable[name].connections, childPart.ChildRemoved:connect(function(property) configureAnimationSet(name, fileList) end)) 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 end end -- preload anims if PreloadAnimsUserFlag then for i, animType in pairs(animTable) do for idx = 1, animType.count, 1 do if PreloadedAnims[animType[idx].anim.AnimationId] == nil then Humanoid:LoadAnimation(animType[idx].anim) PreloadedAnims[animType[idx].anim.AnimationId] = true end end end end end
-- Declarations
local Figure = script.Parent local Head = Figure:WaitForChild("Head") local Humanoid = Figure:WaitForChild("NPC") local Regening = false
--// Walk and Sway
local L_139_ local L_140_ = 0.6 local L_141_ = 0.05 -- speed local L_142_ = -0.1 -- height local L_143_ = 0 local L_144_ = 0 local L_145_ = 35 --This is the limit of the mouse input for the sway local L_146_ = -9 --This is the magnitude of the sway when you're unaimed local L_147_ = -9 --This is the magnitude of the sway when you're aimed
---[[ Channel Settings ]]
module.GeneralChannelName = "All" -- You can set to nil to turn off echoing to a general channel. module.ChannelsBarFullTabSize = 4 -- number of tabs in bar before it starts to scroll module.MaxChannelNameLength = 12
--------- CONFIGURATION -----------
local detectionDistance = 40 -- slime will wander until a player comes within this distance local wanderSpeed = 1 -- the walk speed at which the slime will wander as long as no player is within detection distance local wanderDistance = 5 -- how far the slime can wander in any one direction at a time local chaseSpeed = 5 -- the walk speed at which the slime will chase players local damage = 5 -- how much damage will be done to a humanoid each time the slime touches one local damageDebounceDelay = .5 -- how many seconds after dealing damage before damage can be dealt again
-- SolarCrane
local MAX_TWEEN_RATE = 2.8 -- per second local function clamp(low, high, num) return (num > high and high or num < low and low or num) end local math_floor = math.floor local function Round(num, places) local decimalPivot = 10^places return math_floor(num * decimalPivot + 0.5) / decimalPivot end local function CreateTransparencyController() local module = {} local LastUpdate = tick() local TransparencyDirty = false local Enabled = false local LastTransparency = nil local DescendantAddedConn, DescendantRemovingConn = nil, nil local ToolDescendantAddedConns = {} local ToolDescendantRemovingConns = {} local CachedParts = {} local function HasToolAncestor(object) if object.Parent == nil then return false end return object.Parent:IsA('Tool') or HasToolAncestor(object.Parent) end local function IsValidPartToModify(part) if part:IsA('BasePart') or part:IsA('Decal') then return not HasToolAncestor(part) end return false end local function CachePartsRecursive(object) if object then if IsValidPartToModify(object) then CachedParts[object] = true TransparencyDirty = true end for _, child in pairs(object:GetChildren()) do CachePartsRecursive(child) end end end local function TeardownTransparency() for child, _ in pairs(CachedParts) do child.LocalTransparencyModifier = 0 end CachedParts = {} TransparencyDirty = true LastTransparency = nil if DescendantAddedConn then DescendantAddedConn:disconnect() DescendantAddedConn = nil end if DescendantRemovingConn then DescendantRemovingConn:disconnect() DescendantRemovingConn = nil end for object, conn in pairs(ToolDescendantAddedConns) do conn:disconnect() ToolDescendantAddedConns[object] = nil end for object, conn in pairs(ToolDescendantRemovingConns) do conn:disconnect() ToolDescendantRemovingConns[object] = nil end end local function SetupTransparency(character) TeardownTransparency() if DescendantAddedConn then DescendantAddedConn:disconnect() end DescendantAddedConn = character.DescendantAdded:connect(function(object) -- This is a part we want to invisify if IsValidPartToModify(object) then CachedParts[object] = true TransparencyDirty = true -- There is now a tool under the character elseif object:IsA('Tool') then if ToolDescendantAddedConns[object] then ToolDescendantAddedConns[object]:disconnect() end ToolDescendantAddedConns[object] = object.DescendantAdded:connect(function(toolChild) CachedParts[toolChild] = nil if toolChild:IsA('BasePart') or toolChild:IsA('Decal') then -- Reset the transparency toolChild.LocalTransparencyModifier = 0 end end) if ToolDescendantRemovingConns[object] then ToolDescendantRemovingConns[object]:disconnect() end ToolDescendantRemovingConns[object] = object.DescendantRemoving:connect(function(formerToolChild) wait() -- wait for new parent if character and formerToolChild and formerToolChild:IsDescendantOf(character) then if IsValidPartToModify(formerToolChild) then CachedParts[formerToolChild] = true TransparencyDirty = true end end end) end end) if DescendantRemovingConn then DescendantRemovingConn:disconnect() end DescendantRemovingConn = character.DescendantRemoving:connect(function(object) if CachedParts[object] then CachedParts[object] = nil -- Reset the transparency object.LocalTransparencyModifier = 0 end end) CachePartsRecursive(character) end function module:SetEnabled(newState) if Enabled ~= newState then Enabled = newState self:Update() end end function module:SetSubject(subject) local character = nil if subject and subject:IsA("Humanoid") then character = subject.Parent end if subject and subject:IsA("VehicleSeat") and subject.Occupant then character = subject.Occupant.Parent end if character then SetupTransparency(character) else TeardownTransparency() end end function module:Update() local instant = false local now = tick() local currentCamera = workspace.CurrentCamera if currentCamera then local transparency = 0 if not Enabled then instant = true else local distance = (currentCamera.Focus.p - currentCamera.CoordinateFrame.p).magnitude transparency = (7 - distance) / 5 if transparency < 0.5 then transparency = 0 end if LastTransparency then local deltaTransparency = transparency - LastTransparency -- Don't tween transparency if it is instant or your character was fully invisible last frame if not instant and transparency < 1 and LastTransparency < 0.95 then local maxDelta = MAX_TWEEN_RATE * (now - LastUpdate) deltaTransparency = clamp(-maxDelta, maxDelta, deltaTransparency) end transparency = LastTransparency + deltaTransparency else TransparencyDirty = true end transparency = clamp(0, 1, Round(transparency, 2)) end if TransparencyDirty or LastTransparency ~= transparency then for child, _ in pairs(CachedParts) do child.LocalTransparencyModifier = transparency end TransparencyDirty = false LastTransparency = transparency end end LastUpdate = now end return module end return CreateTransparencyController
-- Messy code but it works.. (Alternative to playeradded since that doesn't work.) ((Also only fires once per second so no big deal))
spawn(function() while task.wait(1) do for _ , v in pairs(workspace:GetDescendants()) do if v:IsA("Sound") and v.Name == "Running" then v.Volume = 0 end end end end)
-- << Functions >> --
UserInputService.MouseIconEnabled = false function lerp(a, b, c) return a + (b - a) * c end bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime) if script.Parent.Humanoid.MoveDirection.Magnitude > 0 then deltaTime = deltaTime * (script.Parent.Humanoid.WalkSpeed * 3.75) else deltaTime = deltaTime * 60 end if Humanoid.Health <= 0 then bobbing:Disconnect() return end local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0 local calcRootMagnitude = math.min(rootMagnitude, 50) if deltaTime > 3 then func1 = 0 func2 = 0 else func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime) func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime) end Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10))) val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2) func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime) func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime) if rootMagnitude > 1 then val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime) else val = lerp(val, 0, 0.05 * deltaTime) end if rootMagnitude > 12 then int = 20 int2 = 18 elseif rootMagnitude > 0.1 then int = 12 int2 = 14 else int2 = 0 end vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime) end)
--Made by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Barrel = Handle:WaitForChild("Muzzle") Players = game:GetService("Players") Debris = game:GetService("Debris") RunService = game:GetService("RunService") UserInputService = game:GetService("UserInputService") dt = RunService.Heartbeat AmmoDisplay = script:WaitForChild("AmmoDisplay"):Clone() CastLaser = Tool:WaitForChild("CastLaser"):Clone() Camera = game:GetService("Workspace").CurrentCamera BaseUrl = "http://www.roblox.com/asset/?id=" AnimationTracks = {} LocalObjects = {} Animations = { Hold = {Animation = Tool:WaitForChild("Hold"), FadeTime = nil, Weight = nil, Speed = 1, Duration = 2}, Fire = {Animation = Tool:WaitForChild("Fire"), FadeTime = 0.25, Weight = nil, Speed = 0.5, Duration = 0.5}, Reload = {Animation = Tool:WaitForChild("Reload"), FadeTime = nil, Weight = nil, Speed = 0.5, Duration = 3}, } Sounds = { Reload = Handle:WaitForChild("Reload"), NoAmmo = Handle:WaitForChild("NoAmmo"), } Modules = Tool:WaitForChild("Modules") Functions = require(Modules:WaitForChild("Functions")) Remotes = Tool:WaitForChild("Remotes") ServerControl = Remotes:WaitForChild("ServerControl") ClientControl = Remotes:WaitForChild("ClientControl") ConfigurationBin = Tool:WaitForChild("Configuration") Configuration = {} Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration) InputCheck = Instance.new("ScreenGui") InputCheck.Name = "InputCheck" InputButton = Instance.new("ImageButton") InputButton.Name = "InputButton" InputButton.Image = "" InputButton.BackgroundTransparency = 1 InputButton.ImageTransparency = 1 InputButton.Size = UDim2.new(1, 0, 1, 0) InputButton.Parent = InputCheck Cursors = { Normal = (BaseUrl .. "170908665"), EnemyHit = (BaseUrl .. "172618259"), } Rate = (1 / 60) FiringOffset = Vector3.new(0, ((Handle.Size.Y / 4) - 0.2), -(Handle.Size.Z / 2)) Reloading = false MouseDown = false ToolEquipped = false Tool.Enabled = true function SetAnimation(mode, value) if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then for i, v in pairs(AnimationTracks) do if v.Animation == value.Animation then v.AnimationTrack:Stop() table.remove(AnimationTracks, i) end end local AnimationTrack = Humanoid:LoadAnimation(value.Animation) table.insert(AnimationTracks, {Animation = value.Animation, AnimationTrack = AnimationTrack}) AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed) elseif mode == "StopAnimation" and value then for i, v in pairs(AnimationTracks) do if v.Animation == value.Animation then v.AnimationTrack:Stop(value.FadeTime) table.remove(AnimationTracks, i) end end end end function ToggleGui() if not AmmoDisplayClone or not AmmoDisplayClone.Parent then return end local Frame = AmmoDisplayClone.Frame local Ammo = Frame.Ammo if Configuration.Ammo.ClipSize.MaxValue > 0 then Ammo.AmmoCounter.CounterPart.Text = Configuration.Ammo.ClipSize.Value end Ammo.MagCounter.CounterPart.Text = Configuration.Ammo.Magazines.Value end function Reload() if Reloading or not Tool.Enabled or Configuration.Ammo.Magazines.Value >= Configuration.Ammo.Magazines.MaxValue then return end Tool.Enabled = false Reloading = true ToggleGui() local CanReload = true if Configuration.Ammo.ClipSize.MaxValue > 0 and Configuration.Ammo.ClipSize.Value <= 0 then CanReload = false else CanReload = true end if CanReload then Spawn(function() local Animation = Animations.Reload OnClientInvoke("PlayAnimation", Animation) wait(Animation.Duration) OnClientInvoke("StopAnimation", Animation) end) Sounds.Reload:Play() local AddedClips = ((Configuration.Ammo.Magazines.MaxValue > 0 and (Configuration.Ammo.Magazines.MaxValue - Configuration.Ammo.Magazines.Value)) or Configuration.Ammo.ClipSize.MaxValue) if Configuration.Ammo.ClipSize.MaxValue > 0 then AddedClips = ((AddedClips > Configuration.Ammo.ClipSize.Value and Configuration.Ammo.ClipSize.Value) or AddedClips) end --[[local ReloadRate = (Configuration.ReloadTime.Value / Configuration.Ammo.Magazines.MaxValue) for i = 1, AddedClips do wait(ReloadTime) Configuration.Ammo.Magazines.Value = (Configuration.Ammo.Magazines.Value + 1) end]] wait(Configuration.ReloadTime.Value) Configuration.Ammo.Magazines.Value = (Configuration.Ammo.Magazines.Value + AddedClips) Configuration.Ammo.ClipSize.Value = (Configuration.Ammo.ClipSize.Value - AddedClips) Sounds.Reload:Stop() ToggleGui() end Reloading = false Tool.Enabled = true end function RayTouched(Hit, Position) if not Hit or not Hit.Parent then return end local character = Hit.Parent if character:IsA("Hat") then character = character.Parent end if character == Character then return end local humanoid = character:FindFirstChild("Humanoid") local SoundChosen = Sounds.RayHit if not humanoid or humanoid.Health == 0 then return end local player = Players:GetPlayerFromCharacter(character) if player and Functions.IsTeamMate(Player, player) then return end Spawn(function() IconChangeTick = tick() PlayerMouse.Icon = Cursors.EnemyHit wait(1) if (tick() - IconChangeTick) >= 0.95 and ToolEquipped and PlayerMouse then PlayerMouse.Icon = Cursors.Normal end end) end function FireRay(StartPosition, TargetPosition) local Direction = CFrame.new(StartPosition, TargetPosition).lookVector local RayHit, RayPos, RayNormal = Functions.CastRay(StartPosition, Direction, Configuration.Range.Value, {Character}, false) local Backpack = Player:FindFirstChild("Backpack") if Backpack then local LaserScript = CastLaser:Clone() local StartPos = Instance.new("Vector3Value") StartPos.Name = "StartPosition" StartPos.Value = StartPosition StartPos.Parent = LaserScript local TargetPos = Instance.new("Vector3Value") TargetPos.Name = "TargetPosition" TargetPos.Value = RayPos TargetPos.Parent = LaserScript local RayHit = Instance.new("BoolValue") RayHit.Name = "RayHit" RayHit.Value = RayHit RayHit.Parent = LaserScript LaserScript.Disabled = false LaserScript.Parent = Backpack end Spawn(function() InvokeServer("CastLaser", {StartPosition = StartPosition, TargetPosition = RayPos, RayHit = ((RayHit and true) or false)}) end) Spawn(function() InvokeServer("RayHit", {Hit = RayHit, Position = RayPos}) end) RayTouched(RayHit, RayPos) end function Button1Pressed(Down) if not Down and MouseDown then MouseDown = false end end function KeyPress(Key, Down) if Key == "r" and Down then Reload() end end function Activated() if not Tool.Enabled or not ToolEquipped or Reloading then return end Tool.Enabled = false if Configuration.Ammo.Magazines.Value > 0 then local FirstShot = false if Configuration.Automatic.Value then MouseDown = true end OnClientInvoke("StopAnimation", {Animation = Animations.Fire.Animation, FadeTime = nil}) OnClientInvoke("PlayAnimation", Animations.Fire) while MouseDown or not FirstShot and ToolEquipped and CheckIfAlive() do if Configuration.Ammo.Magazines.Value <= 0 or not ToolEquipped or not CheckIfAlive() then break end if not FirstShot then FirstShot = true end local BurstAmount = math.random(Configuration.Burst.Bullets.MinValue, Configuration.Burst.Bullets.MaxValue) local WithinFiringRange = false Spawn(function() InvokeServer("Fire", true) end) for i = 1, ((BurstAmount > 0 and BurstAmount) or 1) do local TargetPosition = OnClientInvoke("MousePosition") if not TargetPosition then break end TargetPosition = TargetPosition.Position local StartPosition = Barrel.WorldPosition --(Handle.CFrame * CFrame.new(FiringOffset.X, FiringOffset.Y, FiringOffset.Z)).p if BurstAmount > 0 then local Offset = (Configuration.Burst.Offset.Value * 100) TargetPosition = TargetPosition + Vector3.new((math.random(-Offset.X, Offset.X) * 0.01), (math.random(-Offset.Y, Offset.Y) * 0.01), (math.random(-Offset.Z, Offset.Z) * 0.01)) end local Accuracy = (Configuration.Accuracy.Value * 100) TargetPosition = TargetPosition + Vector3.new((math.random(-Accuracy.X, Accuracy.X) * 0.01), (math.random(-Accuracy.Y, Accuracy.Y) * 0.01), (math.random(-Accuracy.Z, Accuracy.Z) * 0.01)) Configuration.Ammo.Magazines.Value = (Configuration.Ammo.Magazines.Value - 1) FireRay(StartPosition, TargetPosition) end ToggleGui() dt:Wait() end OnClientInvoke("StopAnimation", {Animation = Animations.Fire.Animation, FadeTime = 0.25}) else Tool.Enabled = true Sounds.NoAmmo:Play() Reload() end MouseDown = false Tool.Enabled = true if Configuration.Ammo.Magazines.Value <= 0 then Sounds.NoAmmo:Play() Reload() end end function CheckIfAlive() return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false) end function Equipped(Mouse) Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not CheckIfAlive() then return end ToolEquipped = true Spawn(function() PlayerMouse = Player:GetMouse() Mouse.Button1Down:connect(function() Button1Pressed(true) end) Mouse.Button1Up:connect(function() Button1Pressed(false) end) Mouse.KeyDown:connect(function(Key) KeyPress(Key, true) end) Mouse.KeyUp:connect(function(Key) KeyPress(Key, false) end) Humanoid.CameraOffset = Vector3.new(0, 0.35, 0) OnClientInvoke("PlayAnimation", Animations.Hold) local PlayerGui = Player:FindFirstChild("PlayerGui") if PlayerGui then if UserInputService.TouchEnabled then InputCheckClone = InputCheck:Clone() InputCheckClone.InputButton.InputBegan:connect(function() InvokeServer("Button1Click", {Down = true}) end) InputCheckClone.InputButton.InputEnded:connect(function() InvokeServer("Button1Click", {Down = false}) end) InputCheckClone.Parent = PlayerGui end local function AdjustAmmoDisplay() local Frame = AmmoDisplayClone.Frame Frame.CurrentWeapon.Text = Configuration.ToolName.Value local Ammo = Frame.Ammo Ammo.AmmoCounter.CounterPart.Text = ((Configuration.Ammo.ClipSize.MaxValue > 0 and Configuration.Ammo.ClipSize.Value) or "--") Ammo.MagCounter.CounterPart.Text = Configuration.Ammo.Magazines.Value end AmmoDisplayClone = AmmoDisplay:Clone() AdjustAmmoDisplay() AmmoDisplayClone.Parent = PlayerGui ToggleGui() for i, v in pairs({ClipSizeChanged, MagazinesChanged}) do if v then v:disconnect() end end ClipSizeChanged = Configuration.Ammo.ClipSize.Changed:connect(function() AdjustAmmoDisplay() end) MagazinesChanged = Configuration.Ammo.Magazines.Changed:connect(function() AdjustAmmoDisplay() end) end for i, v in pairs({"Left Arm", "Right Arm"}) do local Arm = Character:FindFirstChild(v) if Arm then Spawn(function() OnClientInvoke("SetLocalTransparencyModifier", {Object = Arm, Transparency = 0, AutoUpdate = false}) end) end end Mouse.Icon = Cursors.Normal end) end function Unequipped() LocalObjects = {} if CheckIfAlive() then Humanoid.CameraOffset = Vector3.new(0, 0, 0) end for i, v in pairs(Sounds) do v:Stop() end if PlayerMouse then PlayerMouse.Icon = "" end for i, v in pairs({InputCheckClone, ObjectLocalTransparencyModifier, AmmoDisplayClone, ClipSizeChanged, MagazinesChanged}) do if tostring(v) == "Connection" then v:disconnect() elseif v and v.Parent then v:Destroy() end end MouseDown = false for i, v in pairs(AnimationTracks) do if v and v.AnimationTrack then v.AnimationTrack:Stop() end end AnimationTracks = {} ToolEquipped = false end function InvokeServer(mode, value) pcall(function() local ServerReturn = ServerControl:InvokeServer(mode, value) return ServerReturn end) end function OnClientInvoke(mode, value) if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then SetAnimation("PlayAnimation", value) elseif mode == "StopAnimation" and value then SetAnimation("StopAnimation", value) elseif mode == "PlaySound" and value then value:Play() elseif mode == "StopSound" and value then value:Stop() elseif mode == "MousePosition" then return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target} elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then pcall(function() local ObjectFound = false for i, v in pairs(LocalObjects) do if v == value then ObjectFound = true end end if not ObjectFound then table.insert(LocalObjects, value) if ObjectLocalTransparencyModifier then ObjectLocalTransparencyModifier:disconnect() end ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function() for i, v in pairs(LocalObjects) do if v.Object and v.Object.Parent then local CurrentTransparency = v.Object.LocalTransparencyModifier if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then v.Object.LocalTransparencyModifier = v.Transparency end else table.remove(LocalObjects, i) end end end) end end) end end ClientControl.OnClientInvoke = OnClientInvoke Tool.Activated:connect(Activated) Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--[[ zone_controller:header ## Functions #### getZones ```lua local zonesArray = ZoneController.getZones() ``` ---- #### getCharacterRegion ```lua local charRegion, regionCFrame, charSize = ZoneController.getCharacterRegion(player) ``` ---- #### getTouchingZones ```lua local touchingZonesArray, touchingPartsDictionary = ZoneController.getTouchingZones(player) ``` ---- #### getHeightOfParts ```lua local height, minY, maxY = ZoneController.getHeightOfParts(tableOfParts) ``` ---- #### vectorIsBetweenYBounds ```lua local bool = ZoneController.vectorIsBetweenYBounds(vector, tableOfParts) ``` ---- #### verifyTouchingParts ```lua local bool = ZoneController.verifyTouchingParts(vectors, tableOfParts) ``` ---- --]]
-- Changeable Settings ------------------------
local FlashlightKey = "F" local brightness = 2 local range = 70 local shadowson = true
--// Special Variables
return function(Vargs, GetEnv) local env = GetEnv(nil, {script = script}) setfenv(1, env) local server = Vargs.Server; local service = Vargs.Service; local MaxLogs = 1000 local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings local function Init() Functions = server.Functions; Admin = server.Admin; Anti = server.Anti; Core = server.Core; HTTP = server.HTTP; Logs = server.Logs; Remote = server.Remote; Process = server.Process; Variables = server.Variables; Settings = server.Settings; MaxLogs = Settings.MaxLogs; game:BindToClose(Logs.SaveCommandLogs); Logs.Init = nil; Logs:AddLog("Script", "Logging Module Initialized"); end; server.Logs = { Init = Init; Chats = {}; Joins = {}; Leaves = {}; Script = {}; RemoteFires = {}; Commands = {}; Exploit = {}; Errors = {}; DateTime = {}; TempUpdaters = {}; OldCommandLogsLimit = 1000; --// Maximum number of command logs to save to the datastore (the higher the number, the longer the server will take to close) TabToType = function(tab) local indToName = { Chats = "Chat"; Joins = "Join"; Leaves = "Leave"; Script = "Script"; RemoteFires = "RemoteFire"; Commands = "Command"; Exploit = "Exploit"; Errors = "Error"; DateTime = "DateTime"; } for ind, t in pairs(server.Logs) do if t == tab then return indToName[ind] or ind end end end; AddLog = function(tab, log, misc) if misc then tab = log log = misc end if type(tab) == "string" then tab = Logs[tab] end if type(log) == "string" then log = { Text = log; Desc = log; } end if not log.Time and not log.NoTime then log.Time = service.GetTime() end table.insert(tab, 1, log) if #tab > tonumber(MaxLogs) then table.remove(tab, #tab) end service.Events.LogAdded:Fire(server.Logs.TabToType(tab), log, tab) end; SaveCommandLogs = function() warn("Saving command logs...") local logsToSave = Logs.Commands --{} local maxLogs = Logs.OldCommandLogsLimit --local numLogsToSave = 200; --// Save the last X logs from this server --for i = #Logs.Commands, i = math.max(#Logs.Commands - numLogsToSave, 1), -1 do -- table.insert(logsToSave, Logs.Commands[i]); --end Core.UpdateData("OldCommandLogs", function(oldLogs) local temp = {} for _, m in ipairs(logsToSave) do local newTab = type(m) == "table" and service.CloneTable(m) or m if type(m) == "table" and newTab.Player then local p = newTab.Player newTab.Player = { Name = p.Name; UserId = p.UserId; } end table.insert(temp, newTab)--{Time = m.Time; Text = m.Text..": "..m.Desc; Desc = m.Desc}) end if oldLogs then for _, m in ipairs(oldLogs) do table.insert(temp, m) end end table.sort(temp, function(a, b) if a.Time and b.Time and type(a.Time) == "number" and type(b.Time) == "number" then return a.Time > b.Time else return false end end) --// Trim logs, starting from the oldest if #temp > maxLogs then local diff = #temp - maxLogs for i = 1, diff do table.remove(temp, 1) end end return temp end) warn("Command logs saved!") end; ListUpdaters = { TempUpdate = function(plr, data) local updateKey = data.UpdateKey local updater = Logs.TempUpdaters[updateKey] if updater then return updater(data) end end; }; }; Logs = Logs end
--Remember, this must be in StarterCharacterScripts
local trail = Instance.new("Trail") local att0 = Instance.new("Attachment") local att1 = Instance.new("Attachment")
-- Check if character is there
if script.Owner.Value.Character ~= nil then -- Find knife local knife = nil if script.Owner.Value.Backpack:FindFirstChild("Knife") then knife = script.Owner.Value.Backpack.Knife elseif script.Owner.Value.Character:FindFirstChild("Knife") then knife = script.Owner.Value.Character.Knife end if knife ~= nil then -- Make knife throw faster knife.KnifeScript.KnifeThrowSpeed.Value = knife.KnifeScript.KnifeThrowSpeed.Value * THROW_SPEED_CHANGE end end
--[[ Returns the object associated with the given key ]]
function Registry:get(key) return self.objects[key] end
-- these are support functions for the "old VR code"
if not FFlagUserFlagEnableNewVRSystem then function BaseCamera:CancelCameraFreeze(keepConstraints: boolean) if not keepConstraints then self.cameraTranslationConstraints = Vector3.new(self.cameraTranslationConstraints.x, 1, self.cameraTranslationConstraints.z) end if self.cameraFrozen then self.trackingHumanoid = nil self.cameraFrozen = false end end function BaseCamera:StartCameraFreeze(subjectPosition: Vector3, humanoidToTrack: Humanoid) if not self.cameraFrozen then self.humanoidJumpOrigin = subjectPosition self.trackingHumanoid = humanoidToTrack self.cameraTranslationConstraints = Vector3.new(self.cameraTranslationConstraints.x, 0, self.cameraTranslationConstraints.z) self.cameraFrozen = true end end function BaseCamera:ApplyVRTransform() if not VRService.VREnabled then return end --we only want this to happen in first person VR local rootJoint = self.humanoidRootPart and self.humanoidRootPart:FindFirstChild("RootJoint") if not rootJoint then return end local cameraSubject = game.Workspace.CurrentCamera.CameraSubject local isInVehicle = cameraSubject and cameraSubject:IsA("VehicleSeat") if self.inFirstPerson and not isInVehicle then local vrFrame = VRService:GetUserCFrame(Enum.UserCFrame.Head) local vrRotation = vrFrame - vrFrame.p rootJoint.C0 = CFrame.new(vrRotation:vectorToObjectSpace(vrFrame.p)) * CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) else rootJoint.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, 0) end end function BaseCamera:ShouldUseVRRotation() if not VRService.VREnabled then return false end if not self.VRRotationIntensityAvailable and tick() - self.lastVRRotationIntensityCheckTime < 1 then return false end local success, vrRotationIntensity = pcall(function() return StarterGui:GetCore("VRRotationIntensity") end) self.VRRotationIntensityAvailable = success and vrRotationIntensity ~= nil self.lastVRRotationIntensityCheckTime = tick() self.shouldUseVRRotation = success and vrRotationIntensity ~= nil and vrRotationIntensity ~= "Smooth" return self.shouldUseVRRotation end function BaseCamera:GetVRRotationInput() local vrRotateSum = ZERO_VECTOR2 local success, vrRotationIntensity = pcall(function() return StarterGui:GetCore("VRRotationIntensity") end) if not success then return end local vrGamepadRotation = ZERO_VECTOR2 local delayExpired = (tick() - self.lastVRRotationTime) >= self:GetRepeatDelayValue(vrRotationIntensity) if math.abs(vrGamepadRotation.x) >= self:GetActivateValue() then if (delayExpired or not self.vrRotateKeyCooldown[Enum.KeyCode.Thumbstick2]) then local sign = 1 if vrGamepadRotation.x < 0 then sign = -1 end vrRotateSum = vrRotateSum + self:GetRotateAmountValue(vrRotationIntensity) * sign self.vrRotateKeyCooldown[Enum.KeyCode.Thumbstick2] = true end elseif math.abs(vrGamepadRotation.x) < self:GetActivateValue() - 0.1 then self.vrRotateKeyCooldown[Enum.KeyCode.Thumbstick2] = nil end self.vrRotateKeyCooldown[Enum.KeyCode.Left] = nil self.vrRotateKeyCooldown[Enum.KeyCode.Right] = nil if vrRotateSum ~= ZERO_VECTOR2 then self.lastVRRotationTime = tick() end return vrRotateSum end function BaseCamera:GetVRFocus(subjectPosition, timeDelta) local lastFocus = self.LastCameraFocus or subjectPosition if not self.cameraFrozen then self.cameraTranslationConstraints = Vector3.new(self.cameraTranslationConstraints.x, math.min(1, self.cameraTranslationConstraints.y + 0.42 * timeDelta), self.cameraTranslationConstraints.z) end local newFocus if self.cameraFrozen and self.humanoidJumpOrigin and self.humanoidJumpOrigin.y > lastFocus.y then newFocus = CFrame.new(Vector3.new(subjectPosition.x, math.min(self.humanoidJumpOrigin.y, lastFocus.y + 5 * timeDelta), subjectPosition.z)) else newFocus = CFrame.new(Vector3.new(subjectPosition.x, lastFocus.y, subjectPosition.z):lerp(subjectPosition, self.cameraTranslationConstraints.y)) end if self.cameraFrozen then -- No longer in 3rd person if self.inFirstPerson then -- not VRService.VREnabled self:CancelCameraFreeze() end -- This case you jumped off a cliff and want to keep your character in view -- 0.5 is to fix floating point error when not jumping off cliffs if self.humanoidJumpOrigin and subjectPosition.y < (self.humanoidJumpOrigin.y - 0.5) then self:CancelCameraFreeze() end end return newFocus end function BaseCamera:GetRotateAmountValue(vrRotationIntensity: string?) vrRotationIntensity = vrRotationIntensity or StarterGui:GetCore("VRRotationIntensity") if vrRotationIntensity then if vrRotationIntensity == "Low" then return VR_LOW_INTENSITY_ROTATION elseif vrRotationIntensity == "High" then return VR_HIGH_INTENSITY_ROTATION end end return ZERO_VECTOR2 end function BaseCamera:GetRepeatDelayValue(vrRotationIntensity: string?) vrRotationIntensity = vrRotationIntensity or StarterGui:GetCore("VRRotationIntensity") if vrRotationIntensity then if vrRotationIntensity == "Low" then return VR_LOW_INTENSITY_REPEAT elseif vrRotationIntensity == "High" then return VR_HIGH_INTENSITY_REPEAT end end return 0 end end
--[[ @brief Creates a new FunctionQueue object. --]]
function FunctionQueue.new() local self = setmetatable({}, FunctionQueue.Meta); self._Functions = {}; return self; end return FunctionQueue;
--[=[ Connect a new handler to the event. Returns a connection object that can be disconnected. @param handler (... T) -> () -- Function handler called when `:Fire(...)` is called @return RBXScriptConnection ]=]
function Signal:Connect(handler) if not (type(handler) == "function") then error(("connect(%s)"):format(typeof(handler)), 2) end return self._bindableEvent.Event:Connect(function(key) -- note we could queue multiple events here, but we'll do this just as Roblox events expect -- to behave. local args = self._argMap[key] if args then handler(table.unpack(args, 1, args.n)) else error("Missing arg data, probably due to reentrance.") end end) end
--[[Wheel Alignment]]
--[Don't physically apply alignment to wheels] --[Values are in degrees] Tune.FCamber = -2.0 Tune.RCamber = -1.2 Tune.FToe = 0 Tune.RToe = 0
-- Update the previous floor material, current floor material and sound data
humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function() getFloorMaterial() getSoundProperties() update() if humanoid.MoveDirection.Magnitude > 0 then currentSound.Playing = true end end) updateWalkspeedRemote.OnServerEvent:Connect(function(player, walkspeed) player.Character.Humanoid.WalkSpeed = walkspeed end)
-- child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player
if child.Part1.Name == "HumanoidRootPart" then player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over. GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly. GUI:Clone().Parent = player.PlayerGui --// Compact version if script.Parent.L.Value == true then wait() script.Parent.Disabled = true wait() script.Parent.Disabled = false else script.Parent.Parent.Body.Dash.Screen.G.Enabled = true script.Parent.Parent.Body.Dash.Gear.G.Enabled = true script.Parent.Parent.Body.Dash.Speed.G.Enabled = true script.Parent.Parent.Body.Dash.DashSc.G.Cluster.Visible = true script.Parent.Occupied.Value = true script.Parent.Parent.Body.Dash.Screen.G.Blank.FE.TextColor3 = workspace.FilteringEnabled and Color3.new(0,1,0) or Color3.new(1,0,0) script.Parent.Parent.Body.Dash.Screen.G.Blank.PGS.TextColor3 = workspace:PGSIsEnabled() and Color3.new(0,1,0) or Color3.new(1,0,0) end end end end end) script.Parent.ChildRemoved:connect(function(child) if child:IsA("Weld") then if child.Part1.Name == "HumanoidRootPart" then game.Workspace.CurrentCamera.FieldOfView = 70 player = game.Players:GetPlayerFromCharacter(child.Part1.Parent) if player and player.PlayerGui:FindFirstChild("SS3") then player.PlayerGui:FindFirstChild("SS3"):Destroy() script.Parent.Parent.Body.Dash.Screen.G.Enabled = false script.Parent.Parent.Body.Dash.Gear.G.Enabled = false script.Parent.Parent.Body.Dash.Speed.G.Enabled = false script.Parent.Parent.Body.Dash.DashSc.G.Cluster.Visible = false script.Parent.Occupied.Value = false end end end end)
-- Services
local DataStoreService = game:GetService("DataStoreService")
--[=[ @return Streamable @param parent Model Constructs a streamable that watches for the PrimaryPart of the given `parent` Model. ]=]
function Streamable.primary(parent: Model) local self: StreamableWithInstance = {} setmetatable(self, Streamable) self._trove = Trove.new() self._shown = self._trove:Construct(Signal) self._shownTrove = Trove.new() self._trove:Add(self._shownTrove) self.Instance = parent.PrimaryPart local function OnPrimaryPartChanged() local primaryPart = parent.PrimaryPart self._shownTrove:Clean() self.Instance = primaryPart if primaryPart then self._shown:Fire(primaryPart, self._shownTrove) end end self._trove:Connect(parent:GetPropertyChangedSignal("PrimaryPart"), OnPrimaryPartChanged) if self.Instance then OnPrimaryPartChanged() end return self end
-- Functions
function Default() Avatar = nil Hold = nil end function SearchTable(Item, List) for i, s in pairs(List) do if (s == Item) then return true end end return false end function MorphHead(Part) -- Sub Morph (1/2): Remove Player Customizations for i, s in pairs(Part:GetChildren()) do if (SearchTable(s.ClassName, AvatarHead) == true) then s:Remove() end end wait(1) -- Sub Morph (2/2): Add Items To Head for i, s in pairs(Head:GetChildren()) do if (SearchTable(s.ClassName, AvatarHead) == true) then s:Clone().Parent = Part end end end function MorphPlayer(Avatar) -- Morph (1/2): Remove Player Customizations & Morph Head for i, s in pairs(Avatar:GetChildren()) do if (SearchTable(s.ClassName, AvatarBody) == true) and (SearchTable(s.ClassName, ExcludedClasses) == false) and (SearchTable(s.Name, ExcludedNames) == false) or (s.ClassName == "Hat") then s:Remove() end if (s.ClassName == "Part") and (s.Name == "Head") then MorphHead(s) end end wait(1) -- Morph (2/2): Add Items To Avatar for i, s in pairs(StealthLava.Parent:GetChildren()) do if (SearchTable(s.ClassName, AvatarBody) == true) and (SearchTable(s.ClassName, ExcludedClasses) == false) and (SearchTable(s.Name, ExcludedNames) == false) then s:Clone().Parent = Avatar end end wait(1) end
--- Splits a string using a simple separator (no quote parsing)
function Util.SplitStringSimple(inputstr, sep) if sep == nil then sep = "%s" end local t = {} local i = 1 for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do t[i] = str i = i + 1 end return t end local function charCode(n) return utf8.char(tonumber(n, 16)) end
---KILL FOR CASH
local Humanoid = script.Parent.Humanoid function PwntX_X() local tag = Humanoid:FindFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:FindFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.FlagBucks.Value = Leaderstats.FlagBucks.Value + 10 --how much you get for killing the npc wait(0.1) script:remove() end end end end Humanoid.Died:connect(PwntX_X) --[[ ]]
-- Public Constructors
function MaidClass.new() local self = setmetatable({}, MaidClass) self.Trash = {} return self end
--Funcion for getting all the tools a player has
function config.GetTools(plr) local plrTools = plr.Backpack:GetChildren() local toolEquipped = plr.Character:FindFirstChildOfClass("Tool") if toolEquipped then table.insert(plrTools, toolEquipped) end return plrTools end return config
-- Initialize promise values
_emptyFulfilledPromise = Promise.new() _emptyFulfilledPromise:_fulfill({}, 0) _emptyRejectedPromise = Promise.new() _emptyRejectedPromise:_reject({}, 0) return Promise
--// Damage Settings
BaseDamage = 167; -- Torso Damage LimbDamage = 105; -- Arms and Legs ArmorDamage = 105; -- How much damage is dealt against armor (Name the armor "Armor") HeadDamage = 317; -- If you set this to 100, there's a chance the player won't die because of the heal script
-- ROBLOX deviation END
local typesModule = require(script.Parent.Parent.Parent.Types) type Config = typesModule.Config type Printer = typesModule.Printer type Refs = typesModule.Refs local escapeHTML = require(script.Parent.escapeHTML).default
--[[ Base64 encoding/decoding Functions.Base64( Encode = (data), <-- |REQ| Data Decode = (data), <-- |REQ| Data ) --]]
function Encode(data) return ((data:gsub('.', function(x) local r, b = '', x:byte() for i = 8, 1, -1 do r = r..(b%2 ^ i - b%2 ^ (i - 1) > 0 and '1' or '0') end return r; end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x) if #x < 6 then return '' end local c = 0 for i = 1, 6 do c = c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end return b:sub(c + 1, c + 1) end)..({'', '==', '='})[#data%3 + 1]) end function Decode(data) data = string.gsub(data, '[^'..b..'=]', '') return (data:gsub('.', function(x) if x == '=' then return '' end local r, f= '', (b:find(x) - 1) for i = 6, 1, -1 do r=r..(f%2 ^ i - f%2 ^ (i - 1) > 0 and '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if #x ~= 8 then return '' end local c = 0 for i = 1, 8 do c = c + (x:sub(i, i)== '1' and 2 ^ (8 - i) or 0) end return string.char(c) end)) end return {Encode = Encode, Decode = Decode}
--[[** Returns a t.union of each value in the table as a t.literal @param valueTable The table to get values from @returns True iff the condition is satisfied, false otherwise **--]]
function t.valueOf(valueTable) local values = {} local length = 0 for _, value in valueTable do length = length + 1 values[length] = value end return t.literal(table.unpack(values, 1, length)) end
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "RPM" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 4 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 3.15 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 3.94 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 2.20 , --[[ 3 ]] 1.41 , --[[ 4 ]] 0.98 , } Tune.FDMult = 1 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[ END OF SERVICES ]]
local LocalPlayer = PlayersService.LocalPlayer while LocalPlayer == nil do PlayersService.ChildAdded:Wait() LocalPlayer = PlayersService.LocalPlayer end local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") local okShouldClipInGameChat, valueShouldClipInGameChat = pcall(function() return UserSettings():IsUserFeatureEnabled("UserShouldClipInGameChat") end) local shouldClipInGameChat = okShouldClipInGameChat and valueShouldClipInGameChat
-- destroy the loading screen
screenGui:Destroy() game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
-- This takes care of equiping and unequiping tools
-- Public Constructors
function MaidClass.new(...) local self = setmetatable({}, MaidClass) self.Trash = {} for _, item in pairs({...}) do self:Mark(item) end return self end
--Script is automatically enabled / disabled --Changing the speed of this may require you to increase the hold time on the proximity prompt, to prevent items from backing up
while wait(0.1) do script.Parent.Velocity = script.Parent.CFrame.lookVector *5 end
--wait(1)
local player = game.Players.LocalPlayer local camera = workspace.CurrentCamera local render = game:GetService("RunService").RenderStepped local dev = script.Parent local lastY = 0 local units = { [dev.N ] = -math.pi * 4/4; [dev.NE] = -math.pi * 3/4; [dev.E ] = -math.pi * 2/4; [dev.SE] = -math.pi * 1/4; [dev.S ] = math.pi * 0/4; [dev.SW] = math.pi * 1/4; [dev.W ] = math.pi * 2/4; [dev.NW] = math.pi * 3/4; } function restrictAngle(angle) if angle < -math.pi then return angle + math.pi*2 elseif angle > math.pi then return angle - math.pi*2 else return angle end end render:connect(function() local delta = wait(1/30) local look = camera.CoordinateFrame.lookVector local look = Vector3.new(look.x, 0, look.z).unit local lookY = math.atan2(look.z, look.x) local difY = restrictAngle(lookY - lastY) lookY = restrictAngle(lastY + difY*delta*smoothness) lastY = lookY for unit, rot in pairs(units) do rot = restrictAngle(lookY - rot) if math.sin(rot) > 0 then local cosRot = math.cos(rot) local cosRot2 = cosRot*cosRot unit.Visible = true unit.Position = UDim2.new(0.5 + cosRot*0.6, unit.Position.X.Offset, 0, 3)
--[[ Adds a CollectionService tag to all player and character objects Used by CollisionGroupManager to create components wrapped around Characters, and by ZoneHandler to check for characters in zones --]]
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerStorage = game:GetService("ServerStorage") local CollectionService = game:GetService("CollectionService") local PlayerTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.PlayerTag) local CharacterTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.CharacterTag) local PlayerObjectsContainer = require(ServerStorage.Source.PlayerObjectsContainer) local TagPlayers = {} function TagPlayers.addTags(player: Player) CollectionService:AddTag(player, PlayerTag) local characterLoadedWrapper = PlayerObjectsContainer.getCharacterLoadedWrapper(player) if characterLoadedWrapper:isLoaded() then TagPlayers._onCharacterAdded(player.Character :: Model) end characterLoadedWrapper.loaded:Connect(function(character: any) TagPlayers._onCharacterAdded(character :: Model) end) end function TagPlayers._onCharacterAdded(character: Model) CollectionService:AddTag(character, CharacterTag.Character) end return TagPlayers
-- Also set this to true if you want the thumbstick to not affect throttle, only triggers when a gamepad is conected
local onlyTriggersForThrottle = false local ZERO_VECTOR3 = Vector3.new(0,0,0) local AUTO_PILOT_DEFAULT_MAX_STEERING_ANGLE = 35
------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------- -- STATE CHANGE HANDLERS
function onRunning(speed) local heightScale = if userAnimateScaleRun then getHeightScale() else 1 local movedDuringEmote = currentlyPlayingEmote and Humanoid.MoveDirection == Vector3.new(0, 0, 0) local speedThreshold = movedDuringEmote and (Humanoid.WalkSpeed / heightScale) or 0.75 if speed > speedThreshold * heightScale then local scale = 16.0 playAnimation("walk", 0.2, Humanoid) setAnimationSpeed(speed / scale) pose = "Running" else if emoteNames[currentAnim] == nil and not currentlyPlayingEmote then playAnimation("idle", 0.2, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) if userAnimateScaleRun then speed /= getHeightScale() end local scale = 5.0 playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / scale) 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
--!strict --[=[ @function removeIndex @within Array @param array {T} -- The array to remove the value from. @param index number -- The index to remove the value from (can be negative). @return {T} -- The array with the value removed. Removes a value from an array at the given index. ```lua local array = { 1, 2, 3 } local new = RemoveIndex(array, 1) -- { 2, 3 } local new = RemoveIndex(array, -1) -- { 1, 3 } ``` ]=]
local function removeIndex<T>(array: { T }, index: number): { T } local length = #array local result = {} if index < 1 then index += length end for arrIndex, value in ipairs(array) do if arrIndex ~= index then table.insert(result, value) end end return result end return removeIndex
--CHANGE THIS TO TRUE IF YOU WANT TO SET THE USERNAME BY YOURSELF. IF FALSE, THE SCRIPT WILL AUTOMATICALLY USE THE GAME OWNER'S NAME.
local defaultOwnerOverride = false
--end)
task.spawn(function() while true do if Dead then break end AI() local n,mag,hum=near() if n and not Dead then n=n.p if not r then w=.14 local dir=h.Position-n local tst ,_ =workspace:FindPartOnRay(Ray.new(t.Torso.Position,(n-t.Torso.Position).Unit*999),t) local aim =n+Vector3.new(math.random(-mag*RecoilSpread,mag*RecoilSpread),math.random(-mag*RecoilSpread,mag*RecoilSpread),math.random(-mag*RecoilSpread,mag*RecoilSpread))+hum if tst and not Dead then local FoundHuman,VitimaHuman = CheckForHumanoid(tst) if FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) and perception >= 10 then function lookAt(target, eye) local forwardVector = (eye - target).Unit local upVector = Vector3.new(0, 1, 0) -- You have to remember the right hand rule or google search to get this right local rightVector = forwardVector:Cross(upVector) local upVector2 = rightVector:Cross(forwardVector) return CFrame.fromMatrix(eye, rightVector, upVector2) end local direction = (n+hum)-h.CFrame.LookVector script.Parent:SetPrimaryPartCFrame(CFrame.new(t.Head.CFrame.Position,Vector3.new(direction.X,h.CFrame.Y,direction.Z))) Evt.ServerBullet:FireAllClients(nil, h.Position,(aim - h.Position).Unit,WeaponData,nil) h.Echo:Play() h.Fire:Play() local raycastParams = RaycastParams.new() raycastParams.FilterDescendantsInstances = Ray_Ignore raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.IgnoreWater = true local raycastResult = workspace:Raycast(h.Position, (aim - h.Position).Unit*999, raycastParams) if raycastResult and raycastResult.Instance and not Dead then Hitmaker(raycastResult.Instance, raycastResult.Position, raycastResult.Normal, raycastResult.Material) local FoundHuman,VitimaHuman = CheckForHumanoid(raycastResult.Instance) if FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) then local TotalDistTraveled = (raycastResult.Position - h.Position).Magnitude ------ How much damage the gun inflicts if raycastResult.Instance.Name == "Head" or raycastResult.Instance.Parent.Name == "Top" or raycastResult.Instance.Parent.Name == "Headset" or raycastResult.Instance.Parent.Name == "Olho" or raycastResult.Instance.Parent.Name == "Face" or raycastResult.Instance.Parent.Name == "Numero" then local DanoBase = math.random(WeaponData.HeadDamage[1], WeaponData.HeadDamage[2]) local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head") Damage(VitimaHuman,Dano,DanoColete,DanoCapacete) elseif (raycastResult.Instance.Parent:IsA('Accessory') or raycastResult.Instance.Parent:IsA('Hat')) then local DanoBase = math.random(WeaponData.HeadDamage[1], WeaponData.HeadDamage[2]) local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head") Damage(VitimaHuman,Dano,DanoColete,DanoCapacete) elseif raycastResult.Instance.Name == "Torso" or raycastResult.Instance.Parent.Name == "Chest" or raycastResult.Instance.Parent.Name == "Waist" then local DanoBase = math.random(WeaponData.TorsoDamage[1], WeaponData.TorsoDamage[2]) local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body") Damage(VitimaHuman,Dano,DanoColete,DanoCapacete) elseif raycastResult.Instance.Name == "Right Arm" or raycastResult.Instance.Name == "Left Arm" or raycastResult.Instance.Name == "Right Leg" or raycastResult.Instance.Name == "Left Leg" or raycastResult.Instance.Parent.Name == "Back" or raycastResult.Instance.Parent.Name == "Leg1" or raycastResult.Instance.Parent.Name == "Leg2" or raycastResult.Instance.Parent.Name == "Arm1" or raycastResult.Instance.Parent.Name == "Arm2" then local DanoBase = math.random(WeaponData.LimbDamage[1], WeaponData.LimbDamage[2]) local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body") Damage(VitimaHuman,Dano,DanoColete,DanoCapacete) else local DanoBase = math.random(WeaponData.LimbDamage[1], WeaponData.LimbDamage[2]) local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body") Damage(VitimaHuman,Dano,DanoColete,DanoCapacete) end end end ammo=ammo-1 if raycastResult then mag=(h.Position-raycastResult.Position).magnitude end t.Humanoid.WalkSpeed = ShootingWalkspeed elseif FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) and perception < 10 then perception = perception + Settings.Level.Value t.Humanoid.WalkSpeed = SearchingWalkspeed Memory = Settings.Level.Value * 100 CanSee = true elseif perception > 0 then perception = perception - 1/Settings.Level.Value * 2 t.Humanoid.WalkSpeed = SearchingWalkspeed CanSee = false elseif perception <= 0 then perception = 0 t.Humanoid.WalkSpeed = RegularWalkspeed Memory = Memory - .25 end --print(Memory) end task.wait(RPM) -- How fast the enemy shoots if ammo==0 then reload() end end end end end)
---------------------------------MOBILE------------------------------------
if UserInputService.TouchEnabled then local MobileButtons = plr.PlayerGui.MobileButtons:WaitForChild("MobileButtons") MobileButtons.Visible = true local MobileBlockButton = MobileButtons.Block MobileBlockButton.Activated:Connect(function() if not char.Values:FindFirstChild("Stunned") and not debounce then if Status == "nil" then startBlocking() else stopBlocking() end end end) end
-- Management of which options appear on the Roblox User Settings screen
do local PlayerScripts = Players.LocalPlayer:WaitForChild("PlayerScripts") PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default) PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow) PlayerScripts:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic) PlayerScripts:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle) end function CameraModule.new() local self = setmetatable({},CameraModule) -- Current active controller instances self.activeCameraController = nil self.activeOcclusionModule = nil self.activeMouseLockController = nil self.currentComputerCameraMovementMode = nil -- Connections to events self.cameraSubjectChangedConn = nil self.cameraTypeChangedConn = nil -- Adds CharacterAdded and CharacterRemoving event handlers for all current players for _,player in pairs(Players:GetPlayers()) do self:OnPlayerAdded(player) end -- Adds CharacterAdded and CharacterRemoving event handlers for all players who join in the future Players.PlayerAdded:Connect(function(player) self:OnPlayerAdded(player) end) if not UserInputService.TouchEnabled then self.activeMouseLockController = MouseLockController.new() local toggleEvent = self.activeMouseLockController:GetBindableToggleEvent() if toggleEvent then toggleEvent:Connect(function() self:OnMouseLockToggled() end) end end self:ActivateCameraController(self:GetCameraControlChoice()) self:ActivateOcclusionModule(Players.LocalPlayer.DevCameraOcclusionMode) self:OnCurrentCameraChanged() -- Does initializations and makes first camera controller RunService:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(dt) self:Update(dt) end) -- Connect listeners to camera-related properties for _, propertyName in pairs(PLAYER_CAMERA_PROPERTIES) do Players.LocalPlayer:GetPropertyChangedSignal(propertyName):Connect(function() self:OnLocalPlayerCameraPropertyChanged(propertyName) end) end for _, propertyName in pairs(USER_GAME_SETTINGS_PROPERTIES) do UserGameSettings:GetPropertyChangedSignal(propertyName):Connect(function() self:OnUserGameSettingsPropertyChanged(propertyName) end) end game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function() self:OnCurrentCameraChanged() end) return self end function CameraModule:GetCameraMovementModeFromSettings() local cameraMode = Players.LocalPlayer.CameraMode -- Lock First Person trumps all other settings and forces ClassicCamera if cameraMode == Enum.CameraMode.LockFirstPerson then return CameraUtils.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic) end local devMode, userMode if UserInputService.TouchEnabled then devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevTouchCameraMode) userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode) else devMode = CameraUtils.ConvertCameraModeEnumToStandard(Players.LocalPlayer.DevComputerCameraMode) userMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode) end if devMode == Enum.DevComputerCameraMovementMode.UserChoice then -- Developer is allowing user choice, so user setting is respected return userMode end return devMode end function CameraModule:ActivateOcclusionModule(occlusionMode: Enum.DevCameraOcclusionMode) local newModuleCreator if occlusionMode == Enum.DevCameraOcclusionMode.Zoom then newModuleCreator = Poppercam elseif occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then newModuleCreator = Invisicam else warn("CameraScript ActivateOcclusionModule called with unsupported mode") return end self.occlusionMode = occlusionMode -- First check to see if there is actually a change. If the module being requested is already -- the currently-active solution then just make sure it's enabled and exit early if self.activeOcclusionModule and self.activeOcclusionModule:GetOcclusionMode() == occlusionMode then if not self.activeOcclusionModule:GetEnabled() then self.activeOcclusionModule:Enable(true) end return end -- Save a reference to the current active module (may be nil) so that we can disable it if -- we are successful in activating its replacement local prevOcclusionModule = self.activeOcclusionModule -- If there is no active module, see if the one we need has already been instantiated self.activeOcclusionModule = instantiatedOcclusionModules[newModuleCreator] -- If the module was not already instantiated and selected above, instantiate it if not self.activeOcclusionModule then self.activeOcclusionModule = newModuleCreator.new() if self.activeOcclusionModule then instantiatedOcclusionModules[newModuleCreator] = self.activeOcclusionModule end end -- If we were successful in either selecting or instantiating the module, -- enable it if it's not already the currently-active enabled module if self.activeOcclusionModule then local newModuleOcclusionMode = self.activeOcclusionModule:GetOcclusionMode() -- Sanity check that the module we selected or instantiated actually supports the desired occlusionMode if newModuleOcclusionMode ~= occlusionMode then warn("CameraScript ActivateOcclusionModule mismatch: ",self.activeOcclusionModule:GetOcclusionMode(),"~=",occlusionMode) end -- Deactivate current module if there is one if prevOcclusionModule then -- Sanity check that current module is not being replaced by itself (that should have been handled above) if prevOcclusionModule ~= self.activeOcclusionModule then prevOcclusionModule:Enable(false) else warn("CameraScript ActivateOcclusionModule failure to detect already running correct module") end end -- Occlusion modules need to be initialized with information about characters and cameraSubject -- Invisicam needs the LocalPlayer's character -- Poppercam needs all player characters and the camera subject if occlusionMode == Enum.DevCameraOcclusionMode.Invisicam then -- Optimization to only send Invisicam what we know it needs if Players.LocalPlayer.Character then self.activeOcclusionModule:CharacterAdded(Players.LocalPlayer.Character, Players.LocalPlayer ) end else -- When Poppercam is enabled, we send it all existing player characters for its raycast ignore list for _, player in pairs(Players:GetPlayers()) do if player and player.Character then self.activeOcclusionModule:CharacterAdded(player.Character, player) end end self.activeOcclusionModule:OnCameraSubjectChanged((game.Workspace.CurrentCamera :: Camera).CameraSubject) end -- Activate new choice self.activeOcclusionModule:Enable(true) end end function CameraModule:ShouldUseVehicleCamera() local camera = workspace.CurrentCamera if not camera then return false end local cameraType = camera.CameraType local cameraSubject = camera.CameraSubject local isEligibleType = cameraType == Enum.CameraType.Custom or cameraType == Enum.CameraType.Follow local isEligibleSubject = cameraSubject and cameraSubject:IsA("VehicleSeat") or false local isEligibleOcclusionMode = self.occlusionMode ~= Enum.DevCameraOcclusionMode.Invisicam return isEligibleSubject and isEligibleType and isEligibleOcclusionMode end
-- Renderers that don't support test selectors -- can re-export everything from this module.
local function shim(...) invariant( false, "The current renderer does not support test selectors. " .. "This error is likely caused by a bug in React. " .. "Please file an issue." ) end