prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--// Input Connections
L_104_.InputBegan:connect(function(L_308_arg1, L_309_arg2) if not L_309_arg2 and L_15_ then if L_308_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_308_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_76_ and not L_75_ and not L_74_ and L_24_.CanAim and not L_71_ and L_15_ and not L_63_ and not L_64_ then if not L_61_ then if not L_62_ then L_3_.Humanoid.WalkSpeed = 10 L_152_ = 10 L_151_ = 0.008 end if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then L_94_ = L_50_ end L_130_.target = L_53_.CFrame:toObjectSpace(L_44_.CFrame).p L_112_:FireServer(true) L_61_ = true end end; if L_308_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_77_ and not L_78_ then L_77_ = true L_79_ = false L_78_ = true LeanRight() end if L_308_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_77_ and not L_79_ then L_77_ = true L_78_ = false L_79_ = true LeanLeft() end if L_308_arg1.KeyCode == L_24_.AlternateAimKey and not L_76_ and not L_75_ and not L_74_ and L_24_.CanAim and not L_71_ and L_15_ and not L_63_ and not L_64_ then if not L_61_ then if not L_62_ then L_3_.Humanoid.WalkSpeed = 10 L_152_ = 10 L_151_ = 0.008 end L_94_ = L_50_ L_130_.target = L_53_.CFrame:toObjectSpace(L_44_.CFrame).p L_112_:FireServer(true) L_61_ = true end end; if L_308_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_308_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_76_ and not L_74_ and L_66_ and L_15_ and not L_63_ and not L_64_ and not L_71_ then L_65_ = true if not Shooting and L_15_ and not L_80_ then if L_100_ > 0 then Shoot() end elseif not Shooting and L_15_ and L_80_ then if L_102_ > 0 then Shoot() end end end; if L_308_arg1.KeyCode == (L_24_.LaserKey or L_308_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then local L_310_ = L_1_:FindFirstChild("LaserLight") L_119_.KeyDown[1].Plugin() end; if L_308_arg1.KeyCode == (L_24_.LightKey or L_308_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then local L_311_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light') local L_312_ = false L_311_.Enabled = not L_311_.Enabled end; if L_15_ and L_308_arg1.KeyCode == (L_24_.FireSelectKey or L_308_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_76_ and not L_67_ and not L_75_ then L_67_ = true if L_89_ == 1 then if Shooting then Shooting = false end if L_24_.AutoEnabled then L_89_ = 2 L_80_ = false L_66_ = L_81_ elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then L_89_ = 3 L_80_ = false L_66_ = L_81_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then L_89_ = 4 L_80_ = false L_66_ = L_81_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_89_ = 6 L_80_ = true L_81_ = L_66_ L_66_ = L_82_ elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then L_89_ = 1 L_80_ = false L_66_ = L_81_ end elseif L_89_ == 2 then if Shooting then Shooting = false end if L_24_.BurstEnabled then L_89_ = 3 L_80_ = false L_66_ = L_81_ elseif not L_24_.BurstEnabled and L_24_.BoltAction then L_89_ = 4 L_80_ = false L_66_ = L_81_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_89_ = 6 L_80_ = true L_81_ = L_66_ L_66_ = L_82_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_89_ = 1 L_80_ = false L_66_ = L_81_ elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then L_89_ = 2 L_80_ = false L_66_ = L_81_ end elseif L_89_ == 3 then if Shooting then Shooting = false end if L_24_.BoltAction then L_89_ = 4 L_80_ = false L_66_ = L_81_ elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then L_89_ = 6 L_80_ = true L_81_ = L_66_ L_66_ = L_82_ elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_89_ = 1 L_80_ = false L_66_ = L_81_ elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then L_89_ = 2 L_80_ = false L_66_ = L_81_ elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then L_89_ = 3 L_80_ = false L_66_ = L_81_ end elseif L_89_ == 4 then if Shooting then Shooting = false end if L_24_.ExplosiveEnabled then L_89_ = 6 L_80_ = true L_81_ = L_66_ L_66_ = L_82_ elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then L_89_ = 1 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then L_89_ = 2 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then L_89_ = 3 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then L_89_ = 4 L_80_ = false L_66_ = L_81_ end elseif L_89_ == 6 then if Shooting then Shooting = false end L_82_ = L_66_ if L_24_.SemiEnabled then L_89_ = 1 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then L_89_ = 2 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then L_89_ = 3 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then L_89_ = 4 L_80_ = false L_66_ = L_81_ elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then L_89_ = 6 L_80_ = true L_81_ = L_66_ L_66_ = L_82_ end end UpdateAmmo() FireModeAnim() IdleAnim() L_67_ = false end; if L_308_arg1.KeyCode == (Enum.KeyCode.F or L_308_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_76_ and not L_74_ and not L_75_ and not L_64_ and not L_67_ and not L_61_ and not L_63_ and not Shooting and not L_73_ then if not L_70_ and not L_71_ then L_71_ = true Shooting = false L_66_ = false L_132_ = time() delay(0.6, function() if L_100_ ~= L_24_.Ammo and L_100_ > 0 then CreateShell() end end) BoltBackAnim() L_70_ = true elseif L_70_ and L_71_ then BoltForwardAnim() Shooting = false L_66_ = true if L_100_ ~= L_24_.Ammo and L_100_ > 0 then L_100_ = L_100_ - 1 elseif L_100_ >= L_24_.Ammo then L_66_ = true end L_70_ = false L_71_ = false IdleAnim() L_72_ = false end UpdateAmmo() end; if L_308_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_308_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_75_ and not L_74_ and L_143_ then L_68_ = true if L_15_ and not L_67_ and not L_64_ and L_68_ and not L_62_ and not L_71_ then Shooting = false L_61_ = false L_64_ = true delay(0, function() if L_64_ and not L_63_ then L_61_ = false L_69_ = true end end) L_94_ = 80 L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed L_152_ = L_24_.SprintSpeed L_151_ = 0.4 end end; if L_308_arg1.KeyCode == (Enum.KeyCode.R or L_308_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_76_ and not L_75_ and not L_74_ and L_15_ and not L_63_ and not L_61_ and not Shooting and not L_64_ and not L_71_ then if not L_80_ then if L_101_ > 0 and L_100_ < L_24_.Ammo then Shooting = false L_63_ = true for L_313_forvar1, L_314_forvar2 in pairs(game.Players:GetChildren()) do if L_314_forvar2 and L_314_forvar2 ~= L_2_ and L_314_forvar2.TeamColor == L_2_.TeamColor then if (L_314_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude <= 150 then if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then L_116_:FireServer(L_7_.AHH, L_97_[math.random(0, 23)]) end end end end ReloadAnim() if L_100_ <= 0 then if not L_24_.CanSlideLock then BoltBackAnim() BoltForwardAnim() end end IdleAnim() L_66_ = true if L_100_ <= 0 then if (L_101_ - (L_24_.Ammo - L_100_)) < 0 then L_100_ = L_100_ + L_101_ L_101_ = 0 else L_101_ = L_101_ - (L_24_.Ammo - L_100_) L_100_ = L_24_.Ammo end elseif L_100_ > 0 then if (L_101_ - (L_24_.Ammo - L_100_)) < 0 then L_100_ = L_100_ + L_101_ + 1 L_101_ = 0 else L_101_ = L_101_ - (L_24_.Ammo - L_100_) L_100_ = L_24_.Ammo + 1 end end L_63_ = false if not L_72_ then L_66_ = true end end; elseif L_80_ then if L_102_ > 0 then Shooting = false L_63_ = true nadeReload() IdleAnim() L_63_ = false L_66_ = true end end; UpdateAmmo() end; if L_308_arg1.KeyCode == Enum.KeyCode.RightBracket and L_61_ then if (L_51_ < 1) then L_51_ = L_51_ + L_24_.SensitivityIncrement end end if L_308_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_61_ then if (L_51_ > 0.1) then L_51_ = L_51_ - L_24_.SensitivityIncrement end end if L_308_arg1.KeyCode == (Enum.KeyCode.T or L_308_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then if not L_83_ then L_53_ = L_1_:WaitForChild("AimPart2") L_50_ = L_24_.CycleAimZoom if L_61_ then L_94_ = L_24_.CycleAimZoom end L_83_ = true else L_53_ = L_1_:FindFirstChild("AimPart") L_50_ = L_24_.AimZoom if L_61_ then L_94_ = L_24_.AimZoom end L_83_ = false end; end; if L_308_arg1.KeyCode == L_24_.InspectionKey and not L_76_ and not L_75_ then if not L_74_ then L_74_ = true InspectAnim() IdleAnim() L_74_ = false end end; if L_308_arg1.KeyCode == L_24_.AttachmentKey and not L_76_ and not L_74_ then if L_15_ then if not L_75_ then L_64_ = false L_61_ = false L_66_ = false L_75_ = true AttachAnim() elseif L_75_ then L_64_ = false L_61_ = false L_66_ = true L_75_ = false IdleAnim() end end end; if L_308_arg1.KeyCode == Enum.KeyCode.P and not L_74_ and not L_75_ and not L_61_ and not L_64_ and not L_62_ and not L_63_ and not Recoiling and not L_64_ then if not L_76_ then L_76_ = true L_14_:Create(L_45_, TweenInfo.new(0.2), { C1 = L_24_.SprintPos }):Play() wait(0.2) L_109_:FireServer("Patrol", L_24_.SprintPos) else L_76_ = false L_14_:Create(L_45_, TweenInfo.new(0.2), { C1 = CFrame.new() }):Play() wait(0.2) L_109_:FireServer("Unpatrol") end end; end end) L_104_.InputEnded:connect(function(L_315_arg1, L_316_arg2) if not L_316_arg2 and L_15_ then if L_315_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_315_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_74_ and L_24_.CanAim and not L_75_ then if L_61_ then if not L_62_ then L_3_.Humanoid.WalkSpeed = 16 L_152_ = 17 L_151_ = .25 end L_94_ = 70 L_130_.target = Vector3.new() L_112_:FireServer(false) L_61_ = false end end; if L_315_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_77_ then Unlean() L_77_ = false L_79_ = false L_78_ = false end if L_315_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_77_ then Unlean() L_77_ = false L_79_ = false L_78_ = false end if L_315_arg1.KeyCode == L_24_.AlternateAimKey and not L_74_ and L_24_.CanAim then if L_61_ then if not L_62_ then L_3_.Humanoid.WalkSpeed = 16 L_152_ = 17 L_151_ = .25 end L_94_ = 70 L_130_.target = Vector3.new() L_112_:FireServer(false) L_61_ = false end end; if L_315_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_315_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_74_ then L_65_ = false if Shooting then Shooting = false end end; if L_315_arg1.KeyCode == Enum.KeyCode.E and L_15_ then local L_317_ = L_42_:WaitForChild('GameGui') if L_16_ then L_317_:WaitForChild('AmmoFrame').Visible = false L_16_ = false end end; if L_315_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_315_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_74_ and not L_67_ and not L_62_ then -- SPRINT L_68_ = false if L_64_ and not L_61_ and not Shooting and not L_68_ then L_64_ = false L_69_ = false L_94_ = 70 L_3_.Humanoid.WalkSpeed = 16 L_152_ = 17 L_151_ = .25 end end; end end) L_104_.InputChanged:connect(function(L_318_arg1, L_319_arg2) if not L_319_arg2 and L_15_ and L_24_.FirstPersonOnly and L_61_ then if L_318_arg1.UserInputType == Enum.UserInputType.MouseWheel then if L_318_arg1.Position.Z == 1 and (L_51_ < 1) then L_51_ = L_51_ + L_24_.SensitivityIncrement elseif L_318_arg1.Position.Z == -1 and (L_51_ > 0.1) then L_51_ = L_51_ - L_24_.SensitivityIncrement end end end end) L_104_.InputChanged:connect(function(L_320_arg1, L_321_arg2) if not L_321_arg2 and L_15_ then local L_322_, L_323_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_53_.CFrame.p, (L_53_.CFrame.lookVector).unit * 10000), IgnoreList); if L_322_ then local L_324_ = (L_323_ - L_6_.Position).magnitude L_33_.Text = math.ceil(L_324_) .. ' m' end end end)
-- register what control scripts we are using
do local PlayerScripts = LocalPlayer:WaitForChild("PlayerScripts") local canRegisterControls = pcall(function() PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.Default) end) if canRegisterControls then PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.Thumbstick) PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.DPad) PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.Thumbpad) PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.ClickToMove) PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.DynamicThumbstick) PlayerScripts:RegisterComputerMovementMode(Enum.ComputerMovementMode.Default) PlayerScripts:RegisterComputerMovementMode(Enum.ComputerMovementMode.KeyboardMouse) PlayerScripts:RegisterComputerMovementMode(Enum.ComputerMovementMode.ClickToMove) end end local DynamicThumbstickAvailable = pcall(function() return Enum.DevTouchMovementMode.DynamicThumbstick and Enum.TouchMovementMode.DynamicThumbstick end) local FFlagUserNoCameraClickToMoveSuccess, FFlagUserNoCameraClickToMoveResult = pcall(function() return UserSettings():IsUserFeatureEnabled("UserNoCameraClickToMove") end) local FFlagUserNoCameraClickToMove = FFlagUserNoCameraClickToMoveSuccess and FFlagUserNoCameraClickToMoveResult
--Settings localized
local Fade = Random_:NextNumber(1,1.5) local fadeInfo = TweenInfo.new(Fade, Enum.EasingStyle.Sine, Enum.EasingDirection.In) local strechInfo = TweenInfo.new(Fade / 1.05, Enum.EasingStyle.Quint, Enum.EasingDirection.In) local fadeGoal = {Transparency = 1}
-------------------------
function onClicked() R.Function1.Disabled = true FX.HPF.BrickColor = BrickColor.new("Really red") FX.HPF.loop.Disabled = true FX.JET.BrickColor = BrickColor.new("Really red") FX.JET.loop.Disabled = true FX.LPF.BrickColor = BrickColor.new("Really red") FX.LPF.loop.Disabled = true FX.NOISE.BrickColor = BrickColor.new("Really red") FX.NOISE.loop.Disabled = true FX.ZIP.BrickColor = BrickColor.new("Really red") FX.ZIP.loop.Disabled = true R.loop.Disabled = false R.Function2.Disabled = false end script.Parent.ClickDetector.MouseClick:connect(onClicked)
-------- OMG HAX
r = game:service("RunService") local damage = 100 local slash_damage = 100 local lunge_damage = 100 sword = script.Parent.Handle Tool = script.Parent local SlashSound = sword.SoundSlash local UnsheathSound = sword.SoundUnsheath function getHumanoid(obj) local get = obj:getChildren() for i=1, #get do if get[i].className == "Humanoid" then return get[i] end end return nil end function blow(hit) if (hit.Parent == nil) then return end -- happens when bullet hits sword local humanoid = getHumanoid(hit.Parent) local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character if humanoid~=nil and humanoid ~= hum and hum ~= nil then -- final check, make sure sword is in-hand local right_arm = vCharacter:FindFirstChild("Right Arm") if (right_arm ~= nil) then local joint = right_arm:FindFirstChild("RightGrip") if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(damage) wait(1) untagHumanoid(humanoid) end end end end function tagHumanoid(humanoid, player) local creator_tag = Instance.new("ObjectValue") creator_tag.Value = player creator_tag.Name = "creator" creator_tag.Parent = humanoid end function untagHumanoid(humanoid) if humanoid ~= nil then local tag = humanoid:findFirstChild("creator") if tag ~= nil then tag.Parent = nil end end end function attack() damage = slash_damage SlashSound:play() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = Tool end function fire(pos) local bullet =script.Parent.Handle:clone() bullet.CFrame = CFrame.new(Tool.Parent.Head.Position + (pos - Tool.Parent.Head.Position).unit * 6, pos) bullet.CanCollide = true bullet.Name = "Projectile" local velo = Instance.new("BodyVelocity") velo.velocity = (pos - Tool.Parent.Head.Position).unit * 100 velo.Parent = bullet local spin = Instance.new("BodyAngularVelocity") spin.angularvelocity = bullet.CFrame:vectorToWorldSpace(Vector3.new(0,15,0)) spin.Parent = bullet local newscript = script.Parent.ProjectileScript:clone() newscript.Disabled = false newscript.Parent = bullet local player = game.Players:findFirstChild(Tool.Parent.Name) if player == nil then return end tagHumanoid(bullet, player) bullet.Parent = workspace end function swordAcross() -- parry end Tool.Enabled = true local last_attack = 0 function onActivated(mouse) if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end t = r.Stepped:wait() attack() fire(humanoid.TargetPoint) --wait(.5) Tool.Enabled = true end function onEquipped(mouse) UnsheathSound:play() end script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) connection = sword.Touched:connect(blow)
---------------------------------------------------------------
function onChildAdded(child) if child.Name == "SeatWeld" then local human = child.part1.Parent:findFirstChild("Humanoid") if (human ~= nil) then print("Human IN") seat.SirenControl.CarName.Value = human.Parent.Name.."'s Car" seat.Parent.Name = human.Parent.Name.."'s Car" s.Parent.SirenControl:clone().Parent = game.Players:findFirstChild(human.Parent.Name).PlayerGui seat.Start:Play() seat.Engine:Play() wait(3.07) seat.Start:Stop() end end end function onChildRemoved(child) if (child.Name == "SeatWeld") then local human = child.part1.Parent:findFirstChild("Humanoid") if (human ~= nil) then print("Human OUT") seat.Parent.Name = "PoliceCharger" seat.SirenControl.CarName.Value = "PoliceCharger" game.Players:findFirstChild(human.Parent.Name).PlayerGui.SirenControl:remove() seat.Engine:Stop() end end end script.Parent.ChildAdded:connect(onChildAdded) script.Parent.ChildRemoved:connect(onChildRemoved)
-- This script is made by y3th on youtube. The link to his video and channel are: -- Channel: https://www.youtube.com/channel/UC3EjHc4SHjfeGhN1lFOkJyA -- Video Link: https://www.youtube.com/watch?v=iVJHiv5nuXk
--//ENGINE//--
Horsepower = 140 --{This is how much power your engine block makes ALONE, this does not represent to total horsepower output [IF you have a turbo/SC]} EngineDisplacement = 3200 --{Engine size in CC's} EngineType = "Diesel" --{Petrol, Diesel, Electric] EngineLocation = "Front" --{Front, Mid, Rear} ForcedInduction = "Natural" --{Natural, Single, Twin, Supercharger} InductionPartSize = 0 --{0-5, 1 being small, 5 being large (Decimals accepted, e.g 2.64 turbo size, this is the size of the turbo} ElectronicallyLimited = false --{Electronically Limit the top speed of your vehicle} LimitSpeedValue = 200 --{Limits top speed of the vehicle [In MPH]}
-- You may turn both of these on at once. In that case, zone-specific music will play in the appropriate zones, and global background music will play whenever you're not within any zone.
settings.DisplayMuteButton = false -- If set to true, there will be a button in the bottom-right corner of the screen allowing players to mute the background music. settings.MusicFadeoutTime = 3 -- How long music takes to fade out, in seconds. settings.MusicOnlyPlaysWithinZones = false -- (This setting only applies when UseGlobalBackgroundMusic is set to false) If a player walks into an area that's not covered by any music zone, what should happen? If true, music will stop playing. If false, the music from the previous zone will continue to play. return settings
--[[Shutdown]]
car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") then _PBrake = not _PBrake wait(.2) script.Parent:Destroy() end end)
--[=[ @param predicate (player: Player, argsFromFire: ...) -> boolean @param ... any -- Arguments to pass to the clients (and to the predicate) Fires the signal at any clients that pass the `predicate` function test. This can be used to fire signals with much more control logic. :::note Outbound Middleware All arguments pass through any outbound middleware before being sent to the clients. ::: :::caution Predicate Before Middleware The arguments sent to the predicate are sent _before_ getting transformed by any middleware. ::: ```lua -- Fire signal to players of the same team: remoteSignal:FireFilter(function(player) return player.Team.Name == "Best Team" end) ``` ]=]
function RemoteSignal:FireFilter(predicate: (Player, ...any) -> boolean, ...: any) for _,player in ipairs(Players:GetPlayers()) do if predicate(player, ...) then self._re:FireClient(player, self:_processOutboundMiddleware(nil, ...)) end end end
--[[ Returns the last cached value calculated by this Computed object. The computed object will be registered as a dependency unless `asDependency` is false. ]]
function class:get(asDependency: boolean?) if asDependency ~= false then useDependency(self) end return self._value end
-- Left Legs
character.RagdollRig.ConstraintLeftUpperLeg.Attachment0 = LUL character.RagdollRig.ConstraintLeftUpperLeg.Attachment1 = LULRig character.RagdollRig.ConstraintLeftLowerLeg.Attachment0 = LLL character.RagdollRig.ConstraintLeftLowerLeg.Attachment1 = LLLRig character.RagdollRig.ConstraintLeftFoot.Attachment0 = LF character.RagdollRig.ConstraintLeftFoot.Attachment1 = LFRig
-- Calculate label length
local LABEL_TEXT = 'ALT' local LABEL_LENGTH = TextService:GetTextSize(LABEL_TEXT, 21/2, Enum.Font.SourceSansSemibold, Vector2.new(math.huge, math.huge)).X local function ScopeInTooltip(props) return new('ImageLabel', { BackgroundTransparency = 1; ImageTransparency = 1 - 0.14; Image = 'rbxassetid://4445959523'; ScaleType = Enum.ScaleType.Slice; SliceCenter = Rect.new(4, 4, 12, 12); ImageColor3 = Color3.fromRGB(0, 0, 0); Size = UDim2.new(0, LABEL_LENGTH + 8/2, 0, 30/2); LayoutOrder = props.LayoutOrder or 3; }, { Label = new('TextLabel', { BackgroundTransparency = 1; Size = UDim2.new(0, LABEL_LENGTH, 1, 0); Position = UDim2.new(0, 5/2, 0.5, 0); AnchorPoint = Vector2.new(0, 0.5); Font = Enum.Font.SourceSansSemibold; TextSize = 21/2; Text = LABEL_TEXT; TextTransparency = 0.5; TextYAlignment = Enum.TextYAlignment.Center; TextColor3 = Color3.fromRGB(255, 255, 255); LayoutOrder = 1; }); }) end return ScopeInTooltip
-- ROBLOX deviation: imported chalk instead of ansi-styles
local chalk = require(Packages.ChalkLua)
---------------------------------------------------------------------------------------- -- Adonis Loader -- ---------------------------------------------------------------------------------------- -- Epix Incorporated. Not Everything is so Black and White. -- ---------------------------------------------------------------------------------------- -- Edit settings in-game or using the settings module in the Config folder -- ---------------------------------------------------------------------------------------- -- This is not designed to work in solo mode -- ----------------------------------------------------------------------------------------
local warn = function(...) warn(":: Adonis ::", ...) end warn("Loading...") local ServerScriptService = game:GetService("ServerScriptService") local RunService = game:GetService("RunService") local mutex = RunService:FindFirstChild("__Adonis_MUTEX") if mutex then if mutex:IsA("StringValue") then warn("Adonis is already running! Aborting...; Running Location:", mutex.Value, "This Location:", script:GetFullName()) else warn("Adonis mutex detected but is not a StringValue! Aborting anyway...; This Location:", script:GetFullName()) end else mutex = Instance.new("StringValue") mutex.Name = "__Adonis_MUTEX" mutex.Value = script:GetFullName() mutex.Parent = RunService local model = script.Parent.Parent local config = model.Config local core = model.Loader local dropper = core.Dropper local loader = core.Loader local runner = script local settings = config.Settings local plugins = config.Plugins local themes = config.Themes local backup = model:Clone() local data = { Settings = {}; Descriptions = {}; Messages = {}; ServerPlugins = {}; ClientPlugins = {}; Packages = {}; Themes = {}; ModelParent = model.Parent; Model = model; Config = config; Core = core; Loader = loader; Dopper = dropper; Runner = runner; ModuleID = 7510592873; --// https://www.roblox.com/library/7510592873/Adonis-MainModule LoaderID = 7510622625; --// https://www.roblox.com/library/7510622625/Adonis-Loader-Sceleratis-Davey-Bones-Epix DebugMode = false; } --// Init -- selene: allow(incorrect_standard_library_use) script.Parent = nil --script:Destroy() model.Name = math.random() local moduleId = data.ModuleID if data.DebugMode then moduleId = model.Parent.MainModule end local success, setTab = pcall(require, settings) if success then data.Messages = setTab.Settings.Messages else warn("[DEVELOPER ERROR] Settings module errored while loading; Using defaults; Error Message: ", setTab) table.insert(data.Messages, { Title = "Warning!"; Message = "Settings module error detected. Using default settings."; Time = 15; }) setTab = {} end data.Settings = setTab.Settings data.Descriptions = setTab.Description data.Order = setTab.Order for _, plugin in ipairs(plugins:GetChildren()) do if plugin:IsA("Folder") then table.insert(data.Packages, plugin) elseif plugin.Name:lower():match("^client[%-:]") then table.insert(data.ClientPlugins, plugin) elseif plugin.Name:lower():match("^server[%-:]") then table.insert(data.ServerPlugins, plugin) else warn("[DEVELOPER ERROR] Unknown Plugin Type for "..tostring(plugin).."; Plugin name should either start with 'Server:', 'Server-', 'Client:', or 'Client-'") end end for _, theme in ipairs(themes:GetChildren()) do table.insert(data.Themes, theme) end if tonumber(moduleId) then warn("Requiring Adonis MainModule. Model URL: https://www.roblox.com/library/".. moduleId) end local module = require(moduleId) local response = module(data) if response == "SUCCESS" then if (data.Settings and data.Settings.HideScript) and not data.DebugMode and not RunService:IsStudio() then model.Parent = nil game:BindToClose(function() model.Parent = ServerScriptService model.Name = "Adonis_Loader" end) end model.Name = "Adonis_Loader" else error(" !! Adonis MainModule failed to load !! ") end end --[[ --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- ___________ .__ .___ \_ _____/_____ |__|__ ___ | | ____ ____ | __)_\____ \| \ \/ / | |/ \_/ ___\ | \ |_> > |> < | | | \ \___ /_______ / __/|__/__/\_ \ |___|___| /\___ > /\ \/|__| \/ \/ \/ \/ -------------------------------------------------------- Epix Incorporated. Not Everything is so Black and White. -------------------------------------------------------- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --___________________________________________________________________________________________-- --]]
----------------------
function module.Create(radius,Position, rockSize , FlyingDebrisSize, DespawnTime, FlyingRockDespawnTime , AmountFlyingDebris) local newrocksize = math.random(rockSize[1],rockSize[2]) local ModelCircle = Instance.new("Model",workspace.FX) ModelCircle.Name = "Debris" Debris:AddItem(ModelCircle,10) local Y = Position.Y local Material local Transparency local Color local IgnoreList = {} for _,object in pairs(workspace:GetDescendants()) do if object.Name == "Debree" or object:FindFirstChildWhichIsA("Humanoid") then table.insert(IgnoreList,object) end end local RPParams = RaycastParams.new() RPParams.FilterDescendantsInstances = IgnoreList RPParams.FilterType = Enum.RaycastFilterType.Blacklist local ray = workspace:Raycast(Position + Vector3.new(0,0.1,0),Vector3.new(0,-999,0),RPParams) if ray then Y = ray.Position.Y Material = ray.Material Transparency = ray.Instance.Transparency Color = ray.Instance.Color end local parts = {} for i = 0,radius * 8,newrocksize do local Rock = PartCacheModule.new(script.Parent.Parent.Effects.RockModuleRock,1) local DropletClone = PartCacheModule.GetPart(Rock) DropletClone.Parent = ModelCircle table.insert(parts,DropletClone) Rock:ReturnPart(DropletClone) end local function getXAndZPositions(angle) local x = math.cos(angle) * radius local z = math.sin(angle) * radius return x, z end for i, part in pairs(parts) do part.Anchored = true part.Name = "Debree" part.Size = Vector3.new(0,0,0) local angle = (i*newrocksize) * (360 / #parts) local x,z = getXAndZPositions(angle) table.insert(IgnoreList,part) RPParams.FilterDescendantsInstances = IgnoreList part.CFrame = CFrame.new(Position) * CFrame.new(x, 0, z) part.Position = Vector3.new(part.Position.X,Y,part.Position.Z) part.CFrame *= CFrame.Angles(math.rad(math.random(-90,90)),math.rad(math.random(-90,90)),math.rad(math.random(-90,90))) if AccurateRepresentation == true then local raynew = workspace:Raycast(part.Position + Vector3.new(0,0.1,0),Vector3.new(0,-999,0),RPParams) if raynew then part.Material = raynew.Material part.Transparency = raynew.Instance.Transparency part.Color = raynew.Instance.Color else --part.Material = Material --part.Transparency = Transparency --part.Color = Color end else part.Material = Materials[math.random(1,#Materials)] part.Color = Colors[math.random(1,#Colors)] end local newrocksize2 = math.random(rockSize[1],rockSize[2]) part.Parent = workspace TS:Create(part,TweenInfo.new(0.2),{Size = Vector3.new(newrocksize2,newrocksize2,newrocksize2)}):Play() local DespawnTime1 = math.random(DespawnTime[1],DespawnTime[2]) local RockDespawnTimeTween = math.random(.5,1.3) task.spawn(function() task.wait(DespawnTime1) local HighlightTweenInfo = {RockDespawnTimeTween, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false} local TweenGoal1 = {Size = Vector3.new(0,0,0)} local RockSizeTween = Tween.Tween(part, HighlightTweenInfo, TweenGoal1) Debris:AddItem(part,4.1) end) end for i = 0,AmountFlyingDebris do local DebrisVelocity = Vector3.new(math.random(-40,40),math.floor(55,105),math.random(-40,40)) local newFlyingrocksize = math.random(FlyingDebrisSize[1],FlyingDebrisSize[2]) local part = Instance.new("Part",ModelCircle) part.CanCollide = false part.Size = Vector3.new(0,0,0) part.Massless = true part.Name = "Debree" TS:Create(part,TweenInfo.new(0.2),{Size = Vector3.new(newFlyingrocksize,newFlyingrocksize,newFlyingrocksize)}):Play() if AccurateRepresentation == true then part.Material = Material part.Transparency = Transparency part.Color = Color else part.Material = Materials[math.random(1,#Materials)] part.Color = Colors[math.random(1,#Colors)] end part.Position = Position + Vector3.new(0,newFlyingrocksize,0) part.Velocity = DebrisVelocity part.AssemblyAngularVelocity = Vector3.new(math.random(-90,90),math.random(-90,90),math.random(-90,90)) task.spawn(function() task.wait(0.5) part.CanCollide = FlyingDebrisCollision end) local FlyingRockDespawnTime1 = math.random(FlyingRockDespawnTime[1],FlyingRockDespawnTime[2]) local FlyingRockDespawnTimeTween = math.random(1,2) task.spawn(function() task.wait(FlyingRockDespawnTime1) local HighlightTweenInfo = {FlyingRockDespawnTimeTween, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, 0, false} local TweenGoal1 = {Size = Vector3.new(0,0,0)} local RockSizeTween = Tween.Tween(part, HighlightTweenInfo, TweenGoal1) Debris:AddItem(part, 5.1) coroutine.wrap(spinPart)(part) end) end return end return module
--[[ Compress.OnServerEvent:Connect(function(player) local Human = player.Character.Humanoid local enabled = Human.Parent.Saude.Variaveis.Doer local Sangrando = Human.Parent.Saude.Stances.Sangrando local MLs = Human.Parent.Saude.Variaveis.MLs local Caido = Human.Parent.Saude.Stances.Caido local isdead = Human.Parent.Saude.Stances.rodeath local cpr = Human.Parent.Saude.Stances.cpr local Bandagens = Human.Parent.Saude.Kit.Bandagem if enabled.Value == false and isdead.Value == true then enabled.Value = true cpr.Value = true Human.Health = Human.Health + 25 wait(0.5) enabled.Value = false end end) ]]
--
--[[ Camera Maths Utilities Library ]]
-- local Util = require(script.Parent:WaitForChild("CameraUtils")) local PlayersService = game:GetService("Players") local POP_RESTORE_RATE = 0.3 local MIN_CAMERA_ZOOM = 0.5 local VALID_SUBJECTS = { 'Humanoid', 'VehicleSeat', 'SkateboardPlatform', } local portraitPopperFixFlagExists, portraitPopperFixFlagEnabled = pcall(function() return UserSettings():IsUserFeatureEnabled("UserPortraitPopperFix") end) local FFlagUserPortraitPopperFix = portraitPopperFixFlagExists and portraitPopperFixFlagEnabled
--Funcion Del AutoClick
local plr = script.Parent.Parent.Parent.Parent local lea = plr:WaitForChild("Otherstats")-- Nombre De La Carpeta De Su Sistema De Dinero local leae = plr:WaitForChild("leaderstats")-- Nombre De La Carpeta De Su Sistema De Dinero local sas = plr:WaitForChild("PlayerStats")-- Nombre De La Carpeta De Su Sistema De Dinero local autoclick = false local autoclickDD = false function GetAuto() lea.Grow.Value = lea.Grow.Value +1*sas.GrowBoost.Value +1*sas.GrowsGamepass.Value leae.TotalGrows.Value = leae.TotalGrows.Value +1*sas.GrowBoost.Value +1*sas.GrowsGamepass.Value game.Workspace.Tree.Size = game.Workspace.Tree.Size + Vector3.new(1,1,1) game.Workspace.Base.Size = game.Workspace.Base.Size + Vector3.new(1,0,1) game.Workspace.Pop:Play() end script.Parent.AutoClick.MouseButton1Click:Connect(function() if autoclick == false then autoclick = true script.Parent.AutoClick.TextLabel.Text = "ON" else autoclick = false script.Parent.AutoClick.TextLabel.Text = "OFF" end end) while wait()do if autoclick == true then if autoclickDD == false then autoclickDD = true GetAuto(1)-- Cambia El Tiempo De Espera Al Recargar wait(1.5)-- Tambien Cambia Para El Tiempo De Espera Al Recargar autoclickDD = false end end end
--[[ @param BasePart TargetPart The part for which we want to create a path to. @return Boolean IsValidPath Returns true if a valid path exists. Returns false otherwise. @return Path Path Returns a Path object if it is a valid path. Returns nil otherwise. --]]
function Pathfinder:CreatePath(TargetPosition) if not TargetPosition then return false end local Path = PathfindingService:FindPathAsync(self.RootPart.Position, TargetPosition) if Path.Status == Enum.PathStatus.Success then if DEBUG then self:DrawPath(Path) end return true, Path end return false end function Pathfinder:SetCurrentPath(Path) self.CurrentPath = Path end
--[[ Fired when PreGameReady is entered, throwing out a player state update, as well as transitioning the player state ]]
function Transitions.onEnterPreGameReady(stateMachine, event, from, to, playerComponent) Logger.trace(playerComponent.player.Name, " state change: ", from, " -> ", to) playerComponent:updateStatus("currentState", to) end
----TUNING OPTIONS--YOU REALLY DON'T NEED TO PLAY HERE BUT ITS OKAY--
local Reducer = 0.5 ---- How much Lag you gain from a single turbo lag local Missfireboost = 0.6 ----- How much lag when it misfires local DefaultTurboLag = _Tune.BoostLag ---- you already wrote that in the main tune local Missfireboostwait = 10 ----- how long you wait before each misfireboost
-- Credit to Davidii for creating the orginal module which I slightly modified for my purposes
local RoomPackager = {}
--BotHit0
Door.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Bot") then if Ready == true then if Open == false then Ready = false Unlock:Play() hit.Parent.HumanoidRootPart.Anchored = true wait(1) hit.Parent.HumanoidRootPart.Anchored = false Open = true OpenSound:Play() OpenTween:Play() OpenTween1:Play() wait(.5) Ready = true end end end end)
-- Listener for changes to workspace.CurrentCamera
function BaseCamera:OnCurrentCameraChanged() if UserInputService.TouchEnabled then if self.viewportSizeChangedConn then self.viewportSizeChangedConn:Disconnect() self.viewportSizeChangedConn = nil end local newCamera = game.Workspace.CurrentCamera if newCamera then self:OnViewportSizeChanged() self.viewportSizeChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function() self:OnViewportSizeChanged() end) end end -- VR support additions if self.cameraSubjectChangedConn then self.cameraSubjectChangedConn:Disconnect() self.cameraSubjectChangedConn = nil end local camera = game.Workspace.CurrentCamera if camera then self.cameraSubjectChangedConn = camera:GetPropertyChangedSignal("CameraSubject"):Connect(function() self:OnNewCameraSubject() end) self:OnNewCameraSubject() end end function BaseCamera:OnDynamicThumbstickEnabled() if UserInputService.TouchEnabled then self.isDynamicThumbstickEnabled = true end end function BaseCamera:OnDynamicThumbstickDisabled() self.isDynamicThumbstickEnabled = false end function BaseCamera:OnGameSettingsTouchMovementModeChanged() if player.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice then if (UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.DynamicThumbstick or UserGameSettings.TouchMovementMode == Enum.TouchMovementMode.Default) then self:OnDynamicThumbstickEnabled() else self:OnDynamicThumbstickDisabled() end end end function BaseCamera:OnDevTouchMovementModeChanged() if player.DevTouchMovementMode.Name == "DynamicThumbstick" then self:OnDynamicThumbstickEnabled() else self:OnGameSettingsTouchMovementModeChanged() end end function BaseCamera:OnPlayerCameraPropertyChange() -- This call forces re-evaluation of player.CameraMode and clamping to min/max distance which may have changed self:SetCameraToSubjectDistance(self.currentSubjectDistance) end function BaseCamera:GetCameraHeight() if VRService.VREnabled and not self.inFirstPerson then return math.sin(VR_ANGLE) * self.currentSubjectDistance end return 0 end function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity) if not FFlagUserDontAdjustSensitvityForPortrait then local camera = game.Workspace.CurrentCamera if camera and camera.ViewportSize.X > 0 and camera.ViewportSize.Y > 0 and (camera.ViewportSize.Y > camera.ViewportSize.X) then -- Screen has portrait orientation, swap X and Y sensitivity return translationVector * Vector2.new( sensitivity.Y, sensitivity.X) end end return translationVector * sensitivity end function BaseCamera:Enable(enable) if self.enabled ~= enable then self.enabled = enable if self.enabled then self:ConnectInputEvents() self:BindContextActions() if player.CameraMode == Enum.CameraMode.LockFirstPerson then self.currentSubjectDistance = 0.5 if not self.inFirstPerson then self:EnterFirstPerson() end end else self:DisconnectInputEvents() self:UnbindContextActions() -- Clean up additional event listeners and reset a bunch of properties self:Cleanup() end end end function BaseCamera:GetEnabled() return self.enabled end function BaseCamera:OnInputBegan(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchBegan(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton2 then self:OnMouse2Down(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton3 then self:OnMouse3Down(input, processed) end end function BaseCamera:OnInputChanged(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchChanged(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseMovement then self:OnMouseMoved(input, processed) end end function BaseCamera:OnInputEnded(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchEnded(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton2 then self:OnMouse2Up(input, processed) elseif input.UserInputType == Enum.UserInputType.MouseButton3 then self:OnMouse3Up(input, processed) end end function BaseCamera:OnPointerAction(wheel, pan, pinch, processed) if processed then return end if pan.Magnitude > 0 then local inversionVector = Vector2.new(1, UserGameSettings:GetCameraYInvertValue()) local rotateDelta = self:InputTranslationToCameraAngleChange(PAN_SENSITIVITY*pan, MOUSE_SENSITIVITY)*inversionVector self.rotateInput = self.rotateInput + rotateDelta end local zoom = self.currentSubjectDistance local zoomDelta = -(wheel + pinch) if abs(zoomDelta) > 0 then local newZoom if self.inFirstPerson and zoomDelta > 0 then newZoom = FIRST_PERSON_DISTANCE_THRESHOLD else if FFlagUserFixZoomInZoomOutDiscrepancy then if (zoomDelta > 0) then newZoom = zoom + zoomDelta*(1 + zoom*ZOOM_SENSITIVITY_CURVATURE) else newZoom = (zoom + zoomDelta) / (1 - zoomDelta*ZOOM_SENSITIVITY_CURVATURE) end else newZoom = zoom + zoomDelta*(1 + zoom*ZOOM_SENSITIVITY_CURVATURE) end end self:SetCameraToSubjectDistance(newZoom) end end function BaseCamera:ConnectInputEvents() self.pointerActionConn = UserInputService.PointerAction:Connect(function(wheel, pan, pinch, processed) self:OnPointerAction(wheel, pan, pinch, processed) end) self.inputBeganConn = UserInputService.InputBegan:Connect(function(input, processed) self:OnInputBegan(input, processed) end) self.inputChangedConn = UserInputService.InputChanged:Connect(function(input, processed) self:OnInputChanged(input, processed) end) self.inputEndedConn = UserInputService.InputEnded:Connect(function(input, processed) self:OnInputEnded(input, processed) end) self.menuOpenedConn = GuiService.MenuOpened:connect(function() self:ResetInputStates() end) self.gamepadConnectedConn = UserInputService.GamepadDisconnected:connect(function(gamepadEnum) if self.activeGamepad ~= gamepadEnum then return end self.activeGamepad = nil self:AssignActivateGamepad() end) self.gamepadDisconnectedConn = UserInputService.GamepadConnected:connect(function(gamepadEnum) if self.activeGamepad == nil then self:AssignActivateGamepad() end end) self:AssignActivateGamepad() if not FFlagUserCameraToggle then self:UpdateMouseBehavior() end end function BaseCamera:BindContextActions() self:BindGamepadInputActions() self:BindKeyboardInputActions() end function BaseCamera:AssignActivateGamepad() local connectedGamepads = UserInputService:GetConnectedGamepads() if #connectedGamepads > 0 then for i = 1, #connectedGamepads do if self.activeGamepad == nil then self.activeGamepad = connectedGamepads[i] elseif connectedGamepads[i].Value < self.activeGamepad.Value then self.activeGamepad = connectedGamepads[i] end end end if self.activeGamepad == nil then -- nothing is connected, at least set up for gamepad1 self.activeGamepad = Enum.UserInputType.Gamepad1 end end function BaseCamera:DisconnectInputEvents() if self.inputBeganConn then self.inputBeganConn:Disconnect() self.inputBeganConn = nil end if self.inputChangedConn then self.inputChangedConn:Disconnect() self.inputChangedConn = nil end if self.inputEndedConn then self.inputEndedConn:Disconnect() self.inputEndedConn = nil end end function BaseCamera:UnbindContextActions() for i = 1, #self.boundContextActions do ContextActionService:UnbindAction(self.boundContextActions[i]) end self.boundContextActions = {} end function BaseCamera:Cleanup() if self.pointerActionConn then self.pointerActionConn:Disconnect() self.pointerActionConn = nil end if self.menuOpenedConn then self.menuOpenedConn:Disconnect() self.menuOpenedConn = nil end if self.mouseLockToggleConn then self.mouseLockToggleConn:Disconnect() self.mouseLockToggleConn = nil end if self.gamepadConnectedConn then self.gamepadConnectedConn:Disconnect() self.gamepadConnectedConn = nil end if self.gamepadDisconnectedConn then self.gamepadDisconnectedConn:Disconnect() self.gamepadDisconnectedConn = nil end if self.subjectStateChangedConn then self.subjectStateChangedConn:Disconnect() self.subjectStateChangedConn = nil end if self.viewportSizeChangedConn then self.viewportSizeChangedConn:Disconnect() self.viewportSizeChangedConn = nil end if self.touchActivateConn then self.touchActivateConn:Disconnect() self.touchActivateConn = nil end self.turningLeft = false self.turningRight = false self.lastCameraTransform = nil self.lastSubjectCFrame = nil self.userPanningTheCamera = false self.rotateInput = Vector2.new() self.gamepadPanningCamera = Vector2.new(0,0) -- Reset input states self.startPos = nil self.lastPos = nil self.panBeginLook = nil self.isRightMouseDown = false self.isMiddleMouseDown = false self.fingerTouches = {} self.dynamicTouchInput = nil self.numUnsunkTouches = 0 self.startingDiff = nil self.pinchBeginZoom = nil -- Unlock mouse for example if right mouse button was being held down if UserInputService.MouseBehavior ~= Enum.MouseBehavior.LockCenter then UserInputService.MouseBehavior = Enum.MouseBehavior.Default end end
-- if ZombieTarget.Torso.Position.Y > model.Torso.Position.Y + 2 then -- model.Humanoid.Jump = true -- end
end end end PursueState.Init = function() end -- AttackState: Keep moving towards target and play attack animation. local AttackState = StateMachine.NewState() AttackState.Name = "Attack" local lastAttack = os.time() local attackTrack = model.Humanoid:LoadAnimation(model.Animations.Attack) AttackState.Action = function() model.Humanoid:MoveTo(ZombieTarget.Torso.Position) local now = os.time() if now - lastAttack > 3 then lastAttack = now attackTrack:Play() end end -- HuntState: Can't see target but NPC will move to target's last known location. -- Will eventually get bored and switch state. local HuntState = StateMachine.NewState() HuntState.Name = "Hunt" HuntState.Action = function() if ZombieTargetLastLocation then PathLib:MoveToTarget(model, ZombieTargetLastLocation) end end HuntState.Init = function() lastBored = os.time() + configs["BoredomDuration"] / 2 end -- CONDITION DEFINITIONS -- CanSeeTarget: Determines if a target is visible. Returns true if target is visible and -- sets current target. A target is valid if it is nearby, visible, has a Torso and WalkSpeed -- greater than 0 (this is to ignore inanimate objects that happen to use humanoids) local CanSeeTarget = StateMachine.NewCondition() CanSeeTarget.Name = "CanSeeTarget" CanSeeTarget.Evaluate = function() if model then -- Get list of all nearby Zombies and non-Zombie humanoids -- Zombie list is used to ignore zombies during later raycast local humanoids = HumanoidList:GetCurrent() local zombies = {} local characters = {} for _, object in pairs(humanoids) do if object and object.Parent and object.Parent:FindFirstChild("Torso") and object.Health > 0 and object.WalkSpeed > 0 then local torso = object.Parent:FindFirstChild("Torso") if torso then local distance = (model.Torso.Position - torso.Position).magnitude if distance <= configs["AggroRange"] then if object.Parent.Name == "Drooling Zombie" then table.insert(zombies, object.Parent) else table.insert(characters, object.Parent) end end end end end local target = AIUtilities:GetClosestVisibleTarget(model, characters, zombies, configs["FieldOfView"]) if target then ZombieTarget = target return true end
-- A-Z
for Index = 65, 90 do table.insert(Alphabet, Index) end
--[[ local require = function(mod, ...) if mod and tonumber(mod) then warn("Requiring Module by ID; Expand for module URL > ", {URL = "https://www.roblox.com/library/".. moduleId}) end return require(mod, ...) end --]]
local function CloneTable(tab, recursive) local clone = table.clone(tab) if recursive then for i,v in pairs(clone) do if type(v) == "table" then clone[i] = CloneTable(v, recursive) end end end return clone end local function Pcall(func, ...) local pSuccess, pError = pcall(func, ...) if not pSuccess then warn(pError) logError(pError) end return pSuccess, pError end local function cPcall(func, ...) return Pcall(function(...) return coroutine.resume(coroutine.create(func), ...) end, ...) end local function Routine(func, ...) return coroutine.resume(coroutine.create(func), ...) end local function GetEnv(env, repl) local scriptEnv = setmetatable({}, { __index = function(tab, ind) return (locals[ind] or (env or origEnv)[ind]) end; __metatable = unique; }) if repl and type(repl) == "table" then for ind, val in pairs(repl) do scriptEnv[ind] = val end end return scriptEnv end local function GetVargTable() return { Server = server; Service = service; } end local function LoadModule(module, yield, envVars, noEnv, isCore) noEnv = false --// Seems to make loading take longer when true (?) local isFunc = type(module) == "function" local module = (isFunc and service.New("ModuleScript", {Name = "Non-Module Loaded"})) or module local plug = (isFunc and module) or require(module) if server.Modules and type(module) ~= "function" then table.insert(server.Modules,module) end if type(plug) == "function" then if isCore then local ran,err = service.TrackTask("CoreModule: ".. tostring(module), plug, GetVargTable(), GetEnv) if not ran then warn("Core Module encountered an error while loading:", module) warn(err) else return err; end elseif yield then --Pcall(setfenv(plug,GetEnv(getfenv(plug), envVars))) local ran,err = service.TrackTask("Plugin: ".. tostring(module), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable()) if not ran then warn("Plugin Module encountered an error while loading:", module) warn(err) else return err; end else --service.Threads.RunTask("PLUGIN: "..tostring(module),setfenv(plug,GetEnv(getfenv(plug), envVars))) local ran, err = service.TrackTask("Thread: Plugin: ".. tostring(module), (noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)), GetVargTable()) if not ran then warn("Plugin Module encountered an error while loading:", module) warn(err) else return err; end end else server[module.Name] = plug end if server.Logs then server.Logs.AddLog(server.Logs.Script,{ Text = "Loaded Module: "..tostring(module); Desc = "Adonis loaded a core module or plugin"; }) end end;
-- Helper function to lazily instantiate a controller if it does not yet exist, -- disable the active controller if it is different from the on being switched to, -- and then enable the requested controller. The argument to this function must be -- a reference to one of the control modules, i.e. Keyboard, Gamepad, etc.
function ControlModule:SwitchToController(controlModule) if not controlModule then if self.activeController then self.activeController:Enable(false) end self.activeController = nil self.activeControlModule = nil else if not self.controllers[controlModule] then self.controllers[controlModule] = controlModule.new(CONTROL_ACTION_PRIORITY) end if self.activeController ~= self.controllers[controlModule] then if self.activeController then self.activeController:Enable(false) end self.activeController = self.controllers[controlModule] self.activeControlModule = controlModule -- Only used to check if controller switch is necessary if self.touchControlFrame and (self.activeControlModule == ClickToMove or self.activeControlModule == TouchThumbstick or self.activeControlModule == DynamicThumbstick) then if not self.controllers[TouchJump] then self.controllers[TouchJump] = TouchJump.new() end self.touchJumpController = self.controllers[TouchJump] self.touchJumpController:Enable(true, self.touchControlFrame) else if self.touchJumpController then self.touchJumpController:Enable(false) end end self:EnableActiveControlModule() end end end function ControlModule:OnLastInputTypeChanged(newLastInputType) if lastInputType == newLastInputType then warn("LastInputType Change listener called with current type.") end lastInputType = newLastInputType if lastInputType == Enum.UserInputType.Touch then -- TODO: Check if touch module already active local touchModule, success = self:SelectTouchModule() if success then while not self.touchControlFrame do wait() end self:SwitchToController(touchModule) end elseif computerInputTypeToModuleMap[lastInputType] ~= nil then local computerModule = self:SelectComputerMovementModule() if computerModule then self:SwitchToController(computerModule) end end self:UpdateTouchGuiVisibility() end
------------------------------------------------------------------------
local TOGGLE_INPUT_PRIORITY = Enum.ContextActionPriority.Low.Value local INPUT_PRIORITY = Enum.ContextActionPriority.High.Value local FREECAM_MACRO_KB = {Enum.KeyCode.LeftShift, Enum.KeyCode.P} local NAV_GAIN = Vector3.new(1, 1, 1)*64 local PAN_GAIN = Vector2.new(0.75, 1)*8 local FOV_GAIN = 300 local PITCH_LIMIT = rad(90) local VEL_STIFFNESS = 1.5 local PAN_STIFFNESS = 1.0 local FOV_STIFFNESS = 4.0
--// Todo: --// Fix a loooootttttttt of bugged commands --// Probably a lot of other stuff idk --// Transform from Sceleratis into Dr. Sceleratii; Evil alter-ego; Creator of bugs, destroyer of all code that is good --// Maybe add a celery command at some point (wait didn't we do this?) --// Say hi to people reading the script --// ... --// "Hi." - Me --// Your mom
--[[** Checks if the player's primary group is the given group. @param [Instance<Player>] Player The player you are checking for. Can also be their UserID. @param [Integer] GroupID The group you are checking. @returns [Boolean] Whether or not the primary group is the given group. **--]]
function GroupService:IsPrimaryGroupAsync(Player, GroupID) for _, Group in ipairs(GroupService:GetGroupsAsync(Player)) do if Group.Id == GroupID and Group.IsPrimary then return true end end return false end
-- ROBLOX Services
local RunService = game:GetService('RunService')
--Brew touched event logic
function onTouch(touchedPart) local character = touchedPart.Parent if character == nil then return end local humanoid = character:FindFirstChild("Humanoid", false); if humanoid then doTheBrew(humanoid, character) end end brew.Touched:Connect(onTouch)
--WARNING: ABANDON ALL HOPE YE WHO TREAD THESE LINES
local Camera =game.Workspace.CurrentCamera local Tool = script.Parent local Handle = Tool:WaitForChild('Handle') function StartTrail(source,nparent) local trailParts = {} local sourceAlive = true UTIL.DefineDestructor(source,function() sourceAlive=false for _,i in pairs(trailParts) do i.Parent = nil end end) local numParts = 60 local counter = 1 while sourceAlive do if not trailParts[counter] then local tpart = Instance.new('Part') tpart.Anchored = true tpart.CanCollide = false tpart.FormFactor = 'Custom' tpart.Size = Vector3.new(.3,5,3) tpart.Transparency = .2 tpart.BrickColor = BrickColor.new('Bright blue') tpart.Parent = nparent trailParts[counter]=tpart end trailParts[counter].CFrame = source.CFrame:toWorldSpace(CFrame.new(0,0,6.5)) counter = counter+1 if counter>numParts then counter = 1 end wait(.025) end end Tool.ChildAdded:connect(function(nchild) if nchild.Name=='FakeHandle' then Spawn(function() StartTrail(nchild,Camera) end) end end)
-- send nil to client to mark repair cancelled
local repairTarget local repairingValue local apparentHolder local requestStop = false script.RepairChannel.OnServerEvent:Connect(function(plr, engine, valObj) local holder = game:GetService("Players") :GetPlayerFromCharacter(script.Parent.Parent) if holder == plr then apparentHolder = plr if engine ~= nil then repairingValue = valObj repairTarget = repairingValue.Parent.Parent.Parent.Engine script.Internal:Fire() else requestStop = true end end end) while true do requestStop = false script.Internal.Event:Wait() while wait(.5) do local engine = repairingValue.Parent.Parent.Parent.Engine local dist = (script.Parent.Handle.Position - engine.Position).Magnitude local vel = engine.Velocity.Magnitude if requestStop or dist > 50 or vel > 3 or script.Parent.Parent:FindFirstChildOfClass("Humanoid") == nil or repairingValue.Value >= 100 then script.RepairChannel:FireClient(apparentHolder) repairingValue = nil break else repairingValue.Value = math.min(repairingValue.Value + 1, 100) end end end
-- FUNÇÕES AJUDANTES ---------------------------------------- -- Defina a propriedade "MotorMaxTorque" em todos os motores CylindricalConstraint
local function setMotorTorque(torque) motorFR.MotorMaxTorque = torque motorFL.MotorMaxTorque = torque motorBR.MotorMaxTorque = torque motorBL.MotorMaxTorque = torque end
-- tick() returns the number of seconds since January 1st, 1970 -- Because this is a LocalScript, it will return the time based on your timezone -- Don't mess with anything in the script. The constants and variables are all mixed together
local year = 2020 local month = 1 local day = 1 local Date = "January 1, 2020" function getDate() local months = { -- {"MONTH", TOAL DAYS TO YEAR, DAYS} <- Format {"January",31,31}; {"February",59,28}; {"March",90,31}; {"April",120,30}; {"May",151,31}; {"June",181,30}; {"July",212,31}; {"August",243,31}; {"September",273,30}; {"October",304,31}; {"November",334,30}; {"December",365,31}; } year = math.floor(1970+(t/31579200)) if ((year%4) == 0) then -- Check for leap year months[2][3] = 29 for i,v in pairs(months) do if (i ~= 1) then v[2] = (v[2]+1) end end end day = math.floor(((t/86400)%365.25)+1) -- Get current day of the year. Starts at 0, so 1 is added (365.25 is the average # of days in a year due to leap year) for i,m in pairs(months) do if ((m[2]-m[3]) <= day) then -- Get month based on day month = i end end local m = months[month] day = (day+m[3]-m[2]) -- Get day of the month year,day = tostring(year),tostring(day) local c,s = ", "," " -- Comma, space Date = (months[month][1] .. s .. day .. c .. year) end function display(start) if (start) then getDate() delay(0,function() for i = 1,0,-0.05 do script.Parent.Time.TextTransparency,script.Parent.Date.TextTransparency = i,i wait() end script.Parent.Time.TextTransparency,script.Parent.Date.TextTransparency = 0,0 end) end script.Parent.Date.Text = Date end function start() display(true) while (true) do -- Simplicity FTW: t = tick() getDate() display() wait() end end start()
--Declared humanoid
hum.BreakJointsOnDeath = false
-- Lobby toggle
local LobbyButton = GameplayUi.LobbyButton local SpawnLocation = workspace.SpawnLocations.SpawnLocation
--Made by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") Animations = {} ServerControl = Tool:WaitForChild("ServerControl") ClientControl = Tool:WaitForChild("ClientControl") ToolEquipped = false function SetAnimation(Mode, Value) if Mode == "PlayAnimation" and Value and ToolEquipped and Humanoid then for i, v in pairs(Animations) do if v.Animation == Value.Animation then v.AnimationTrack:Stop() table.remove(Animations, i) end end local AnimationTrack = Humanoid:LoadAnimation(Value.Animation) table.insert(Animations, {Animation = Value.Animation, AnimationTrack = AnimationTrack}) AnimationTrack:Play(Value.FadeTime, Value.Weight, Value.Speed) elseif Mode == "StopAnimation" and Value then for i, v in pairs(Animations) do if v.Animation == Value.Animation then v.AnimationTrack:Stop() table.remove(Animations, i) end end end end function CheckIfAlive() return (((Player and Player.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 end function Unequipped() for i, v in pairs(Animations) do if v and v.AnimationTrack then v.AnimationTrack:Stop() end end Animations = {} 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() end end ClientControl.OnClientInvoke = OnClientInvoke Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--[[Engine]]
--Torque Curve Tune.Horsepower = 250 -- [TORQUE CURVE VISUAL] Tune.IdleRPM = 800 -- https://www.desmos.com/calculator/2uo3hqwdhf Tune.PeakRPM = 8000 -- Use sliders to manipulate values Tune.Redline = 8500 -- Copy and paste slider values into the respective tune values Tune.EqPoint = 6800 Tune.PeakSharpness = 3.8 Tune.CurveMult = 0.07 --Incline Compensation Tune.InclineComp = .5 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees) --Misc Tune.RevAccel = 250 -- RPM acceleration when clutch is off Tune.RevDecay = 75 -- RPM decay when clutch is off Tune.RevBounce = 500 -- RPM kickback from redline Tune.IdleThrottle = 3 -- Percent throttle at idle Tune.ClutchTol = 150 -- Clutch engagement threshold (higher = faster response)
--// F key, HornOn
mouse.KeyDown:connect(function(key) if key=="h" then veh.Lightbar.middle.Airhorn:Play() veh.Lightbar.middle.Wail.Volume = 0 veh.Lightbar.middle.Yelp.Volume = 0 veh.Lightbar.middle.Priority.Volume = 0 veh.Lightbar.HORN.Transparency = 0 end end)
--[[ Similar to finally, except rejections are propagated through it. ]]
function Promise.prototype:done(finallyHandler) assert( finallyHandler == nil or type(finallyHandler) == "function", string.format(ERROR_NON_FUNCTION, "Promise:done") ) return self:_finally(debug.traceback(nil, 2), finallyHandler, true) end
--// Localize
log("Localize") local Localize = service.Localize os = Localize(os) math = Localize(math) table = Localize(table) string = Localize(string) coroutine = Localize(coroutine) Instance = Localize(Instance) Vector2 = Localize(Vector2) Vector3 = Localize(Vector3) CFrame = Localize(CFrame) UDim2 = Localize(UDim2) UDim = Localize(UDim) Ray = Localize(Ray) Rect = Localize(Rect) Faces = Localize(Faces) Color3 = Localize(Color3) NumberRange = Localize(NumberRange) NumberSequence = Localize(NumberSequence) NumberSequenceKeypoint = Localize(NumberSequenceKeypoint) ColorSequenceKeypoint = Localize(ColorSequenceKeypoint) PhysicalProperties = Localize(PhysicalProperties) ColorSequence = Localize(ColorSequence) Region3int16 = Localize(Region3int16) Vector3int16 = Localize(Vector3int16) BrickColor = Localize(BrickColor) TweenInfo = Localize(TweenInfo) Axes = Localize(Axes) task = Localize(task)
--NOTE: We create the rocket once and then clone it when the player fires
local Rocket = Instance.new('Part') do -- Set up the rocket part Rocket.Name = 'Rocket' Rocket.BrickColor = BrickColor.Random() Rocket.FormFactor = Enum.FormFactor.Custom --NOTE: This must be done before changing Size Rocket.Size = ROCKET_PART_SIZE Rocket.CanCollide = false -- Add the mesh local mesh = Instance.new('SpecialMesh', Rocket) mesh.MeshId = MISSILE_MESH_ID mesh.Scale = MISSILE_MESH_SCALE -- Add fire local fire = Instance.new('Fire', Rocket) fire.Heat = 5 fire.Size = 2 -- Add a force to counteract gravity local bodyForce = Instance.new('BodyForce', Rocket) bodyForce.Name = 'Antigravity' bodyForce.Force = Vector3.new(0, Rocket:GetMass() * GRAVITY_ACCELERATION, 0) -- Clone the sounds and set Boom to PlayOnRemove local swooshSoundClone = SwooshSound:Clone() swooshSoundClone.Parent = Rocket local boomSoundClone = BoomSound:Clone() boomSoundClone.PlayOnRemove = true boomSoundClone.Parent = Rocket -- Attach creator tags to the rocket early on local creatorTag = Instance.new('ObjectValue', Rocket) creatorTag.Value = MyPlayer creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats local iconTag = Instance.new('StringValue', creatorTag) iconTag.Value = Tool.TextureId iconTag.Name = 'icon' -- Finally, clone the rocket script and enable it local rocketScriptClone = RocketScript:Clone() rocketScriptClone.Parent = Rocket rocketScriptClone.Disabled = false end
--[[ SCRIPT VARIABLES ]]
local CHAT_BUBBLE_FONT = Enum.Font.SourceSans local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10 local CHAT_BUBBLE_TAIL_HEIGHT = 14 local CHAT_BUBBLE_WIDTH_PADDING = 30 local CHAT_BUBBLE_FADE_SPEED = 1.5 local BILLBOARD_MAX_WIDTH = 400 local BILLBOARD_MAX_HEIGHT = 250 --This limits the number of bubble chats that you see above characters local ELIPSES = "..." local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses. local MaxChatMessageLengthExclusive = MaxChatMessageLength - getMessageLength(ELIPSES) - 1 local NEAR_BUBBLE_DISTANCE = 65 --previously 45 local MAX_BUBBLE_DISTANCE = 100 --previously 80
--string Type --* is this node a Prompt or Response?
Response.Type = "Response"
---
local Paint = false script.Parent.MouseButton1Click:connect(function() Paint = not Paint handler:FireServer("Olivine",Paint) end)
--edit the below function to execute code when this response is chosen OR this prompt is shown --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) dialogueFolder.Parent.OrbThrow.Use:Fire(player.Character) end
-- -- Go through each valid target to see if within field of view and if there is -- -- clear line of sight. Field of view treated as wedge in front of character. -- for _, character in pairs(characters) do -- local toTarget = (character.Torso.Position - model.Torso.Position) -- toTarget = Vector3.new(toTarget.X, 0, toTarget.Z) -- local angle = math.acos(toTarget:Dot(model.Torso.CFrame.lookVector)/toTarget.magnitude) -- if math.deg(angle) < configs["FieldOfView"]/2 then -- ZombieTarget = character -- -- raycast to see if target is actually visible -- local toTarget = Ray.new(model.Torso.Position, (ZombieTarget.Torso.Position - model.Torso.Position)) -- local part, position = game.Workspace:FindPartOnRayWithIgnoreList(toTarget, zombies) -- if part and part.Parent == ZombieTarget then -- return true -- end -- ZombieTarget = nil -- end -- end
end return false end CanSeeTarget.TransitionState = PursueState -- TargetDead: Check if target is dead. local TargetDead = StateMachine.NewCondition() TargetDead.Name = "TargetDead" TargetDead.Evaluate = function() if ZombieTarget and ZombieTarget.Humanoid then return ZombieTarget.Humanoid.Health <= 0 end return true end TargetDead.TransitionState = IdleState -- GotDamaged: Check if NPC has taken damage local lastHealth = model.Humanoid.Health local GotDamaged = StateMachine.NewCondition() GotDamaged.Name = "GotDamaged" GotDamaged.Evaluate = function() if model then if lastHealth > model.Humanoid.Health then return true end end return false end GotDamaged.TransitionState = SearchState -- GotBored: Used to provide random state change. local GotBored = StateMachine.NewCondition() GotBored.Name = "GotBored" GotBored.Evaluate = function() local now = os.time() if now - lastBored > configs["BoredomDuration"] then local roll = math.random() if roll < configs["ChanceOfBoredom"] then lastBored = now if GotBored.TransitionState == SearchState then GotBored.TransitionState = IdleState else GotBored.TransitionState = SearchState end return true end end return false end GotBored.TransitionState = IdleState -- LostTarget: Checks clear line of sight local LostTarget = StateMachine.NewCondition() LostTarget.Name = "LostTarget" LostTarget.Evaluate = function() if true then return false end if ZombieTarget then if (ZombieTarget.Torso.Position - model.Torso.Position).magnitude > 10 then local toTarget = Ray.new(model.Torso.Position, (ZombieTarget.Torso.Position - model.Torso.Position)) local part, position = game.Workspace:FindPartOnRay(toTarget, model) if not part or part.Parent ~= ZombieTarget then --print("Lost target!") ZombieTargetLastLocation = ZombieTarget.Torso.Position ZombieTarget = nil return true end end end return false end LostTarget.TransitionState = HuntState local WithinRange = StateMachine.NewCondition() WithinRange.Name = "WithinRange" WithinRange.Evaluate = function() if ZombieTarget then local distance = (model.Torso.Position - ZombieTarget.Torso.Position).magnitude if distance < configs["AttackRange"] then --print("Within attack range!") return true end end return false end WithinRange.TransitionState = AttackState local OutsideRange = StateMachine.NewCondition() OutsideRange.Name = "OutsideRange" OutsideRange.Evaluate = function() if ZombieTarget then local distance = (model.Torso.Position - ZombieTarget.Torso.Position).magnitude if distance > configs["AttackRange"] then --print("Outside attack range!") return true end end return false end OutsideRange.TransitionState = PursueState table.insert(IdleState.Conditions, CanSeeTarget) table.insert(IdleState.Conditions, GotDamaged) table.insert(IdleState.Conditions, GotBored) table.insert(SearchState.Conditions, GotBored) table.insert(SearchState.Conditions, CanSeeTarget) table.insert(PursueState.Conditions, LostTarget) table.insert(PursueState.Conditions, WithinRange) table.insert(PursueState.Conditions, TargetDead) table.insert(AttackState.Conditions, OutsideRange) table.insert(AttackState.Conditions, TargetDead) table.insert(HuntState.Conditions, GotBored) table.insert(HuntState.Conditions, CanSeeTarget) -- Setup arms damage local canHit = true local lastHit = os.time() local function handleHit(other) if canHit then if other and other.Parent and other.Parent.Name ~= "Zombie" and other.Parent:FindFirstChild("Humanoid") then local enemy = other.Parent if enemy.Humanoid.WalkSpeed > 0 then enemy.Humanoid.Health = enemy.Humanoid.Health - configs["Damage"] canHit = false end end else local now = os.time() if now - lastHit > configs["DamageCooldown"] then lastHit = now canHit = true end end end local leftHitConnect, rightHitConnect leftHitConnect = model:FindFirstChild("Left Arm").Touched:connect(handleHit) rightHitConnect = model:FindFirstChild("Right Arm").Touched:connect(handleHit) --ZombieAI.Animate(model) --updateDisplay() --updateDisplay(model.BillboardGui.TextLabel, StateMachine.CurrentState) local thread = coroutine.create(function() while true do wait() -- calculate repulsion force local humanoids = HumanoidList:GetCurrent() local localZombies = {} for _, humanoid in pairs(humanoids) do if humanoid and humanoid ~= model.Humanoid and humanoid.Parent and humanoid.Parent:FindFirstChild("Torso") then local torso = humanoid.Parent:FindFirstChild("Torso") local distance = (model.Torso.Position - torso.Position).magnitude if distance <= 2.5 then table.insert(localZombies, torso.Position) end end end local repulsionDirection = AIUtilities:GetRepulsionVector(model.Torso.Position, localZombies) if repulsionDirection.magnitude > 0 then --print("replusion direction: " .. tostring(repulsionDirection)) end model.Torso.RepulsionForce.force = repulsionDirection if StateMachine.CurrentState and model.Configurations.Debug.Value then model.BillboardGui.TextLabel.Visible = true model.BillboardGui.TextLabel.Text = StateMachine.CurrentState.Name end if not model.Configurations.Debug.Value then model.BillboardGui.TextLabel.Visible = false end end end) coroutine.resume(thread) StateMachine.SwitchState(IdleState) zombie.Stop = function() StateMachine.SwitchState(nil) end return zombie end return ZombieAI
--stuff
local tool = script.Parent local remote = tool:WaitForChild("gunremote") local gunmodel = tool.GunModel local handle = gunmodel:FindFirstChild("Handle") local mainpart = gunmodel:FindFirstChild("mainpart") local owner = players.LocalPlayer local ownergui = owner:FindFirstChildOfClass("PlayerGui") local cam = workspace.CurrentCamera local mouse = owner:GetMouse() local character local humanoid local head local hrp local larmcweld local rarmcweld local guncweld local guncmodel local maincpart local boltcweld local boltcmainpart local gunclufa local magcmodel local reloadmagcmodel local reloadmagcpart local reloadmagcweld local viewmodel
-- carSeat.Parent.Body.Dash.Screen.G.Radio.Song.Text = "PRESET 3" -- carSeat.Parent.Body.Dash.Screen.G.Radio.Title.Text = ""
elseif carSeat.Stations.mood.Value == 3 then carSeat.Parent.Body.MP.Sound:Stop() carSeat.Stations.mood.Value = 4
--[[ TODO: Add a function to find first child with an attribute, corotine.resume, coroutine.create shortenings to cr and cc ]]
local Utilities = {} Utilities.cr = coroutine.resume Utilities.cc = coroutine.create Utilities.crcc = function(func) return coroutine.resume(coroutine.create(func)) end Utilities.FindFirstChildWithAttribute = function(Parent, AttributeName, ReturnAttributeValue, Value) if type(Parent) == "table" then Parent = AttributeName AttributeName = ReturnAttributeValue end for _, Child in pairs(Parent:GetChildren()) do if Child:GetAttribute(AttributeName) then if ReturnAttributeValue == true then return Child:GetAttribute(AttributeName) else if Value and Child:GetAttribute(AttributeName) == Value then return Child else return Child end end end end return nil end Utilities.FindFirstChildWithPropertyValue = function(Parent, Property, Value) for _, Child in pairs(Parent:GetChildren()) do if Child[Property] and Child[Property] == Value then return Child end end return nil end Utilities.GlobalTrackSwitch = function(NewTrack, FadeTime) -- Find what Sound in workspace.GlobalSounds is playing, tween fade it out and tween fade in NewTrack -- Find the current track local CurrentTrack = Utilities.FindFirstChildWithPropertyValue(workspace.GlobalSounds, "Playing", true) local NewTrack = workspace.GlobalSounds:FindFirstChild(NewTrack) local NewTrackInitVol = NewTrack.Volume --print(CurrentTrack) -- If the new track is already playing, return if NewTrack.Playing == true then return else NewTrack:Play() NewTrack.Volume = 0 end -- Fade out current track and fade in new track local CurrentTrackFade = TweenService:Create(CurrentTrack, TweenInfo.new(FadeTime), {Volume = 0}) local NewTrackFade = TweenService:Create(NewTrack, TweenInfo.new(FadeTime), {Volume = NewTrackInitVol}) CurrentTrackFade:Play() NewTrackFade:Play() Utilities.crcc(function() task.wait(FadeTime) CurrentTrack:Stop() end) end Utilities.TextTransition = function(Object, TextProperty, EndText, Speed, TransitionType) local StartText = Object[TextProperty] local StartTextLength = string.len(StartText) local EndTextLength = string.len(EndText) local Speed = Speed or 1 local TransitionType = TransitionType or "Collapse" if TransitionType == "Collapse" then -- Take one letter from beginning and end until no letters are left, then do the opposite with EndText for i=2, StartTextLength/2 do -- Collapse Object[TextProperty] = string.sub(StartText, i, StartTextLength-(i-1)) task.wait(Speed/2*.25) end Object[TextProperty] = " " task.wait(Speed/2*.25) for i=EndTextLength/2, 0, -1 do -- Expand from middle Object[TextProperty] = string.sub(EndText, i, EndTextLength-(i-1)) task.wait(Speed/2*.25) end elseif TransitionType == "Scramble" then -- Randomly swap out letters from StartText to EndText end end return Utilities
-- Add tracer decal to server storage if it isn't already there
if not game.ServerStorage:FindFirstChild("ROBLOX_PistolTracerDecal") then tool.ROBLOX_PistolTracerDecal:Clone().Parent = game.ServerStorage end
--newgui.CarName.Value=script.Parent.Parent - a little too much for now.
print("added") end end end end end end) script.Parent.ChildRemoved:connect(function(w) print("ChildRemoved") if w.className=="Weld" then print("IsAWeld") if w.Name=="SeatWeld" then print("IsASeatWeld") if w.Part1.Parent:findFirstChild("Humanoid")~=nil then print("IsAHumanoid") pl=game.Players:GetPlayerFromCharacter(w.Part1.Parent) if pl~=nil then print("IsAPlayer") if pl.PlayerGui:findFirstChild("SirenControl")~=nil then print("found vehicle gui - deleting") pl.PlayerGui:findFirstChild("SirenControl").Parent=nil print("deleted") else print("no gui found - wierd...") end end end end end end)
--////////////////////////////// Methods --//////////////////////////////////////
local methods = {} methods.__index = methods function methods:AddChannel(channelName) if (self.ChatChannels[channelName:lower()]) then error(string.format("Channel %q alrady exists.", channelName)) end local function DefaultChannelCommands(fromSpeaker, message) if (message:lower() == "/leave") then local channel = self:GetChannel(channelName) local speaker = self:GetSpeaker(fromSpeaker) if (channel and speaker) then if (channel.Leavable) then speaker:LeaveChannel(channelName) speaker:SendSystemMessage(string.format("You have left channel '%s'", channelName), "System") else speaker:SendSystemMessage("You cannot leave this channel.", channelName) end end return true end return false end local channel = ChatChannel.new(self, channelName) self.ChatChannels[channelName:lower()] = channel channel:RegisterProcessCommandsFunction("default_commands", DefaultChannelCommands, ChatConstants.HighPriority) local success, err = pcall(function() self.eChannelAdded:Fire(channelName) end) if not success and err then print("Error addding channel: " ..err) end return channel end function methods:RemoveChannel(channelName) if (self.ChatChannels[channelName:lower()]) then local n = self.ChatChannels[channelName:lower()].Name self.ChatChannels[channelName:lower()]:InternalDestroy() self.ChatChannels[channelName:lower()] = nil local success, err = pcall(function() self.eChannelRemoved:Fire(n) end) if not success and err then print("Error removing channel: " ..err) end else warn(string.format("Channel %q does not exist.", channelName)) end end function methods:GetChannel(channelName) return self.ChatChannels[channelName:lower()] end function methods:AddSpeaker(speakerName) if (self.Speakers[speakerName:lower()]) then error("Speaker \"" .. speakerName .. "\" already exists!") end local speaker = Speaker.new(self, speakerName) self.Speakers[speakerName:lower()] = speaker local success, err = pcall(function() self.eSpeakerAdded:Fire(speakerName) end) if not success and err then print("Error adding speaker: " ..err) end return speaker end function methods:InternalUnmuteSpeaker(speakerName) for channelName, channel in pairs(self.ChatChannels) do if channel:IsSpeakerMuted(speakerName) then channel:UnmuteSpeaker(speakerName) end end end function methods:RemoveSpeaker(speakerName) if (self.Speakers[speakerName:lower()]) then local n = self.Speakers[speakerName:lower()].Name self:InternalUnmuteSpeaker(n) self.Speakers[speakerName:lower()]:InternalDestroy() self.Speakers[speakerName:lower()] = nil local success, err = pcall(function() self.eSpeakerRemoved:Fire(n) end) if not success and err then print("Error removing speaker: " ..err) end else warn("Speaker \"" .. speakerName .. "\" does not exist!") end end function methods:GetSpeaker(speakerName) return self.Speakers[speakerName:lower()] end function methods:GetChannelList() local list = {} for i, channel in pairs(self.ChatChannels) do if (not channel.Private) then table.insert(list, channel.Name) end end return list end function methods:GetAutoJoinChannelList() local list = {} for i, channel in pairs(self.ChatChannels) do if channel.AutoJoin then table.insert(list, channel) end end return list end function methods:GetSpeakerList() local list = {} for i, speaker in pairs(self.Speakers) do table.insert(list, speaker.Name) end return list end function methods:SendGlobalSystemMessage(message) for i, speaker in pairs(self.Speakers) do speaker:SendSystemMessage(message, nil) end end function methods:RegisterFilterMessageFunction(funcId, func, priority) self.FilterMessageFunctions:AddFunction(funcId, func, priority) end function methods:UnregisterFilterMessageFunction(funcId) self.FilterMessageFunctions:RemoveFunction(funcId) end function methods:RegisterProcessCommandsFunction(funcId, func, priority) self.ProcessCommandsFunctions:AddFunction(funcId, func, priority) end function methods:UnregisterProcessCommandsFunction(funcId) self.ProcessCommandsFunctions:RemoveFunction(funcId) end local LastFilterNoficationTime = 0 local LastFilterIssueTime = 0 local FilterIssueCount = 0 function methods:InternalNotifyFilterIssue() if (tick() - LastFilterIssueTime) > FILTER_THRESHOLD_TIME then FilterIssueCount = 0 end FilterIssueCount = FilterIssueCount + 1 LastFilterIssueTime = tick() if FilterIssueCount >= FILTER_NOTIFCATION_THRESHOLD then if (tick() - LastFilterNoficationTime) > FILTER_NOTIFCATION_INTERVAL then LastFilterNoficationTime = tick() local systemChannel = self:GetChannel("System") if systemChannel then systemChannel:SendSystemMessage("The chat filter is currently experiencing issues and messages may be slow to appear.", errorExtraData) end end end end local StudioMessageFilteredCache = {}
-------- OMG HAX
r = game:service("RunService") local damage = 0 local slash_damage = 0 sword = script.Parent.Handle Tool = script.Parent function attack() local anim = Instance.new("StringValue") anim.Name = "toolanim" anim.Value = "Slash" anim.Parent = Tool end function swordUp() Tool.GripForward = Vector3.new(-1,0,0) Tool.GripRight = Vector3.new(0,1,0) Tool.GripUp = Vector3.new(0,0,1) end function swordOut() Tool.GripForward = Vector3.new(0,0,1) Tool.GripRight = Vector3.new(0,-1,0) Tool.GripUp = Vector3.new(-1,0,0) end Tool.Enabled = true function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then return end attack() wait(1) Tool.Enabled = true end script.Parent.Activated:connect(onActivated)
--> Services
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Players = game:GetService("Players")
-- Keyboard Input
local function GetKeyboardInput(step) -- Declare & initialize new control inputs local yaw, pitch, boost = 0, 0, 0 -- Key inputs local w = Keyboard:IsDown(KEY_W) or Keyboard:IsDown(KEY_UP) local a = Keyboard:IsDown(KEY_A) or Keyboard:IsDown(KEY_LEFT) local s = Keyboard:IsDown(KEY_S) or Keyboard:IsDown(KEY_DOWN) local d = Keyboard:IsDown(KEY_D) or Keyboard:IsDown(KEY_RIGHT) local shift = Keyboard:IsDown(KEY_LEFTSHIFT) or Keyboard:IsDown(KEY_RIGHTSHIFT) -- Update controls if yaw == 0 then yaw = ((a ~= d) and (d and 1 or -1) or 0) end if pitch == 0 then pitch = ((w ~= s) and (s and -1 or 1) or 0) end boost = ((UpdateBoost(shift, step) and 1) or 0) -- Throttle is off during countdown if countdownGui.TimerFrame.Visible then boost = -1 yaw = 0 pitch = 0 end -- Set engine input variables engine.BoostInput = boost engine.YawInput = yaw engine.PitchInput = pitch end -- GetKeyboardInput()
-- NEW V13.1.0 - PartCache tie-in. If you use the PartCache module to create cosmetic bullets, you can now directly tie that in. -- Ensure you're using the latest version of PartCache.
local CosmeticPartProvider = PartCacheModule.new(CosmeticBullet, 150, CosmeticBulletsFolder)
--------RIGHT DOOR --------
game.Workspace.doorright.l32.BrickColor = BrickColor.new(1013) game.Workspace.doorright.l41.BrickColor = BrickColor.new(106) game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-------------------------------------------------------------------
function CheckUser(user,val) if IsGroupOnly == true and user:GetRankInGroup(GroupID) >= MinRank then val = true else val = false end if TeamOnly == true and user.TeamColor == TeamColor or user.Team == TeamName then val = true else val = false end if UserOnly == true then for _,i in pairs(UserNames) do if user.Name == i then val = true break; else val = false end end end if IsGroupOnly == false and TeamOnly == false and UserOnly == false then val = true end return val end
--- Cleans up all tasks. -- @alias Destroy
function Maid:DoCleaning() local tasks = self._tasks -- Disconnect all events first as we know this is safe for index, task in pairs(tasks) do if (typeof(task) == "RBXScriptConnection") then tasks[index] = nil task:Disconnect() end end -- Clear out tasks table completely, even if clean up tasks add more tasks to the maid local index, task = next(tasks) while (task ~= nil) do tasks[index] = nil if (type(task) == "function") then task() elseif (typeof(task) == "RBXScriptConnection") then task:Disconnect() elseif (task.Destroy) then task:Destroy() elseif (Promise.Is(task)) then task:Cancel() end index, task = next(tasks) end end
--[[* * Same as invokeGuardedCallback, but instead of returning an error, it stores * it in a global so it can be rethrown by `rethrowCaughtError` later. * TODO: See if caughtError and rethrowError can be unified. * * @param {String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function ]]
exports.invokeGuardedCallbackAndCatchFirstError = function(...) -- deviation: instead of the weird `this` indirection, pass varargs through exports.invokeGuardedCallback(...) if hasError then local err = clearCaughtError() if not hasRethrowError then hasRethrowError = true rethrowError = err end end end
------
local M = require(game.ServerScriptService["GC Server"].Services.CPRaid); while true do
-- init
game.ReplicatedStorage.RE.marketPlace.OnServerEvent:Connect(function(player, name) spawn(function() local product, class = getAsset(name) if not product then print("Not product //"..name) return end local data = Datastore:GetData(player) local t = MarketplaceService:UserOwnsGamePassAsync(player.UserId,product.Id) if data and table.find(data.Gamepasses or {}, product.Id) then return onProductPurchased(player, product.Id) -- already owned end if t then return onProductPurchased(player, product.Id) end game.ReplicatedStorage.RE.GamepassNotification:FireClient(player) if class == "Passes" then MarketplaceService:PromptGamePassPurchase(player, product.Id) elseif class == "Products" then MarketplaceService:PromptProductPurchase(player, product.Id) end end) end) game.Players.PlayerAdded:Connect(function(player) local data while not Datastore do Datastore = shared.Datastore wait() end while not data do if not player.Parent then return end data = Datastore:GetData(player) wait(1) end local gamepasses = data.Gamepasses or {} for i, module in pairs(script.Passes:GetChildren()) do local pass = getAsset(module.Name) local id = pass.Id local found = table.find(gamepasses, id) if found or MarketplaceService:UserOwnsGamePassAsync(player.UserId, id) then if not found then table.insert(data.Gamepasses, id) end if pass.onJoined then pass.onJoined(player) end game.ReplicatedStorage.RE.gamepassUpdate:FireClient(player, getNameFromID(id)) end end end)
--[[ @brief Copies a table. @param t The table to copy. @return The copied table. --]]
function module.ShallowTableCopy(t) local s = {}; for i, v in pairs(t) do s[i] = v; end return s; end function module.ArrayCopyOnCondition(t, c) local s = {}; for i, v in pairs(t) do if c(v) then table.insert(s, v); end end return s; end module.ShallowCopy = module.ShallowTableCopy;
-- Gets an int and updates time left
function DisplayManager.updateTime(timeToUpdate) timeLeft.Value = timeToUpdate end
-- DONT TOUCH ANYTHING
function ChangeMe(hit) if hit.Parent == nil then return end if (hit.Parent:findFirstChild("Humanoid") == nil) then return end local human = hit.Parent:findFirstChild("Humanoid") local char = hit.Parent local player = game.Players:GetPlayerFromCharacter(hit.Parent) if (human ~= nil) and debounce == false then debounce = true originals = char:getChildren() for w = 1, #originals do if originals[w].className == "CharacterMesh" then originals[w]:remove() end end meshes = script:getChildren() for y = 1, #meshes do copy = meshes[y]:clone() copy.Parent = char end end wait(0) debounce = true end script.Parent.Touched:connect(ChangeMe)
--//Setup//--
local Holder = script.Parent local Button = Holder.IconButton local SettingsMenu = Holder.Parent.Parent.SettingMenuHolder
-- organises springs by speed and damping, for batch processing
local springBuckets: {[number]: {[number]: Types.Set<Spring>}} = {}
--Please do not touch anything below unless you know what you're doing
script.Parent.Parent:WaitForChild("CarSeat") local seat = script.Parent.Parent.CarSeat.Value function find(i) for _,v in pairs(i:GetChildren()) do if v.Name == "Hitbox" then v.CanCollide = true end find(v) end end find(seat.Parent)
-- Define the function to open or close the window with gene-alike effect
local function toggleWindow() if window.Visible then -- Close the window by tweening back to the button position and size window.Visible = false end end
--------LEFT DOOR --------
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.secondary.Value) game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--- Sets the command bar visible or not
function Window:SetVisible(visible) Gui.Visible = visible if visible then Entry.TextBox:CaptureFocus() self:SetEntryText("") else Entry.TextBox:ReleaseFocus() self.AutoComplete:Hide() end end
--Tweening Size Function
local tweenSize = function(part, duration, direction, goal) local tween = tweenService:Create(part, TweenInfo.new(duration, Enum.EasingStyle.Sine, direction), {Size = goal} ) tween:Play() return tween end
--[=[ @param name string @param inboundMiddleware ServerMiddleware? @param outboundMiddleware ServerMiddleware? @return RemoteSignal Creates a signal that can be used to fire data to the clients or receive data from the clients. ```lua local mySignal = serverComm:CreateSignal("MySignal") -- Examples of firing in different ways (see docs for RemoteSignal for further info): mySignal:Fire(somePlayer, "Hello world") mySignal:FireAll("Hi there") mySignal:FireExcept(somePlayer, "Hello everyone except " .. somePlayer.Name) mySignal:FireFilter(function(player) return player.Team == someCoolTeam end, "Hello cool team") -- Example of listening for clients to send data: mySignal:Connect(function(player, message) print("Got a message from " .. player.Name .. ":", message) end) ``` ]=]
function ServerComm:CreateSignal(name: string, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?) return Comm.CreateSignal(self._instancesFolder, name, inboundMiddleware, outboundMiddleware) end
--Kills users even if they have a shield
function module:ExecuteBehaviour(brickTouched, character) if character:FindFirstChild("Humanoid") ~= nil then if character.Humanoid.Health > 0 then character.Humanoid.Health = 0 end end end return module
--For R15 avatars
Animations = { R15Slash = 522635514, R15Lunge = 522638767 } Damage = DamageValues.BaseDamage Sounds = { Slash = Handle:WaitForChild("SwordSlash"), Lunge = Handle:WaitForChild("SwordLunge"), Unsheath = Handle:WaitForChild("Unsheath") } ToolEquipped = false
--------------------------------------------------------------------------------
local Tooltip = {} function Tooltip:Set(Text: string) ChangeId += 1 Frame:WaitForChild("TextLabel").Text = Text Frame.GroupTransparency = 1 Frame.Visible = true Tween:Play(Frame, {0.3, "Exponential"}, {GroupTransparency = 0}) Tween:Play(Frame:WaitForChild("UIStroke"), {0.3, "Exponential"}, {Transparency = 0}) end function Tooltip:Clear() local Id = ChangeId Tween:Play(Frame:WaitForChild("UIStroke"), {0.3, "Exponential"}, {Transparency = 1}) Tween:Play(Frame, {0.3, "Exponential"}, {GroupTransparency = 1}).Completed:Once(function() if ChangeId == Id then Frame.Visible = false end end) end local function GetTooltipPosition(): UDim2 local MouseLocation = UserInputService:GetMouseLocation() local ViewportSize = workspace.CurrentCamera.ViewportSize local TooltipSize = Frame:WaitForChild("TextLabel").AbsoluteSize return UDim2.fromOffset( math.clamp(MouseLocation.X + 16, 0, ViewportSize.X - (TooltipSize.X+24)), math.clamp(MouseLocation.Y + 16, 0, ViewportSize.Y - (TooltipSize.Y+24)) ) end
--------------------------CHARACTER CONTROL-------------------------------
local CurrentIgnoreList local function GetCharacter() return Player and Player.Character end local function GetTorso() local humanoid = findPlayerHumanoid(Player) return humanoid and humanoid.RootPart end local function getIgnoreList() if CurrentIgnoreList then return CurrentIgnoreList end CurrentIgnoreList = {} table.insert(CurrentIgnoreList, GetCharacter()) return CurrentIgnoreList end
--//R//--
if script.Parent.Gear.Value == -1 then if carSeat.Throttle == 1 then carSeat.Parent.Parent.RFW.VS.Throttle = -1 carSeat.Parent.Parent.LFW.VS.Throttle = -1 carSeat.Parent.Parent.RRW.VS.Throttle = -1 carSeat.Parent.Parent.LRW.VS.Throttle = -1 carSeat.Parent.Parent.RFW.VS.MaxSpeed = 20 carSeat.Parent.Parent.LFW.VS.MaxSpeed = 20 carSeat.Parent.Parent.RRW.VS.MaxSpeed = 20 carSeat.Parent.Parent.LRW.VS.MaxSpeed = 20 else carSeat.Parent.Parent.RFW.VS.Throttle = 0 carSeat.Parent.Parent.LFW.VS.Throttle = 0 carSeat.Parent.Parent.RRW.VS.Throttle = 0 carSeat.Parent.Parent.LRW.VS.Throttle = 0 carSeat.Parent.Parent.RFW.VS.MaxSpeed = 20 carSeat.Parent.Parent.LFW.VS.MaxSpeed = 20 carSeat.Parent.Parent.RRW.VS.MaxSpeed = 20 carSeat.Parent.Parent.LRW.VS.MaxSpeed = 20 end if carSeat.Throttle == 1 then carSeat.Parent.Parent.RRW.VS.Torque = tq.Value/2 carSeat.Parent.Parent.RFW.VS.Torque = tq.Value*2.4 carSeat.Parent.Parent.LRW.VS.Torque = tq.Value/2 carSeat.Parent.Parent.LFW.VS.Torque = tq.Value*2.4 elseif carSeat.Throttle == 0 and carSeat.Steer == 0 then carSeat.Parent.Parent.RRW.VS.Torque = cst.Value carSeat.Parent.Parent.RFW.VS.Torque = cst.Value carSeat.Parent.Parent.LRW.VS.Torque = cst.Value carSeat.Parent.Parent.LFW.VS.Torque = cst.Value end end
-- ClientRemoteProperty -- Stephen Leitnick -- January 07, 2021
--Let the world load before starting
wait(1) function Render(Character) ViewPort:ClearAllChildren() --Render the character local Char = instance("Model") Char.Name = "" Char.Parent = ViewPort RenderHumanoid(Character,Char) end function module:MakeDupe (Character, V) --Handle changes -- These cause disapear --Character.DescendantAdded:Connect(Render) --Character.DescendantRemoving:Connect(Render) --Initialize if (V) then ViewPort = V; ViewPort.CurrentCamera = Camera; end Render(Character); local CameraUpdater = RunService.Heartbeat:Connect(function() Character = Player.Character; if Character:FindFirstChild("HumanoidRootPart") then Camera.CFrame = cf(Character.HumanoidRootPart.CFrame:toWorldSpace(Offset).p, Character.HumanoidRootPart.CFrame.p) end end) end return module;
-- 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 AllowDisableCustomAnimsUserFlag = false local success, msg = pcall(function() AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims2") end) if (AllowDisableCustomAnimsUserFlag) then local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end) if not success then allowCustomAnimations = true end 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
--Handles behaviours
local function characterTouchedBrick(partTouched) local behaviours = partTouched:FindFirstChild("Behaviours") if behaviours ~= nil then behaviours = behaviours:GetChildren() for i = 1, #behaviours do if behaviours[i].Value == true then game.ReplicatedStorage.RemoteEvents.ExecuteBehaviour:FireServer(player.Character, partTouched, behaviours[i].Name) end end end end
--
run_service.RenderStepped:Connect(function() tween_service:Create(bound, info, {Position = UDim2.new(.5, mouse.X / 40, .1, mouse.Y / 8)}):Play() end) frame.MouseEnter:Connect(function() inui = true end) frame.MouseLeave:Connect(function() inui = false end)
--[[ Dax, See the MeleeScript. ]]
local canmelee = true; local tool = script.Parent; function onKeyDown(key) key:lower(); if key == "v" then if canmelee == false then return; end tool.Melee:play() canmelee = false; local rgrip = tool.Parent["Right Arm"].RightGrip; script.melee.Value = true; for i = 1,6 do rgrip.C1 = rgrip.C1 * CFrame.fromEulerAnglesXYZ(-0.55,0,0); wait(); end wait(0.25); for i = 1, 6 do rgrip.C1 = rgrip.C1 * CFrame.fromEulerAnglesXYZ(0.55,0,0); wait(); end script.melee.Value = false; wait(0.5); canmelee = true; end end function onSelect(mouse) mouse.KeyDown:connect(onKeyDown); end function blow(hit) local humanoid = hit.Parent:findFirstChild("Humanoid") if not humanoid then return end local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character if humanoid ~= hum and hum ~= nil and game.Players:playerFromCharacter(humanoid.Parent) and game.Players:playerFromCharacter(humanoid.Parent).TeamColor~=cc then tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(300) wait(1) untagHumanoid(humanoid) end end tool.Equipped:connect(onSelect);
--Activate Function
tool.Activated:connect(function() --Activate Function 1 if not debounce then debounce = true tool.TimeStopSFX.Playing = true tool.TimeStop.Playing = true color.Enabled = true wait(5) tool.TimeResumeSFX.Playing = true wait(0.5) tool.TimeResume.Playing = true wait(1.5) color.Enabled = false debounce = false wait(5) debounce = true end end)
--[[ The Module ]]
-- local BaseCamera = require(script.Parent:WaitForChild("BaseCamera")) local OrbitalCamera = setmetatable({}, BaseCamera) OrbitalCamera.__index = OrbitalCamera function OrbitalCamera.new() local self = setmetatable(BaseCamera.new(), OrbitalCamera) self.lastUpdate = tick() -- OrbitalCamera-specific members self.changedSignalConnections = {} self.refAzimuthRad = nil self.curAzimuthRad = nil self.minAzimuthAbsoluteRad = nil self.maxAzimuthAbsoluteRad = nil self.useAzimuthLimits = nil self.curElevationRad = nil self.minElevationRad = nil self.maxElevationRad = nil self.curDistance = nil self.minDistance = nil self.maxDistance = nil self.gamepadDollySpeedMultiplier = 1 self.lastUserPanCamera = tick() self.externalProperties = {} self.externalProperties["InitialDistance"] = 25 self.externalProperties["MinDistance"] = 10 self.externalProperties["MaxDistance"] = 100 self.externalProperties["InitialElevation"] = 35 self.externalProperties["MinElevation"] = 35 self.externalProperties["MaxElevation"] = 35 self.externalProperties["ReferenceAzimuth"] = -45 -- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally self.externalProperties["CWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above self.externalProperties["CCWAzimuthTravel"] = 90 -- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above self.externalProperties["UseAzimuthLimits"] = false -- Full rotation around Y axis available by default self:LoadNumberValueParameters() return self end function OrbitalCamera:LoadOrCreateNumberValueParameter(name: string, valueType, updateFunction) local valueObj = script:FindFirstChild(name) if valueObj and valueObj:isA(valueType) then -- Value object exists and is the correct type, use its value self.externalProperties[name] = valueObj.Value elseif self.externalProperties[name] ~= nil then -- Create missing (or replace incorrectly-typed) valueObject with default value valueObj = Instance.new(valueType) valueObj.Name = name valueObj.Parent = script valueObj.Value = self.externalProperties[name] else return end if updateFunction then if self.changedSignalConnections[name] then self.changedSignalConnections[name]:Disconnect() end self.changedSignalConnections[name] = valueObj.Changed:Connect(function(newValue) self.externalProperties[name] = newValue updateFunction(self) end) end end function OrbitalCamera:SetAndBoundsCheckAzimuthValues() self.minAzimuthAbsoluteRad = math.rad(self.externalProperties["ReferenceAzimuth"]) - math.abs(math.rad(self.externalProperties["CWAzimuthTravel"])) self.maxAzimuthAbsoluteRad = math.rad(self.externalProperties["ReferenceAzimuth"]) + math.abs(math.rad(self.externalProperties["CCWAzimuthTravel"])) self.useAzimuthLimits = self.externalProperties["UseAzimuthLimits"] if self.useAzimuthLimits then self.curAzimuthRad = math.max(self.curAzimuthRad, self.minAzimuthAbsoluteRad) self.curAzimuthRad = math.min(self.curAzimuthRad, self.maxAzimuthAbsoluteRad) end end function OrbitalCamera:SetAndBoundsCheckElevationValues() -- These degree values are the direct user input values. It is deliberate that they are -- ranged checked only against the extremes, and not against each other. Any time one -- is changed, both of the internal values in radians are recalculated. This allows for -- A developer to change the values in any order and for the end results to be that the -- internal values adjust to match intent as best as possible. local minElevationDeg = math.max(self.externalProperties["MinElevation"], MIN_ALLOWED_ELEVATION_DEG) local maxElevationDeg = math.min(self.externalProperties["MaxElevation"], MAX_ALLOWED_ELEVATION_DEG) -- Set internal values in radians self.minElevationRad = math.rad(math.min(minElevationDeg, maxElevationDeg)) self.maxElevationRad = math.rad(math.max(minElevationDeg, maxElevationDeg)) self.curElevationRad = math.max(self.curElevationRad, self.minElevationRad) self.curElevationRad = math.min(self.curElevationRad, self.maxElevationRad) end function OrbitalCamera:SetAndBoundsCheckDistanceValues() self.minDistance = self.externalProperties["MinDistance"] self.maxDistance = self.externalProperties["MaxDistance"] self.curDistance = math.max(self.curDistance, self.minDistance) self.curDistance = math.min(self.curDistance, self.maxDistance) end
-- Change cooldown based on speed
humanoid:GetPropertyChangedSignal("WalkSpeed"):Connect(function() if humanoid.WalkSpeed <= 16 then cooldown = defaultcooldown else cooldown = defaultcooldown / 2 end end)
--Core Helicopter Parts--
local body = script.Parent.Body local myRoot = script.Parent.HumanoidRootPart local myHuman = script.Parent.Humanoid while myHuman:GetState() ~= Enum.HumanoidStateType.Physics do myHuman:ChangeState(Enum.HumanoidStateType.Physics) wait() end
--[[ << GAMEPASS PERMISSIONS >> Format: [GamepassId] = "PermissionName" OR PermissionNumber ; ]]
Asset_Permissions={ [0] = "Mod"; } ;
--[[Weight and CG]]
Tune.Weight = 1500 -- 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 = 100 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = 1 -- 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
--Rescripted by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") Debris = game:GetService("Debris") Speed = 50 Duration = 3.5 NozzleOffset = Vector3.new(0, 0.4, -1.1) Sounds = { Fire = Handle:WaitForChild("Fire"), Reload = Handle:WaitForChild("Reload"), HitFade = Handle:WaitForChild("HitFade") } PointLight = Handle:WaitForChild("PointLight") ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction")) ServerControl.Name = "ServerControl" ServerControl.Parent = Tool ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction")) ClientControl.Name = "ClientControl" ClientControl.Parent = Tool ServerControl.OnServerInvoke = (function(player, Mode, Value, arg) if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then return end if Mode == "Click" and Value then Activated(arg) end end) function InvokeClient(Mode, Value) pcall(function() ClientControl:InvokeClient(Player, Mode, Value) end) end function TagHumanoid(humanoid, player) local Creator_Tag = Instance.new("ObjectValue") Creator_Tag.Name = "creator" Creator_Tag.Value = player Debris:AddItem(Creator_Tag, 2) Creator_Tag.Parent = humanoid end function UntagHumanoid(humanoid) for i, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function FindCharacterAncestor(Parent) if Parent and Parent ~= game:GetService("Workspace") then local humanoid = Parent:FindFirstChild("Humanoid") if humanoid then return Parent, humanoid else return FindCharacterAncestor(Parent.Parent) end end return nil end function GetTransparentsRecursive(Parent, PartsTable) local PartsTable = (PartsTable or {}) for i, v in pairs(Parent:GetChildren()) do local TransparencyExists = false pcall(function() local Transparency = v["Transparency"] if Transparency then TransparencyExists = true end end) if TransparencyExists then table.insert(PartsTable, v) end GetTransparentsRecursive(v, PartsTable) end return PartsTable end function SelectionBoxify(Object) local SelectionBox = Instance.new("SelectionBox") SelectionBox.Adornee = Object SelectionBox.Color = BrickColor.new("Toothpaste") SelectionBox.Parent = Object return SelectionBox end local function Light(Object) local Light = PointLight:Clone() Light.Range = (Light.Range + 2) Light.Parent = Object end function FadeOutObjects(Objects, FadeIncrement) repeat local LastObject = nil for i, v in pairs(Objects) do v.Transparency = (v.Transparency + FadeIncrement) LastObject = v end wait() until LastObject.Transparency >= 1 or not LastObject end function Dematerialize(character, humanoid, FirstPart) if not character or not humanoid then return end humanoid.WalkSpeed = 0 local Parts = {} for i, v in pairs(character:GetChildren()) do if v:IsA("BasePart") then v.Anchored = true table.insert(Parts, v) elseif v:IsA("LocalScript") or v:IsA("Script") then v:Destroy() end end local SelectionBoxes = {} local FirstSelectionBox = SelectionBoxify(FirstPart) Light(FirstPart) wait(0.05) for i, v in pairs(Parts) do if v ~= FirstPart then table.insert(SelectionBoxes, SelectionBoxify(v)) Light(v) end end local ObjectsWithTransparency = GetTransparentsRecursive(character) FadeOutObjects(ObjectsWithTransparency, 0.1) wait(0.5) character:BreakJoints() humanoid.Health = 0 Debris:AddItem(character, 2) local FadeIncrement = 0.05 Delay(0.2, function() FadeOutObjects({FirstSelectionBox}, FadeIncrement) if character and character.Parent then character:Destroy() end end) FadeOutObjects(SelectionBoxes, FadeIncrement) end function Touched(Projectile, Hit) if not Hit or not Hit.Parent then return end local character, humanoid = FindCharacterAncestor(Hit) if character and humanoid and character ~= Character then local ForceFieldExists = false for i, v in pairs(character:GetChildren()) do if v:IsA("ForceField") then ForceFieldExists = true end end if not ForceFieldExists then if Projectile then local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name) local torso = humanoid.Torso if HitFadeSound and torso then HitFadeSound.Parent = torso HitFadeSound:Play() end end Dematerialize(character, humanoid, Hit) end if Projectile and Projectile.Parent then Projectile:Destroy() end end end function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") if not Player or not Humanoid or Humanoid.Health == 0 then return end end function Activated(target) if Tool.Enabled and Humanoid.Health > 0 then Tool.Enabled = false InvokeClient("PlaySound", Sounds.Fire) local HandleCFrame = Handle.CFrame local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset) local ShotCFrame = CFrame.new(FiringPoint, target) local LaserShotClone = BaseShot:Clone() LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2)) local BodyVelocity = Instance.new("BodyVelocity") BodyVelocity.velocity = ShotCFrame.lookVector * Speed BodyVelocity.Parent = LaserShotClone LaserShotClone.Touched:connect(function(Hit) if not Hit or not Hit.Parent then return end Touched(LaserShotClone, Hit) end) Debris:AddItem(LaserShotClone, Duration) LaserShotClone.Parent = game:GetService("Workspace") wait(1) -- FireSound length InvokeClient("PlaySound", Sounds.Reload) wait(1.25) -- ReloadSound length Tool.Enabled = true end end function Unequipped() end BaseShot = Instance.new("Part") BaseShot.Name = "Effect" BaseShot.BrickColor = BrickColor.new("Toothpaste") BaseShot.Material = Enum.Material.Plastic BaseShot.Shape = Enum.PartType.Block BaseShot.TopSurface = Enum.SurfaceType.Smooth BaseShot.BottomSurface = Enum.SurfaceType.Smooth BaseShot.FormFactor = Enum.FormFactor.Custom BaseShot.Size = Vector3.new(0.2, 0.2, 3) BaseShot.CanCollide = false BaseShot.Locked = true SelectionBoxify(BaseShot) Light(BaseShot) BaseShotSound = Sounds.HitFade:Clone() BaseShotSound.Parent = BaseShot Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
--DO NOT DELETE, THIS WILL BREAK THE GUN
function Stick(x, y) local W = Instance.new("Weld") W.Part0 = x W.Part1 = y local CJ = CFrame.new(x.Position) local C0 = x.CFrame:inverse()*CJ local C1 = y.CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = x end function Get(A) if A.ClassName == ("Part") then Stick(script.Parent.Handle, A) --A.Anchored = false else local C = A:GetChildren() for i=1, #C do Get(C[i]) end end end function Finale() Get(script.Parent) end script.Parent.Equipped:connect(Finale) script.Parent.Unequipped:connect(Finale) Finale()
--[[ By AxisAngle, (Trey Reynolds) Documentation http://www.roblox.com/item.aspx?id=227509468 Region constructors: Region Region.new(CFrame RegionCFrame, Vector3 RegionSize) >Returns a new Region object Region Region.FromPart(Instance Part) >Returns a new Region objects Region methods: table Region:Cast([Instance or table Ignore]) >Returns all parts in the Region, ignoring the Ignore bool Region:CastPart(Instance Part) >Returns true if Part is within Region, false otherwise table Region:CastParts(table Parts) >Returns a table of all parts within the region bool Region:CastPoint(Vector3 Point) >Returns true if Point intersects Region, false otherwise bool Region:CastSphere(Vector3 SphereCenter, number SphereRadius) >Returns true if Sphere intersects Region, false otherwise bool Region:CastBox(CFrame BoxCFrame, Vector3 BoxSize) >Returns true if Box intersects Region, false otherwise Region properties: (Regions are mutable) CFrame CFrame Vector3 Size Region3 Region3 Region functions: Region3 Region.Region3BoundingBox(CFrame BoxCFrame, Vector3 BoxSize) >Returns the enclosing boundingbox of Box table Region.FindAllPartsInRegion3(Region3 Region3, [Instance or table Ignore]) >Returns all parts within a Region3 of any size bool Region.BoxPointCollision(CFrame BoxCFrame, Vector3 BoxSize, Vector3 Point) >Returns true if the Point is intersecting the Box, false otherwise bool Region.BoxSphereCollision(CFrame BoxCFrame, Vector3 BoxSize, Vector3 SphereCenter, number SphereRadius) >Returns true if the Sphere is intersecting the Box, false otherwise bool Region.BoxCollision(CFrame Box0CFrame, Vector3 Box0Size, CFrame Box1CFrame, Vector3 Box1Size, [bool AssumeTrue]) >Returns true if the boxes are intersecting, false otherwise If AssumeTrue is left blank, it does the full check to see if Box0 is intersecting Box1 If AssumeTrue is true, it skips the heavy check and assumes that any part that could possibly be in the Region is If AssumeTrue is false, it skips the heavy check and assumes that any part that could possible be outside the Region is bool Region.CastPoint(Vector3 Point, [Instance or table Ignore]) >Returns true if the point intersects a part, false otherwise ]]
local Region={} local BoxPointCollision do local VecDiv=CFrame.new().pointToObjectSpace--Right Division, yo. function BoxPointCollision(CFrame,Size,Point) local Relative =VecDiv(CFrame, Point) local sx,sy,sz =Size.x/2,Size.y/2,Size.z/2 local rx,ry,rz =Relative.x,Relative.y,Relative.z return rx*rx<sx*sx and ry*ry<sy*sy and rz*rz<sz*sz end end local BoxSphereCollision do local VecDiv=CFrame.new().pointToObjectSpace--Right Division, yo. function BoxSphereCollision(CFrame,Size,Center,Radius) local Relative =VecDiv(CFrame,Center) local sx,sy,sz =Size.x/2,Size.y/2,Size.z/2 local rx,ry,rz =Relative.x,Relative.y,Relative.z local dx =rx>sx and rx-sx--Faster than if statement or rx<-sx and rx+sx or 0 local dy =ry>sy and ry-sy or ry<-sy and ry+sy or 0 local dz =rz>sz and rz-sz or rz<-sz and rz+sz or 0 return dx*dx+dy*dy+dz*dz<Radius*Radius end end
-- Remote Functions Client -> Server
-- Getters RF_getPlayerData.OnServerInvoke = function(player) local cahced = database.GetCachedProfile(player.UserId) return cahced end RF_vehicleSpawnRequest.OnServerInvoke = function(player) return vehicles.SpawnPlayerVehicle(player, 1) end RF_vehicleRemoveRequest.OnServerInvoke = function(player) return vehicles.RemovePlayerVehicle(player) end RF_redeemCode.OnServerInvoke = function(player, code) return twitter.RedeemCode(player, code) end -- Weapons RF_GetUnlockedWeapons.OnServerInvoke = function(player) return weapons.GetUnlockedWeapons(player) end RF_GetWeaponInfo.OnServerInvoke = function(player, weaponID) return weapons.GetWeaponInfo(player, weaponID) end RF_GetEquipedWeapon.OnServerInvoke = function(player) return weapons.GetEquipedWeapon(player) end RF_EquipWeapon.OnServerInvoke = function(player,weaponID) return weapons.EquipWeapon(player, weaponID) end RF_UnEquipWeapon.OnServerInvoke = function(player) return weapons.UnEquipWeapon(player) end RF_BuyWeapon.OnServerInvoke = function(player, weaponID) return weapons.BuyWeapon(player, weaponID) end -- Bullet RF_DamageVehicle.OnServerInvoke = function(player, bullet, hitVehicle) return damageReplicator.ApplyDamageToVehicle(bullet,hitVehicle) end