prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) return plrData.Character.Purity.Value >= 50 end
--------RIGHT DOOR --------
game.Workspace.doorright.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
-----------------------------------------------------------------------------------------------
function CheckWhitelist(v) for i = 1, #Whitelist do if v == Whitelist[i] then return true end end return false end Door.Touched:Connect(function(hit) if game.Players:GetPlayerFromCharacter(hit.Parent) then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if Gamepass <= 0 then return nil end if MS:UserOwnsGamePassAsync(plr.UserId, Gamepass) or CheckWhitelist(plr.UserId) then Door.CanCollide, Door.Transparency = false, OpenTrans wait(OpenTime) Door.CanCollide, Door.Transparency = true, CloseTrans else Door.CanCollide, Door.Transparency = true, CloseTrans if BuyGUI == true then MS:PromptGamePassPurchase(plr, Gamepass) end if KillOnTouch == true then plr.Character.Humanoid.Health = 0 end end end end)
--Variables
local SeatInteractionCount = {} local VehicleSeating = {} local function Raycast(startPos, direction, range, ignore, inceptNumber) if inceptNumber == nil then inceptNumber = 0 end inceptNumber = inceptNumber + 1 local ray = Ray.new(startPos, direction * range) local part, position = Workspace:FindPartOnRayWithIgnoreList(ray, ignore) if part then if part.CanCollide == false and inceptNumber <= 5 then --raycast again if we hit a cancollide false brick, put a limit on to prevent an infinite loop local rangeLeft = range - (startPos - position).magnitude part, position = Raycast(position, direction, rangeLeft, ignore, inceptNumber) --Raycast remaining distance. end end return part, position end local function ExitSeat(player, character, seat, weld) local hrp = character:FindFirstChild("HumanoidRootPart") if hrp then weld:Destroy() if seat:FindFirstChild("DoorHinge") then seat.DoorLatchWeld.Enabled = false seat.DoorHinge.TargetAngle = DOOR_OPEN_ANGLE end --Record the interaction SeatInteractionCount[seat] = SeatInteractionCount[seat] and SeatInteractionCount[seat] + 1 or 1 wait() if seat:FindFirstChild("ExitPosition") then --Check if we can move the character to the designated pos. --Find vehicle model local model local newParent = seat repeat model = newParent newParent = model.Parent until newParent.ClassName ~= "Model" local targetPos = seat.ExitPosition.WorldPosition local delta = targetPos - seat.Position local dist = delta.magnitude local dir = delta.unit local part, _ = Raycast(seat.Position, dir, dist, {character, model}) if not part then --Prevent people being CFramed into walls and stuff hrp.CFrame = CFrame.new(targetPos) else hrp.CFrame = CFrame.new(seat.Position) --The CFrame element orients the character up-right, the MoveTo stops the character from clipping into objects character:MoveTo(seat.Position+Vector3.new(0,8,0)) end else hrp.CFrame = CFrame.new(seat.Position) character:MoveTo(seat.Position+Vector3.new(0,8,0)) end RemotesFolder.ExitSeat:FireClient(player, true) --Fire this to trigger the client-side anti-trip function wait(DOOR_OPEN_TIME) SeatInteractionCount[seat] = SeatInteractionCount[seat] > 1 and SeatInteractionCount[seat] - 1 or nil if seat:FindFirstChild("DoorHinge") then --If nobody else has interactied in this time, close the door. if SeatInteractionCount[seat] == nil then seat.DoorHinge.TargetAngle = 0 -- Weld door shut when closed while math.abs(seat.DoorHinge.CurrentAngle) > 0.01 do wait() end seat.DoorLatchWeld.Enabled = true end end end end local function FlipSeat(Player, Seat) if Seat then if Seat.Parent then if not Seat.Parent.Parent:FindFirstChild("Scripts") then warn("Flip Error: Scripts file not found. Please parent seats to the chassis model") return end if not Seat.Parent.Parent.Scripts:FindFirstChild("Chassis") then warn("Flip Error: Chassis module not found.") return end local Chassis = require(Seat.Parent.Parent.Scripts.Chassis) Chassis.Redress() end end end function VehicleSeating.SetRemotesFolder(remotes) RemotesFolder = remotes RemotesFolder:FindFirstChild("GetSeatTag").OnServerInvoke = function(player) return SeatTag end --Detect exit seat requests RemotesFolder:FindFirstChild("ExitSeat").OnServerEvent:Connect(function(player) if player.Character then local character = player.Character if player.Character:FindFirstChild("HumanoidRootPart") then for _, weld in pairs(character.HumanoidRootPart:GetJoints()) do if weld.Name == "SeatWeld" then ExitSeat(player, character, weld.Part0, weld) break end end end end end) RemotesFolder:FindFirstChild("FlipSeat").OnServerEvent:Connect(FlipSeat) --When a player holds down the interaction button, open the vehicle door. --This only serves a purpose if there are doors to open/close RemotesFolder:FindFirstChild("GetInStart").OnServerEvent:Connect(function(player, seat) if seat:FindFirstChild("DoorHinge") then if seat.DoorHinge.ClassName ~= "HingeConstraint" then warn("Warning, door hinge is not actually a hinge!") end --Record that a player is trying to get in the seat SeatInteractionCount[seat] = SeatInteractionCount[seat] and SeatInteractionCount[seat] + 1 or 1 --Activate the hinge seat.DoorLatchWeld.Enabled = false seat.DoorHinge.TargetAngle = DOOR_OPEN_ANGLE seat.DoorHinge.AngularSpeed = DOOR_OPEN_SPEED wait(DOOR_OPEN_TIME) --Check if anyone has interacted with the door within this time. If not, close it. SeatInteractionCount[seat] = SeatInteractionCount[seat] > 1 and SeatInteractionCount[seat] - 1 or nil if SeatInteractionCount[seat] == nil then seat.DoorHinge.TargetAngle = 0 -- Weld door shut when closed while math.abs(seat.DoorHinge.CurrentAngle) > 0.01 do wait() end seat.DoorLatchWeld.Enabled = true end end end) --Actually put the character in the seat when requested. RemotesFolder.GetInSeat.OnServerEvent:Connect(function(Player, Seat) if Seat then if not Seat:FindFirstChild("SeatWeld") then if Player.Character ~= nil then local HRP = Player.Character:FindFirstChild("HumanoidRootPart") local humanoid = Player.Character:FindFirstChild("Humanoid") if HRP then local Dist = (HRP.Position - Seat.Position).magnitude if Dist <= MAX_SEATING_DISTANCE then Seat:Sit(humanoid) end end end end end end) end function VehicleSeating.AddSeat(seat, enterCallback, exitCallback) CollectionService:AddTag(seat, SeatTag) local occupantPlayer = nil local occupantChangedConn = seat:GetPropertyChangedSignal("Occupant"):Connect(function() if seat.Occupant then local char = seat.Occupant.Parent occupantPlayer = Players:GetPlayerFromCharacter(char) if occupantPlayer and enterCallback then enterCallback(occupantPlayer, seat) end elseif occupantPlayer and exitCallback then exitCallback(occupantPlayer, seat) occupantPlayer = nil end end) --Clean up after the seat is destroyed seat.AncestryChanged:connect(function() if not seat:IsDescendantOf(game) then occupantChangedConn:Disconnect() end end) end return VehicleSeating
--[[ReadMe* Please improve upon this script as needed, I'm a noob scripter and I only script through ways I know that work. This loop works, so I'm happy with it. But please, edit as you may. This model uses MeshParts to animate the flag. The previous frame turns transparent while the next frame becomes visible. If you would like to use your own custom flag, for your ROBLOX group or country, select all the children in the "Flag" model and paste in a ROBLOX decal asset in the "TextureID" slot. If you receive an error, try subtracting 1 from the decal id. http://www.roblox.com/asset/?id={decal id} rbxassetid://{decal id} Any ROBLOX decal in the Developers Library will work, or you may upload your own flag decal to insert in. Rectangular decals are recommended for this flag. *If you use a decal with a transparent background in the MeshPart's TextureID, the transparent background will default to black. Instead, insert the actual decal into every MeshPart in "Flag." This will allow you to change the BrickColor of the flag with the decal on top. The flags have been UV mapped to flip the flag design on the other side. e.g. You won't see the blue box of the United States flag on the other side of the flag on its end, but close to the pole for both sides. Thank you and have a wonderful day. (MeshParts rendered using Blender) --]]
sp=script.Parent flag=sp.Flag reset=function() for _,meshpart in pairs (flag:GetChildren()) do if meshpart:IsA("MeshPart") then meshpart.Transparency=1 end end end waittime=0.0,0 --Time between each "Frame" while true do wait(waittime) reset() flag["2"].Transparency=0 wait(waittime) reset() flag["3"].Transparency=0 wait(waittime) reset() flag["4"].Transparency=0 wait(waittime) reset() flag["5"].Transparency=0 wait(waittime) reset() flag["6"].Transparency=0 wait(waittime) reset() flag["7"].Transparency=0 wait(waittime) reset() flag["8"].Transparency=0 wait(waittime) reset() flag["9"].Transparency=0 wait(waittime) reset() flag["10"].Transparency=0 wait(waittime) reset() flag["11"].Transparency=0 wait(waittime) reset() flag["12"].Transparency=0 wait(waittime) reset() flag["13"].Transparency=0 wait(waittime) reset() flag["14"].Transparency=0 wait(waittime) reset() flag["15"].Transparency=0 wait(waittime) reset() flag["16"].Transparency=0 wait(waittime) reset() flag["1"].Transparency=0 end
-- Want to turn off Invisicam? Be sure to call this after.
function Invisicam:Cleanup() for hit, originalFade in pairs(self.savedHits) do hit.LocalTransparencyModifier = originalFade end end function Invisicam:Update(dt: number, desiredCameraCFrame: CFrame, desiredCameraFocus: CFrame): (CFrame, CFrame) -- Bail if there is no Character if not self.enabled or not self.char then return desiredCameraCFrame, desiredCameraFocus end self.camera = game.Workspace.CurrentCamera -- TODO: Move this to a GetHumanoidRootPart helper, probably combine with CheckTorsoReference -- Make sure we still have a HumanoidRootPart if not self.humanoidRootPart then local humanoid = self.char:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.RootPart then self.humanoidRootPart = humanoid.RootPart else -- Not set up with Humanoid? Try and see if there's one in the Character at all: self.humanoidRootPart = self.char:FindFirstChild("HumanoidRootPart") if not self.humanoidRootPart then -- Bail out, since we're relying on HumanoidRootPart existing return desiredCameraCFrame, desiredCameraFocus end end -- TODO: Replace this with something more sensible local ancestryChangedConn ancestryChangedConn = self.humanoidRootPart.AncestryChanged:Connect(function(child, parent) if child == self.humanoidRootPart and not parent then self.humanoidRootPart = nil if ancestryChangedConn and ancestryChangedConn.Connected then ancestryChangedConn:Disconnect() ancestryChangedConn = nil end end end) end if not self.torsoPart then self:CheckTorsoReference() if not self.torsoPart then -- Bail out, since we're relying on Torso existing, should never happen since we fall back to using HumanoidRootPart as torso return desiredCameraCFrame, desiredCameraFocus end end -- Make a list of world points to raycast to local castPoints = {} self.behaviorFunction(self, castPoints) -- Cast to get a list of objects between the camera and the cast points local currentHits = {} local ignoreList = {self.char} local function add(hit) currentHits[hit] = true if not self.savedHits[hit] then self.savedHits[hit] = hit.LocalTransparencyModifier end end local hitParts local hitPartCount = 0 -- Hash table to treat head-ray-hit parts differently than the rest of the hit parts hit by other rays -- head/torso ray hit parts will be more transparent than peripheral parts when USE_STACKING_TRANSPARENCY is enabled local headTorsoRayHitParts = {} local perPartTransparencyHeadTorsoHits = TARGET_TRANSPARENCY local perPartTransparencyOtherHits = TARGET_TRANSPARENCY if USE_STACKING_TRANSPARENCY then -- This first call uses head and torso rays to find out how many parts are stacked up -- for the purpose of calculating required per-part transparency local headPoint = self.headPart and self.headPart.CFrame.p or castPoints[1] local torsoPoint = self.torsoPart and self.torsoPart.CFrame.p or castPoints[2] hitParts = self.camera:GetPartsObscuringTarget({headPoint, torsoPoint}, ignoreList) -- Count how many things the sample rays passed through, including decals. This should only -- count decals facing the camera, but GetPartsObscuringTarget does not return surface normals, -- so my compromise for now is to just let any decal increase the part count by 1. Only one -- decal per part will be considered. for i = 1, #hitParts do local hitPart = hitParts[i] hitPartCount = hitPartCount + 1 -- count the part itself headTorsoRayHitParts[hitPart] = true for _, child in pairs(hitPart:GetChildren()) do if child:IsA('Decal') or child:IsA('Texture') then hitPartCount = hitPartCount + 1 -- count first decal hit, then break break end end end if (hitPartCount > 0) then perPartTransparencyHeadTorsoHits = math.pow( ((0.5 * TARGET_TRANSPARENCY) + (0.5 * TARGET_TRANSPARENCY / hitPartCount)), 1 / hitPartCount ) perPartTransparencyOtherHits = math.pow( ((0.5 * TARGET_TRANSPARENCY_PERIPHERAL) + (0.5 * TARGET_TRANSPARENCY_PERIPHERAL / hitPartCount)), 1 / hitPartCount ) end end -- Now get all the parts hit by all the rays hitParts = self.camera:GetPartsObscuringTarget(castPoints, ignoreList) local partTargetTransparency = {} -- Include decals and textures for i = 1, #hitParts do local hitPart = hitParts[i] partTargetTransparency[hitPart] =headTorsoRayHitParts[hitPart] and perPartTransparencyHeadTorsoHits or perPartTransparencyOtherHits -- If the part is not already as transparent or more transparent than what invisicam requires, add it to the list of -- parts to be modified by invisicam if hitPart.Transparency < partTargetTransparency[hitPart] then add(hitPart) end -- Check all decals and textures on the part for _, child in pairs(hitPart:GetChildren()) do if child:IsA('Decal') or child:IsA('Texture') then if (child.Transparency < partTargetTransparency[hitPart]) then partTargetTransparency[child] = partTargetTransparency[hitPart] add(child) end end end end -- Invisibilize objects that are in the way, restore those that aren't anymore for hitPart, originalLTM in pairs(self.savedHits) do if currentHits[hitPart] then -- LocalTransparencyModifier gets whatever value is required to print the part's total transparency to equal perPartTransparency hitPart.LocalTransparencyModifier = (hitPart.Transparency < 1) and ((partTargetTransparency[hitPart] - hitPart.Transparency) / (1.0 - hitPart.Transparency)) or 0 else -- Restore original pre-invisicam value of LTM hitPart.LocalTransparencyModifier = originalLTM self.savedHits[hitPart] = nil end end -- Invisicam does not change the camera values return desiredCameraCFrame, desiredCameraFocus end return Invisicam
--//Setup//--
local SongsHolder = script.Parent local Songs = SongsHolder.Songs:GetChildren() local CurrentSong = SongsHolder.CurrentSong local Boombox = SongsHolder.Boombox local SongNameGui = Boombox.SongNameGui local NameText = SongNameGui.NameText
-- May return NaN or inf or -inf
local function findAngleBetweenXZVectors(vec2, vec1) -- This is a way of finding the angle between the two vectors: return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z) end local function CreateFollowCamera() local module = RootCameraCreator() local tweenAcceleration = math.rad(220) local tweenSpeed = math.rad(0) local tweenMaxSpeed = math.rad(250) local timeBeforeAutoRotate = 2 local lastUpdate = tick() module.LastUserPanCamera = tick() function module:Update() local now = tick() local timeDelta = (now - lastUpdate) local userPanningTheCamera = (self.UserPanningTheCamera == true) local camera = workspace.CurrentCamera local player = PlayersService.LocalPlayer local humanoid = self:GetHumanoid() local cameraSubject = camera and camera.CameraSubject local isClimbing = humanoid and humanoid:GetState() == Enum.HumanoidStateType.Climbing local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat') local isOnASkateboard = cameraSubject and cameraSubject:IsA('SkateboardPlatform') if lastUpdate == nil or now - lastUpdate > 1 then module:ResetCameraLook() self.LastCameraTransform = nil end if lastUpdate then if self:ShouldUseVRRotation() then self.RotateInput = self.RotateInput + self:GetVRRotationInput() else -- Cap out the delta to 0.1 so we don't get some crazy things when we re-resume from local delta = math.min(0.1, now - lastUpdate) local angle = 0 -- NOTE: Traditional follow camera does not rotate with arrow keys if not (isInVehicle or isOnASkateboard) then angle = angle + (self.TurningLeft and -120 or 0) angle = angle + (self.TurningRight and 120 or 0) end local gamepadRotation = self:UpdateGamepad() if gamepadRotation ~= Vector2.new(0,0) then userPanningTheCamera = true self.RotateInput = self.RotateInput + (gamepadRotation * delta) end if angle ~= 0 then userPanningTheCamera = true self.RotateInput = self.RotateInput + Vector2.new(math.rad(angle * delta), 0) end end end -- Reset tween speed if user is panning if userPanningTheCamera then tweenSpeed = 0 module.LastUserPanCamera = tick() end local userRecentlyPannedCamera = now - module.LastUserPanCamera < timeBeforeAutoRotate local subjectPosition = self:GetSubjectPosition() if subjectPosition and player and camera then local zoom = self:GetCameraZoom() if zoom < 0.5 then zoom = 0.5 end if self:GetShiftLock() and not self:IsInFirstPerson() then local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput) local offset = ((newLookVector * XZ_VECTOR):Cross(UP_VECTOR).unit * 1.75) if IsFiniteVector3(offset) then subjectPosition = subjectPosition + offset end else if self.LastCameraTransform and not userPanningTheCamera then local isInFirstPerson = self:IsInFirstPerson() if (isClimbing or isInVehicle or isOnASkateboard) and lastUpdate and humanoid and humanoid.Torso then if isInFirstPerson then if self.LastSubjectCFrame and (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then local y = -findAngleBetweenXZVectors(self.LastSubjectCFrame.lookVector, cameraSubject.CFrame.lookVector) if IsFinite(y) then self.RotateInput = self.RotateInput + Vector2.new(y, 0) end tweenSpeed = 0 end elseif not userRecentlyPannedCamera then local forwardVector = humanoid.Torso.CFrame.lookVector if isOnASkateboard then forwardVector = cameraSubject.CFrame.lookVector end tweenSpeed = clamp(0, tweenMaxSpeed, tweenSpeed + tweenAcceleration * timeDelta) local percent = clamp(0, 1, tweenSpeed * timeDelta) if not isClimbing and self:IsInFirstPerson() then percent = 1 end local y = findAngleBetweenXZVectors(forwardVector, self:GetCameraLook()) -- Check for NaN if IsFinite(y) and math.abs(y) > 0.0001 then self.RotateInput = self.RotateInput + Vector2.new(y * percent, 0) end end elseif not (isInFirstPerson or userRecentlyPannedCamera) and (HasVRAPI and not UserInputService.VREnabled) then local lastVec = -(self.LastCameraTransform.p - subjectPosition) local y = findAngleBetweenXZVectors(lastVec, self:GetCameraLook()) -- Check for NaNs if IsFinite(y) and math.abs(y) > 0.0001 then self.RotateInput = self.RotateInput + Vector2.new(y, 0) end end end end local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput) self.RotateInput = Vector2.new() camera.Focus = UserInputService.VREnabled and self:GetVRFocus(subjectPosition, timeDelta) or CFrame.new(subjectPosition) camera.CoordinateFrame = CFrame.new(camera.Focus.p - (zoom * newLookVector), camera.Focus.p) + Vector3.new(0, self:GetCameraHeight(), 0) self.LastCameraTransform = camera.CoordinateFrame self.LastCameraFocus = camera.Focus if isInVehicle or isOnASkateboard and cameraSubject:IsA('BasePart') then self.LastSubjectCFrame = cameraSubject.CFrame else self.LastSubjectCFrame = nil end end lastUpdate = now end return module end return CreateFollowCamera
--properties
local flicker = script.Parent.Base.PointLight flicker.Brightness = 1.78 while true do flicker.Brightness = 1.87 wait (0.01) flicker.Brightness = 1.76 wait (0.01) flicker.Brightness = 1.65 wait (0.01) flicker.Brightness = 1.54 wait (0.01) flicker.Brightness = 1.43 wait (0.01) flicker.Brightness = 1.32 wait (0.01) flicker.Brightness = 1.21 wait (0.01) flicker.Brightness = 1.10 wait (0.01) flicker.Brightness = 0.99 wait (0.02) flicker.Brightness = 0.90 wait(0.01) flicker.Brightness = 1.10 wait (0.02) flicker.Brightness = 1.15 wait (0.3) flicker.Brightness = 1.30 end
-- Get services
local players = game:GetService("Players")
-- ALEX WAS HERE LOL
local v1 = {}; local u1 = nil; coroutine.wrap(function() u1 = require(game.ReplicatedStorage:WaitForChild("Resources")); end)(); function v1.Reward(p1) local v2 = u1.Saving.Get(p1); if not v2 then return; end; local v3 = u1.Directory.Ranks[v2.Rank]; if #v3.rewards == 0 or os.time() - v2.RankTimer < v3.rewardCooldown then return; end; v2.RankTimer = os.time(); for v8, v9 in ipairs(v3.rewards) do local v7 = nil; local v10 = nil; v10, v7 = unpack(v9); if v10 == "Triple Coins Boost" then u1.Boosts.Give(p1, "Triple Coins", v7); elseif v10 == "Super Lucky Boost" then u1.Boosts.Give(p1, "Super Lucky", v7); elseif v10 == "Ultra Lucky Boost" then u1.Boosts.Give(p1, "Ultra Lucky", v7); elseif v10 == "Triple Damage Boost" then u1.Boosts.Give(p1, "Triple Damage", v7); else u1.Give.Currency(p1, v7, v10, false); end; end; coroutine.wrap(function() u1.Network.Fire("Rewards Redeemed", p1, v3.rewards); end)(); return true; end; function v1.Give(p2, p3) local v11 = u1.Saving.Get(p2); if not v11 then return; end; if v11.Rank ~= p3 then v11.Rank = p3; v11.RankProgress = 0; v11.RankTimer = 0; coroutine.wrap(function() u1.Network.FireAll("Rank Changed", p2, p3); u1.Signal.Fire("Rank Changed", p2, p3) end)(); v1.Reward(p2); end; end;
-- Close win dialog
local function closeDlg(input) local mouse = Enum.UserInputType.MouseButton1 local touch = Enum.UserInputType.Touch if input.UserInputType == mouse or input.UserInputType == touch then dlg.Visible = false end end
--{{ Important Values }}--
local playerStats = game.Players.LocalPlayer:WaitForChild("Drift Points") local change = script.Parent
-- Decompiled with the Synapse X Luau decompiler.
local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer; game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false); local l__hotbarTemplate__2 = game:GetService("ReplicatedStorage").hotbarTemplate; local l__TweenService__3 = game:GetService("TweenService"); local u1 = l__LocalPlayer__1.Character or l__LocalPlayer__1.CharacterAdded:Wait(); function getToolAmt() local v4 = 0; local v5, v6, v7 = pairs(u1:GetChildren()); while true do local v8, v9 = v5(v6, v7); if v8 then else break; end; v7 = v8; if v9:IsA("Tool") then v4 = v4 + 1; end; end; local v10, v11, v12 = pairs(l__LocalPlayer__1.Backpack:GetChildren()); while true do local v13, v14 = v10(v11, v12); if v13 then else break; end; v12 = v13; if v14:IsA("Tool") then v4 = v4 + 1; end; end; return v4; end; local u2 = { [Enum.KeyCode.One] = Enum.KeyCode.One, [Enum.KeyCode.Two] = Enum.KeyCode.Two, [Enum.KeyCode.Three] = Enum.KeyCode.Three, [Enum.KeyCode.Four] = Enum.KeyCode.Four, [Enum.KeyCode.Five] = Enum.KeyCode.Five, [Enum.KeyCode.Six] = Enum.KeyCode.Six, [Enum.KeyCode.Seven] = Enum.KeyCode.Seven, [Enum.KeyCode.Eight] = Enum.KeyCode.Eight, [Enum.KeyCode.Nine] = Enum.KeyCode.Nine, [Enum.KeyCode.Zero] = Enum.KeyCode.Zero }; local l__Hotbar__3 = l__LocalPlayer__1.PlayerGui.MainUI.Hotbar; if not l__Hotbar__3 then local hotbar = script.Hotbar:Clone() hotbar = l__LocalPlayer__1.PlayerGui.MainUI l__Hotbar__3 = hotbar end local u4 = { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Zero" }; game:GetService("UserInputService").InputBegan:Connect(function(p1, p2) if p2 then return; end; if u2[p1.KeyCode] then for v15, v16 in pairs(l__Hotbar__3:GetChildren()) do if v16:IsA("TextButton") and p1.KeyCode == Enum.KeyCode[u4[tonumber(v16.SlotNum.Text)]] then script.Parent.EquipTool:FireServer(l__LocalPlayer__1.Backpack:FindFirstChild(v16.Name) or game.Players.LocalPlayer.Character:FindFirstChild(v16.Name)); end; end; end; end); function addToolToHotbar(p3) local v17 = l__hotbarTemplate__2:Clone(); v17.Name = p3.Name; v17.Parent = l__Hotbar__3; v17.Tool.Image = p3.TextureId or "rbxassetid://0"; v17.SlotNum.Text = tostring(getToolAmt()); v17.MouseButton1Click:Connect(function() script.Parent.EquipTool:FireServer(l__LocalPlayer__1.Backpack:FindFirstChild(p3.Name) or game.Players.LocalPlayer.Character:FindFirstChild(p3.Name)); end); l__Hotbar__3.Size = l__Hotbar__3.Size + UDim2.new(0.25, 0, 0, 0); end; for v18, v19 in pairs(l__LocalPlayer__1.Backpack:GetChildren()) do if v19:IsA("Tool") then if not l__Hotbar__3:FindFirstChild(v19.Name) then addToolToHotbar(v19); else local v20 = 0; local v21 = {}; for v22, v23 in pairs(l__LocalPlayer__1.Backpack:GetChildren()) do if v23.Name == v19.Name then v20 = v20 + 1; table.insert(v21, v23); end; end; for v24, v25 in pairs(game:GetService("ReplicatedStorage").PlayerStorage:GetChildren()) do if v25.Name == v19.Name then v20 = v20 + 1; end; end; if v20 > 1 then l__Hotbar__3[v19.Name].DurabilityNumber.Visible = true; l__Hotbar__3[v19.Name].DurabilityNumber.Text = "x" .. tostring(v20); wait(0); v21[1].Parent = game:GetService("ReplicatedStorage").PlayerStorage; else l__Hotbar__3[v19.Name].UIStroke.Transparency = 0.7; l__TweenService__3:Create(l__Hotbar__3[v19.Name], TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Size = UDim2.new(0.8, 0, 0.8, 0) }):Play(); end; end; end; end; l__LocalPlayer__1.Backpack.ChildAdded:Connect(function(p4) if p4:IsA("Tool") then if not l__Hotbar__3:FindFirstChild(p4.Name) then addToolToHotbar(p4); return; end; local v26 = 0; local v27 = {}; for v28, v29 in pairs(l__LocalPlayer__1.Backpack:GetChildren()) do if v29.Name == p4.Name then v26 = v26 + 1; table.insert(v27, v29); end; end; for v30, v31 in pairs(game:GetService("ReplicatedStorage").PlayerStorage:GetChildren()) do if v31.Name == p4.Name then v26 = v26 + 1; end; end; if v26 > 1 then l__Hotbar__3[p4.Name].DurabilityNumber.Visible = true; l__Hotbar__3[p4.Name].DurabilityNumber.Text = "x" .. tostring(v26); wait(0); v27[1].Parent = game:GetService("ReplicatedStorage").PlayerStorage; return; else l__Hotbar__3[p4.Name].UIStroke.Transparency = 0.7; l__TweenService__3:Create(l__Hotbar__3[p4.Name], TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Size = UDim2.new(0.8, 0, 0.8, 0) }):Play(); end; end; end); l__LocalPlayer__1.Character.ChildAdded:Connect(function(p5) if p5:IsA("Tool") then if not l__Hotbar__3:FindFirstChild(p5.Name) then addToolToHotbar(p5); end; local v32 = l__Hotbar__3[p5.Name]; v32.UIStroke.Transparency = 0; l__TweenService__3:Create(v32, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Size = UDim2.new(1, 0, 1, 0) }):Play(); end; end); l__LocalPlayer__1.Character.ChildRemoved:Connect(function(p6) if p6:IsA("Tool") and p6.Parent ~= l__LocalPlayer__1.Backpack and p6.Parent ~= game:GetService("ReplicatedStorage").PlayerStorage and l__Hotbar__3:FindFirstChild(p6.Name) then local v33 = tonumber(string.sub(l__Hotbar__3[p6.Name].DurabilityNumber.Text, 2, 2)); if l__Hotbar__3[p6.Name].DurabilityNumber.Visible and v33 > 1 then l__Hotbar__3[p6.Name].DurabilityNumber.Text = "x" .. tostring(v33 - 1); if l__Hotbar__3[p6.Name].DurabilityNumber.Text == "x1" then l__Hotbar__3[p6.Name].DurabilityNumber.Visible = false; end; game:GetService("ReplicatedStorage").PlayerStorage:FindFirstChild(p6.Name).Parent = l__LocalPlayer__1.Character; return; end; l__Hotbar__3[p6.Name]:Destroy(); l__Hotbar__3.Size = l__Hotbar__3.Size - UDim2.new(0.25, 0, 0, 0); local v34 = 1; for v35, v36 in pairs(l__Hotbar__3:GetChildren()) do if v36:IsA("TextButton") then v36.SlotNum.Text = tostring(v34); v34 = v34 + 1; end; end; end; end);
--Made by Luckymaxer
Tool = script.Parent Handle = Tool:WaitForChild("Handle") Players = game:GetService("Players") RunService = game:GetService("RunService") Camera = game:GetService("Workspace").CurrentCamera Animations = {} LocalObjects = {} Controls = { Forward = { Value = 0, DesiredValue = -1, Keys = {Key = "w", ByteKey = 17}, }, Backward = { Value = 0, DesiredValue = 1, Keys = {Key = "s", ByteKey = 18}, }, Left = { Value = 0, DesiredValue = -1, Keys = {Key = "a", ByteKey = 20}, }, Right = { Value = 0, DesiredValue = 1, Keys = {Key = "d", ByteKey = 19}, } } Speed = { Current = 2, Max = 50 } Inertia = (1 - (Speed.Current / Speed.Max)) Momentum = Vector3.new(0, 0, 0) LastMomentum = Vector3.new(0, 0, 0) TotalMomentum = 0 LastFlap = 0 LastTilt = 0 Rate = (1 / 60) Flying = false FireMode = 0 Remotes = Tool:WaitForChild("Remotes") ServerControl = Remotes:WaitForChild("ServerControl") ClientControl = Remotes:WaitForChild("ClientControl") ToolEquipped = false function RemoveFlyStuff() for i, v in pairs(Torso:GetChildren()) do if v.Name == "FlightGyro" or v.Name == "FlightVelocity" then v:Destroy() end end end function Clamp(Number, Min, Max) return math.max(math.min(Max, Number), Min) end function Fly() if not ToolEquipped or not CheckIfAlive() then Flying = false else Flying = not Flying end if Flying and ToolEquipped and CheckIfAlive() then Momentum = (Torso.Velocity + (Torso.CFrame.lookVector * 3) + Vector3.new(0, 10, 0)) Momentum = Vector3.new(Clamp(Momentum.X, -15, 15), Clamp(Momentum.Y, -15, 15), Clamp(Momentum.Z, -15, 15)) local FlightGyro = Instance.new("BodyGyro") FlightGyro.Name = "FlightGyro" FlightGyro.P = (10 ^ 6) FlightGyro.maxTorque = Vector3.new(FlightGyro.P, FlightGyro.P, FlightGyro.P) FlightGyro.cframe = Torso.CFrame FlightGyro.Parent = Torso local FlightVelocity = Instance.new("BodyVelocity") FlightVelocity.Name = "FlightVelocity" FlightVelocity.velocity = Vector3.new(0, 0, 0) FlightVelocity.P = (10 ^ 4) FlightVelocity.maxForce = (Vector3.new(1, 1, 1) * (10 ^ 6)) FlightVelocity.Parent = Torso Spawn(function() InvokeServer("Flying", {Mode = true}) end) for i, v in pairs(Controls) do Controls[i].Value = 0 end Humanoid.AutoRotate = false while Flying and CheckIfAlive() and ToolEquipped do local CoordinateFrame = Camera.CoordinateFrame local Movement = (CoordinateFrame:vectorToWorldSpace(Vector3.new((Controls.Left.Value + Controls.Right.Value), (math.abs(Controls.Forward.Value) * 0.2), (Controls.Forward.Value + Controls.Backward.Value)) * Speed.Current)) Momentum = ((Momentum * Inertia) + Movement) TotalMomentum = Momentum.magnitude if TotalMomentum > Speed.Max then TotalMomentum = Speed.Max end local Tilt = ((Momentum * Vector3.new(1, 0, 1)).unit:Cross(((LastMomentum * Vector3.new(1, 0, 1)).unit))).y if tostring(Tilt) == "-1.#IND" or tostring(Tilt) == "1.#IND" or Tilt == math.huge or Tilt == -math.huge or tostring(0 / 0) == tostring(Tilt) then Tilt = 0 end local AbsoluteTilt = math.abs(Tilt) if AbsoluteTilt > 0.06 or AbsoluteTilt < 0.0001 then if math.abs(LastTilt) > 0.0001 then Tilt = (LastTilt * 0.9) else Tilt = 0 end else Tilt = ((LastTilt * 0.77) + (Tilt * 0.25)) end LastTilt = Tilt if TotalMomentum < 0.5 then Momentum = Vector3.new(0, 0, 0) TotalMomentum = 0 FlightGyro.cframe = CoordinateFrame else FlightGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), Momentum) *CFrame.Angles(0, 0, (Tilt * -20)) * CFrame.Angles((math.pi * -0.5 * (TotalMomentum / Speed.Max)), 0, 0) end FlightVelocity.velocity = Momentum local GravityDelta = ((((Momentum * Vector3.new(0, 1, 0)) - Vector3.new(0, -Speed.Max, 0)).magnitude / Speed.Max) * 0.5) if GravityDelta > 0.45 and tick() > LastFlap then LastFlap = (tick() + 0.5) end LastMomentum = Momentum wait(Rate) end if CheckIfAlive() then Humanoid.AutoRotate = true Humanoid:ChangeState(Enum.HumanoidStateType.Freefall) end RemoveFlyStuff() Spawn(function() InvokeServer("Flying", {Mode = false}) end) Flying = false end end 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 DisableJump(Boolean) if PreventJump then PreventJump:disconnect() end if Boolean then PreventJump = Humanoid.Changed:connect(function(Property) if Property == "Jump" then Humanoid.Jump = false end end) end end function CheckIfAlive() return (((Player and Player.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false) end function Equipped(Mouse) Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") Torso = Character:FindFirstChild("HumanoidRootPart") if not CheckIfAlive() then return end PlayerMouse = Player:GetMouse() Mouse.Button1Down:connect(function() InvokeServer("MouseClick", {Down = true}) end) Mouse.Button1Up:connect(function() InvokeServer("MouseClick", {Down = false}) end) Mouse.KeyDown:connect(function(Key) OnClientInvoke("KeyPress", {Key = Key, Down = true}) InvokeServer("KeyPress", {Key = Key, Down = true}) end) Mouse.KeyUp:connect(function(Key) OnClientInvoke("KeyPress", {Key = Key, Down = false}) InvokeServer("KeyPress", {Key = Key, Down = false}) end) Mouse.Move:connect(function() InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target}) end) ToolEquipped = true end function Unequipped() LocalObjects = {} RemoveFlyStuff() for i, v in pairs(Animations) do if v and v.AnimationTrack then v.AnimationTrack:Stop() end end for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do if v then v:disconnect() end end Animations = {} ToolEquipped = false end function InvokeServer(mode, value) local ServerRtrurn pcall(function() ServerReturn = ServerControl:InvokeServer(mode, value) end) return ServerReturn end function OnClientInvoke(mode, value) if not ToolEquipped or not CheckIfAlive() then return end if mode == "PlayAnimation" then SetAnimation("PlayAnimation", value) elseif mode == "StopAnimation" then SetAnimation("StopAnimation", value) elseif mode == "PlaySound" and value then value:Play() elseif mode == "StopSound" and value then value:Stop() elseif mode == "MousePosition" then return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target} elseif mode == "DisableJump" and value then DisableJump(value) elseif mode == "SetLocalTransparencyModifier" and value then pcall(function() local ObjectFound = false for i, v in pairs(LocalObjects) do if v == value then ObjectFound = true end end if not ObjectFound then table.insert(LocalObjects, value) if ObjectLocalTransparencyModifier then ObjectLocalTransparencyModifier:disconnect() end ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function() for i, v in pairs(LocalObjects) do if v.Object and v.Object.Parent then local CurrentTransparency = v.Object.LocalTransparencyModifier if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then v.Object.LocalTransparencyModifier = v.Transparency end else table.remove(LocalObjects, i) end end end) end end) elseif mode == "KeyPress" and value then local Key = value.Key local ByteKey = string.byte(Key) local Down = value.Down if ByteKey == 32 and Down then Spawn(Fly) else for i, v in pairs(Controls) do if v.Keys.Key == Key or v.Keys.ByteKey == ByteKey then v.Value = ((Down and v.DesiredValue) or 0) end end end end end ClientControl.OnClientInvoke = OnClientInvoke Tool.Equipped:connect(Equipped) Tool.Unequipped:connect(Unequipped)
-- functions
local function RegisterAction(action, primary, secondary) local info = { Primary = primary; Secondary = secondary; } actions[action] = info end local function ActionFromInputObject(inputObject) for action, info in pairs(actions) do if info.Primary then if info.Primary.EnumType == Enum.KeyCode then if inputObject.KeyCode == info.Primary then return action end elseif info.Primary.EnumType == Enum.UserInputType then if inputObject.UserInputType == info.Primary then return action end end end if info.Secondary then if info.Secondary.EnumType == Enum.KeyCode then if inputObject.KeyCode == info.Secondary then return action end elseif info.Secondary.EnumType == Enum.UserInputType then if inputObject.UserInputType == info.Secondary then return action end end end end end
-- Connect click events for the slider buttons
norm.MouseButton1Click:Connect(function() onSliderButtonClick(norm) end) fast.MouseButton1Click:Connect(function() onSliderButtonClick(fast) end) max.MouseButton1Click:Connect(function() onSliderButtonClick(max) end)
--[=[ Returns whether a value is a Brio. ```lua print(Brio.isBrio("yolo")) --> false ``` @param value any @return boolean ]=]
function Brio.isBrio(value) return type(value) == "table" and value.ClassName == "Brio" end
-- Local Functions
local function StartIntermission() local possiblePoints = {} -- Wait for a flag to circle around. local flagstand = game.Workspace:WaitForChild("FlagStand") -- If no flags were present, use the center of the map as the focal point. if not flagstand then table.insert(possiblePoints, Vector3.new(0,50,0)) else for _, child in ipairs(game.Workspace:GetChildren()) do if child.Name == "FlagStand" then table.insert(possiblePoints, child.FlagStand.Position) end end end local focalPoint = possiblePoints[math.random(#possiblePoints)] Camera.CameraType = Enum.CameraType.Scriptable Camera.Focus = CFrame.new(focalPoint) -- Stream in the area around the focal point. Player:RequestStreamAroundAsync(focalPoint) local angle = 0 game.Lighting.Blur.Enabled = true RunService:BindToRenderStep('IntermissionRotate', Enum.RenderPriority.Camera.Value, function() local cameraPosition = focalPoint + Vector3.new(50 * math.cos(angle), 20, 50 * math.sin(angle)) Camera.CoordinateFrame = CFrame.new(cameraPosition, focalPoint) angle = angle + math.rad(.25) end) end local function StopIntermission() game.Lighting.Blur.Enabled = false RunService:UnbindFromRenderStep('IntermissionRotate') Camera.CameraType = Enum.CameraType.Custom end local function OnDisplayIntermission(display) if display and not InIntermission then InIntermission = true StartIntermission() end if not display and InIntermission then InIntermission = false StopIntermission() end end
--ProximityPrompt.Triggered:Connect(function(Player) -- local ToolsCopy = game.ReplicatedStorage["Crucifix"]:Clone() -- ToolsCopy.Parent = Player.Backpack --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(isDependency: boolean?) if not isDependency then Dependencies.useDependency(self) end return self._value end
-- Thread utilities
local SpawnBindable = Instance.new("BindableEvent") function FastSpawn(fn, ...) coroutine.wrap(function(...) SpawnBindable.Event:Wait() fn(...) end)(...) SpawnBindable:Fire() end function YieldThread() -- needed a way to first call coroutine.yield(), and then call SpawnBindable.Event:Wait() -- but return what coroutine.yield() returned. This is kinda ugly, but the only other -- option was to create a temporary table to store the results, which I didn't want to do return (function(...) SpawnBindable.Event:Wait() return ... end)(coroutine.yield()) end function ResumeThread(thread, ...) coroutine.resume(thread, ...) SpawnBindable:Fire() end
--[[Initialize]]
-- local bike=script.Parent.Parent local _Tune=require(script.Parent) wait(_Tune.LoadDelay)
--Ranks-- --[[ 0 = Normal Player 1 = Banned 2 = Mod 3 = Admin 4 = Super Admin 5 = Owner Admin 6 = Game Creator --Can only be used in Custom_Commands --]]
local Settings = { Advertise = true; --Advertises the admin commands on the GUI on the bottom right of the screen Prefix = ";"; --NOTE: DO NOT MAKE THIS MORE THAN 1 CHARACTER LONG UNLESS YOU WANT TO BREAK THE CODE! Changing this will change the prefix for the commands you run ex: ;cmds will run since the prefix is set to ";" FreeAdmin = false; --Set this from 2-5 if you want people to join the game to have a certain admin, otherwise set it to false CommandBar = true; --Set this to true if you want players to be able to use the command bar, otherwise set it to false Products = { --EXAPMLE [ID OF GAMEPASS/SHIRT] = Ranks: 2-5 or false if you dont want the item to award admin at the moment --Example: Should give the mod for owning the mega donation shirt --[1256454890] = 2; }; Groups = { --EXAPMLE [ID OF GROUP] = {Role rank, Ranks: 2-5 or false} if you dont want the item to award admin at the moment --Example: My group ID is 3675368 and since I'm the owner of the group my group role rank is 255, and anyone with the role rank of 255 or higher gets "2" as their power which is mod --[3675368] = {255,2}; }; }
----TODO>: toast.position
local toastrot=CFrame.new(0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0) toast.CFrame = script.Parent.toaster.CFrame * CFrame.new(Vector3.new(.75,1,0)) * toastrot wait(0.4) toast.CanCollide=true wait(1) isenabled=1 --IF YOU WANT TOAST TO DISAPPEAR AFTER A WHILE, REMOVE THE -- before next two lines. --wait(120) --toast:remove() end end end end script.Parent.toaster.Touched:connect(onTouched)
--Updated for R15 avatars by StarWars
local Tool = script.Parent; enabled = true local ghostChar = nil function makeMeGhostly(trans) if ghostChar == nil then return end local parts = {"Head", "Torso", "Left Leg", "Right Leg", "Left Arm", "Right Arm", "UpperTorso", "LowerTorso", "RightUpperArm", "RightLowerArm", "RightHand", "LeftHand", "LeftLowerArm", "LeftUpperArm", "LeftLowerLeg", "LeftUpperLeg", "RightLowerLeg", "RightUpperLeg", "RightFoot", "LeftFoot"} for i=1,#parts do local p = ghostChar:FindFirstChild(parts[i]) if p ~= nil then p.Transparency = trans end end end function UpdateGhostState(isUnequipping) if isUnequipping == true then makeMeGhostly(0) ghostChar = nil else ghostChar = Tool.Parent makeMeGhostly(.5) end end function onActivated() if not enabled then return end enabled = false Tool.GripForward = Vector3.new(-.981, .196, 0) Tool.GripPos = Vector3.new(-.5, -0.6, -1.5) Tool.GripRight = Vector3.new(0, -0, -1) Tool.GripUp = Vector3.new(0.196, .981, 0) Tool.Handle.DrinkSound:Play() wait(.8) local h = Tool.Parent:FindFirstChild("Humanoid") if (h ~= nil) then UpdateGhostState(false) end Tool.GripForward = Vector3.new(-1, 0, 0) Tool.GripPos = Vector3.new(-.5, -.1, 0) Tool.GripRight = Vector3.new(0, 0, 1) Tool.GripUp = Vector3.new(0,1,0) enabled = true end function onEquipped() Tool.Handle.OpenSound:play() end script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) function onUnequipped() UpdateGhostState(true) end script.Parent.Unequipped:connect(onUnequipped)
--Make the player freeze for 3 seconds when part touched
local function onTouched(otherPart) local humanoid = otherPart.Parent:FindFirstChild('Humanoid') if humanoid then humanoid.WalkSpeed = 0 wait(3) humanoid.WalkSpeed = 16 end end
--vehicle.Nose.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end) --vehicle.Bumper_Front.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, -1)) end) --vehicle.Bumper_Back.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end) --vehicle.Tailgate.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end) --vehicle.ExhaustPipe.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 0, 1)) end)
frontForceField.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, -1, 0)) end) backForceField.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(0, 1, 0)) end) vehicle.Wheel_BackLeft.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(1, 0, 0)) end) vehicle.Wheel_FrontLeft.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(1, 0, 0)) end) vehicle.Wheel_BackRight.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(-1, 0, 0)) end) vehicle.Wheel_FrontRight.Touched:connect(function (hitPart) onTouch(hitPart, Vector3.new(-1, 0, 0)) end) local vehicleDamaged = false function checkIfVehicleIsDamaged() if (not frontForceField.Parent or not backForceField.Parent) and not vehicleDamaged and allowDamage then vehicleDamaged = true script.IsDamaged.Value = true vehicle.VehicleScript.Disabled = true vehicleSmoke.Enabled = true vehicle.VehicleSeat.MaxSpeed = 0 vehicle.ExhaustPipe.Smoke.Enabled = false -- Break Joints vehicle.Wheel_BackLeft:BreakJoints() vehicle.Wheel_FrontLeft:BreakJoints() vehicle.Wheel_BackRight:BreakJoints() vehicle.Wheel_FrontRight:BreakJoints() hood:BreakJoints() end end vehicle.ChildRemoved:connect(checkIfVehicleIsDamaged)
-- Trying to clone something with Archivable=false will return nil for some reason -- Helper function to enable Archivable, clone, reset Archivable to what it was before -- and then return the clone
function safeClone(instance) local oldArchivable = instance.Archivable instance.Archivable = false local clone = instance:Clone() instance.Archivable = oldArchivable return clone end function characterAdded(player, character) player.CharacterAppearanceLoaded:wait() wait(0.1) local humanoid = character:FindFirstChildOfClass("Humanoid") buildRagdoll(humanoid) end function characterRemoving(character) local humanoid = character:FindFirstChildOfClass("Humanoid") if humanoid:GetState() ~= Enum.HumanoidStateType.Dead then return end local clone = safeClone(character) local cloneHumanoid = clone:FindFirstChildOfClass("Humanoid") -- Don't clutter the game with nameplates / healthbars cloneHumanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None -- Roblox will try to rebuild joints when the clone is parented to Workspace and -- break the ragdoll, so disable automatic scaling to prevent that. We don't need -- it anyway since the character is already scaled from when it was originally created cloneHumanoid.AutomaticScalingEnabled = false -- Clean up junk so we have less scripts running and don't have ragdolls -- spamming random sounds local animate = character:FindFirstChild("Animate") local sound = character:FindFirstChild("Sound") local health = character:FindFirstChild("Health") if animate then animate:Destroy() end if sound then sound:Destroy() end if health then health:Destroy() end clone.Parent = workspace -- State is not preserved when cloning. We need to set it back to Dead or the -- character won't ragdoll. This has to be done AFTER parenting the character -- to Workspace or the state change won't replicate to clients that can then -- start simulating the character if they get close enough cloneHumanoid:ChangeState(Enum.HumanoidStateType.Dead) end function playerAdded(player) player.CharacterAdded:connect(function(character) characterAdded(player, character) end) player.CharacterRemoving:Connect(characterRemoving) if player.Character then characterAdded(player, player.Character) end end Players.PlayerAdded:connect(playerAdded)
--[[** <description> Run this once to combine all keys provided into one "main key". Internally, this means that data will be stored in a table with the key mainKey. This is used to get around the 2-DataStore2 reliability caveat. </description> <parameter name = "mainKey"> The key that will be used to house the table. </parameter> <parameter name = "..."> All the keys to combine under one table. </parameter> **--]]
function DataStore2.Combine(mainKey, ...) for _, name in pairs({...}) do combinedDataStoreInfo[name] = mainKey end end function DataStore2.ClearCache() DataStoreCache = {} end function DataStore2.SaveAll(player) if DataStoreCache[player] then for _, dataStore in pairs(DataStoreCache[player]) do if dataStore.combinedStore == nil then dataStore:Save() end end end end function DataStore2.PatchGlobalSettings(patch) for key, value in pairs(patch) do assert(Settings[key] ~= nil, "No such key exists: " .. key) -- TODO: Implement type checking with this when osyris' t is in Settings[key] = value end end function DataStore2.__call(_, dataStoreName, player) assert( typeof(dataStoreName) == "string" and typeof(player) == "Instance", ("DataStore2() API call expected {string dataStoreName, Instance player}, got {%s, %s}") :format( typeof(dataStoreName), typeof(player) ) ) if DataStoreCache[player] and DataStoreCache[player][dataStoreName] then return DataStoreCache[player][dataStoreName] elseif combinedDataStoreInfo[dataStoreName] then local dataStore = DataStore2(combinedDataStoreInfo[dataStoreName], player) dataStore:BeforeSave(function(combinedData) for key in pairs(combinedData) do if combinedDataStoreInfo[key] then local combinedStore = DataStore2(key, player) local value = combinedStore:Get(nil, true) if value ~= nil then if combinedStore.combinedBeforeSave then value = combinedStore.combinedBeforeSave(clone(value)) end combinedData[key] = value end end end return combinedData end) local combinedStore = setmetatable({ combinedName = dataStoreName, combinedStore = dataStore, }, { __index = function(_, key) return CombinedDataStore[key] or dataStore[key] end }) if not DataStoreCache[player] then DataStoreCache[player] = {} end DataStoreCache[player][dataStoreName] = combinedStore return combinedStore end local dataStore = {} dataStore.Name = dataStoreName dataStore.UserId = player.UserId dataStore.callbacks = {} dataStore.beforeInitialGet = {} dataStore.afterSave = {} dataStore.bindToClose = {} dataStore.savingMethod = SavingMethods[Settings.SavingMethod].new(dataStore) setmetatable(dataStore, DataStoreMetatable) local event, fired = Instance.new("BindableEvent"), false game:BindToClose(function() if not fired then spawn(function() player.Parent = nil -- Forces AncestryChanged to fire and save the data end) event.Event:wait() end local value = dataStore:Get(nil, true) for _, bindToClose in pairs(dataStore.bindToClose) do bindToClose(player, value) end end) local playerLeavingConnection playerLeavingConnection = player.AncestryChanged:Connect(function() if player:IsDescendantOf(game) then return end playerLeavingConnection:Disconnect() dataStore:SaveAsync():andThen(function() print("player left, saved " .. dataStoreName) end):catch(function(error) -- TODO: Something more elegant warn("error when player left! " .. error) end):finally(function() event:Fire() fired = true end) delay(40, function() --Give a long delay for people who haven't figured out the cache :^( DataStoreCache[player] = nil end) end) if not DataStoreCache[player] then DataStoreCache[player] = {} end DataStoreCache[player][dataStoreName] = dataStore return dataStore end DataStore2.Constants = Constants return setmetatable(DataStore2, DataStore2)
--Funçao para abrir o menu de respostas
local key = game:GetService("UserInputService") key.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.Q then if script.Parent.Tela.Visible == false then -- Se a tela estiver invisivel script.Parent.Tela.Visible = true -- Fica visivel script.Parent.Tela.Mouse.Modal = true else -- Se não: script.Parent.Tela.Visible = false script.Parent.Tela.Mouse.Modal = false end end end) script.Parent.MouseButton1Click:Connect(function() if script.Parent.Tela.Visible == false then script.Parent.Tela.Visible = true elseif script.Parent.Tela.Visible == true then script.Parent.Tela.Visible = false end end)
--//-//--
if carSeat.Throttle == -1 and carSeat.Steer == 1 then script.Parent.CC.Value = false carSeat.Parent.Parent.LFW.FB.CanCollide = false carSeat.Parent.Parent.LFW.RB.CanCollide = false carSeat.Parent.Parent.LRW.FB.CanCollide = false carSeat.Parent.Parent.LRW.RB.CanCollide = false carSeat.Parent.Parent.RRW.FB.CanCollide = true carSeat.Parent.Parent.RRW.RB.CanCollide = true carSeat.Parent.Parent.RFW.FB.CanCollide = true carSeat.Parent.Parent.RFW.RB.CanCollide = true wait() carSeat.Parent.Parent.RFW.FB.CanCollide = false carSeat.Parent.Parent.RFW.RB.CanCollide = false elseif carSeat.Throttle == -1 and carSeat.Steer == -1 then script.Parent.CC.Value = false carSeat.Parent.Parent.LRW.FB.CanCollide = true carSeat.Parent.Parent.LRW.RB.CanCollide = true carSeat.Parent.Parent.RFW.FB.CanCollide = false carSeat.Parent.Parent.RFW.RB.CanCollide = false carSeat.Parent.Parent.RRW.FB.CanCollide = false carSeat.Parent.Parent.RRW.RB.CanCollide = false carSeat.Parent.Parent.LFW.FB.CanCollide = true carSeat.Parent.Parent.LFW.RB.CanCollide = true wait() carSeat.Parent.Parent.LFW.FB.CanCollide = false carSeat.Parent.Parent.LFW.RB.CanCollide = false elseif carSeat.Throttle == 0 and script.Parent.CC.Value == true then carSeat.Parent.Parent.LFW.FB.CanCollide = false carSeat.Parent.Parent.LFW.RB.CanCollide = false carSeat.Parent.Parent.LRW.FB.CanCollide = false carSeat.Parent.Parent.LRW.RB.CanCollide = false carSeat.Parent.Parent.RFW.FB.CanCollide = false carSeat.Parent.Parent.RFW.RB.CanCollide = false carSeat.Parent.Parent.RRW.FB.CanCollide = false carSeat.Parent.Parent.RRW.RB.CanCollide = false elseif carSeat.Throttle == 0 and script.Parent.CC.Value == false then carSeat.Parent.Parent.LFW.FB.CanCollide = false carSeat.Parent.Parent.LFW.RB.CanCollide = false carSeat.Parent.Parent.LRW.FB.CanCollide = false carSeat.Parent.Parent.LRW.RB.CanCollide = false carSeat.Parent.Parent.RFW.FB.CanCollide = false carSeat.Parent.Parent.RFW.RB.CanCollide = false carSeat.Parent.Parent.RRW.FB.CanCollide = false carSeat.Parent.Parent.RRW.RB.CanCollide = false 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.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 elseif carSeat.Throttle == 1 then carSeat.Parent.Parent.LFW.FB.CanCollide = false carSeat.Parent.Parent.LFW.RB.CanCollide = false carSeat.Parent.Parent.LRW.FB.CanCollide = false carSeat.Parent.Parent.LRW.RB.CanCollide = false carSeat.Parent.Parent.RFW.FB.CanCollide = false carSeat.Parent.Parent.RFW.RB.CanCollide = false carSeat.Parent.Parent.RRW.FB.CanCollide = false carSeat.Parent.Parent.RRW.RB.CanCollide = false elseif carSeat.Throttle == -1 and carSeat.Steer == 0 and speed > 65 then script.Parent.CC.Value = false carSeat.Parent.Parent.LFW.FB.CanCollide = true carSeat.Parent.Parent.LFW.RB.CanCollide = true carSeat.Parent.Parent.LRW.FB.CanCollide = true carSeat.Parent.Parent.LRW.RB.CanCollide = true carSeat.Parent.Parent.RFW.FB.CanCollide = true carSeat.Parent.Parent.RFW.RB.CanCollide = true carSeat.Parent.Parent.RRW.FB.CanCollide = true carSeat.Parent.Parent.RRW.RB.CanCollide = true elseif carSeat.Throttle == -1 and carSeat.Steer == 0 and speed < 65 then script.Parent.CC.Value = false carSeat.Parent.Parent.LFW.FB.CanCollide = true carSeat.Parent.Parent.LFW.RB.CanCollide = true carSeat.Parent.Parent.LRW.FB.CanCollide = true carSeat.Parent.Parent.LRW.RB.CanCollide = true carSeat.Parent.Parent.RFW.FB.CanCollide = true carSeat.Parent.Parent.RFW.RB.CanCollide = true carSeat.Parent.Parent.RRW.FB.CanCollide = true carSeat.Parent.Parent.RRW.RB.CanCollide = true 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.RRW.VS.Torque = 6 carSeat.Parent.Parent.RFW.VS.Torque = 6 carSeat.Parent.Parent.LRW.VS.Torque = 6 carSeat.Parent.Parent.LFW.VS.Torque = 6 elseif carSeat.Velocity.Magnitude < 35 then script.Parent.CC.Value = false print("this is working") end end
--add all the parts in the character to charParts, and accessories to accessoryParts
local charChildren = character:GetChildren() for i = 1, #charChildren do if (charChildren[i]:IsA("BasePart") or charChildren[i]:IsA("Part") or charChildren[i]:IsA("WedgePart") or charChildren[i]:IsA("CornerWedgePart") or charChildren[i]:IsA("MeshPart")) and charChildren[i].Name ~= "HumanoidRootPart" then table.insert(charParts, charChildren[i]) end if charChildren[i]:IsA("Hat") or charChildren[i]:IsA("Accoutrement") or charChildren[i]:IsA("Accessory") then for ii, vv in pairs(charChildren[i]:GetChildren()) do if vv:IsA("BasePart") then table.insert(accessoryParts, vv) end end end end
--v fast
script.Parent.Color = Color3.new(math.random(),math.random(),math.random()) wait(0.1) mode3() end function mode4()
-- connect events
Humanoid.Died:connect(onDied) Humanoid.Running:connect(onRunning) Humanoid.Jumping:connect(onJumping) Humanoid.Climbing:connect(onClimbing) Humanoid.GettingUp:connect(onGettingUp) Humanoid.FreeFalling:connect(onFreeFall) Humanoid.FallingDown:connect(onFallingDown) Humanoid.Seated:connect(onSeated) Humanoid.PlatformStanding:connect(onPlatformStanding) Humanoid.Swimming:connect(onSwimming)
-- Get player control enabled state
function UserInputController:getPlayerControlsEnabled() local playerControls = self:_getPlayerControls() local activeController = playerControls and playerControls:GetActiveController() if activeController then return activeController.enabled end end
--Tuck in
XR15RightLegTuckIn = 0 YR15RightLegTuckIn = .13 ZR15RightLegTuckIn = .35 R15RightKneeTuckIn = -.2 XR15RightArmTuckIn = 0 YR15RightArmTuckIn = -0.05 ZR15RightArmTuckIn = .4 R15RightElbowTuckIn = .4 XR15LeftLegTuckIn = 0 YR15LeftLegTuckIn = -.13 ZR15LeftLegTuckIn = -.35 R15LeftKneeTuckIn = .2 XR15LeftArmTuckIn = -0 YR15LeftArmTuckIn = 0.05 ZR15LeftArmTuckIn = -.4 R15LeftElbowTuckIn = -.4 XR15LowerTorsoTuckIn = 0 YR15LowerTorsoTuckIn = 0 ZR15LowerTorsoTuckIn = .3 ZR15UpperTorsoTuckIn = .1
-- b2.BrickColor = BrickColor.new("Crimson") -- b2.Material = Enum.Material.SmoothPlastic
end end elseif input.KeyCode == Enum.KeyCode.Z then if input.UserInputState == Enum.UserInputState.Begin then if hazards then return end left = not left right = false if relay then repeat wait() until not relay end while left do l1.BrickColor = BrickColor.new("Deep orange") l1.Material = Enum.Material.Neon b1.BrickColor = BrickColor.new("Really red") b1.Material = Enum.Material.Neon cr.DriveSeat.Indicator.Value = true cr.DriveSeat.LI.Value = true runner.Material = Enum.Material.SmoothPlastic runner.BrickColor = BrickColor.new("Pearl") wait(1/3) l1.BrickColor = BrickColor.new("Pearl") l1.Material = Enum.Material.SmoothPlastic cr.DriveSeat.Indicator.Value = false cr.DriveSeat.LI.Value = false if not headlt then b1.BrickColor = BrickColor.new("Crimson") b1.Material = Enum.Material.SmoothPlastic else b1.BrickColor = BrickColor.new("Crimson") b1.Material = Enum.Material.SmoothPlastic runner.Material = Enum.Material.SmoothPlastic runner.BrickColor = BrickColor.new("Pearl") end wait(1/3) if not left then runner.Material = Enum.Material.Neon runner.BrickColor = BrickColor.new("Pearl") if brake then b1.Material = Enum.Material.Neon b1.BrickColor = BrickColor.new("Really red") end end end end elseif input.KeyCode == Enum.KeyCode.X then if input.UserInputState == Enum.UserInputState.Begin then if hazards == false then hazards = true left = true right = true else hazards = false left = false right = false end if hazards then left = false right = false end if relay then repeat wait() until not relay end while hazards do l1.BrickColor = BrickColor.new("Deep orange") l1.Material = Enum.Material.Neon r1.BrickColor = BrickColor.new("Deep orange") r1.Material = Enum.Material.Neon b1.BrickColor = BrickColor.new("Really red") b1.Material = Enum.Material.Neon b2.BrickColor = BrickColor.new("Really red") b2.Material = Enum.Material.Neon cr.DriveSeat.Indicator.Value = true cr.DriveSeat.LI.Value = true cr.DriveSeat.RI.Value = true runner.Material = Enum.Material.SmoothPlastic runner.BrickColor = BrickColor.new("Pearl") runner2.Material = Enum.Material.SmoothPlastic runner2.BrickColor = BrickColor.new("Pearl") wait(1/3) l1.BrickColor = BrickColor.new("Pearl") l1.Material = Enum.Material.SmoothPlastic r1.BrickColor = BrickColor.new("Pearl") r1.Material = Enum.Material.SmoothPlastic b1.BrickColor = BrickColor.new("Crimson") b1.Material = Enum.Material.SmoothPlastic b2.BrickColor = BrickColor.new("Crimson") b2.Material = Enum.Material.SmoothPlastic cr.DriveSeat.Indicator.Value = false cr.DriveSeat.LI.Value = false cr.DriveSeat.RI.Value = false runner.Material = Enum.Material.SmoothPlastic runner2.Material = Enum.Material.SmoothPlastic runner.BrickColor = BrickColor.new("Pearl") runner2.BrickColor = BrickColor.new("Pearl") wait(1/3) if not hazards then runner.Material = Enum.Material.Neon runner2.Material = Enum.Material.Neon runner.BrickColor = BrickColor.new("Pearl") runner2.BrickColor = BrickColor.new("Pearl") if brake then b1.Material = Enum.Material.Neon b2.Material = Enum.Material.Neon b1.BrickColor = BrickColor.new("Really red") b2.BrickColor = BrickColor.new("Really red") end end end end elseif input.KeyCode == Enum.KeyCode.C then if input.UserInputState == Enum.UserInputState.Begin then if hazards then return end right = not right left = false if relay then repeat wait() until not relay end while right do r1.BrickColor = BrickColor.new("Deep orange") r1.Material = Enum.Material.Neon b2.BrickColor = BrickColor.new("Really red") b2.Material = Enum.Material.Neon cr.DriveSeat.Indicator.Value = true cr.DriveSeat.RI.Value = true runner2.Material = Enum.Material.SmoothPlastic runner2.BrickColor = BrickColor.new("Pearl") wait(1/3) r1.BrickColor = BrickColor.new("Pearl") r1.Material = Enum.Material.SmoothPlastic cr.DriveSeat.Indicator.Value = false cr.DriveSeat.RI.Value = false runner2.Material = Enum.Material.SmoothPlastic runner2.BrickColor = BrickColor.new("Pearl") if not headlt then b2.BrickColor = BrickColor.new("Crimson") b2.Material = Enum.Material.SmoothPlastic else b2.BrickColor = BrickColor.new("Crimson") b2.Material = Enum.Material.SmoothPlastic end wait(1/3) if not right then runner2.Material = Enum.Material.Neon runner2.BrickColor = BrickColor.new("Pearl") if brake then b2.Material = Enum.Material.Neon b2.BrickColor = BrickColor.new("Really red") end end end end elseif input.KeyCode == Enum.KeyCode.L then if input.UserInputState == Enum.UserInputState.Begin then if headlt and not highlt then highlt = true elseif headlt and highlt then headlt = false highlt = false elseif not headlt then headlt = true end if highlt then hi.BrickColor = BrickColor.new("Institutional white") hi.Material = Enum.Material.Neon lwww.SpotLight.Enabled = true rb.Material = Enum.Material.Neon elseif not highlt then hi.BrickColor = BrickColor.new("Pearl") hi.Material = Enum.Material.SmoothPlastic lwww.SpotLight.Enabled = false if not brake then rb.Material = Enum.Material.SmoothPlastic else rb.Material = Enum.Material.SmoothPlastic if not headlt then rb.Material = Enum.Material.SmoothPlastic else rb.Material = Enum.Material.SmoothPlastic end end end if headlt then lw.BrickColor = BrickColor.new("Institutional white") lw.Material = Enum.Material.Neon lww.SpotLight.Enabled = true rb.Material = Enum.Material.Neon if not highlt then rb.Material = Enum.Material.Neon end for i,v in pairs(lt.RL:GetChildren()) do v.Material = "Neon" end elseif not headlt then for i,v in pairs(lt.RL:GetChildren()) do v.Material = "SmoothPlastic" end lw.Material = Enum.Material.SmoothPlastic lww.SpotLight.Enabled = false end end end end is.InputBegan:connect(DealWithInput) is.InputChanged:connect(DealWithInput) is.InputEnded:connect(DealWithInput) gr.Changed:connect(function() if gr.Value == -1 then rv.Material = Enum.Material.Neon else rv.Material = Enum.Material.SmoothPlastic end end)
---------------------------------------------------------------------------------------------------- --------------------=[ CFRAME ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,EnableHolster = false ,HolsterTo = 'Right Leg' -- Put the name of the body part you wanna holster to ,HolsterPos = CFrame.new(0.80,0.7,0.2) * CFrame.Angles(math.rad(-88),math.rad(-180),math.rad(0)) ,RightArmPos = CFrame.new(-0.575, 0.65, -1.185) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Server ,LeftArmPos = CFrame.new(1.15,-0.1,-1.65) * CFrame.Angles(math.rad(-120),math.rad(20),math.rad(-25)) --server ,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) ,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0)) ,RightPos = CFrame.new(-0.4, 0.65, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Client ,LeftPos = CFrame.new(.85,-0.15,-1.55) * CFrame.Angles(math.rad(-120),math.rad(20),math.rad(-25)) --Client } return Config
--Precalculated paths
local t,f,n=true,false,{} local r={ [58]={{67,64,66,19,20,58},t}, [49]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49},t}, [16]={n,f}, [19]={{67,64,66,19},t}, [59]={{67,64,66,19,20,57,56,30,41,59},t}, [63]={{67,64,66,63},t}, [34]={{67,64,66,19,20,57,56,30,41,39,35,34},t}, [21]={{67,64,66,19,20,21},t}, [48]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t}, [27]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27},t}, [14]={n,f}, [31]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31},t}, [56]={{67,64,66,19,20,57,56},t}, [29]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29},t}, [13]={n,f}, [47]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t}, [12]={n,f}, [45]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45},t}, [57]={{67,64,66,19,20,57},t}, [36]={{67,64,66,19,20,57,56,30,41,39,35,37,36},t}, [25]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25},t}, [71]={{67,64,66,19,20,57,56,30,41,59,61,71},t}, [20]={{67,64,66,19,20},t}, [60]={{67,64,66,19,20,57,56,30,41,60},t}, [8]={n,f}, [4]={n,f}, [75]={{67,64,66,19,20,57,56,30,41,59,61,71,72,76,73,75},t}, [22]={{67,64,66,19,20,21,22},t}, [74]={{67,64,66,19,20,57,56,30,41,59,61,71,72,76,73,74},t}, [62]={{67,64,66,63,62},t}, [1]={n,f}, [6]={n,f}, [11]={n,f}, [15]={n,f}, [37]={{67,64,66,19,20,57,56,30,41,39,35,37},t}, [2]={n,f}, [35]={{67,64,66,19,20,57,56,30,41,39,35},t}, [53]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t}, [73]={{67,64,66,19,20,57,56,30,41,59,61,71,72,76,73},t}, [72]={{67,64,66,19,20,57,56,30,41,59,61,71,72},t}, [33]={{67,64,66,19,20,57,56,30,41,39,35,37,36,33},t}, [69]={{67,64,66,19,20,57,56,30,41,60,69},t}, [65]={{67,64,65},t}, [26]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26},t}, [68]={{67,68},t}, [76]={{67,64,66,19,20,57,56,30,41,59,61,71,72,76},t}, [50]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t}, [66]={{67,64,66},t}, [10]={n,f}, [24]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t}, [23]={{67,64,66,63,62,23},t}, [44]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44},t}, [39]={{67,64,66,19,20,57,56,30,41,39},t}, [32]={{67,64,66,19,20,57,56,30,41,39,35,34,32},t}, [3]={n,f}, [30]={{67,64,66,19,20,57,56,30},t}, [51]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t}, [18]={n,f}, [67]={{67},t}, [61]={{67,64,66,19,20,57,56,30,41,59,61},t}, [55]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t}, [46]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t}, [42]={{67,64,66,19,20,57,56,30,41,39,40,38,42},t}, [40]={{67,64,66,19,20,57,56,30,41,39,40},t}, [52]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t}, [54]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t}, [43]={n,f}, [7]={n,f}, [9]={n,f}, [41]={{67,64,66,19,20,57,56,30,41},t}, [17]={n,f}, [38]={{67,64,66,19,20,57,56,30,41,39,40,38},t}, [28]={{67,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28},t}, [5]={n,f}, [64]={{67,64},t}, } return r
--[[Weight and CG]]
Tune.Weight = 3472 -- Total weight (in pounds) Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable) --[[Width]] 6 , --[[Height]] 3.5 , --[[Length]] 14 } Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100) Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels) Tune.WBVisible = false -- Makes the weight brick visible --Unsprung Weight Tune.FWheelDensity = .1 -- Front Wheel Density Tune.RWheelDensity = .1 -- Rear Wheel Density Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF] Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF] Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight) Tune.AxleDensity = .1 -- Density of structural members
-- [[ Update ]]--
function OrbitalCamera:Update(dt) local now = tick() local timeDelta = (now - self.lastUpdate) local userPanningTheCamera = (self.UserPanningTheCamera == true) local camera = workspace.CurrentCamera local newCameraCFrame = camera.CFrame local newCameraFocus = camera.Focus local player = PlayersService.LocalPlayer local humanoid = self:GetHumanoid() local cameraSubject = camera and camera.CameraSubject local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat') local isOnASkateboard = cameraSubject and cameraSubject:IsA('SkateboardPlatform') if self.lastUpdate == nil or timeDelta > 1 then self.lastCameraTransform = nil end if self.lastUpdate then local gamepadRotation = self:UpdateGamepad() if self:ShouldUseVRRotation() then self.RotateInput = self.RotateInput + self:GetVRRotationInput() else -- Cap out the delta to 0.1 so we don't get some crazy things when we re-resume from local delta = math.min(0.1, timeDelta) if gamepadRotation ~= ZERO_VECTOR2 then userPanningTheCamera = true self.rotateInput = self.rotateInput + (gamepadRotation * delta) end local angle = 0 if not (isInVehicle or isOnASkateboard) then angle = angle + (self.TurningLeft and -120 or 0) angle = angle + (self.TurningRight and 120 or 0) end if angle ~= 0 then self.rotateInput = self.rotateInput + Vector2.new(math.rad(angle * delta), 0) userPanningTheCamera = true end end end -- Reset tween speed if user is panning if userPanningTheCamera then tweenSpeed = 0 self.lastUserPanCamera = tick() end local userRecentlyPannedCamera = now - self.lastUserPanCamera < TIME_BEFORE_AUTO_ROTATE local subjectPosition = self:GetSubjectPosition() if subjectPosition and player and camera then -- Process any dollying being done by gamepad -- TODO: Move this if self.gamepadDollySpeedMultiplier ~= 1 then self:SetCameraToSubjectDistance(self.currentSubjectDistance * self.gamepadDollySpeedMultiplier) end local VREnabled = VRService.VREnabled newCameraFocus = VREnabled and self:GetVRFocus(subjectPosition, timeDelta) or CFrame.new(subjectPosition) local cameraFocusP = newCameraFocus.p if VREnabled and not self:IsInFirstPerson() then local cameraHeight = self:GetCameraHeight() local vecToSubject = (subjectPosition - camera.CFrame.p) local distToSubject = vecToSubject.magnitude -- Only move the camera if it exceeded a maximum distance to the subject in VR if distToSubject > self.currentSubjectDistance or self.rotateInput.x ~= 0 then local desiredDist = math.min(distToSubject, self.currentSubjectDistance) -- Note that CalculateNewLookVector is overridden from BaseCamera vecToSubject = self:CalculateNewLookVector(vecToSubject.unit * X1_Y0_Z1, Vector2.new(self.rotateInput.x, 0)) * desiredDist local newPos = cameraFocusP - vecToSubject local desiredLookDir = camera.CFrame.lookVector if self.rotateInput.x ~= 0 then desiredLookDir = vecToSubject end local lookAt = Vector3.new(newPos.x + desiredLookDir.x, newPos.y, newPos.z + desiredLookDir.z) self.RotateInput = ZERO_VECTOR2 newCameraCFrame = CFrame.new(newPos, lookAt) + Vector3.new(0, cameraHeight, 0) end else -- self.RotateInput is a Vector2 of mouse movement deltas since last update self.curAzimuthRad = self.curAzimuthRad - self.rotateInput.x if self.useAzimuthLimits then self.curAzimuthRad = Util.Clamp(self.minAzimuthAbsoluteRad, self.maxAzimuthAbsoluteRad, self.curAzimuthRad) else self.curAzimuthRad = (self.curAzimuthRad ~= 0) and (math.sign(self.curAzimuthRad) * (math.abs(self.curAzimuthRad) % TAU)) or 0 end self.curElevationRad = Util.Clamp(self.minElevationRad, self.maxElevationRad, self.curElevationRad + self.rotateInput.y) local cameraPosVector = self.currentSubjectDistance * ( CFrame.fromEulerAnglesYXZ( -self.curElevationRad, self.curAzimuthRad, 0 ) * UNIT_Z ) local camPos = subjectPosition + cameraPosVector newCameraCFrame = CFrame.new(camPos, subjectPosition) self.rotateInput = ZERO_VECTOR2 end self.lastCameraTransform = newCameraCFrame self.lastCameraFocus = newCameraFocus if (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then self.lastSubjectCFrame = cameraSubject.CFrame else self.lastSubjectCFrame = nil end end self.lastUpdate = now return newCameraCFrame, newCameraFocus end return OrbitalCamera
-- / Functions / --
EventModule.ActivateEvent = function() local RandomPlayer = PlayingTeam:GetPlayers()[math.random(1, #PlayingTeam:GetPlayers())] if RandomPlayer then local Backpack = RandomPlayer:WaitForChild("Backpack") if Backpack then local Chainsaw = Tools:WaitForChild("Chainsaw"):Clone() Chainsaw.Parent = Backpack end end end
--[[Transmission]]
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[ [Modes] "Auto" : Automatic shifting "Semi" : Clutchless manual shifting, dual clutch transmission "Manual" : Manual shifting with clutch >Include within brackets eg: {"Semi"} or {"Auto", "Manual"} >First mode is default mode ]] --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev) Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev) --Gear Ratios Tune.FinalDrive = 3.06 -- Gearing determines top speed and wheel torque Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 4.35 , -- Reverse, Neutral, and 1st gear are required --[[ 2 ]] 3.65 , --[[ 3 ]] 2.64 , } Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[ Public API ]]
-- function Thumbstick:Enable() ThumbstickFrame.Visible = true end function Thumbstick:Disable() ThumbstickFrame.Visible = false OnTouchEnded() end function Thumbstick:Create(parentFrame) if ThumbstickFrame then ThumbstickFrame:Destroy() ThumbstickFrame = nil if OnTouchMovedCn then OnTouchMovedCn:disconnect() OnTouchMovedCn = nil end if OnTouchEndedCn then OnTouchEndedCn:disconnect() OnTouchEndedCn = nil end end local isSmallScreen = parentFrame.AbsoluteSize.y <= 500 local thumbstickSize = isSmallScreen and 70 or 120 local position = isSmallScreen and UDim2.new(0, (thumbstickSize/2) - 10, 1, -thumbstickSize - 20) or UDim2.new(0, thumbstickSize/2, 1, -thumbstickSize * 1.75) ThumbstickFrame = Instance.new('Frame') ThumbstickFrame.Name = "ThumbstickFrame" ThumbstickFrame.Active = true ThumbstickFrame.Visible = false ThumbstickFrame.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) ThumbstickFrame.Position = position ThumbstickFrame.BackgroundTransparency = 1 local outerImage = Instance.new('ImageLabel') outerImage.Name = "OuterImage" outerImage.Image = TOUCH_CONTROL_SHEET outerImage.ImageRectOffset = Vector2.new() outerImage.ImageRectSize = Vector2.new(220, 220) outerImage.BackgroundTransparency = 1 outerImage.Size = UDim2.new(0, thumbstickSize, 0, thumbstickSize) outerImage.Position = UDim2.new(0, 0, 0, 0) outerImage.Parent = ThumbstickFrame StickImage = Instance.new('ImageLabel') StickImage.Name = "StickImage" StickImage.Image = TOUCH_CONTROL_SHEET StickImage.ImageRectOffset = Vector2.new(220, 0) StickImage.ImageRectSize = Vector2.new(111, 111) StickImage.BackgroundTransparency = 1 StickImage.Size = UDim2.new(0, thumbstickSize/2, 0, thumbstickSize/2) StickImage.Position = UDim2.new(0, thumbstickSize/2 - thumbstickSize/4, 0, thumbstickSize/2 - thumbstickSize/4) StickImage.ZIndex = 2 StickImage.Parent = ThumbstickFrame local centerPosition = nil local deadZone = 0.05 local function doMove(direction) MasterControl:AddToPlayerMovement(-currentMoveVector) currentMoveVector = direction / (thumbstickSize/2) -- Scaled Radial Dead Zone local inputAxisMagnitude = currentMoveVector.magnitude if inputAxisMagnitude < deadZone then currentMoveVector = Vector3.new() else currentMoveVector = currentMoveVector.unit * ((inputAxisMagnitude - deadZone) / (1 - deadZone)) -- NOTE: Making currentMoveVector a unit vector will cause the player to instantly go max speed -- must check for zero length vector is using unit currentMoveVector = Vector3.new(currentMoveVector.x, 0, currentMoveVector.y) end MasterControl:AddToPlayerMovement(currentMoveVector) end local function moveStick(pos) local relativePosition = Vector2.new(pos.x - centerPosition.x, pos.y - centerPosition.y) local length = relativePosition.magnitude local maxLength = ThumbstickFrame.AbsoluteSize.x/2 if IsFollowStick and length > maxLength then local offset = relativePosition.unit * maxLength ThumbstickFrame.Position = UDim2.new( 0, pos.x - ThumbstickFrame.AbsoluteSize.x/2 - offset.x, 0, pos.y - ThumbstickFrame.AbsoluteSize.y/2 - offset.y) else length = math.min(length, maxLength) relativePosition = relativePosition.unit * length end StickImage.Position = UDim2.new(0, relativePosition.x + StickImage.AbsoluteSize.x/2, 0, relativePosition.y + StickImage.AbsoluteSize.y/2) end -- input connections ThumbstickFrame.InputBegan:connect(function(inputObject) if MoveTouchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch then return end MoveTouchObject = inputObject ThumbstickFrame.Position = UDim2.new(0, inputObject.Position.x - ThumbstickFrame.Size.X.Offset/2, 0, inputObject.Position.y - ThumbstickFrame.Size.Y.Offset/2) centerPosition = Vector2.new(ThumbstickFrame.AbsolutePosition.x + ThumbstickFrame.AbsoluteSize.x/2, ThumbstickFrame.AbsolutePosition.y + ThumbstickFrame.AbsoluteSize.y/2) local direction = Vector2.new(inputObject.Position.x - centerPosition.x, inputObject.Position.y - centerPosition.y) moveStick(inputObject.Position) end) OnTouchMovedCn = UserInputService.TouchMoved:connect(function(inputObject, isProcessed) if inputObject == MoveTouchObject then centerPosition = Vector2.new(ThumbstickFrame.AbsolutePosition.x + ThumbstickFrame.AbsoluteSize.x/2, ThumbstickFrame.AbsolutePosition.y + ThumbstickFrame.AbsoluteSize.y/2) local direction = Vector2.new(inputObject.Position.x - centerPosition.x, inputObject.Position.y - centerPosition.y) doMove(direction) moveStick(inputObject.Position) end end) OnTouchEnded = function() ThumbstickFrame.Position = position StickImage.Position = UDim2.new(0, ThumbstickFrame.Size.X.Offset/2 - thumbstickSize/4, 0, ThumbstickFrame.Size.Y.Offset/2 - thumbstickSize/4) MoveTouchObject = nil MasterControl:AddToPlayerMovement(-currentMoveVector) currentMoveVector = Vector3.new(0,0,0) MasterControl:SetIsJumping(false) end OnTouchEndedCn = UserInputService.TouchEnded:connect(function(inputObject, isProcessed) if inputObject == MoveTouchObject then OnTouchEnded() end end) ThumbstickFrame.Parent = parentFrame end return Thumbstick
--WeldRec(P.Parent.Lights)
for _,v in pairs(weldedParts) do if v:IsA("BasePart") then --v.Anchored = false end end script:Destroy()
--[[ Returns all the physical parts of the monster ]]
function MonsterManager.getAllMonsterParts() return TableUtils.map( monsters:getAll(), function(monster) return monster:getPart() end ) end return MonsterManager
-- ROBLOX deviation: matchersObject annotated as { [string]: any } for now rather than { [string]: RawMatcherFn } -- because we cannot currently express RawMatcherFn as tuple
type MatchersObject = { [string]: any } local spyMatchers: MatchersObject = { lastCalledWith = createLastCalledWithMatcher("lastCalledWith"), lastReturnedWith = createLastReturnedMatcher("lastReturnedWith"), nthCalledWith = createNthCalledWithMatcher("nthCalledWith"), nthReturnedWith = createNthReturnedWithMatcher("nthReturnedWith"), toBeCalled = createToBeCalledMatcher("toBeCalled"), toBeCalledTimes = createToBeCalledTimesMatcher("toBeCalledTimes"), toBeCalledWith = createToBeCalledWithMatcher("toBeCalledWith"), toHaveBeenCalled = createToBeCalledMatcher("toHaveBeenCalled"), toHaveBeenCalledTimes = createToBeCalledTimesMatcher("toHaveBeenCalledTimes"), toHaveBeenCalledWith = createToBeCalledWithMatcher("toHaveBeenCalledWith"), toHaveBeenLastCalledWith = createLastCalledWithMatcher("toHaveBeenLastCalledWith"), toHaveBeenNthCalledWith = createNthCalledWithMatcher("toHaveBeenNthCalledWith"), toHaveLastReturnedWith = createLastReturnedMatcher("toHaveLastReturnedWith"), toHaveNthReturnedWith = createNthReturnedWithMatcher("toHaveNthReturnedWith"), toHaveReturned = createToReturnMatcher("toHaveReturned"), toHaveReturnedTimes = createToReturnTimesMatcher("toHaveReturnedTimes"), toHaveReturnedWith = createToReturnWithMatcher("toHaveReturnedWith"), toReturn = createToReturnMatcher("toReturn"), toReturnTimes = createToReturnTimesMatcher("toReturnTimes"), toReturnWith = createToReturnWithMatcher("toReturnWith"), } function isMock(received: any) return received ~= nil and typeof(received) == "table" and received._isMockFunction == true end function isSpy(received: any) return received ~= nil and typeof(received) == "table" and received.calls ~= nil and typeof(received.calls.all) == "function" and typeof(received.calls.count) == "function" end
-- Directional tags
local Direction = 0 local Steer = 0
------------------------------------------------------------------------------------------------------------------------------------------------
if script.Parent:FindFirstChild("Leg2") then local g = script.Parent.Leg2:Clone() g.Parent = File for _,i in pairs(g:GetChildren()) do if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then i.CanCollide = false i.Anchored = false local Y = Instance.new("Weld") Y.Part0 = Player.Character["Right Leg"] Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Player.Character["Right Leg"] end end end
--for i = 2, 100 do
--prevRoom = roomModule.Generate(prevRoom, i)
--[[Dependencies]]
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local UserInputService = game:GetService("UserInputService") local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"])
--[[**put this code into a (server) script inside of the model that contains all of the dance floor tiles, name the floor pieces "tile" and name the circle inside of the tile "circle"**]]
-- deltarager cried here -- 27/05/2021
repeat wait() until game:IsLoaded() and game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) ~= nil and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") ~= nil local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local constants = require(ReplicatedStorage["ClientModules"].Constants) local player = game.Players.LocalPlayer local character = player.Character or player.CharacterAdded:Wait() local humanoid = character:WaitForChild("Humanoid") local animator = humanoid:WaitForChild("Animator") local oldEvent1,oldEvent2 = nil,nil local toolEvent,toolEventDe = nil,nil IdleAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Idle) SprintAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Sprint) CrouchAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Crouch) local crouching = false local sprinting = false local equipped = false local shooting = false local function Crouch() if sprinting then humanoid.WalkSpeed = 16; SprintAnimation:Stop() sprinting = false end if crouching then humanoid.WalkSpeed = 16 CrouchAnimation:Stop() else if equipped then IdleAnimation:Play() end CrouchAnimation:Play() humanoid.WalkSpeed = 10 end crouching = not crouching end local function Sprint() if crouching then humanoid.WalkSpeed = 16 CrouchAnimation:Stop() if equipped then IdleAnimation:Stop() end crouching = false end if sprinting then humanoid.WalkSpeed = 16; if equipped then SprintAnimation:Stop() IdleAnimation:Play() end else if equipped then IdleAnimation:Stop() SprintAnimation:Play() end humanoid.WalkSpeed = 24; end sprinting = not sprinting end UserInputService.InputBegan:Connect(function(input,gpe) if gpe then return end if input.KeyCode == constants.sprintKey and not shooting then Sprint() elseif input.KeyCode == constants.crouchKey then Crouch() elseif input.KeyCode == Enum.KeyCode.Space then if crouching then Crouch() end end end)
-- DO NOT GROUP THIS WITH YOUR MODEL!
local everything = {model} local names = {model} local children = game.Workspace:children() for i=1,#children do if (children[i].Name == "flags") then -- Replace the name with your models's name. table.insert(everything, children[i]:clone()) table.insert(names, children[i].Name) end end function regen() for i=1,#everything do game.Workspace:findFirstChild(names[i]):remove() -- Dont mess with this stuff. new_thing = everything[i]:clone() new_thing.Parent = game.Workspace new_thing:makeJoints() end end function onTouched() script.Parent.BrickColor = BrickColor.new(26) regen() wait(10)-- This is how long it takes untill the regen button will work again. script.Parent.BrickColor = BrickColor.new(104) debounce = false end script.Parent.ClickDetector.MouseClick:connect(onTouched)
--[[ Toggles light visibility in specified group ]]
function VehicleLightsComponent:toggleLights(group, isOn) for _, lightPart in pairs(group) do lightPart.Material = isOn and Enum.Material.Neon or Enum.Material.SmoothPlastic lightPart:FindFirstChildWhichIsA("Light").Enabled = isOn end end
--Evento touched: Se realiza animación en NPC y se invoca eventos
script.Parent.Parent.Touched:Connect(function(IsAPlayer) if debounce == false then if IsAPlayer.Parent:FindFirstChild("Humanoid") and game.Players:GetPlayerFromCharacter(IsAPlayer.Parent) then local animKill = Dummy:FindFirstChildOfClass("Humanoid"):LoadAnimation(animation) animKill:Play() sound:Play() debounce = true local player = game.Players:GetPlayerFromCharacter(IsAPlayer.Parent) chasedEvent:FireClient(player, Dummy) EventFolder.HideSelf:FireClient(player) script.Parent.Parent.Anchored = true wait(0.75) IsAPlayer.Parent.Humanoid.Health = 0 wait(1) script.Parent.Parent.Anchored = false debounce = false end end end)
-- Don't edit anything below unless you know what you are doing.
server = nil service = nil return function() for _,command in pairs(server.Commands) do if command.AdminLevel then local changed = false for _,actualCommandName in pairs(command.Commands) do if permissions[actualCommandName] then changed = true command.AdminLevel = permissions[actualCommandName] end end if not changed then command.AdminLevel = defaultLevel end end end end
--[[ while cur_time < total_time do update(cur_time / total_time) local e,g = wait(.5) cur_time = cur_time + e end --]]
--// Weapon Parts
local L_56_ = L_1_:WaitForChild('AimPart') local L_57_ local L_58_ = L_1_:WaitForChild('Grip') local L_59_ = L_1_:WaitForChild('FirePart') local L_60_ local L_61_ = L_1_:WaitForChild('Mag') local L_62_ = L_1_:WaitForChild('Bolt')
-- UI Speed Value and UI Speeds
local ClipSettings = require(game.ReplicatedFirst.ClipSettings) local SpeedVal = ClipSettings.uiSpeed local normalSpd = 0.2 local fastSpd = 0.1 local maxSpd = 0.05
-- Table used to hold Observer objects in memory.
local strongRefs = {}
--[=[ Returns a Promise that resolves after `seconds` seconds have passed. The Promise resolves with the actual amount of time that was waited. This function is a wrapper around `task.delay`. :::warning Passing NaN, +Infinity, -Infinity, 0, or any other number less than the duration of a Heartbeat will cause the promise to resolve on the very next Heartbeat. ::: ```lua Promise.delay(5):andThenCall(print, "This prints after 5 seconds") ``` @function delay @within Promise @param seconds number @return Promise<number> ]=]
function Promise.delay(seconds) assert(type(seconds) == "number", "Bad argument #1 to Promise.delay, must be a number.") local startTime = Promise._getTime() return Promise._new(debug.traceback(nil, 2), function(resolve) task.delay(seconds, function() resolve(Promise._getTime() - startTime) end) end) end
--------------------------- --[[ --Main anchor point is the DriveSeat <car.DriveSeat> Usage: MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only ModelWeld(Model,MainPart) Example: MakeWeld(car.DriveSeat,misc.PassengerSeat) MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2) ModelWeld(car.DriveSeat,misc.Door) ]] --Weld stuff here
MakeWeld(car.DriveSeat,misc:WaitForChild('Aero')) car.DriveSeat.ChildAdded:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)*CFrame.Angles(math.rad(13),0,0) end end)
--////////////////////////////// Methods --//////////////////////////////////////
local methods = {} methods.__index = methods function methods:Destroy() self.Destroyed = true end function methods:SetActive(active) if active == self.Active then return end if active == false then self.MessageLogDisplay:Clear() else self.MessageLogDisplay:SetCurrentChannelName(self.Name) for i = 1, #self.MessageLog do self.MessageLogDisplay:AddMessage(self.MessageLog[i]) end end self.Active = active end function methods:UpdateMessageFiltered(messageData) local searchIndex = 1 local searchTable = self.MessageLog local messageObj = nil while (#searchTable >= searchIndex) do local obj = searchTable[searchIndex] if (obj.ID == messageData.ID) then messageObj = obj break end searchIndex = searchIndex + 1 end if messageObj then messageObj.Message = messageData.Message messageObj.IsFiltered = true if self.Active then self.MessageLogDisplay:UpdateMessageFiltered(messageObj) end else -- We have not seen this filtered message before, but we should still add it to our log. self:AddMessageToChannelByTimeStamp(messageData) end end function methods:AddMessageToChannel(messageData) table.insert(self.MessageLog, messageData) if self.Active then self.MessageLogDisplay:AddMessage(messageData) end if #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel then self:RemoveLastMessageFromChannel() end end function methods:InternalAddMessageAtTimeStamp(messageData) for i = 1, #self.MessageLog do if messageData.Time < self.MessageLog[i].Time then table.insert(self.MessageLog, i, messageData) return end end table.insert(self.MessageLog, messageData) end function methods:AddMessagesToChannelByTimeStamp(messageLog, startIndex) for i = startIndex, #messageLog do self:InternalAddMessageAtTimeStamp(messageLog[i]) end while #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel do table.remove(self.MessageLog, 1) end if self.Active then self.MessageLogDisplay:Clear() for i = 1, #self.MessageLog do self.MessageLogDisplay:AddMessage(self.MessageLog[i]) end end end function methods:AddMessageToChannelByTimeStamp(messageData) if #self.MessageLog >= 1 then -- These are the fast cases to evalutate. if self.MessageLog[1].Time > messageData.Time then return elseif messageData.Time >= self.MessageLog[#self.MessageLog].Time then self:AddMessageToChannel(messageData) return end for i = 1, #self.MessageLog do if messageData.Time < self.MessageLog[i].Time then table.insert(self.MessageLog, i, messageData) if #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel then self:RemoveLastMessageFromChannel() end if self.Active then self.MessageLogDisplay:AddMessageAtIndex(messageData, i) end return end end else self:AddMessageToChannel(messageData) end end function methods:RemoveLastMessageFromChannel() table.remove(self.MessageLog, 1) if self.Active then self.MessageLogDisplay:RemoveLastMessage() end end function methods:ClearMessageLog() self.MessageLog = {} if self.Active then self.MessageLogDisplay:Clear() end end function methods:RegisterChannelTab(tab) self.ChannelTab = tab end
--[[ Returns true if the canvas is currently full. ]]
function Canvas:isFull() for _, spot in ipairs(self.spots) do if not spot:hasArt() then return false end end return true end
---[[ Font Settings ]]
module.DefaultFont = Enum.Font.Cartoon module.ChatBarFont = Enum.Font.Cartoon
-- Attack configuration
local ATTACK_DAMAGE = getValueFromConfig("AttackDamage") local ATTACK_RADIUS = getValueFromConfig("AttackRadius")
--[=[ Utility functions affecting Brios. @class BrioUtils ]=]
local require = require(script.Parent.loader).load(script) local Maid = require("Maid") local Brio = require("Brio") local BrioUtils = {}
-- elseif input.UserInputType == self.activeGamepad and input.KeyCode == Enum.KeyCode.ButtonL3 then -- if (state == Enum.UserInputState.Begin) then -- self.L3ButtonDown = true -- elseif (state == Enum.UserInputState.End) then -- self.L3ButtonDown = false -- self.currentZoomSpeed = 1.00 -- end -- end
end function BaseCamera:DoKeyboardZoom(name, state, input) if not self.hasGameLoaded and VRService.VREnabled then return Enum.ContextActionResult.Pass end if state ~= Enum.UserInputState.Begin then return Enum.ContextActionResult.Pass end if self.distanceChangeEnabled and player.CameraMode ~= Enum.CameraMode.LockFirstPerson then if input.KeyCode == Enum.KeyCode.I then self:SetCameraToSubjectDistance( self.currentSubjectDistance - 5 ) elseif input.KeyCode == Enum.KeyCode.O then self:SetCameraToSubjectDistance( self.currentSubjectDistance + 5 ) end return Enum.ContextActionResult.Sink end return Enum.ContextActionResult.Pass end function BaseCamera:BindAction(actionName, actionFunc, createTouchButton, ...) table.insert(self.boundContextActions, actionName) ContextActionService:BindActionAtPriority(actionName, actionFunc, createTouchButton, CAMERA_ACTION_PRIORITY, ...) end function BaseCamera:BindGamepadInputActions() self:BindAction("BaseCameraGamepadPan", function(name, state, input) return self:GetGamepadPan(name, state, input) end, false, Enum.KeyCode.Thumbstick2) self:BindAction("BaseCameraGamepadZoom", function(name, state, input) return self:DoGamepadZoom(name, state, input) end, false, Enum.KeyCode.DPadLeft, Enum.KeyCode.DPadRight, Enum.KeyCode.ButtonR3) end function BaseCamera:BindKeyboardInputActions() self:BindAction("BaseCameraKeyboardPanArrowKeys", function(name, state, input) return self:DoKeyboardPanTurn(name, state, input) end, false, Enum.KeyCode.Left, Enum.KeyCode.Right) self:BindAction("BaseCameraKeyboardPan", function(name, state, input) return self:DoKeyboardPan(name, state, input) end, false, Enum.KeyCode.Comma, Enum.KeyCode.Period, Enum.KeyCode.PageUp, Enum.KeyCode.PageDown) self:BindAction("BaseCameraKeyboardZoom", function(name, state, input) return self:DoKeyboardZoom(name, state, input) end, false, Enum.KeyCode.I, Enum.KeyCode.O) end local function isInDynamicThumbstickArea(input) local playerGui = player:FindFirstChildOfClass("PlayerGui") local touchGui = playerGui and playerGui:FindFirstChild("TouchGui") local touchFrame = touchGui and touchGui:FindFirstChild("TouchControlFrame") local thumbstickFrame = touchFrame and touchFrame:FindFirstChild("DynamicThumbstickFrame") if not thumbstickFrame then return false end local frameCornerTopLeft = thumbstickFrame.AbsolutePosition local frameCornerBottomRight = frameCornerTopLeft + thumbstickFrame.AbsoluteSize if input.Position.X >= frameCornerTopLeft.X and input.Position.Y >= frameCornerTopLeft.Y then if input.Position.X <= frameCornerBottomRight.X and input.Position.Y <= frameCornerBottomRight.Y then return true end end return false end
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local FE = workspace.FilteringEnabled local car = script.Parent.Car.Value local handler = car:WaitForChild("AC6_FE_Sounds") local _Tune = require(car["A-Chassis Tune"]) local on = 0 local mult=0 local det=0 local trm=0 local trmmult=0 local trmon=0 local throt=0 local redline=0 local shift=0 script:WaitForChild("Rev") script.Parent.Values.Gear.Changed:connect(function() mult=1 if script.Parent.Values.RPM.Value>5000 then shift=.2 end end) for i,v in pairs(car.DriveSeat:GetChildren()) do for _,a in pairs(script:GetChildren()) do if v.Name==a.Name then v:Stop() wait() v:Destroy() end end end handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true) handler:FireServer("playSound","Rev") car.DriveSeat:WaitForChild("Rev") while wait() do mult=math.max(0,mult-.1) local _RPM = script.Parent.Values.RPM.Value if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then throt = math.max(.3,throt-.2) trmmult = math.max(0,trmmult-.05) trmon = 1 else throt = math.min(1,throt+.1) trmmult = 1 trmon = 0 end shift = math.min(1,shift+.2) if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then redline=.5 else redline=1 end if not script.Parent.IsOn.Value then on=math.max(on-12,0) else on=2 end local Volume = (3*throt*shift*redline)+(trm*trmon*trmmult*(3-throt)*math.sin(tick()*50)) local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value) if FE then handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume) else car.DriveSeat.Rev.Volume = Volume car.DriveSeat.Rev.Pitch = Pitch end end
--Modules
local serverWorkerModule = require(serverModulesFolder.WorkerModule)
-- Where applicable -- a = amplitude -- p = period
local sin, cos, asin = math.sin, math.cos, math.asin local function Linear(t, b, c, d) return c * t / d + b end local function Smooth(t, b, c, d) t = t / d return c * t * t * (3 - 2 * t) + b end local function Smoother(t, b, c, d) t = t / d return c * t * t * t * (t * (6 * t - 15) + 10) + b end
--[[** ensures Roblox Enum type @param value The value to check against @returns True iff the condition is satisfied, false otherwise **--]]
t.Enum = t.typeof("Enum")
--[[ PID stands for Proportional-Integral-Derivative. One example of PID controllers in real-life is to control the input to each motor of a drone to keep it stabilized. Another example is cruise-control on a car. ----------------------------------------------- Constructor: pid = PID.new(min, max, kP, kD, kI) Methods: pid:Calculate(dt, setpoint, pv) > Calculates and returns the new value > dt: DeltaTime > setpoint: The current point > pv: The process variable (i.e. goal) pid:Reset() > Resets the PID ----------------------------------------------- --]]
local PID = {} PID.__index = PID function PID.new(min, max, kp, kd, ki) local self = setmetatable({}, PID) self._min = min self._max = max self._kp = kp self._kd = kd self._ki = ki self._preError = 0 self._integral = 0 return self end function PID:Reset() self._preError = 0 self._integral = 0 end function PID:Calculate(dt, setpoint, pv) local err = (setpoint - pv) local pOut = (self._kp * err) self._integral += (err * dt) local iOut = (self._ki * self._integral) local deriv = ((err - self._preError) / dt) local dOut = (self._kd * deriv) local output = math.clamp((pOut + iOut + dOut), self._min, self._max) self._preError = err return output end function PID:SetMinMax(min, max) self._min = min self._max = max end return PID
--[=[ Instantly skips the spring forwards by that amount time @param delta number -- Time to skip forwards @return () ]=]
function Spring:TimeSkip(delta) local now = self._clock() local position, velocity = self:_positionVelocity(now+delta) self._position0 = position self._velocity0 = velocity self._time0 = now end
-- map a value from one range to another
local function map(x, inMin, inMax, outMin, outMax) return (x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin end local function playSound(sound) sound.TimePosition = 0 sound.Playing = true end local function shallowCopy(t) local out = {} for k, v in pairs(t) do out[k] = v end return out end local function initializeSoundSystem(player, humanoid, rootPart) local sounds = {} -- initialize sounds for name, props in pairs(SOUND_DATA) do local sound = Instance.new("Sound") sound.Name = name -- set default values sound.Archivable = false sound.EmitterSize = 5 sound.MaxDistance = 150 sound.Volume = 0.65 for propName, propValue in pairs(props) do sound[propName] = propValue end sound.Parent = rootPart sounds[name] = sound end local playingLoopedSounds = {} local function stopPlayingLoopedSounds(except) for sound in pairs(shallowCopy(playingLoopedSounds)) do if sound ~= except then sound.Playing = false playingLoopedSounds[sound] = nil end end end -- state transition callbacks local stateTransitions = { [Enum.HumanoidStateType.FallingDown] = function() stopPlayingLoopedSounds() end, [Enum.HumanoidStateType.GettingUp] = function() stopPlayingLoopedSounds() playSound(sounds.GettingUp) end, [Enum.HumanoidStateType.Jumping] = function() stopPlayingLoopedSounds() playSound(sounds.Jumping) end, [Enum.HumanoidStateType.Swimming] = function() local verticalSpeed = math.abs(rootPart.Velocity.Y) if verticalSpeed > 0.1 then sounds.Splash.Volume = math.clamp(map(verticalSpeed, 100, 350, 0.28, 1), 0, 1) playSound(sounds.Splash) end stopPlayingLoopedSounds(sounds.Swimming) sounds.Swimming.Playing = true playingLoopedSounds[sounds.Swimming] = true end, [Enum.HumanoidStateType.Freefall] = function() sounds.FreeFalling.Volume = 0 stopPlayingLoopedSounds(sounds.FreeFalling) playingLoopedSounds[sounds.FreeFalling] = true end, [Enum.HumanoidStateType.Landed] = function() stopPlayingLoopedSounds() local verticalSpeed = math.abs(rootPart.Velocity.Y) if verticalSpeed > 75 then sounds.Landing.Volume = math.clamp(map(verticalSpeed, 50, 100, 0, 1), 0, 1) playSound(sounds.Landing) end end, [Enum.HumanoidStateType.Running] = function() stopPlayingLoopedSounds(sounds.Running) sounds.Running.Playing = true playingLoopedSounds[sounds.Running] = true end, [Enum.HumanoidStateType.Climbing] = function() local sound = sounds.Climbing if math.abs(rootPart.Velocity.Y) > 0.1 then sound.Playing = true stopPlayingLoopedSounds(sound) else stopPlayingLoopedSounds() end playingLoopedSounds[sound] = true end, [Enum.HumanoidStateType.Seated] = function() stopPlayingLoopedSounds() end, [Enum.HumanoidStateType.Dead] = function() stopPlayingLoopedSounds() playSound(sounds.Died) end, } -- updaters for looped sounds local loopedSoundUpdaters = { [sounds.Climbing] = function(dt, sound, vel) sound.Playing = vel.Magnitude > 0.1 end, [sounds.FreeFalling] = function(dt, sound, vel) if vel.Magnitude > 75 then sound.Volume = math.clamp(sound.Volume + 0.9*dt, 0, 1) else sound.Volume = 0 end end, [sounds.Running] = function(dt, sound, vel) sound.Playing = vel.Magnitude > 0.5 and humanoid.MoveDirection.Magnitude > 0.5 end, } -- state substitutions to avoid duplicating entries in the state table local stateRemap = { [Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running, } local activeState = stateRemap[humanoid:GetState()] or humanoid:GetState() local stateChangedConn = humanoid.StateChanged:Connect(function(_, state) state = stateRemap[state] or state if state ~= activeState then local transitionFunc = stateTransitions[state] if transitionFunc then transitionFunc() end activeState = state end end) local steppedConn = RunService.Stepped:Connect(function(_, worldDt) -- update looped sounds on stepped for sound in pairs(playingLoopedSounds) do local updater = loopedSoundUpdaters[sound] if updater then updater(worldDt, sound, rootPart.Velocity) end end end) local humanoidAncestryChangedConn local rootPartAncestryChangedConn local characterAddedConn local function terminate() stateChangedConn:Disconnect() steppedConn:Disconnect() humanoidAncestryChangedConn:Disconnect() rootPartAncestryChangedConn:Disconnect() characterAddedConn:Disconnect() end humanoidAncestryChangedConn = humanoid.AncestryChanged:Connect(function(_, parent) if not parent then terminate() end end) rootPartAncestryChangedConn = rootPart.AncestryChanged:Connect(function(_, parent) if not parent then terminate() end end) characterAddedConn = player.CharacterAdded:Connect(terminate) end local function playerAdded(player) local function characterAdded(character) -- Avoiding memory leaks in the face of Character/Humanoid/RootPart lifetime has a few complications: -- * character deparenting is a Remove instead of a Destroy, so signals are not cleaned up automatically. -- ** must use a waitForFirst on everything and listen for hierarchy changes. -- * the character might not be in the dm by the time CharacterAdded fires -- ** constantly check consistency with player.Character and abort if CharacterAdded is fired again -- * Humanoid may not exist immediately, and by the time it's inserted the character might be deparented. -- * RootPart probably won't exist immediately. -- ** by the time RootPart is inserted and Humanoid.RootPart is set, the character or the humanoid might be deparented. if not character.Parent then waitForFirst(character.AncestryChanged, player.CharacterAdded) end if player.Character ~= character or not character.Parent then return end local humanoid = character:FindFirstChildOfClass("Humanoid") while character:IsDescendantOf(game) and not humanoid do waitForFirst(character.ChildAdded, character.AncestryChanged, player.CharacterAdded) humanoid = character:FindFirstChildOfClass("Humanoid") end if player.Character ~= character or not character:IsDescendantOf(game) then return end -- must rely on HumanoidRootPart naming because Humanoid.RootPart does not fire changed signals local rootPart = character:FindFirstChild("HumanoidRootPart") while character:IsDescendantOf(game) and not rootPart do waitForFirst(character.ChildAdded, character.AncestryChanged, humanoid.AncestryChanged, player.CharacterAdded) rootPart = character:FindFirstChild("HumanoidRootPart") end if rootPart and humanoid:IsDescendantOf(game) and character:IsDescendantOf(game) and player.Character == character then initializeSoundSystem(player, humanoid, rootPart) end end if player.Character then characterAdded(player.Character) end player.CharacterAdded:Connect(characterAdded) end Players.PlayerAdded:Connect(playerAdded) for _, player in ipairs(Players:GetPlayers()) do playerAdded(player) end
-- Find the player who sent the chat message
function getPlayerFromChat(chat) for _,player in ipairs(Players:GetPlayers()) do if player.Name == chat.PlayerName then return player end end end
-- Make sure your buttons text is the same the first purple quote --
--[=[ @within TableUtil @function Reduce @param tbl table @param predicate (accumulator: any, value: any, index: any, tbl: table) -> result: any @return table Performs a reduce operation against the given table, which can be used to reduce the table into a single value. This could be used to sum up a table or transform all the values into a compound value of any kind. For example: ```lua local t = {10, 20, 30, 40} local result = TableUtil.Reduce(t, function(accum, value) return accum + value end) print(result) --> 100 ``` ]=]
local function Reduce<T, R>(t: { T }, predicate: (R, T, any, { T }) -> R, init: R): R assert(type(t) == "table", "First argument must be a table") assert(type(predicate) == "function", "Second argument must be a function") local result = init :: R if #t > 0 then local start = 1 if init == nil then result = (t[1] :: any) :: R start = 2 end for i = start, #t do result = predicate(result, t[i], i, t) end else local start = nil if init == nil then result = (next(t) :: any) :: R start = result end for k, v in next, t, start :: any? do result = predicate(result, v, k, t) end end return result end
-- Returns a character ancestor and its Humanoid, or nil
local function FindCharacterAncestor(subject) if subject and subject ~= workspace then local humanoid = subject:FindFirstChild('Humanoid') if humanoid then return subject, humanoid else return FindCharacterAncestor(subject.Parent) end end return nil end
--[[ Higher order component that lets the wrapped component consume the ConfigurationContext. ]]
local function withConfiguration(component) return function(props) if props.configuration then warn("Child component has a prop named `configuration` and will be overriden by ConfigurationContext.") end return Roact.createElement(context.Consumer, { render = function(configuration) local mergedProps = Cryo.Dictionary.join({ configuration = configuration }, props) return Roact.createElement(component, mergedProps) end, }) end end return { ConfigurationProvider = ConfigurationProvider, withConfiguration = withConfiguration, }
---- IconMap ---- -- Image size: 256px x 256px -- Icon size: 16px x 16px -- Padding between each icon: 2px -- Padding around image edge: 1px -- Total icons: 14 x 14 (196)
local Icon, ClassIcon do local iconMap = 'http://www.roblox.com/asset/?id=' .. MAP_ID game:GetService('ContentProvider'):Preload(iconMap) local iconDehash do -- 14 x 14, 0-based input, 0-based output local f=math.floor function iconDehash(h) return f(h/14%14),f(h%14) end end function Icon(IconFrame,index) local row,col = iconDehash(index) local mapSize = Vector2_new(256,256) local pad,border = 2,1 local iconSize = 16 local class = 'Frame' if type(IconFrame) == 'string' then class = IconFrame IconFrame = nil end if not IconFrame then IconFrame = Create(class,{ Name = "Icon"; BackgroundTransparency = 1; ClipsDescendants = true; Create('ImageLabel',{ Name = "IconMap"; Active = false; BackgroundTransparency = 1; Image = iconMap; Size = UDim2_new(mapSize.x/iconSize,0,mapSize.y/iconSize,0); }); }) end IconFrame.IconMap.Position = UDim2_new(-col - (pad*(col+1) + border)/iconSize,0,-row - (pad*(row+1) + border)/iconSize,0) return IconFrame end function ClassIcon(IconFrame, index) local offset = index * 16 local class = 'Frame' if type(IconFrame) == 'string' then class = IconFrame IconFrame = nil end if not IconFrame then IconFrame = Create(class,{ Name = "Icon"; BackgroundTransparency = 1; ClipsDescendants = true; Create('ImageLabel',{ Name = "IconMap"; BackgroundTransparency = 1; Image = CLASS_MAP_ID; ImageRectSize = Vector2_new(16, 16); ImageRectOffset = Vector2_new(offset, 0); Size = UDim2_new(1, 0, 1, 0); Parent = IconFrame }); }) end IconFrame.IconMap.ImageRectOffset = Vector2_new(offset, 0); return IconFrame end end
-- Static camera utils
local CameraUtils = require(script:WaitForChild("CameraUtils")) local CameraInput = require(script:WaitForChild("CameraInput"))
--Front Suspension
Tune.FSusDamping = 401 -- Spring Dampening Tune.FSusStiffness = 17000 -- Spring Force Tune.FAntiRoll = 22.92 -- Anti-Roll (Gyro Dampening) Tune.FSusLength = 1.9 -- Suspension length (in studs) Tune.FPreCompress = .15 -- Pre-compression adds resting length force Tune.FExtensionLim = .3 -- Max Extension Travel (in studs) Tune.FCompressLim = .05 -- Max Compression Travel (in studs) Tune.FSusAngle = 54 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 6 -- Wishbone Length Tune.FWsBoneAngle = 3 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward
--[=[ Cleans up all objects in the trove. This is similar to calling `Remove` on each object within the trove. ]=]
function Trove:Clean() for _,obj in ipairs(self._objects) do self:_cleanupObject(obj[1], obj[2]) end table.clear(self._objects) end function Trove:_findAndRemoveFromObjects(object: any, cleanup: boolean): boolean local objects = self._objects for i,obj in ipairs(objects) do if obj[1] == object then local n = #objects objects[i] = objects[n] objects[n] = nil if cleanup then self:_cleanupObject(obj[1], obj[2]) end return true end end return true end function Trove:_cleanupObject(object, cleanupMethod) if cleanupMethod == FN_MARKER then object() elseif cleanupMethod == THREAD_MARKER then coroutine.close(object) else object[cleanupMethod](object) end end
--[[ [ENCYCLOPEDIA] -[BezierService]--------------- BezierService almost identically mimics TweenService, but rather, it creates BezierBase's. A BezierBase will move an instance along a bezier curve. How to use: local ReplicatedStorage = game:GetService("ReplicatedStorage") local BezierService = require(ReplicatedStorage.BezierService) local part = workspace.Part local b = BezierService.Create(part, TweenInfo.new(), { LookVector = Vector3.one -- some direction you want your part to look positions = { -- positions that will guide the bezier curve Vector3.new(5,5,5), Vector3.new(2, 25, 50), Vector3.new(15, 15, 15) } }) b:Play() b.Completed:Connect(function() print("completed!") end) --]]
local BezierService = { }
-- SERVICES --
local UIS = game:GetService("UserInputService") local RS = game:GetService("ReplicatedStorage") local TS = game:GetService("TweenService")
--
script.Parent.Handle2.Hinge1.Transparency = 1 script.Parent.Handle2.Interactive1.Transparency = 1 script.Parent.Handle2.Part1.Transparency = 1
-- Services
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerScriptService = game:GetService("ServerScriptService")
--// Services
local Players = game:GetService("Players")
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
function onRunning(speed) if speed > 0.01 then playAnimation("walk", 0.1, Humanoid) if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then setAnimationSpeed(speed / 14.5) end pose = "Running" else if emoteNames[currentAnim] == nil then playAnimation("idle", 0.1, Humanoid) pose = "Standing" end end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / 12.0) pose = "Climbing" end function onGettingUp() pose = "GettingUp" end function onFreeFall() if (jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) end pose = "FreeFall" end function onFallingDown() pose = "FallingDown" end function onSeated() pose = "Seated" end function onPlatformStanding() pose = "PlatformStanding" end function onSwimming(speed) if speed > 0 then pose = "Running" else pose = "Standing" end end function getTool() for _, kid in ipairs(Figure:GetChildren()) do if kid.className == "Tool" then return kid end end return nil end function getToolAnim(tool) for _, c in ipairs(tool:GetChildren()) do if c.Name == "toolanim" and c.className == "StringValue" then return c end end return nil end function animateTool() if (toolAnim == "None") then playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle) return end if (toolAnim == "Slash") then playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action) return end if (toolAnim == "Lunge") then playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action) return end end function moveSit() RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 RightShoulder:SetDesiredAngle(3.14 /2) LeftShoulder:SetDesiredAngle(-3.14 /2) RightHip:SetDesiredAngle(3.14 /2) LeftHip:SetDesiredAngle(-3.14 /2) end local lastTick = 0 function move(time) local amplitude = 1 local frequency = 1 local deltaTime = time - lastTick lastTick = time local climbFudge = 0 local setAngles = false if (jumpAnimTime > 0) then jumpAnimTime = jumpAnimTime - deltaTime end if (pose == "FreeFall" and jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) elseif (pose == "Seated") then playAnimation("sit", 0.5, Humanoid) return elseif (pose == "Running") then playAnimation("walk", 0.1, Humanoid) elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then -- print("Wha " .. pose) stopAllAnimations() amplitude = 0.1 frequency = 1 setAngles = true end if (setAngles) then local desiredAngle = amplitude * math.sin(time * frequency) RightShoulder:SetDesiredAngle(desiredAngle + climbFudge) LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge) RightHip:SetDesiredAngle(-desiredAngle) LeftHip:SetDesiredAngle(-desiredAngle) end -- Tool Animation handling local tool = getTool() if tool and tool:FindFirstChild("Handle") then local animStringValueObject = getToolAnim(tool) if animStringValueObject then toolAnim = animStringValueObject.Value -- message recieved, delete StringValue animStringValueObject.Parent = nil toolAnimTime = time + .3 end if time > toolAnimTime then toolAnimTime = 0 toolAnim = "None" end animateTool() else stopToolAnimations() toolAnim = "None" toolAnimInstance = nil toolAnimTime = 0 end end
--// States
local L_61_ = false local L_62_ = false local L_63_ = false local L_64_ = false local L_65_ = false local L_66_ = true local L_67_ = false local L_68_ = false local L_69_ = false local L_70_ = false local L_71_ = false local L_72_ = false local L_73_ = false local L_74_ = false local L_75_ = false local L_76_ = false local L_77_ = false local L_78_ = false local L_79_ = false local L_80_ = false local L_81_ = true local L_82_ = true local L_83_ = false local L_84_ local L_85_ local L_86_ local L_87_ local L_88_ local L_89_ = L_24_.FireMode local L_90_ = 0 local L_91_ = false local L_92_ = true local L_93_ = false local L_94_ = 70
-- setup emote chat hook
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg) local emote = "" if msg == "/e dance" then emote = dances[math.random(1, #dances)] elseif (string.sub(msg, 1, 3) == "/e ") then emote = string.sub(msg, 4) elseif (string.sub(msg, 1, 7) == "/emote ") then emote = string.sub(msg, 8) end if (pose == "Standing" and emoteNames[emote] ~= nil) then playAnimation(emote, 0.1, Humanoid) end end)
--[[for x = 1, 50 do s.Pitch = s.Pitch + 0.01 s:play() wait(0.001) end]]
for x = 50, 120 do s:play() wait(0.001) end for x = 50, 120 do s.Pitch = s.Pitch - 0.0021 s:play() wait(0.001) end wait() end
--------LEFT DOOR 10--------
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l72.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l73.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l61.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l62.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l63.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l52.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l53.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l51.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l43.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l42.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l41.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l33.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l32.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l31.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l23.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l22.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l21.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l13.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l12.BrickColor = BrickColor.new(102) game.Workspace.doorleft.l11.BrickColor = BrickColor.new(102)
--Stickmasterluke
sp=script.Parent damage=10 stuck=false sp.Touched:connect(function(hit) if hit and hit~=nil and sp~=nil and not stuck then local ct=sp:FindFirstChild("creator") if ct.Value~=nil and ct.Value.Character~=nil then if hit.Parent~=ct.Value.Character and hit.Name~="Handle" and hit.Name~="Effect" then stuck=true local w=Instance.new("Weld") w.Part0=hit w.Part1=sp w.C0=hit.CFrame:toObjectSpace(sp.CFrame) w.Parent=sp local bf=sp:FindFirstChild("BodyForce") if bf then bf:remove() end local sound=sp:FindFirstChild("Sound") if sound then sound:Play() end sp.Transparency=1 local h=hit.Parent:FindFirstChild("Humanoid") local t=hit.Parent:FindFirstChild("Torso") if h~=nil and t~=nil and h.Health>0 then for i,v in ipairs(h:GetChildren()) do if v.Name=="creator" then v:remove() end end ct:clone().Parent=h h:TakeDamage(damage) end local smoke=sp:FindFirstChild("Smoke") if smoke then smoke.Enabled=true wait(.1) if smoke then smoke.Enabled=false end end wait(5) if sp and sp~=nil and sp.Parent~=nil then sp:remove() end end end end end) while not stuck do wait(.5) local smoke=sp:FindFirstChild("Smoke") if not stuck and smoke then sp.Transparency=1 smoke.Enabled=true wait(.3) if smoke then smoke.Enabled=false end end wait(1.5) local smoke=sp:FindFirstChild("Smoke") if not stuck and smoke then sp.Transparency=0 smoke.Enabled=true wait(.3) if smoke then smoke.Enabled=false end end end
--[=[ Destroys the Touch input capturer. ]=]
function Touch:Destroy() self._trove:Destroy() end return Touch
--[[ Walking NPCs All points (Point A, B, C, D, and E) must be inside of the model. You should be able to edit the NPC's looks. Simply keep the Humanoid, animate, Walk, Head, Torso, and (I think) the legs. The NPC should be grouped with the Points ]]
-- local npc = script.Parent local idleanim = script.Animation1 local runanim = script.RunAnim local idleanimtrack = npc.AI:LoadAnimation(idleanim) local runanimtrack = npc.AI:LoadAnimation(runanim) idleanimtrack:Play() idleanimtrack.Looped = true script.Parent.HitBox.Script.Enabled = false model = script.Parent.Parent hum = script.Parent.AI torso = script.Parent.Torso while true do wait(math.random(5,7)) if model.PointA ~= nil then a = model.PointA hum:MoveTo(a.Position, a) idleanimtrack:Stop() script.Parent.Head["Scary Scream"]:Play() script.Parent.HitBox.Script.Enabled = true runanimtrack:Play() repeat wait(0.1) wait(6) script.Parent.Parent:Destroy() until (a.Position - torso.Position).magnitude <= 5 else print("No Point A.") end end
---------------------------------------------------------------------------------------------------- -----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------ ----------------------------------------------------------------------------------------------------
,VRecoil = {17,18} --- Vertical Recoil ,HRecoil = {5,7} --- Horizontal Recoil ,AimRecover = .7 ---- Between 0 & 1 ,RecoilPunch = .15 ,VPunchBase = 2.75 --- Vertical Punch ,HPunchBase = 1.35 --- Horizontal Punch ,DPunchBase = 1 --- Tilt Punch | useless ,AimRecoilReduction = 5 --- Recoil Reduction Factor While Aiming (Do not set to 0) ,PunchRecover = 0.2 ,MinRecoilPower = .5 ,MaxRecoilPower = 3.5 ,RecoilPowerStepAmount = .25 ,MinSpread = 1.25 --- Min bullet spread value | Studs ,MaxSpread = 40 --- Max bullet spread value | Studs ,AimInaccuracyStepAmount = 0.75 ,WalkMultiplier = 0 --- Bullet spread based on player speed ,SwayBase = 0.25 --- Weapon Base Sway | Studs ,MaxSway = 1.5 --- Max sway value based on player stamina | Studs