prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[=[
Gets class type for the given lua type
@param luaType string
@return string?
]=]
|
function ValueBaseUtils.getClassNameFromType(luaType)
return TYPE_TO_CLASSNAME_LOOKUP[luaType]
end
|
--DO NOT DELETE, THIS WILL BREAK THE GUN
|
function Stick(x, y)
local W = Instance.new("Weld")
W.Part0 = x
W.Part1 = y
local CJ = CFrame.new(x.Position)
local C0 = x.CFrame:inverse()*CJ
local C1 = y.CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = x
end
function Get(A)
if A.ClassName == ("Part") then
Stick(script.Parent.Handle, A)
A.Anchored = false
else
local C = A:GetChildren()
for i=1, #C do
Get(C[i])
end
end
end
function Finale()
Get(script.Parent)
end
script.Parent.Equipped:connect(Finale)
script.Parent.Unequipped:connect(Finale)
Finale()
|
-- Local private variables and constants
|
local ZERO_VECTOR2 = Vector2.new(0,0)
local tweenAcceleration = math.rad(220) --Radians/Second^2
local tweenSpeed = math.rad(0) --Radians/Second
local tweenMaxSpeed = math.rad(250) --Radians/Second
local TIME_BEFORE_AUTO_ROTATE = 2.0 --Seconds, used when auto-aligning camera with vehicles
local INITIAL_CAMERA_ANGLE = CFrame.fromOrientation(math.rad(-15), 0, 0)
|
--[[
WeaponRuntimeData
Description: WeaponRuntimeData is wraps around the tool to turn it into a weapon for all other scripts to access on the weapon.
It contains the current ammo of a weapon, recoil simulation data, and spread simulation data. Also some helpful methods to quickly
determine if a weapon has ammo or not.
]]
|
local WeaponRuntimeData = {}
WeaponRuntimeData.__index = WeaponRuntimeData
|
--[[Weight and CG]]
|
Tune.Weight = 3439 -- Total weight (in pounds, under Earth's gravity)
Tune.WeightBSize = { -- Size of weight brick, dimensions of your car in inches divided by 10
--[[Width]] 7.03 ,
--[[Height]] 5.35 ,
--[[Length]] 18.11 }
Tune.WeightDist = 55 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.AxleSize = 1.5 -- Size of structural members (larger = MORE STABLE / carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
Tune.CustomSuspensionDensity = 0 -- Density of suspension joints, only applies to custom suspension
|
--
|
local dualWorld = require(game.ReplicatedStorage.DualWorlds).new(localPlayer.Character, doorA, doorB, Enum.NormalId.Front, localPlayer.PlayerGui)
dualWorld.PortalA:AddToWorld(dualWorld.PortalB:ClipModel(world:Clone()))
dualWorld.PortalB:AddToWorld(dualWorld.PortalA:ClipModel(world:Clone()))
|
--removedLength = 8
|
function onTouched(hit)
if hit.Parent == nil then return end
humanoid = hit.Parent:findFirstChild("Humanoid")
if(ball.Name=="Icicle") then
-- make a splat
for i=1,3 do
local s = Instance.new("Part")
s.Name = "Shard"
s.Shape = 1 -- block
s.formFactor = 2 -- plate
s.Size = Vector3.new(1,.4,1)
s.BrickColor = BrickColor.new(blues[math.random(#blues)])
s.Material = Enum.Material.Ice
local v = Vector3.new(math.random(-1,1), math.random(0,1), math.random(-1,1))
s.Velocity = 50 * v
s.CFrame = CFrame.new(ball.Position + v, v)
local new_script = script:clone()
new_script.Disabled = false
new_script.Parent = s
s.Parent = game.Workspace
local tag = ball:findFirstChild("creator")
if tag~= nil then
local new_tag = tag:clone()
new_tag.Parent = s
end
debris:AddItem(s, 2) ---NICK I THINK THIS IS IT
if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid:TakeDamage(damage)
wait(2)
untagHumanoid(humanoid)
end
connection:disconnect()
ball.Parent = nil
end
else
if humanoid ~= nil then
tagHumanoid(humanoid)
humanoid:TakeDamage(10)
wait(2)
untagHumanoid(humanoid)
ball.Parent = nil
end
--removedLength = 2
connection:disconnect()
end
end
function tagHumanoid(humanoid)
-- todo: make tag expire
local tag = ball:findFirstChild("creator")
if tag ~= nil then
local new_tag = tag:clone()
new_tag.Parent = humanoid
end
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
connection = ball.Touched:connect(onTouched)
wait(8)
|
--[[
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/100 --Take all of the player's health away
i.Parent["Right Leg"].Anchored = true --Anchor their legs
i.Parent["Left Leg"].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.Torso.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["Right Leg"].Anchored = false --Free the player
i.Parent["Left Leg"].Anchored = false
h.Jump = true --Make sure the player isn't glitched
i.Parent.Torso.Anchored = false
debounce = true
end
end
end
script.Parent.Touched:connect(onTouched)
|
--[=[
Cancels this promise, preventing the promise from resolving or rejecting. Does not do anything if the promise is already settled.
Cancellations will propagate upwards and downwards through chained promises.
Promises will only be cancelled if all of their consumers are also cancelled. This is to say that if you call `andThen` twice on the same promise, and you cancel only one of the child promises, it will not cancel the parent promise until the other child promise is also cancelled.
```lua
promise:cancel()
```
]=]
|
function Promise.prototype:cancel()
if self._status ~= Promise.Status.Started then
return
end
self._status = Promise.Status.Cancelled
if self._cancellationHook then
self._cancellationHook()
end
coroutine.close(self._thread)
if self._parent then
self._parent:_consumerCancelled(self)
end
for child in pairs(self._consumers) do
child:cancel()
end
self:_finalize()
end
|
--[=[
Alias for Destroy.
@method Kill
@within Brio
]=]
|
Brio.Kill = Brio.Destroy
|
-- Services --
|
local Players = game:GetService('Players')
local RepStorage = game:GetService('ReplicatedStorage')
local RunService = game:GetService('RunService')
|
-----------------
--| Constants |--
-----------------
|
local ROCKET_MESH_ID = ''
local ROCKET_MESH_SCALE = Vector3.new(1, 1, 1)
local ANIM_TOTAL_TIME = 3.4 -- Total length of FireAndReload animation
local ROCKET_SHOW_TIME = 1.5 -- Seconds after animation begins to show the rocket
local ROCKET_HIDE_TIME = 2.2 -- Seconds after animation begins to hide the rocket
|
--print("guess again, old man")
|
elseif key == "w" then
w = true
elseif key == "s" then
s = true
carSeat.Parent.Rinner.Material = "Neon"
carSeat.Parent.Linner.Material = "Neon"
end
end)
mouse.KeyUp:connect(function (key)
key = string.lower(key)
if key == "a" or key == "d" then
if d == false then
m.DesiredAngle = 0
n.DesiredAngle = m.DesiredAngle
end
elseif key == "d" then
print("d up")
if a == false then
m.DesiredAngle = 0
n.DesiredAngle = m.DesiredAngle
end
end
a = false
d = false
end)
mouse.KeyUp:connect(function (key)
key = string.lower(key)
if key == "w" or key == "s" then
carSeat.Parent.Rinner.Material = "SmoothPlastic"
carSeat.Parent.Linner.Material = "SmoothPlastic"
end
end)
HUB.Flip.MouseButton1Click:connect(function()
local g = Instance.new("BodyGyro", player.Character.HumanoidRootPart)
g.maxTorque = Vector3.new(math.huge, 0, math.huge)
g.cframe = CFrame.new(0,0,0)
game:GetService("Debris"):AddItem(g, 3)
end)
limitButton.MouseButton1Click:connect(function()
|
------//Sprinting Animations
|
self.RightSprint = CFrame.new(-1.1, 0.75, -1.25) * CFrame.Angles(math.rad(-40), math.rad(-45), math.rad(0))
self.LeftSprint = CFrame.new(1,0.8,-1) * CFrame.Angles(math.rad(-30),math.rad(60),math.rad(0))
self.RightElbowSprint = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftElbowSprint = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.RightWristSprint = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftWristSprint = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
return self
|
-- ONLY SUPPORTS ORDINAL TABLES (ARRAYS). Allocates a new table by getting the length of the current table and increasing its capacity by the specified amount.
-- This uses Roblox's table.create function.
|
Table.expand = function (tbl, byAmount)
if (byAmount < 0) then
error("Cannot expand a table by a negative amount of objects.")
end
local newtbl = table.create(#tbl + byAmount)
for i = 1, #tbl do
newtbl[i] = tbl[i]
end
return newtbl
end
return Table
|
--
|
local car=script.Parent
for i,a in pairs(car.Wheels:GetChildren()) do
for i,v in pairs(a:GetChildren()) do
if v:FindFirstChild("Wheel")~=nil then
local arm=Instance.new("Part",v)
arm.Name="Arm"
arm.Anchored=true
arm.CanCollide=false
arm.FormFactor=Enum.FormFactor.Custom
arm.Size=Vector3.new(1,1,1)
arm.CFrame=v.Wheel.CFrame*CFrame.Angles(-math.pi/2,-math.pi/2,0)
arm.TopSurface=Enum.SurfaceType.Smooth
arm.BottomSurface=Enum.SurfaceType.Smooth
arm.Transparency=1
local base=arm:Clone()
base.Parent=v
base.Name="Base"
base.CFrame=base.CFrame*CFrame.new(0,1,0)
base.BottomSurface=Enum.SurfaceType.Hinge
local axle=arm:Clone()
axle.Parent=v
axle.Name="Axle"
axle.CFrame=CFrame.new(v.Wheel.Position-((v.Wheel.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Wheel.Size.x/2)+(axle.Size.x/2))),v.Wheel.Position)*CFrame.Angles(0,math.pi,0)
axle.BackSurface=Enum.SurfaceType.Hinge
MakeWeld(car.DriveSeat,base,"Weld")--
if v.Parent.Name == "RL" or v.Parent.Name == "RR" then
MakeWeld(car.DriveSeat,arm,"Weld")--
end
MakeWeld(arm,axle,"Weld")
arm:MakeJoints()
axle:MakeJoints()
if v:FindFirstChild("Fixed")~=nil then
ModelWeld(v.Fixed,axle)
end
if v:FindFirstChild("Parts")~=nil then
ModelWeld(v.Parts,v.Wheel)
end
local gyro=Instance.new("BodyGyro",arm)
gyro.Name="Steer"
gyro.P=100000
gyro.D=1000
gyro.MaxTorque=Vector3.new(50000,50000,50000)
gyro.cframe=base.CFrame
end
end
end
ModelWeld(car.Body,car.DriveSeat)
wait()
UnAnchor(car)
local parts={}
function Parts(a)
if a:IsA("BasePart") then table.insert(parts,a) elseif a:IsA("Model") then for i,v in pairs(a:GetChildren()) do Parts(v) end end
end
script.G.Car.Value=script.Parent
car.DriveSeat.ChildAdded:connect(function(child)
if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
for i,v in pairs(parts) do
v:SetNetworkOwner(p)
end
child.C0=CFrame.new(0,-1,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
local g=script.G:Clone()
g.Parent=p.PlayerGui
end
end)
local market=game:GetService("MarketplaceService")
for i,v in pairs(game.Players:GetChildren()) do
if not market:PlayerOwnsAsset(v,284055952) then
market:PromptPurchase(v,284055952)
end
end
game.Players.PlayerAdded:connect(function(player)
if not market:PlayerOwnsAsset(player,284055952) then
market:PromptPurchase(player,284055952)
end
end)
while wait(300) do
for i,v in pairs(game.Players:GetChildren()) do
if not market:PlayerOwnsAsset(v,284055952) then
market:PromptPurchase(v,284055952)
end
end
end
|
-- This is the function you should use if you want to weld a model.
-- Parameters:
-- model = The Model containing the parts.
-- mainPart = The part where all other parts will be welded against.
-- Returns:
-- A Lua table containing all welds, which can be fed into the UnanchorWeldList function, as demonstrated in the example code.
|
function WeldAllToPart(model, mainPart)
local welds = {}
WeldAll(model, mainPart, welds)
return welds
end
|
--// ToDo: Move to common modules
|
function methods:WaitUntilParentedCorrectly()
while (not self.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer)) do
self.GuiObject.AncestryChanged:Wait()
end
end
|
-- Customizable variables
|
local TWEEN_TIME = posRndm -- Time for the animation
local TWEEN_MOVE_DISTANCE = posRndm -- Distance to move
|
--set these three variables to your liking
|
local printAll = false
local fullscan = true
local doublescan = false
|
-- Get reference to the Dock frame
|
local btn = script.Parent
|
-----------------------------------------------------------------------------------------------
|
ItemID = 107021385 -- The ID of the Gamepass/T-Shirt.
OpenTime = 0 -- The time the door is open for.
OpenTrans = 1 -- The transparency of the door when it is open.
CloseTrans = 1 -- The transparency of the door when it is closed.
BuyGUI = true -- Set to false to stop the BuyGUI appearing.
KillOnTouch = false -- Set to false to stop players being killed when they touch it.
|
--Tune
|
TuckInSpeed = 70 --At what speed you tuck in
|
--------- Slim AI Script (don't edit unless you know what you're doing) -----------
|
local slime = script.Parent
local walkAnimation = slime.Slime:LoadAnimation(slime.Slime.Animation)
walkAnimation:Play()
slime.Slime.Died:Connect(function()
slime:Destroy()
-- TODO: Add fancier death or give rewards
end)
local hasDamagedRecently = false
local function damageIfHumanoidDebounced(part)
if not hasDamagedRecently then
local humanoid = part.Parent:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health -= damage
hasDamagedRecently = true
wait(damageDebounceDelay)
hasDamagedRecently = false
end
end
end
for _,part in pairs(slime:GetChildren()) do
if part:IsA("BasePart") and part.Name ~= "HitBox" then
part.Touched:Connect(damageIfHumanoidDebounced)
end
end
local function getClosestPlayer(position)
local closestPlayer = false
local closestDistance = 999999999
for _,player in pairs(game.Players:GetChildren()) do
local playerPosition = game.Workspace:WaitForChild(player.Name).HumanoidRootPart.Position
local dist = (position - playerPosition).magnitude
if(dist < closestDistance) then
closestDistance = dist
closestPlayer = game.Workspace:WaitForChild(player.Name)
end
end
return closestPlayer
end
local isWandering = false
while true do -- main AI loop
wait(.1)
local player = getClosestPlayer(slime.Head.Position)
if player then
local distance = (player.PrimaryPart.Position - slime.HumanoidRootPart.Position).magnitude
if distance < detectionDistance then
isWandering = false
slime.Slime.WalkSpeed = chaseSpeed
slime.Slime:MoveTo(player.PrimaryPart.Position)
else
if not isWandering then
isWandering = true
slime.Slime.WalkSpeed = wanderSpeed
slime.Slime:MoveTo(slime.HumanoidRootPart.Position + Vector3.new(math.random(-wanderDistance, wanderDistance), 0, math.random(-wanderDistance, wanderDistance)))
slime.Slime.MoveToFinished:Connect(function()
isWandering = false
end)
end
end
end
end
|
--[[
Most accurate way to calculate cumulative probability. Accepts a list of integers (any size).
Used for lootboxes, drop chances, or any other list-oriented RNG mechanics. Highly accurate. Returns (1) winner ID and (2) roll.
Example:
_L.Functions.Lottery(
{"dirt", 500},
{"copper", 45},
{"silver", 18},
{"gold", 7.5},
{"platinum", 0.05},
)
--]]
|
return function(...)
--- Variables
local entrees = {...}
local roll
--- Needs a minimum of 1 entree
if #entrees < 2 then
--_L.Print("Did not provide enough arguments to simulate lottery (>1)", true)
return (entrees[1] and entrees[1][1])
end
--- Convert integers into a percentage (int/total)
local function Init()
local total = 0
--
for _, entree in ipairs(entrees) do
local float = entree[2]
total = total + float
end
--
for _, entree in ipairs(entrees) do
local float = entree[2]
local percentage = (float / total)
entree[2] = percentage
entree[3] = float
end
end
--- Pick a random number (0-1)
local function Roll()
roll = rng:NextNumber()
end
--- Pick winner (actual black magic)
local function Calc()
local total = 0
--
for _, entree in ipairs(entrees) do
local percentage = entree[2]
total = total + percentage
if roll <= total then
return entree
end
end
end
--- Run
Init()
Roll()
local result = Calc()
--
return result[1], roll, result[3]
end
|
-- create attachments
|
local attachment0 = Instance.new("Attachment")
local attachment1 = Instance.new("Attachment")
beam.Attachment0 = attachment0
beam.Attachment1 = attachment1
|
-- returns a table with vector3 control points of the Bezier
|
function Bezier:GetAllPoints(): {Vector3}
-- declarations
local points = self.Points
local numPoints = #points
local v3Points = {}
-- iterate through points
for i = 1, numPoints do
table.insert(v3Points, self:GetPoint(i))
end
-- return list of points
return v3Points
end
|
-- ROBLOX deviation: printBigInt omitted
|
local function printFunction(val: any, printFunctionName: boolean): string
if not printFunctionName then
return "[Function]"
end
local functionName = debug.info(val, "n")
if functionName == nil or functionName == "" then
functionName = "anonymous"
end
return "[Function " .. functionName .. "]"
end
local function printSymbol(val: any): string
return tostring(val)
end
local function printError(val)
return "[" .. tostring(val) .. "]"
end
|
-- for key,value in pairs(sessionData[playerUserId]) do
-- print("Getting object "..key)
-- print(value)
-- end
|
-- Data exists for this player
-- Data store is working, but no current data for this player
|
--[[
InstantKill
Place this Script inside a part.
This part will kill any character touching it instantly.
--]]
|
local part = script.Parent
local function onTouched(otherPart)
-- Confirm the part has a parent
local character = otherPart.Parent
if character then
-- Look for a humanoid inside the part's parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
-- If the humanoid exists, set its health to 0
humanoid.Health = 0
end
end
end
|
--[=[
@within TableUtil
@function Reconcile
@param source table
@param template table
@return table
Performs a one-way sync on the `source` table against the
`template` table. Any keys found in `template` that are
not found in `source` will be added to `source`. This is
useful for syncing player data against data template tables
to ensure players have all the necessary keys, while
maintaining existing keys that may no longer be in the
template.
This is a deep operation, so nested tables will also be
properly reconciled.
```lua
local template = {kills = 0, deaths = 0, xp = 0}
local data = {kills = 10, abc = 20}
local correctedData = TableUtil.Reconcile(data, template)
print(correctedData) --> {kills = 10, deaths = 0, xp = 0, abc = 30}
```
]=]
|
local function Reconcile(src: Table, template: Table): Table
assert(type(src) == "table", "First argument must be a table")
assert(type(template) == "table", "Second argument must be a table")
local tbl = Copy(src)
for k,v in pairs(template) do
local sv = src[k]
if sv == nil then
if type(v) == "table" then
tbl[k] = Copy(v, true)
else
tbl[k] = v
end
elseif type(sv) == "table" then
if type(v) == "table" then
tbl[k] = Reconcile(sv, v)
else
tbl[k] = Copy(sv, true)
end
end
end
return tbl
end
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
env.script.Parent.Parent:Destroy()
end
|
--original, 5, 10
|
GameSettings.TransitionTime = 5
GameSettings.QueueTime = 5
GameSettings.PlayersPerDifficulty = {
Easy = 1,
Normal = 2,
Hard = 3
}
|
--//Suspension//--
|
RideHeightFront = 2 --{This value will increase the ride height for front}
RideHeightRear = 2.3 --{This value will increase the ride height for rear}
StiffnessFront = 5 --[0-10]{HIGHER STIFFNESS DECREASES SPAWNING STABILITY}
StiffnessRear = 4 --[0-10]{This value will increase the stiffness for rear} (S/A)
AntiRollFront = 2 --[0-10]{HIGHER STIFFNESS DECREASES SPAWNING STABILITY}
AntiRollRear = 3 --[0-10]{This value will reduce roll on the rear} (S/A)
CamberFront = -0.2 --[0-10]{Camber to the front in degrees}
CamberRear = -1.3 --[0-10]{Camber to the rear in degrees}
|
--vars
|
local state = "unequipped"
local adsing = false
local rstepgun
local savedfov
local currentlyfps = false
offset = CFrame.new()
|
---------------------------------
|
local force = Instance.new("BodyForce")
force.Parent = torso
f = force
wait(0.01)
elseif ison == 0 then
if arms then
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
f.Parent = nil
arms[2].Name = "Right Leg"
arms[1].Name = "Left Leg"
welds[1].Parent = nil
welds[2].Parent = nil
end
end
|
--Initialization
|
tool = script.Tool.Value
char = script.Char.Value
part = script.Part.Value
|
-- This is to store other things that may require our radar attention
|
local Camera = workspace.CurrentCamera
local SaveList = {MinhaVisao = 1, RosaDosVentos = 1, UIAspectRatioConstraint = 1, FoeBlip = 1, FriendBlip = 1}
local SquadSave = {UIGridLayout = 1}
Character.Humanoid.Died:Connect(function()
script.Parent.Enabled = false
end)
game:GetService("RunService").RenderStepped:connect(function()
local Direction = (Vector2.new(Camera.Focus.x,Camera.Focus.z)-Vector2.new(Camera.CoordinateFrame.x,Camera.CoordinateFrame.z)).unit
local theta = (math.atan2(Direction.y,Direction.x))*(-180/math.pi) - 90
if Saude.FireTeam.SquadName.Value ~= "" then
MinhasVisao.ImageColor3 = Saude.FireTeam.SquadColor.Value
else
MinhasVisao.ImageColor3 = Color3.fromRGB(255,255,255)
end
local frame = Vector3.new(Camera.CoordinateFrame.x, 0, Camera.CoordinateFrame.z)
local focus = Vector3.new(Camera.Focus.x, 0, Camera.Focus.z)
local frame = CFrame.new(focus, frame)
script.Parent.Frame.RosaDosVentos.Rotation = theta
local players = game.Players:GetChildren()
if Saude.FireTeam.SquadName.Value ~= "" and Player then
script.Parent.Squad.Visible = true
script.Parent.Squad.Esquadrao.Text = Saude.FireTeam.SquadName.Value
else
script.Parent.Squad.Visible = false
end
local Nomes = script.Parent.Squad.Membros:GetChildren()
for i = 1, #Nomes do
if not SquadSave[Nomes[i].Name] then
Nomes[i]:Destroy()
end
end
for i = 1, #players do
if players[i] ~= Player and players[i].Character and Player and Player.Character and Player.Character.Humanoid.Health > 0 then
local unit = script.Parent.Squad.Membros:FindFirstChild(players[i].Name)
if not unit then
if players[i].TeamColor == Player.TeamColor and players[i].Character:FindFirstChild("Saude") and players[i].Character.Saude:FindFirstChild("FireTeam") and players[i].Character.Saude.FireTeam.SquadName.Value == Player.Character.Saude.FireTeam.SquadName.Value and Player.Character.Saude.FireTeam.SquadName.Value ~= "" then
unit = script.Parent.Squad.Exemplo:Clone()
unit.Visible = true
unit.Text = players[i].Name
unit.Name = players[i].Name
unit.Parent = script.Parent.Squad.Membros
end
end
end
end
local labels = RadarFrame:GetChildren()
for i = 1, #labels do
if not SaveList[labels[i].Name] then
labels[i]:Destroy()
end
end
for i = 1, #players do
if players[i] ~= Player and players[i].Character and Player and Player.Character then
local unit = RadarFrame:FindFirstChild(players[i].Name)
if not unit then
if players[i].TeamColor == Player.TeamColor then
unit = FriendBlip:Clone()
else
unit = FoeBlip:Clone()
end
unit.Visible = false
unit.Name = players[i].Name
unit.Parent = RadarFrame
end
if players[i].Character:FindFirstChild('Humanoid') and players[i].Character:FindFirstChild('HumanoidRootPart') then
-- Get the relative position of the players
local pos = CFrame.new(players[i].Character.HumanoidRootPart.Position.X, 0, players[i].Character.HumanoidRootPart.Position.Z)
local relativeCFrame = frame:inverse() * pos
local distanceRatio = relativeCFrame.p.Magnitude/RANGE
if distanceRatio < 0.9 then
local xScale = 0.5 - ((relativeCFrame.x/RANGE)/2)
local yScale = 0.5 - ((relativeCFrame.z/RANGE)/2)
unit.Position = UDim2.new(xScale, 0, yScale, 0)
unit.Rotation = -players[i].Character.HumanoidRootPart.Orientation.Y + theta
if players[i].TeamColor == Player.TeamColor and players[i].Character then
if players[i].Character:FindFirstChild("Saude") and players[i].Character.Saude:FindFirstChild("FireTeam") and players[i].Character.Saude.FireTeam.SquadName.Value ~= "" then
unit.ImageColor3 = players[i].Character.Saude.FireTeam.SquadColor.Value
else
unit.ImageColor3 = FriendBlip.ImageColor3
end
else
unit.ImageColor3 = FoeBlip.ImageColor3
end
unit.Visible = true
else
unit.Visible = false
end
else
unit.Visible = false
end
end
end
end)
|
-- Autosaving part
|
game.Players.PlayerRemoving:Connect(function(Player)
DataStore:SetAsync(Player.UserId, Player.leaderstats.Coins.Value) -- Change "Coins" to the name of your currency.
end)
|
-- Finds out which side the player is on and teleports them to the other
|
local function TeleportToOtherSide(character, hitPart)
local bottomOfDoor = VipDoor.CFrame.p - Vector3.new(0, VipDoor.Size.Y / 2, 0)
local inFrontOfDoor = bottomOfDoor + VipDoor.CFrame.lookVector * 3
local behindDoor = bottomOfDoor - VipDoor.CFrame.lookVector * 3
local distanceToFront = (inFrontOfDoor - hitPart.Position).magnitude
local distanceToBack = (behindDoor - hitPart.Position).magnitude
if distanceToFront < distanceToBack then
character:MoveTo(behindDoor)
else
character:MoveTo(inFrontOfDoor)
end
end
|
--[[
We need a lot of information to determine which collisions to filter, but they are all
condensed into one place to minimize redundant loops in case someone is spam-spawning
characters with hundreds of limbs. Returns the following information:
limbs:
{
["Arm"] = { LeftUpperArm, LeftLowerArm, LeftHand, RightUpperArm, RightLowerArm, RightHand},
["Head"] = { Head },
["Torso"] = { LowerTorso, UpperTorso },
...
}
limbRootParts:
{ {Part=Head, Type=Head}, {Part=LeftUpperArm, Type="Arm"}, {Part=RightUpperArm, Type="Arm"}, ... }
limbParents:
{
["Arm"] = { "Torso" },
["Head"] = { "Torso" },
["Torso"] = {},
...
}
--]]
|
function getLimbs(characterRoot, attachmentMap)
local limbs = {}
local limbRootParts = {}
local limbParents = {}
local function parsePart(part, lastLimb)
if part.Name ~= "HumanoidRootPart" then
local limbType = getLimbType(part.Name)
limbs[limbType] = limbs[limbType] or {}
table.insert(limbs[limbType], part)
local limbData = limbs[limbType]
if limbType ~= lastLimb then
limbParents[limbType] = limbParents[limbType] or {}
if lastLimb then
limbParents[limbType][lastLimb] = true
end
table.insert(limbRootParts, {Part=part, Type=limbType})
lastLimb = limbType
end
end
for _,v in pairs(part:GetChildren()) do
if v:isA("Attachment") and attachmentMap[v.Name] then
local part1 = attachmentMap[v.Name].Attachment1.Parent
if part1 and part1 ~= part then
parsePart(part1, lastLimb)
end
end
end
end
parsePart(characterRoot)
return limbs, limbRootParts, limbParents
end
function createNoCollision(part0, part1)
local noCollision = Instance.new("NoCollisionConstraint")
noCollision.Name = part0.Name.."<->"..part1.Name
noCollision.Part0 = part0
noCollision.Part1 = part1
return noCollision
end
return function(attachmentMap, characterRoot)
local noCollisionConstraints = Instance.new("Folder")
noCollisionConstraints.Name = "NoCollisionConstraints"
local limbs, limbRootParts, limbParents = getLimbs(characterRoot, attachmentMap)
--[[
Disable collisions between all limb roots (e.g. left/right shoulders, head, etc) unless
one of them is a parent of the other (handled in next step). This is to ensure limbs
maintain free range of motion and we don't have issues like
- Large shoulders clipping with the head and all of them being unable to move
- Legs being stuck together because rotating would cause the collision boxes to intersect
--]]
for i=1, #limbRootParts do
for j=i+1, #limbRootParts do
local limbType0, limbType1 = limbRootParts[i].Type, limbRootParts[j].Type
if not (limbParents[limbType0][limbType1] or limbParents[limbType1][limbType0]) then
createNoCollision(limbRootParts[i].Part, limbRootParts[j].Part).Parent = noCollisionConstraints
end
end
end
--[[
Disable collisions between limbs and their parent limbs. This is mostly to address
bundle torsos having insane hitboxes that touch more than just limb roots
--]]
for limbType, parts in pairs(limbs) do
for parentLimbType,_ in pairs(limbParents[limbType]) do
for _,part2 in pairs(limbs[parentLimbType]) do
for _,part in pairs(parts) do
createNoCollision(part, part2).Parent = noCollisionConstraints
end
end
end
end
return noCollisionConstraints
end
|
--[[ @brief Adds the same value to all numbers in an array so the sum is 0.
@example AdditiveNormalize({5, 10, 15}) = {-5, 0, 5}
@param t The array to normalize.
@return The normalized array.
--]]
|
function module.AdditiveNormalize(t)
local offset = module.Sum(t) / #t;
for i, v in pairs(t) do
t[i] = v - offset;
end
return t;
end
|
--[=[
Kills the Brio.
:::info
You can call this multiple times and it will not error if the brio is dead.
:::
```lua
local brio = Brio.new("hi")
print(brio:GetValue()) --> "hi"
brio:Kill()
print(brio:GetValue()) --> ERROR: Brio is dead
```
]=]
|
function Brio:Destroy()
if not self._values then
return
end
self._values = nil
if self._diedEvent then
self._diedEvent:Fire()
self._diedEvent:Destroy()
self._diedEvent = nil
end
end
|
-- Script GUID: {6BA2CDC4-2490-4BF3-A382-3936CFCA3401}
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = script:FindFirstAncestor("MainUI");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v3 = require(l__LocalPlayer__2:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v4 = game["Run Service"];
local l__UserInputService__5 = game:GetService("UserInputService");
local l__TweenService__6 = game:GetService("TweenService");
local v7 = require(script:WaitForChild("Lightning"));
local l__Bricks__1 = game:GetService("ReplicatedStorage"):WaitForChild("Bricks");
local u2 = require(script.Parent);
local v8 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientModules"):WaitForChild("Module_Events"));
v8.init(u2);
local v10 = Vector3.new();
game.SoundService.Main.Volume = 1;
l__Bricks__1:WaitForChild("PadlockHint").OnClientEvent:Connect(function(p1, p2, p3)
local l__Hints__11 = v1.Parent.PermUI.Hints;
l__Hints__11.Visible = true;
if not p1 or not p2 then
l__Hints__11.Visible = false;
for v12, v13 in pairs(l__Hints__11:GetChildren()) do
if v13.Name == "Icon" then
v13:Destroy();
end;
end;
return;
end;
local v14 = l__Hints__11.Template:Clone();
v14.Name = "Icon";
v14.Visible = true;
v14.ImageRectOffset = Vector2.new(50 * p1, 0);
v14.TextLabel.Text = p2;
if p3 and p3 ~= l__LocalPlayer__2.UserId then
v14.User.Visible = true;
v14.User.Image = "rbxthumb://type=AvatarHeadShot&id=" .. p3 .. "&w=48&h=48";
end;
v14.Parent = l__Hints__11;
end);
l__Bricks__1:WaitForChild("MotorReplication").OnClientEvent:Connect(function(p4, p5, p6, p7)
if not p4 or not p4:FindFirstChild("Humanoid") or not p4:FindFirstChild("Humanoid"):GetAttribute("AppearanceFinal") then
return;
end;
local v15 = CFrame.new(0, 0.22, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v16 = CFrame.new(0, -1.1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v17 = CFrame.new(0, 0.88, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v18 = CFrame.new(1, 0.62, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v19 = CFrame.new(-1, 0.62, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
if p4 and p4:FindFirstChild("HumanoidRootPart") then
local l__HumanoidRootPart__20 = p4:WaitForChild("HumanoidRootPart", 0.5);
local l__ClientMotors__21 = p4:FindFirstChild("ClientMotors");
local l__Waist__22 = p4:WaitForChild("UpperTorso", 0.5):WaitForChild("Waist", 0.5);
local l__Neck__23 = p4:WaitForChild("Head", 0.5):WaitForChild("Neck", 0.5);
local l__Root__24 = p4:WaitForChild("LowerTorso", 0.5):WaitForChild("Root", 0.5);
local l__RightShoulder__25 = p4:WaitForChild("RightUpperArm", 0.5):WaitForChild("RightShoulder", 0.5);
local l__LeftShoulder__26 = p4:WaitForChild("LeftUpperArm", 0.5):WaitForChild("LeftShoulder", 0.5);
local l__Value__27 = l__Root__24:WaitForChild("CVal").Value;
local l__Value__28 = l__Waist__22:WaitForChild("CVal").Value;
local l__Value__29 = l__Neck__23:WaitForChild("CVal").Value;
local l__Value__30 = l__LeftShoulder__26:WaitForChild("CVal").Value;
local l__Value__31 = l__RightShoulder__25:WaitForChild("CVal").Value;
local v32 = v16 * CFrame.Angles(0, math.rad(p5 * -45), 0);
local v33 = v15 * CFrame.Angles(math.rad(p6 * 0.25), 0, 0) * CFrame.Angles(0, math.rad(p5 * 45), 0) * CFrame.Angles(0, 0, math.rad(p7));
local v34 = v17 * CFrame.Angles(math.rad(p6 * 0.5), 0, 0);
local v35 = v19 * CFrame.Angles(math.rad(p6 * -0.025), 0, 0);
local v36 = v18 * CFrame.Angles(math.rad(p6 * -0.025), 0, 0);
if not l__ClientMotors__21 then
local v37 = Instance.new("BoolValue");
v37.Name = "ClientMotors";
v37.Parent = p4;
end;
if p4.Humanoid:GetAttribute("Stunned") == true then
if l__HumanoidRootPart__20 then
l__Waist__22.Enabled = false;
l__Neck__23.Enabled = false;
l__Root__24.Enabled = false;
l__RightShoulder__25.Enabled = false;
l__LeftShoulder__26.Enabled = false;
return;
end;
else
l__Waist__22.Enabled = true;
l__Neck__23.Enabled = true;
l__Root__24.Enabled = true;
l__RightShoulder__25.Enabled = true;
l__LeftShoulder__26.Enabled = true;
if l__HumanoidRootPart__20 and (l__HumanoidRootPart__20.Position - u2.cam.CFrame.p).Magnitude > 100 then
l__Root__24.C0 = v32;
l__Waist__22.C0 = v33;
l__Neck__23.C0 = v34;
l__LeftShoulder__26.C0 = v35;
l__RightShoulder__25.C0 = v36;
return;
end;
if l__HumanoidRootPart__20 then
local v38 = {};
local v39 = {};
local v40 = {};
local v41 = {};
local v42 = {};
v38.C0 = v32;
v39.C0 = v33;
v40.C0 = v34;
v41.C0 = v35;
v42.C0 = v36;
l__TweenService__6:Create(l__Root__24, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v38):Play();
l__TweenService__6:Create(l__Waist__22, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v39):Play();
l__TweenService__6:Create(l__Neck__23, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v40):Play();
l__TweenService__6:Create(l__RightShoulder__25, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v42):Play();
l__TweenService__6:Create(l__LeftShoulder__26, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v41):Play();
end;
end;
end;
end);
l__Bricks__1:WaitForChild("SoundToClient").OnClientEvent:Connect(function(p8, p9, p10, p11)
if p8 and p9 then
u2.playaudio(p8, p9, p10, p11);
end;
end);
local u3 = {};
l__Bricks__1:WaitForChild("UseEnemyModule").OnClientEvent:Connect(function(p12, p13, ...)
if not u3[p12] then
u3[p12] = require(game:GetService("ReplicatedStorage").ClientModules.EntityModules:FindFirstChild(p12));
end;
u3[p12][p13](u2, ...);
end);
l__Bricks__1:WaitForChild("UseEventModule").OnClientEvent:Connect(function(p14, ...)
v8[p14](...);
end);
l__Bricks__1:WaitForChild("ReplicateAnimation").OnClientEvent:Connect(function(p15, p16, p17, p18, p19, p20)
local v43 = game.ReplicatedStorage.AnimationRoot:Clone();
local v44 = p15.Humanoid.Animator:LoadAnimation(v43.Animation);
v43:SetPrimaryPartCFrame(p15.PrimaryPart.CFrame);
v43.Parent = u2.cam;
l__TweenService__6:Create(v43.PrimaryPart, TweenInfo.new(0.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
CFrame = p17
}):Play();
local v45 = nil;
local v46 = v43.AnimationController:LoadAnimation(p16);
p16 = p15.Humanoid.Animator:LoadAnimation(p16);
local v47 = false;
if u2.char == p15 then
u2.stopcam = true;
v47 = true;
end;
if p19 and p20 and v47 then
p20 = p19:LoadAnimation(p20);
v45 = p19.Parent:FindFirstChild("CamAttach", true) and v45.WorldCFrame;
u2.hideplayers = -1;
end;
for v48 = 1, 1000 do
if p16.Length > 0 then
if p20 == nil then
break;
end;
if p20.Length > 0 then
break;
end;
end;
task.wait();
end;
p16:Play(0, 1, 1);
v44:Play(0, 1, 1);
v46:Play(0, 1, 1);
if p19 and p20 then
p20:Play(0, 1, 1);
end;
local l__CFrame__49 = p15.PrimaryPart.CFrame;
local l__CFrame__50 = u2.cam.CFrame;
local u4 = false;
local u5 = tick();
task.spawn(function()
for v51 = 1, 100000 do
task.wait();
if u4 then
break;
end;
local v52 = l__TweenService__6:GetValue((tick() - u5) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut);
if v45 then
v52 = l__TweenService__6:GetValue((tick() - u5) / 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
end;
p15.PrimaryPart.CFrame = p15.PrimaryPart.CFrame:Lerp(v43.LowerTorso.CFrame * CFrame.new(0, 0.96, 0), v52);
if v47 then
local v53
if v45 then
v53 = v45;
else
v53 = p15.Head.CFrame * CFrame.new(0, 0.15, -0.25) * CFrame.Angles(math.rad(math.clamp(u2.bobspring.p.Y, -80, 80)), math.rad(math.clamp(u2.bobspring.p.X, -80, 80)), math.rad(math.clamp(u2.bobspring.p.Z, -40, 40))) * CFrame.Angles(0, math.rad(u2.camlockedoffset[1]), 0) * CFrame.Angles(math.rad(u2.camlockedoffset[2]), 0, 0);
end;
u2.cam.CFrame = u2.cam.CFrame:Lerp(v53, v52);
end;
end;
end);
task.wait(p16.Length - 0.1);
u4 = true;
l__TweenService__6:Create(p15.PrimaryPart, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
CFrame = p18
}):Play();
p16:AdjustWeight(0.01);
p16:AdjustSpeed(0.01);
p16:Stop(0);
v46:Stop(0);
v44:Stop(0);
v43:Destroy();
if v47 then
local v54 = tick();
local l__CFrame__55 = u2.cam.CFrame;
for v56 = 1, 10000 do
u2.cam.CFrame = l__CFrame__55:Lerp(u2.basecamcf * u2.csgo, (l__TweenService__6:GetValue((tick() - v54) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)));
task.wait();
if v54 + 0.25 <= tick() then
break;
end;
end;
u2.stopcam = false;
u2.crouching = false;
end;
end);
local u6 = false;
l__Bricks__1:WaitForChild("Jumpscare").OnClientEvent:Connect(function(p21)
if u6 == true then
return;
end;
u6 = true;
v1.MainFrame.Heartbeat.Visible = false;
if p21 == "Seek" then
u2.deathtick = tick() + 0.5;
if workspace:FindFirstChild("SeekMoving", true) then
local l__SeekMoving__57 = workspace:FindFirstChild("SeekMoving", true);
u2.stopcam = true;
u2.fovtarget = 40;
local v58 = tick();
for v59 = 1, 10000 do
u2.cam.CFrame = (u2.basecamcf * u2.csgo):Lerp(l__SeekMoving__57.PrimaryPart.CamAttach.WorldCFrame, (l__TweenService__6:GetValue((tick() - v58) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.In)));
task.wait();
if v58 + 0.25 <= tick() then
break;
end;
end;
else
warn("cant find seekmoving");
end;
script.Jumpscare_Seek:Play();
v1.Jumpscare_Seek.Visible = true;
local v60 = tick();
for v61 = 1, 1000 do
local v62 = math.clamp((tick() - v60) * 2, 0.1, 1);
v1.Jumpscare_Seek.ImageLabel.Position = UDim2.new(0.5 + math.random(-100, 100) / (5000 * v62), 0, 0.5 + math.random(-100, 100) / (2500 * v62), 0);
v1.Jumpscare_Seek.BackgroundColor3 = Color3.new(math.random(0, 4) / 12, 0, 0);
game["Run Service"].RenderStepped:wait();
if v60 + 0.7 <= tick() then
break;
end;
end;
u2.stopcam = false;
script.Jumpscare_Seek:Stop();
script.Kill:Play();
v1.Jumpscare_Seek.ImageLabel.Visible = false;
for v63 = 1, 4 do
v1.Jumpscare_Seek.BackgroundColor3 = Color3.new(math.random(0, 1), 0, 0);
wait();
end;
v1.Jumpscare_Seek.Visible = false;
u2.deathtick = tick();
u2.fovtarget = 70;
return;
end;
if p21 == "Rush" then
u2.deathtick = tick() + 10;
game.SoundService.Main.Volume = 0;
script.Jumpscare_Rush:Play();
v1.Jumpscare_Rush.Visible = true;
local v64 = tick();
local v65 = math.random(5, 30) / 10;
local v66 = v65 + math.random(10, 60) / 10;
local v67 = 0.25;
for v68 = 1, 100000 do
task.wait();
if v64 + v65 <= tick() then
v1.Jumpscare_Rush.ImageLabel.Visible = true;
v65 = v65 + math.random(7, 44) / 10;
script.Jumpscare_Rush.Pitch = 1 + math.random(-100, 100) / 500;
v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
v1.Jumpscare_Rush.ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
v67 = v67 + 0.05;
v1.Jumpscare_Rush.ImageLabel.Size = UDim2.new(v67, 0, v67, 0);
end;
if v64 + v66 <= tick() then
break;
end;
end;
v1.Jumpscare_Rush.ImageLabel.Visible = true;
script.Jumpscare_Rush:Stop();
script.Jumpscare_Rush2:Play();
v1.Jumpscare_Rush.ImageLabel.Visible = false;
v1.Jumpscare_Rush.ImageLabelBig.Visible = true;
v1.Jumpscare_Rush.ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
local v69 = tick();
for v70 = 1, 1000 do
local v71 = math.random(0, 10) / 10;
v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(v71, v71, math.clamp(math.random(25, 50) / 50, v71, 1));
v1.Jumpscare_Rush.ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
task.wait(0.016666666666666666);
if v69 + 0.3 <= tick() then
break;
end;
end;
v1.Jumpscare_Rush.ImageLabelBig.Visible = false;
v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, 0);
v1.Jumpscare_Rush.Visible = false;
u2.deathtick = tick();
return;
end;
if p21 == "A-60" then
u2.deathtick = tick() + 10;
game.SoundService.Main.Volume = 0;
script["Jumpscare_A-60"]:Play();
v1["Jumpscare_A-60"].Visible = true;
local v64 = tick();
local v65 = math.random(5, 30) / 10;
local v66 = v65 + math.random(10, 60) / 10;
local v67 = 0.25;
for v68 = 1, 100000 do
task.wait();
if v64 + v65 <= tick() then
v1["Jumpscare_A-60"].ImageLabel.Visible = true;
v65 = v65 + math.random(7, 44) / 10;
script["Jumpscare_A-60"].Pitch = 1 + math.random(-100, 100) / 500;
v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
v1["Jumpscare_A-60"].ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
v67 = v67 + 0.05;
v1["Jumpscare_A-60"].ImageLabel.Size = UDim2.new(v67, 0, v67, 0);
end;
if v64 + v66 <= tick() then
break;
end;
end;
v1["Jumpscare_A-60"].ImageLabel.Visible = true;
script["Jumpscare_A-60"]:Stop();
script["Jumpscare_A-60"]:Play();
v1["Jumpscare_A-60"].ImageLabel.Visible = false;
v1["Jumpscare_A-60"].ImageLabelBig.Visible = true;
v1["Jumpscare_A-60"].ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
local v69 = tick();
for v70 = 1, 1000 do
local v71 = math.random(0, 10) / 10;
v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(v71, v71, math.clamp(math.random(25, 50) / 50, v71, 1));
v1["Jumpscare_A-60"].ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
task.wait(0.016666666666666666);
if v69 + 0.3 <= tick() then
break;
end;
end;
v1["Jumpscare_A-60"].ImageLabelBig.Visible = false;
v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(0, 0, 0);
v1["Jumpscare_A-60"].Visible = false;
u2.deathtick = tick();
return;
end;
if p21 == "Ambush" then
u2.deathtick = tick() + 10;
game.SoundService.Main.Volume = 0;
script.Jumpscare_Ambush:Play();
v1.Jumpscare_Ambush.Visible = true;
local v72 = tick();
local v73 = math.random(5, 30) / 100;
local v74 = v73 + math.random(10, 60) / 100;
local v75 = 0.2;
for v76 = 1, 100000 do
task.wait(0.016666666666666666);
v1.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-15, 15), 0.5, math.random(-15, 15));
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
if v72 + v73 <= tick() then
v1.Jumpscare_Ambush.ImageLabel.Visible = true;
v73 = v73 + math.random(7, 44) / 100;
script.Jumpscare_Ambush.Pitch = math.random(35, 155) / 100;
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
v1.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-25, 25), 0.5, math.random(-25, 25));
v75 = v75 + 0.05;
v1.Jumpscare_Ambush.ImageLabel.Size = UDim2.new(v75, 0, v75, 0);
end;
if v72 + v74 <= tick() then
break;
end;
end;
script.Jumpscare_Ambush2:Play();
v1.Jumpscare_Ambush.ImageLabel.Visible = true;
v1.Jumpscare_Ambush.ImageLabel:TweenSize(UDim2.new(9, 0, 9, 0), "In", "Quart", 0.3, true);
local v77 = tick();
for v78 = 1, 100 do
local v79 = math.random(0, 10) / 10;
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(v79, math.clamp(math.random(25, 50) / 50, v79, 1), math.clamp(math.random(25, 50) / 150, v79, 1));
game["Run Service"].RenderStepped:wait();
if v77 + 0.3 <= tick() then
break;
end;
end;
script.Jumpscare_Ambush:Stop();
v1.Jumpscare_Ambush.ImageLabel.Visible = false;
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, 0, 0);
v1.Jumpscare_Ambush.Visible = false;
u2.deathtick = tick();
return;
end;
if p21 == "Figure" then
l__TweenService__6:Create(game.SoundService.Main, TweenInfo.new(0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {
Volume = 0
}):Play();
local l__FigureSetup__80 = workspace:FindFirstChild("FigureSetup", true);
if workspace:FindFirstChild("FigureSetup", true) then
local v81 = u2.cam;
if l__FigureSetup__80 then
v81 = l__FigureSetup__80.Parent;
end;
u2.stopcam = true;
u2.fovtarget = 80;
script.Reverse:Play();
script.Figure_Growl:Play();
local v82 = game:GetService("ReplicatedStorage"):WaitForChild("JumpscareModels"):WaitForChild("Figure"):Clone();
if l__FigureSetup__80 then
l__FigureSetup__80.Parent = game:GetService("ReplicatedStorage");
v82:SetPrimaryPartCFrame(l__FigureSetup__80.FigureRagdoll.PrimaryPart.CFrame);
else
v82:SetPrimaryPartCFrame(u2.cam.CFrame);
end;
v82.Parent = u2.cam;
v82:WaitForChild("AnimationController"):LoadAnimation(v82:WaitForChild("Jumpscare")):Play(0, 1, 1);
game.Debris:AddItem(v82, 10);
local l__OriginalCFrame__83 = script:WaitForChild("OriginalCFrame");
l__OriginalCFrame__83.Value = u2.cam.CFrame;
l__TweenService__6:Create(l__OriginalCFrame__83, TweenInfo.new(0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
Value = v82:WaitForChild("CamSpot").CFrame
}):Play();
u2.camShaker:ShakeOnce(20, 12, 0, 0.8);
u2.camShaker:ShakeOnce(2, 24, 0.1, 0.5, Vector3.new(0, 0, 0), Vector3.new(3, 1, 3));
u2.camShaker:ShakeOnce(8, 25, 0.7, 1, Vector3.new(0, 0, 0));
local v84 = tick();
delay(0.55, function()
u2.camShaker:ShakeOnce(1, 35, 0.01, 1, Vector3.new(0, 0, 0), Vector3.new(3, 1, 3));
end);
for v85 = 1, 1000 do
game["Run Service"].RenderStepped:wait();
u2.cam.CFrame = l__OriginalCFrame__83.Value * u2.csgo;
if v84 + 0.8 <= tick() then
break;
end;
end;
if l__FigureSetup__80 then
l__FigureSetup__80.Parent = v81;
end;
v82:Destroy();
end;
script.Kill:Play();
v1.FlashFrame.Visible = true;
for v86 = 1, 8 do
v1.FlashFrame.BackgroundColor3 = Color3.new(math.random(0, 1), 0, 0);
wait();
end;
v1.FlashFrame.BackgroundColor3 = Color3.new(0, 0, 0);
u2.cam.CameraType = Enum.CameraType.Scriptable;
u2.stopcam = false;
u2.deathtick = tick();
v1.FlashFrame.Visible = false;
end;
end);
l__Bricks__1:WaitForChild("Cutscene").OnClientEvent:Connect(function(p22)
local v87 = script.Cutscenes:FindFirstChild(p22);
if v87 then
require(v87)(u2);
end;
end);
l__Bricks__1:WaitForChild("GetOutOfHiding").OnClientEvent:Connect(function()
u2.char:SetAttribute("Hiding", true);
u2.char:SetAttribute("Hiding", false);
end);
u2.char:GetAttributeChangedSignal("Hiding"):Connect(function()
if u2.char:GetAttribute("Hiding") == true then
for v88 = 1, 100000 do
task.wait(0.1);
if u2.char:GetAttribute("Hiding") == false then
u2.ax_t = u2.ax_t + u2.camlockedoffset[1] % 360;
u2.ay_t = math.clamp(u2.ay_t + u2.camlockedoffset[2], -65, 65);
if math.abs(u2.ax_t) > 180 then
u2.ax_t = u2.ax_t - 360;
u2.ax_t = u2.ax_t;
end;
if math.abs(u2.ax) > 180 then
u2.ax = u2.ax - 360;
u2.ax = u2.ax;
end;
u2.camShaker:ShakeOnce(8, 1, 0, 1, Vector3.new(0, 0, 0));
u2.camlock = nil;
--game:GetService("ReplicatedStorage").Bricks.CamLock:FireServer();
v1.HideVignette.Visible = false;
return;
end;
end;
end;
end);
l__Bricks__1:WaitForChild("CamLock").OnClientEvent:Connect(function(p23)
local v89, v90, v91 = CFrame.new(Vector3.new(0, 0, 0), p23):ToOrientation();
if math.abs(u2.ax - math.deg(v90)) > 180 then
u2.ax_t = u2.ax_t - 360;
u2.ax = u2.ax_t;
end;
u2.camlock = {
y = math.deg(v89),
x = math.deg(v90),
z = 0,
last = tick() + 1,
pos = u2.char.PrimaryPart.Position
};
u2.camlockHead = false;
v1.HideVignette.ImageTransparency = 1;
v1.HideVignette.Visible = true;
l__TweenService__6:Create(v1.HideVignette, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
ImageTransparency = 0
}):Play();
u2.camShaker:ShakeOnce(12, 1, 0, 1, Vector3.new(0, 0, 0));
end);
l__Bricks__1:WaitForChild("CamLockHead").OnClientEvent:Connect(function(p24)
local v92, v93, v94 = CFrame.new(Vector3.new(0, 0, 0), p24):ToOrientation();
if math.abs(u2.ax - math.deg(v93)) > 180 then
u2.ax_t = u2.ax_t - 360;
end;
u2.camlockHead = true;
u2.camlock = {
y = math.deg(v92),
x = math.deg(v93),
z = 0,
last = tick() + 1,
pos = u2.char.PrimaryPart.Position
};
end);
l__Bricks__1:WaitForChild("CamShake").OnClientEvent:Connect(function(p25, p26, p27, p28, p29, p30)
u2.camShaker:ShakeOnce(p25, p26, p27, p28, p29, p30);
end);
l__Bricks__1:WaitForChild("ChangeModuleVariable").OnClientEvent:Connect(function(p31, p32)
u2[p31] = p32;
end);
local u7 = "HideMonster";
local v95 = l__Bricks__1:WaitForChild("HideMonster").OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild("HideMonster"))(u2, ...);
end);
u7 = "SpiderJumpscare";
u7 = "SpiderJumpscare";
local v96 = l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild(u7))(u2, ...);
end);
local v97 = l__Bricks__1:WaitForChild("AchievementUnlock").OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild("AchievementUnlock"))(u2, ...);
end);
local v98 = l__Bricks__1:WaitForChild("Screech").OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild("Screech"))(u2, ...);
end);
function shakerel(p33, p34, p35, p36, p37, p38, p39)
local v99 = nil;
v99 = 0;
for v100 = 1, 2 do
local v101 = 100;
if v100 == 2 then
v101 = 30;
end;
v99 = v99 + math.abs(math.clamp((u2.cam.CFrame.Position - p33).Magnitude, 0, v101) - v101) / v101;
end;
u2.camShaker:ShakeOnce(p34 * v99 * 0.8, p35, p36, p37, p38, p39);
end;
u7 = "CamShakeRelative";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(shakerel);
u7 = "LightningStrike";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(v7);
|
--// All remote events will have a no-opt OnServerEvent connecdted on construction
|
local function CreateEventIfItDoesntExist(parentObject, objectName)
local obj = CreateIfDoesntExist(parentObject, objectName, "RemoteEvent")
obj.OnServerEvent:Connect(emptyFunction)
return obj
end
CreateEventIfItDoesntExist(EventFolder, "OnNewMessage")
CreateEventIfItDoesntExist(EventFolder, "OnMessageDoneFiltering")
CreateEventIfItDoesntExist(EventFolder, "OnNewSystemMessage")
CreateEventIfItDoesntExist(EventFolder, "OnChannelJoined")
CreateEventIfItDoesntExist(EventFolder, "OnChannelLeft")
CreateEventIfItDoesntExist(EventFolder, "OnMuted")
CreateEventIfItDoesntExist(EventFolder, "OnUnmuted")
CreateEventIfItDoesntExist(EventFolder, "OnMainChannelSet")
CreateEventIfItDoesntExist(EventFolder, "ChannelNameColorUpdated")
CreateEventIfItDoesntExist(EventFolder, "SayMessageRequest")
CreateEventIfItDoesntExist(EventFolder, "SetBlockedUserIdsRequest")
CreateIfDoesntExist(EventFolder, "GetInitDataRequest", "RemoteFunction")
CreateIfDoesntExist(EventFolder, "MutePlayerRequest", "RemoteFunction")
CreateIfDoesntExist(EventFolder, "UnMutePlayerRequest", "RemoteFunction")
EventFolder = useEvents
local function CreatePlayerSpeakerObject(playerObj)
--// If a developer already created a speaker object with the
--// name of a player and then a player joins and tries to
--// take that name, we first need to remove the old speaker object
local speaker = ChatService:GetSpeaker(playerObj.Name)
if (speaker) then
ChatService:RemoveSpeaker(playerObj.Name)
end
speaker = ChatService:InternalAddSpeakerWithPlayerObject(playerObj.Name, playerObj, false)
for _, channel in pairs(ChatService:GetAutoJoinChannelList()) do
speaker:JoinChannel(channel.Name)
end
speaker:InternalAssignEventFolder(EventFolder)
speaker.ChannelJoined:connect(function(channel, welcomeMessage)
local log = nil
local channelNameColor = nil
local channelObject = ChatService:GetChannel(channel)
if (channelObject) then
log = channelObject:GetHistoryLogForSpeaker(speaker)
channelNameColor = channelObject.ChannelNameColor
end
EventFolder.OnChannelJoined:FireClient(playerObj, channel, welcomeMessage, log, channelNameColor)
end)
speaker.Muted:connect(function(channel, reason, length)
EventFolder.OnMuted:FireClient(playerObj, channel, reason, length)
end)
speaker.Unmuted:connect(function(channel)
EventFolder.OnUnmuted:FireClient(playerObj, channel)
end)
ChatService:InternalFireSpeakerAdded(speaker.Name)
end
EventFolder.SayMessageRequest.OnServerEvent:connect(function(playerObj, message, channel)
if type(message) ~= "string" then
return
elseif not validateMessageLength(message) then
return
end
if type(channel) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if (speaker) then
return speaker:SayMessage(message, channel)
end
return nil
end)
EventFolder.MutePlayerRequest.OnServerInvoke = function(playerObj, muteSpeakerName)
if type(muteSpeakerName) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if speaker then
local muteSpeaker = ChatService:GetSpeaker(muteSpeakerName)
if muteSpeaker then
speaker:AddMutedSpeaker(muteSpeaker.Name)
return true
end
end
return false
end
EventFolder.UnMutePlayerRequest.OnServerInvoke = function(playerObj, unmuteSpeakerName)
if type(unmuteSpeakerName) ~= "string" then
return
end
local speaker = ChatService:GetSpeaker(playerObj.Name)
if speaker then
local unmuteSpeaker = ChatService:GetSpeaker(unmuteSpeakerName)
if unmuteSpeaker then
speaker:RemoveMutedSpeaker(unmuteSpeaker.Name)
return true
end
end
return false
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 = 8000 -- 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 = 8000 -- Spring Force
Tune.FAntiRoll = 30 -- 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 = true -- 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 Vida = script.Parent.Overhaul.Vida
local Consciente = script.Parent.Overhaul.Consciente
local Dor = script.Parent.Overhaul.Dor
local Ferido = script.Parent.Overhaul.Ferido
local Sangrando = script.Parent.Overhaul.Sangrando
local BleedTween = TS:Create(Sangrando, TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,-1,true), {TextColor3 = Color3.fromRGB(255, 0, 0)} )
RS.RenderStepped:connect(function()
if script.Parent.Visible == true then
if Target.Value ~= "N/A" then
local player = game.Players:FindFirstChild(Target.Value)
local vHuman = player.Character.Humanoid
local vSang = player.Character.ACS_Client.Variaveis.Sangue
local pie = (vHuman.Health / vHuman.MaxHealth)
script.Parent.Menu.Base.VidaBar.Sangue.Size = UDim2.new(1, 0, pie, 0)
local Pizza = (vSang.Value / vSang.MaxValue)
script.Parent.Menu.Base.SangueBar.Sangue.Size = UDim2.new(1, 0, Pizza, 0)
else
local pie = (Human.Health / Human.MaxHealth)
script.Parent.Menu.Base.VidaBar.Sangue.Size = UDim2.new(1, 0, pie, 0)
local Pizza = (Saude.Variaveis.Sangue.Value / Saude.Variaveis.Sangue.MaxValue)
script.Parent.Menu.Base.SangueBar.Sangue.Size = UDim2.new(1, 0, Pizza, 0)
end
if Target.Value == "N/A" then
if Human.Health <= 0 then
Vida.Text = "Dead"
Vida.TextColor3 = Color3.fromRGB(255,0,0)
elseif Human.Health <= (Human.MaxHealth * .5) then
Vida.Text = "High Risk"
Vida.TextColor3 = Color3.fromRGB(255,0,0)
elseif Human.Health <= (Human.MaxHealth * .75) then
Vida.Text = "Low Risk"
Vida.TextColor3 = Color3.fromRGB(255,255,0)
elseif Human.Health <= (Human.MaxHealth) then
Vida.Text = "Healthy"
Vida.TextColor3 = Color3.fromRGB(255,255,255)
end
if Saude.Stances.Caido.Value == true then
Consciente.Text = "Unconscious"
else
Consciente.Text = "Conscious"
end
if Saude.Variaveis.Dor.Value <= 0 then
Dor.Text = "No pain"
Dor.TextColor3 = Color3.fromRGB(255,255,255)
elseif Saude.Variaveis.Dor.Value <= 25 then
Dor.Text = "Minor pain"
Dor.TextColor3 = Color3.fromRGB(255,255,255)
elseif Saude.Variaveis.Dor.Value < 100 then
Dor.Text = "Major pain"
Dor.TextColor3 = Color3.fromRGB(255,255,0)
elseif Saude.Variaveis.Dor.Value >= 100 then
Dor.Text = "Extreme pain"
Dor.TextColor3 = Color3.fromRGB(255,0,0)
end
if Saude.Stances.Ferido.Value == true then
Ferido.Visible = true
else
Ferido.Visible = false
end
if Saude.Stances.Sangrando.Value == true or Saude.Stances.Tourniquet.Value == true then
if Saude.Stances.Tourniquet.Value == true then
Sangrando.Text = 'Tourniquet'
else
Sangrando.Text = 'Bleeding'
end
Sangrando.Visible = true
Sangrando.TextColor3 = Color3.fromRGB(255,255,255)
BleedTween:Play()
else
Sangrando.Visible = false
BleedTween:Cancel()
end
else
local player2 = game.Players:FindFirstChild(Target.Value)
local PlHuman = player2.Character.Humanoid
local PlSaude = player2.Character.ACS_Client
if PlHuman.Health > 0 then
if PlHuman.Health <= 0 then
Vida.Text = "Dead"
Vida.TextColor3 = Color3.fromRGB(255,0,0)
elseif PlHuman.Health <= (PlHuman.MaxHealth * .5) then
Vida.Text = "High Risk"
Vida.TextColor3 = Color3.fromRGB(255,0,0)
elseif PlHuman.Health <= (PlHuman.MaxHealth * .75) then
Vida.Text = "Low Risk"
Vida.TextColor3 = Color3.fromRGB(255,255,0)
elseif PlHuman.Health <= (PlHuman.MaxHealth) then
Vida.Text = "Healthy"
Vida.TextColor3 = Color3.fromRGB(255,255,255)
end
if PlSaude.Stances.Caido.Value == true then
Consciente.Text = "Unconscious"
else
Consciente.Text = "Conscious"
end
if PlSaude.Variaveis.Dor.Value <= 0 then
Dor.Text = "No pain"
Dor.TextColor3 = Color3.fromRGB(255,255,255)
elseif PlSaude.Variaveis.Dor.Value <= 25 then
Dor.Text = "Minor pain"
Dor.TextColor3 = Color3.fromRGB(255,255,255)
elseif PlSaude.Variaveis.Dor.Value < 100 then
Dor.Text = "Major pain"
Dor.TextColor3 = Color3.fromRGB(255,255,0)
elseif PlSaude.Variaveis.Dor.Value >= 100 then
Dor.Text = "Extreme pain"
Dor.TextColor3 = Color3.fromRGB(255,0,0)
end
if PlSaude.Stances.Ferido.Value == true then
Ferido.Visible = true
else
Ferido.Visible = false
end
if PlSaude.Stances.Sangrando.Value == true or PlSaude.Stances.Tourniquet.Value == true then
if PlSaude.Stances.Tourniquet.Value == true then
Sangrando.Text = 'Tourniquet'
else
Sangrando.Text = 'Bleeding'
end
Sangrando.Visible = true
Sangrando.TextColor3 = Color3.fromRGB(255,255,255)
BleedTween:Play()
else
Sangrando.Visible = false
BleedTween:Cancel()
end
else
Reset:FireServer()
end
end
end
end)
|
--[[**
Decodes a string from Base64.
@param [t:string] Input The input string to decode.
@returns [t:string] The newly decoded string.
**--]]
|
function Base64.Decode(Input)
local Output = {}
local Length = 0
for Index = 1, #Input, 4 do
local C1, C2, C3, C4 = string.byte(Input, Index, Index + 3)
local I1 = Indexes[C1] - 1
local I2 = Indexes[C2] - 1
local I3 = (Indexes[C3] or 1) - 1
local I4 = (Indexes[C4] or 1) - 1
local A = bit32_lshift(I1, 2) + bit32_rshift(I2, 4)
local B = bit32_lshift(bit32_band(I2, 15), 4) + bit32_rshift(I3, 2)
local C = bit32_lshift(bit32_band(I3, 3), 6) + I4
Length = Length + 1
Output[Length] = A
if C3 ~= 61 then
Length = Length + 1
Output[Length] = B
end
if C4 ~= 61 then
Length = Length + 1
Output[Length] = C
end
end
local NewOutput = {}
local NewLength = 0
local IndexAdd4096Sub1
for Index = 1, Length, 4096 do
NewLength = NewLength + 1
IndexAdd4096Sub1 = Index + 4096 - 1
NewOutput[NewLength] = string.char(table.unpack(
Output,
Index,
IndexAdd4096Sub1 > Length and Length or IndexAdd4096Sub1
))
end
return table.concat(NewOutput)
end
return Base64
|
-- Load default environment
|
if workspace.Areas:FindFirstChildOfClass("Folder") then
require(updateEnvironment).LoadArea(workspace.Areas:FindFirstChildOfClass("Folder").Name)
end
game:GetService("RunService"):BindToRenderStep("UI", 50, function() -- Update and animate health UI
if players.LocalPlayer.Character and players.LocalPlayer.Character:FindFirstChild("Humanoid") then
if players.LocalPlayer.Character.Humanoid.Health/players.LocalPlayer.Character.Humanoid.MaxHealth >= 0.998 then
healthFill.UIGradient.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 0)})
elseif players.LocalPlayer.Character.Humanoid.Health/players.LocalPlayer.Character.Humanoid.MaxHealth <= 0.001 then
healthFill.UIGradient.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 1)})
else
healthFill.UIGradient.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(players.LocalPlayer.Character.Humanoid.Health/players.LocalPlayer.Character.Humanoid.MaxHealth, 0), NumberSequenceKeypoint.new(math.clamp((players.LocalPlayer.Character.Humanoid.Health/players.LocalPlayer.Character.Humanoid.MaxHealth)+0.001, (players.LocalPlayer.Character.Humanoid.Health/players.LocalPlayer.Character.Humanoid.MaxHealth)+0.001, 0.999), 1), NumberSequenceKeypoint.new(1, 1)})
end
healthFill.Parent.LifeLabel.Text = math.floor(players.LocalPlayer.Character.Humanoid.Health)
healthFill.UIGradient.Rotation = healthFill.UIGradient.Rotation - 1
healthFill.Rotation = healthFill.Rotation + 1
if lastHealth > players.LocalPlayer.Character.Humanoid.Health then
DamageEffect(lastHealth/players.LocalPlayer.Character.Humanoid.MaxHealth, (lastHealth-players.LocalPlayer.Character.Humanoid.Health)/players.LocalPlayer.Character.Humanoid.MaxHealth, lastHealth-players.LocalPlayer.Character.Humanoid.Health)
end
lastHealth = players.LocalPlayer.Character.Humanoid.Health
end
-- Update other stuff in UI
if players.LocalPlayer.Stats.Rank.Value >= rankCap.Value then
rankLabel.TextColor3 = Color3.fromRGB(255, 255, 0)
else
rankLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
end
if players.LocalPlayer.Stats.Mana.Value >= GetManaCap() then
manaLabel.TextColor3 = Color3.fromRGB(255, 255, 0)
else
manaLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
end
rankLabel.Text = players.LocalPlayer.Stats.Rank.Value
goldLabel.Text = players.LocalPlayer.Stats.Gold.Value
arrowsLabel.Text = players.LocalPlayer.Stats.Arrows.Value
manaLabel.Text = players.LocalPlayer.Stats.Mana.Value
rankBar.Parent.Label.Text = players.LocalPlayer.Stats.XP.Value .. "/" .. replicatedStorage.ServerSettings.XPPerRank.Value * players.LocalPlayer.Stats.Rank.Value .. " XP"
rankBar.Position = UDim2.new((players.LocalPlayer.Stats.XP.Value / (replicatedStorage.ServerSettings.XPPerRank.Value * players.LocalPlayer.Stats.Rank.Value)) - 1, 0, 0, 0)
rankBar.Fill.Position = UDim2.new(1 - players.LocalPlayer.Stats.XP.Value / (replicatedStorage.ServerSettings.XPPerRank.Value * players.LocalPlayer.Stats.Rank.Value), 0, 0, 0)
end)
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
local gui = script.Parent.Parent--client.UI.Prepare(script.Parent.Parent)
local frame = gui.Frame
local frame2 = frame.Frame
local msg = frame2.Message
local ttl = frame2.Title
local gIndex = data.gIndex
local gTable = data.gTable
local title = data.Title
local message = data.Message
local scroll = data.Scroll
local tim = data.Time
local gone = false
if not data.Message or not data.Title then gTable:Destroy() end
ttl.Text = title
msg.Text = message
ttl.TextTransparency = 1
msg.TextTransparency = 1
ttl.TextStrokeTransparency = 1
msg.TextStrokeTransparency = 1
frame.BackgroundTransparency = 1
local fadeSteps = 10
local blurSize = 10
local textFade = 0.1
local strokeFade = 0.5
local frameFade = frame.BackgroundTransparency
local blurStep = blurSize/fadeSteps
local frameStep = frameFade/fadeSteps
local textStep = 0.1
local strokeStep = 0.1
local function fadeIn()
gTable:Ready()
for i = 1,fadeSteps do
if msg.TextTransparency>textFade then
msg.TextTransparency = msg.TextTransparency-textStep
ttl.TextTransparency = ttl.TextTransparency-textStep
end
if msg.TextStrokeTransparency>strokeFade then
msg.TextStrokeTransparency = msg.TextStrokeTransparency-strokeStep
ttl.TextStrokeTransparency = ttl.TextStrokeTransparency-strokeStep
end
if frame.BackgroundTransparency>frameFade then
frame.BackgroundTransparency = frame.BackgroundTransparency-frameStep
--frame2.BackgroundTransparency = frame.BackgroundTransparency
end
service.Wait("Stepped")
end
end
local function fadeOut()
if not gone then
gone = true
for i = 1,fadeSteps do
if msg.TextTransparency<1 then
msg.TextTransparency = msg.TextTransparency+textStep
ttl.TextTransparency = ttl.TextTransparency+textStep
end
if msg.TextStrokeTransparency<1 then
msg.TextStrokeTransparency = msg.TextStrokeTransparency+strokeStep
ttl.TextStrokeTransparency = ttl.TextStrokeTransparency+strokeStep
end
if frame.BackgroundTransparency<1 then
frame.BackgroundTransparency = frame.BackgroundTransparency+frameStep
frame2.BackgroundTransparency = frame.BackgroundTransparency
end
service.Wait("Stepped")
end
service.UnWrap(gui):Destroy()
end
end
gTable.CustomDestroy = function()
fadeOut()
end
fadeIn()
if not tim then
local _,time = message:gsub(" ","")
time = math.clamp(time/2,4,11)+1
wait(time)
else
wait(tim)
end
if not gone then
fadeOut()
end
end
|
-- Provide iteration sorting modifiers
|
Cheer.Sorted = setmetatable({}, {
-- Allow increasing sort modifiers
__add = function (Self, SortingField)
return { Type = 'Sort', Field = SortingField, Direction = 'Increasing' };
end;
-- Allow decreasing sort modifiers
__sub = function (Self, SortingField)
return { Type = 'Sort', Field = SortingField, Direction = 'Decreasing' };
end;
});
setmetatable(Cheer, {
-- Enable syntactic sugar for loading components
__call = function (Cheer, ...)
local ArgCount = #{...};
-- Direct loading
if ArgCount == 1 then
return Cheer.LoadComponent(...);
-- Template instance loading
elseif ArgCount == 2 then
return Cheer.FromTemplate(...);
end;
end;
});
return Cheer;
|
-- float rd_flt_be(string src, int s)
-- @src - Source binary string
-- @s - Start index of big endian float
|
local function rd_flt_be(src, s)
local f1, f2, f3, f4 = src:byte(s, s + 3)
return rd_flt_basic(f4, f3, f2, f1)
end
|
--[[**
ensures Lua primitive none type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.none = primitive("nil")
|
-- setup emote chat hook
|
game:GetService("Players").LocalPlayer.Chatted:connect(function(msg)
local emote = ""
if (string.sub(msg, 1, 3) == "/e ") then
emote = string.sub(msg, 4)
elseif (string.sub(msg, 1, 7) == "/emote ") then
emote = string.sub(msg, 8)
end
if (pose == "Standing" and emoteNames[emote] ~= nil) then
playAnimation(emote, 0.1, zombie)
end
end)
|
-- Renderers that don't support hydration
-- can re-export everything from this module.
|
function shim(...)
invariant(
false,
"The current renderer does not support hydration. "
.. "This error is likely caused by a bug in React. "
.. "Please file an issue."
)
end
|
--[=[
Takes in a brio and returns an observable that emits the brio, and then completes
on death.
@deprecated 3.6.0 -- This method does not wrap the resulting value in a Brio, which can sometimes lead to leaks.
@param project (value: TBrio) -> TProject
@return (brio<TBrio>) -> TProject
]=]
|
function RxBrioUtils.mapBrio(project)
assert(type(project) == "function", "Bad project")
warn("[RxBrioUtils.mapBrio] - Deprecated since 3.6.0. Use RxBrioUtils.mapBrioBrio")
return function(brio)
assert(Brio.isBrio(brio), "Not a brio")
if brio:IsDead() then
return Rx.EMPTY
end
local observable = project(brio:GetValue())
assert(Observable.isObservable(observable), "Not an observable")
return RxBrioUtils.completeOnDeath(brio, observable)
end
end
|
-- ROBLOX TODO: fix PrettyFormat types imports
|
type CompareKeys = ((a: string, b: string) -> number) | nil
export type DiffOptionsColor = (string) -> string
export type DiffOptions = {
aAnnotation: string?,
aColor: DiffOptionsColor?,
aIndicator: string?,
bAnnotation: string?,
bColor: DiffOptionsColor?,
bIndicator: string?,
changeColor: DiffOptionsColor?,
changeLineTrailingSpaceColor: DiffOptionsColor?,
commonColor: DiffOptionsColor?,
commonIndicator: string?,
commonLineTrailingSpaceColor: DiffOptionsColor?,
contextLines: number?,
emptyFirstOrLastLinePlaceholder: string?,
expand: boolean?,
includeChangeCounts: boolean?,
omitAnnotationLines: boolean?,
patchColor: DiffOptionsColor?,
compareKeys: CompareKeys?,
}
export type DiffOptionsNormalized = {
aAnnotation: string,
aColor: DiffOptionsColor,
aIndicator: string,
bAnnotation: string,
bColor: DiffOptionsColor,
bIndicator: string,
changeColor: DiffOptionsColor,
changeLineTrailingSpaceColor: DiffOptionsColor,
commonColor: DiffOptionsColor,
commonIndicator: string,
commonLineTrailingSpaceColor: DiffOptionsColor,
compareKeys: CompareKeys,
contextLines: number,
emptyFirstOrLastLinePlaceholder: string,
expand: boolean,
includeChangeCounts: boolean,
omitAnnotationLines: boolean,
patchColor: DiffOptionsColor,
}
return {}
|
--BotHit1
|
Door1.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("Bot") then
if Ready == true then
if Open == false then
Ready = false
Unlock:Play()
hit.Parent.HumanoidRootPart.Anchored = true
wait(1)
hit.Parent.HumanoidRootPart.Anchored = false
Open = true
OpenSound:Play()
OpenTween:Play()
OpenTween1:Play()
wait(.5)
Ready = true
end
end
end
end)
|
--[[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)
|
-- Constants for MD5
|
do
for idx = 1, 64 do
-- we can't use formula math.floor(abs(sin(idx))*TWO_POW_32) because its result may be beyond integer range on Lua built with 32-bit integers
local hi, lo = math.modf(math.abs(math.sin(idx)) * TWO_POW_16)
md5_K[idx] = hi * 65536 + math.floor(lo * TWO_POW_16)
end
end
|
--------------| SYSTEM SETTINGS |--------------
|
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Blue"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 1;
["Admin"] = 1;
["Settings"] = 1;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
RankRequiredToViewIcon = 1;
WelcomeRankNotice = false; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = false; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
["fly"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["fly2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["speed"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["jumpPower"] = {
Limit = 10000;
IgnoreLimit = 3;
};
};
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
|
--these are for button checks. It's kinda ugly so if you have a better way pm me
|
ha=false
hd=false
hs=false
hw=false
imgassets ={
hazardoff="http://www.roblox.com/asset/?id=216957891",
hazardon = "http://www.roblox.com/asset/?id=216957887",
leftyoff = "http://www.roblox.com/asset/?id=216957962",
leftyon = "http://www.roblox.com/asset/?id=216957949",
rightyoff = "http://www.roblox.com/asset/?id=216957912",
rightyon = "http://www.roblox.com/asset/?id=216957903",
outoff="http://www.roblox.com/asset/?id=216957880",
outon = "http://www.roblox.com/asset/?id=216957874",
sirensoff = "http://www.roblox.com/asset/?id=216958870",
sirenson = "http://www.roblox.com/asset/?id=216958870",
wailoff = "http://www.roblox.com/asset/?id=216930335",
wailon = "http://www.roblox.com/asset/?id=216930318",
x4off = "http://www.roblox.com/asset/?id=216954211",
x4on = "http://www.roblox.com/asset/?id=216954202",
x2off = "http://www.roblox.com/asset/?id=216958009",
x2on = "http://www.roblox.com/asset/?id=216958007",
fastoff = "http://www.roblox.com/asset/?id=216957982",
faston = "http://www.roblox.com/asset/?id=216957977",
slowoff = "http://www.roblox.com/asset/?id=216957998",
slowon = "http://www.roblox.com/asset/?id=216957989",
lightsoff = "http://www.roblox.com/asset/?id=115931775",
lightson = "http://www.roblox.com/asset/?id=115931779",
lockoff = "http://www.roblox.com/asset/?id=116532096",
lockon = "http://www.roblox.com/asset/?id=116532114",
leftturn = "http://www.roblox.com/asset/?id=115931542",
rightturn = "http://www.roblox.com/asset/?id=115931529",
fltd = "http://www.roblox.com/asset/?id=116531501",
yelpon = "http://www.roblox.com/asset/?id=216930350",
yelpoff = "http://www.roblox.com/asset/?id=216930359",
phaseron = "http://www.roblox.com/asset/?id=216930382",
phaseroff = "http://www.roblox.com/asset/?id=216930390",
hiloon = "http://www.roblox.com/asset/?id=216930459",
hilooff = "http://www.roblox.com/asset/?id=216930471",
hornon = "http://www.roblox.com/asset/?id=216930428",
hornoff = "http://www.roblox.com/asset/?id=216930438",
wailrumbleron = "http://www.roblox.com/asset/?id=216930512",
wailrumbleroff = "http://www.roblox.com/asset/?id=216930520",
yelprumbleron = "http://www.roblox.com/asset/?id=216930566",
yelprumbleroff = "http://www.roblox.com/asset/?id=216930573",
phaserrumbleron = "http://www.roblox.com/asset/?id=216930585",
phaserrumbleroff = "http://www.roblox.com/asset/?id=216930595",
hyperhiloon = "http://www.roblox.com/asset/?id=216963140",
hyperhilooff = "http://www.roblox.com/asset/?id=216963128",
}
for _,i in pairs (imgassets) do
Game:GetService("ContentProvider"):Preload(i)
end
if gear == 1 then
script.Parent.dn.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.dn.Style = "RobloxRoundButton"
end
if gear == maxgear then
script.Parent.up.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.up.Style = "RobloxRoundButton"
end
function gearup()--activated by GUI or pressing E
if lock then return end
if gear < maxgear then
gear = gear+1
watdo()
script.Parent.Gear.Text = (gear.."/"..maxgear)
end
if gear == maxgear then
script.Parent.up.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.up.Style = "RobloxRoundButton"
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
elseif gear == 1 then
script.Parent.dn.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
else
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
end
end
function geardown()--activated by GUI or pressing Q
if lock then return end
if gear > 1 then
gear = gear-1
watdo()
script.Parent.Gear.Text = (gear.."/"..maxgear)
end
if gear == 1 then
script.Parent.dn.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
elseif gear == maxgear then
script.Parent.up.TextColor3 = Color3.new(.3,.3,.3)
script.Parent.up.Style = "RobloxRoundButton"
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
else
script.Parent.dn.TextColor3 = Color3.new(1,1,1)
script.Parent.dn.Style = "RobloxRoundButton"
script.Parent.up.TextColor3 = Color3.new(1,1,1)
script.Parent.up.Style = "RobloxRoundButton"
end
end
script.Parent.up.MouseButton1Click:connect(gearup)
script.Parent.dn.MouseButton1Click:connect(geardown)
script.Parent.up.MouseButton1Click:connect(gearup)
script.Parent.dn.MouseButton1Click:connect(geardown)
script.Parent.flipbutton.MouseButton1Click:connect(function()
if not flipping then
flipping = true
local a = Instance.new("BodyPosition",seat)
a.maxForce = Vector3.new(100000,10000000,100000)
a.position = seat.Position + Vector3.new(0,10,0)
local b = Instance.new("BodyGyro",seat)
wait(3)
a:Destroy()
b:Destroy()
flipping = false
end
end)
function turn()
if turndebounce == false then
turndebounce = true
wait(0.05)
repeat
templeft = turningleft
tempright = turningright
script.Parent.onsound:Play()
if turningleft == true then
script.Parent.leftturn.Visible = true
for _,i in pairs (leftturn) do
i.BrickColor = BrickColor.new("Deep orange")
i.Material = "Neon"
end
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material = "Neon"
end
for _,b in pairs (leftflash) do
if lightson then
b.Enabled = true
end
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
end
if turningright == true then
script.Parent.rightturn.Visible = true
for _,i in pairs (rightturn) do
i.BrickColor = BrickColor.new("Deep orange")
i.Material = "Neon"
end
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material = "Neon"
end
for _,b in pairs (rightflash) do
if lightson then
b.Enabled = true
end
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
end
wait(0.4)
script.Parent.offsound:Play()
script.Parent.leftturn.Visible = false
script.Parent.rightturn.Visible = false
if templeft == true then
for _,i in pairs (leftturn) do
i.BrickColor = BrickColor.new("Neon orange")
i.Material = "SmoothPlastic"
end
for _,b in pairs (leftflash) do
b.Enabled = false
end
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Bright red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (leftbrake) do
b.Brightness = 1
end
else
if throttle > 0 then
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Bright red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (leftbrake) do
b.Brightness = 1
end
else
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
end
end
if tempright == true then
for _,i in pairs (rightturn) do
i.BrickColor = BrickColor.new("Neon orange")
i.Material = "SmoothPlastic"
end
for _,b in pairs (rightflash) do
b.Enabled = false
end
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Bright red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (rightbrake) do
b.Brightness = 1
end
else
if throttle > 0 then
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Bright red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (rightbrake) do
b.Brightness = 1
end
else
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
end
end
wait(0.35)
until turningleft == false and turningright == false
turndebounce = false
end
end
seat.ChildRemoved:connect(function(it)
if it:IsA("Weld") then
if it.Part1.Parent == Player.Character then
lock = true
ha=false
hd=false
hs=false
hw=false
throttle = 0
steer = 0
watdo()
script.Parent.close.Active = true
script.Parent.close.Visible = true
script.Parent.xlabel.Visible = true
end
end
end)
seat.ChildAdded:connect(function(it)
if it:IsA("Weld") then
if it.Part1.Parent == Player.Character then
lock = false
script.Parent.close.Active = false
script.Parent.close.Visible = false
script.Parent.xlabel.Visible = false
end
end
end)
function exiting()
lock = true--when we close the gui stop everything
steer = 0
throttle = 0
watdo()
turningleft = false
turningright = false
script.Parent.flasher.Value = false
script.Parent.siren.Value = false
lightson = false
Instance.new("IntValue",seat)
for _,i in pairs (leftturn) do
i.BrickColor = BrickColor.new("Neon orange")
i.Material ="Neon"
end
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material ="Neon"
end
for _,b in pairs (leftflash) do
b.Enabled = false
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
for _,i in pairs (rightturn) do
i.BrickColor = BrickColor.new("Neon orange")
i.Material ="Neon"
end
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material ="Neon"
end
for _,b in pairs (rightflash) do
b.Enabled = false
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
script.Parent.Parent:Destroy()--destroy the 'Car' ScreenGui
end
function updatelights()
for _,i in pairs (leftbrake) do
i.Enabled = lightson
end
for _,i in pairs (rightbrake) do
i.Enabled = lightson
end
for _,i in pairs (brakelight) do
i.Enabled = lightson
end
for _,i in pairs (headlight) do
i.Enabled = lightson
end
if lightson then
script.Parent.lightimage.Image = imgassets.lightson
else
script.Parent.lightimage.Image = imgassets.lightsoff
end
end
script.Parent.lights.MouseButton1Click:connect(function()
if lock then return end
lightson = not lightson
updatelights()
end)
function destroycar()
seat.Parent:Destroy()--destroy the car
end
script.Parent.close.MouseButton1Up:connect(exiting)
Player.Character.Humanoid.Died:connect(destroycar)
game.Players.PlayerRemoving:connect(function(Playeras)
if Playeras.Name == Player.Name then
destroycar()
end
end)
for _, i in pairs (seat.Parent:GetChildren()) do--populate the tables for ease of modularity. You could have 100 left wheels if you wanted.
if i.Name == "LeftWheel" then
table.insert(left,i)
elseif i.Name == "RightWheel" then
table.insert(right,i)
elseif i.Name == "Rearlight" then
table.insert(rearlight,i)
elseif i.Name == "Brakelight" then
table.insert(brakelight,i.SpotLight)
elseif i.Name == "rightturn" then
table.insert(rightturn,i)
elseif i.Name == "leftturn" then
table.insert(leftturn,i)
elseif i.Name == "leftflash" then
table.insert(leftflash,i.SpotLight)
elseif i.Name == "rightflash" then
table.insert(rightflash,i.SpotLight)
elseif i.Name == "leftlight" then
table.insert(leftlight,i)
elseif i.Name == "rightlight" then
table.insert(rightlight,i)
elseif i.Name == "Headlight" then
table.insert(headlight,i.SpotLight)
elseif i.Name == "leftbrake" then
table.insert(leftbrake,i.SpotLight)
elseif i.Name == "rightbrake" then
table.insert(rightbrake,i.SpotLight)
elseif i.Name == "revlight" then
table.insert(revlight,i.SpotLight)
end
end
for _,l in pairs (left) do
l.BottomParamA = 0
l.BottomParamB = 0
end
for _,r in pairs (right) do
r.BottomParamA = 0
r.BottomParamB = 0
end
function watdo()
seat.Parent.LeftMotor.DesiredAngle = math.rad(throttle < 0 and 40* steer or 40*steer/gear^0.5)
seat.Parent.RightMotor.DesiredAngle = math.rad(throttle < 0 and 40* steer or 40*steer/gear^0.5)
for _,l in pairs (left) do--I do it this way so that it's not searching the model every time an input happens
if throttle ~= -1 then
l.BottomParamA = (.1/gear)
l.BottomParamB = (.5*gear+steer*gear/30)*throttle
else
l.BottomParamA = -.01
l.BottomParamB = -.5-steer/20
end
end
for _,r in pairs (right) do
if throttle ~= -1 then
r.BottomParamA = -(.1/gear)
r.BottomParamB = -(.5*gear-steer*gear/30)*throttle
else
r.BottomParamA = .01
r.BottomParamB = .5-steer/20
end
end
if throttle < 1 then
for _,g in pairs (rearlight) do
g.BrickColor = BrickColor.new("Really red")
end
for _,b in pairs (brakelight) do
b.Brightness = 2
end
if turningleft == false then
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material ="Neon"
end
for _,b in pairs (leftbrake) do
b.Brightness = 2
end
end
if turningright == false then
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Really red")
a.Material ="Neon"
end
for _,b in pairs (rightbrake) do
b.Brightness = 2
end
end
else
for _,g in pairs (rearlight) do
g.BrickColor = BrickColor.new("Bright red")
g.Material = "SmoothPlastic"
end
for _,b in pairs (brakelight) do
b.Brightness = 1
end
if turningleft == false then
for _,a in pairs (leftlight) do
a.BrickColor = BrickColor.new("Bright red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (leftbrake) do
b.Brightness = 1
end
end
if turningright == false then
for _,a in pairs (rightlight) do
a.BrickColor = BrickColor.new("Bright red")
a.Material = "SmoothPlastic"
end
for _,b in pairs (rightbrake) do
b.Brightness = 1
end
end
end
if throttle < 0 then
for _,b in pairs (revlight) do
if lightson then
b.Enabled = true
end
end
else
for _,b in pairs (revlight) do
b.Enabled = false
end
end
end
Player:GetMouse().KeyDown:connect(function(key)--warning ugly button code
if lock then return end
key = string.upper(key)
if not ha and key == "A" or key == string.char(20) and not ha then
ha = true
steer = steer-1
end
if not hd and key == "D" or key == string.char(19) and not hd then
hd = true
steer = steer+1
end
if not hw and key == "W" or key == string.char(17) and not hw then
hw = true
throttle = throttle+1
end
if not hs and key == "S" or key == string.char(18) and not hs then
hs = true
throttle = throttle-1
end
if key == "Z" then
geardown()
end
if key == "X" then
gearup()
end
if key == "Q" then
turningleft = not turningleft
turn()
end
if key == "E" then
turningright = not turningright
turn()
end
watdo()
end)
Player:GetMouse().KeyUp:connect(function(key)
if lock then return end
key = string.upper(key)
if ha and key == "A" or key == string.char(20)and ha then
steer = steer+1
ha = false
end
if hd and key == "D" or key == string.char(19) and hd then
steer = steer-1
hd = false
end
if hw and key == "W" or key == string.char(17) and hw then
throttle = throttle-1
hw = false
end
if hs and key == "S" or key == string.char(18) and hs then
throttle = throttle+1
hs = false
end
if key == "" then
--more keys if I need them
end
watdo()
end)
|
--[[
Cleans up the task passed in as the argument.
A task can be any of the following:
- an Instance - will be destroyed
- an RBXScriptConnection - will be disconnected
- a function - will be run
- a table with a `Destroy` or `destroy` function - will be called
- an array - `cleanup` will be called on each item
]]
|
export type Task =
Instance |
RBXScriptConnection |
() -> () |
{destroy: (any) -> ()} |
{Destroy: (any) -> ()} |
{Task}
local function cleanup(task: any)
local taskType = typeof(task)
-- case 1: Instance
if taskType == "Instance" then
task:Destroy()
-- case 2: RBXScriptConnection
elseif taskType == "RBXScriptConnection" then
task:Disconnect()
-- case 3: callback
elseif taskType == "function" then
task()
elseif taskType == "table" then
-- case 4: destroy() function
if typeof(task.destroy) == "function" then
task:destroy()
-- case 5: Destroy() function
elseif typeof(task.Destroy) == "function" then
task:Destroy()
-- case 6: array of tasks
elseif task[1] ~= nil then
for _, subtask in ipairs(task) do
cleanup(subtask)
end
end
end
end
return cleanup
|
--tycoonsFolder.ChildAdded:Connect(function(tycoon)
|
--local purchaseHandler = tycoon:FindFirstChild("PurchaseHandler")
--if purchaseHandler ~= nil then
--purchaseHandler:Destroy()
--purchaseHandlerNew:Clone().Parent = tycoon
|
--// Hash: f1e25cc5a70586bc0cb2ccfb248fa3890a7efaf8846040164a31a46176c8dcdb35134e7badd64ce621fc28380cb315c7
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local l__TweenService__2 = game:GetService("TweenService");
for v3, v4 in pairs(script:WaitForChild("StatModules"):GetChildren()) do
local v5 = Instance.new("IntValue");
v5.Name = v4.Name .. "Val";
v5.Parent = v4;
v5.Value = 0;
local u1 = require(v4);
local u2 = script.Parent:FindFirstChild(v4.Name);
local function v6(p1)
if p1 ~= nil then
p1 = tonumber(p1);
else
p1 = u1.value;
end;
if type(p1) ~= "number" then
return;
end;
local v7 = tonumber(u2.Text);
u2.Size = UDim2.new(1, 0, 0.3, 0);
if v7 < p1 then
u2.TextColor3 = u2:GetAttribute("FadeIncrease");
u2.SoundIncrease:Play();
elseif p1 < v7 then
u2.TextColor3 = u2:GetAttribute("FadeDecrease");
u2.SoundDecrease:Play();
end;
l__TweenService__2:Create(u2, TweenInfo.new(0.7, Enum.EasingStyle.Quart, Enum.EasingDirection.InOut), {
Size = UDim2.new(1, 0, 0.25, 0),
TextColor3 = Color3.new(1, 1, 1)
}):Play();
l__TweenService__2:Create(v5, TweenInfo.new(0.4, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {
Value = tonumber(p1)
}):Play();
if p1 <= 0 then
u2.Visible = false;
return;
end;
u2.Visible = true;
end;
v5.Changed:Connect(function(p2)
u2.Text = tostring(p2);
end);
if v4.Name == "Gold" then
local u3 = tick();
local u4 = true;
u1.event.Event:Connect(function()
if u3 <= tick() then
u3 = tick() + 0.2;
end;
u4 = false;
end);
game:GetService("ReplicatedStorage"):WaitForChild("Bricks"):WaitForChild("GetGold").OnClientEvent:Connect(function(p3)
u3 = tick() + 0.5;
u4 = false;
print("yeah");
local v8, v9 = workspace.CurrentCamera:WorldToScreenPoint(p3);
local v10 = script.Parent.Parent.Gold:Clone();
v10.Visible = true;
v10.Name = "GoldLive";
v10.Position = UDim2.new(0, v8.X, 0, v8.Y);
v10.Parent = script.Parent.Parent;
local l__AbsolutePosition__11 = u2.Icon.AbsolutePosition;
local l__AbsoluteSize__12 = u2.Icon.AbsoluteSize;
l__TweenService__2:Create(v10, TweenInfo.new(0.5, Enum.EasingStyle.Quart, Enum.EasingDirection.In), {
Size = UDim2.new(0, l__AbsoluteSize__12.X, 0, l__AbsoluteSize__12.Y),
Position = UDim2.new(0, l__AbsolutePosition__11.X + l__AbsoluteSize__12.X / 2, 0, l__AbsolutePosition__11.Y + l__AbsoluteSize__12.Y / 2)
}):Play();
game.Debris:AddItem(v10, 0.5);
end);
game:GetService("RunService").Heartbeat:Connect(function()
if u4 == false and u3 <= tick() then
u4 = true;
v6();
end;
end);
else
u1.event.Event:Connect(v6);
end;
v6();
end;
wait(5);
pcall(function()
script.Parent.Parent:WaitForChild("ImageLabel"):TweenPosition(UDim2.new(0.85, 0, 0.8, 0), "Out", "Quad", 1);
script.Parent:TweenPosition(UDim2.new(1, 0, 1, 0), "Out", "Quad", 2);
end);
|
-- GUI DETECTION SETTINGS
|
settings.AntiOwlHub = true
settings.AntiDex = false
settings.AntiInfiniteYield = true
settings.AntiRemoteSpy = true
|
--Tool.Spray.Transparency = 1
--Tool.Spray.Script.Disabled = true
--Tool.Nossle.Spray.Enabled = false
|
event:FireServer("Button1Up")
end
function onEquip(mouse)
if mouse == nil then return end
mouse.Button1Down:connect(function() OB1D(mouse) end)
mouse.Button1Up:connect(function() OB1U(mouse) end)
end
script.Parent.Equipped:connect(onEquip)
|
--s.Pitch = 0.7
--[[for x = 1, 50 do
s.Pitch = s.Pitch + 0.20 1.900
s:play()
wait(0.001)
end]]
--[[Chopper level 5=1.2, Chopper level 4=1.04]]
|
while s.Pitch<0.65 do
s.Pitch=s.Pitch+0.009
s:Play()
if s.Pitch>1 then
s.Pitch=1
end
wait(-9)
end
while s.Pitch<0.97 do
s.Pitch=s.Pitch+0.003
s:Play()
if s.Pitch>1 then
s.Pitch=1
end
wait(-9)
end
while true do
for x = 1, 500 do
s:play()
wait(-9)
end
end
|
--[[ alexnewtron 2014 ]]
|
--
local p = game.Players.LocalPlayer;
local h = p.Character:findFirstChild("Humanoid");
if (h ~= nil) then
wait(7+math.random())
h.WalkSpeed = 16;
end
|
-- Called when the RealismHook tag is added to a
-- humanoid in the DataModel. Mounts the look-angle
-- and material walking sounds into this humanoid.
|
function CharacterRealism:OnHumanoidAdded(humanoid)
if humanoid:IsA("Humanoid") then
if not self.SkipLookAngle then
self:MountLookAngle(humanoid)
end
if not self.SkipMaterialSounds then
self:MountMaterialSounds(humanoid)
end
end
end
|
-- Note: The active transparency controller could be made to listen for this event itself.
|
function CameraModule:OnCameraSubjectChanged()
local camera = workspace.CurrentCamera
local cameraSubject = camera and camera.CameraSubject
if self.activeTransparencyController then
self.activeTransparencyController:SetSubject(cameraSubject)
end
if self.activeOcclusionModule then
self.activeOcclusionModule:OnCameraSubjectChanged(cameraSubject)
end
self:ActivateCameraController(nil, camera.CameraType)
end
function CameraModule:OnCameraTypeChanged(newCameraType)
if newCameraType == Enum.CameraType.Scriptable then
if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
-- Forward the change to ActivateCameraController to handle
self:ActivateCameraController(nil, newCameraType)
end
|
-- CONFIRMATIONS and FETCHES
|
function TribeModule:ValidateLeadership(playerName,tribeName)
end
function TribeModule:ValidateMembership(playerName,tribeName)
end
function TribeModule:GetPlayerTribe(playerName)
end
function TribeModule:GetTribeColor(tribeName)
end
|
-- Prepend to list so the last added is the first tested.
|
local function addSerializer(plugin_)
table.insert(PLUGINS, 1, plugin_)
end
local function getSerializers()
return PLUGINS
end
|
--[=[
Catch errors from the promise
@param onRejected function
@return Promise<T>
]=]
|
function Promise:Catch(onRejected)
return self:Then(nil, onRejected)
end
|
--[=[
http://reactivex.io/documentation/operators/using.html
Each time a subscription occurs, the resource is constructed
and exists for the lifetime of the observation. The observableFactory
uses the resource for subscription.
:::note
Note from Quenty: I haven't found this that useful.
:::
@param resourceFactory () -> MaidTask
@param observableFactory (MaidTask) -> Observable<T>
@return Observable<T>
]=]
|
function Rx.using(resourceFactory, observableFactory)
return Observable.new(function(sub)
local maid = Maid.new()
local resource = resourceFactory()
maid:GiveTask(resource)
local observable = observableFactory(resource)
assert(Observable.isObservable(observable), "Bad observable")
maid:GiveTask(observable:Subscribe(sub:GetFireFailComplete()))
return maid
end)
end
|
--[=[
Shorthand for `Promise:andThen(nil, failureHandler)`.
Returns a Promise that resolves if the `failureHandler` worked without encountering an additional error.
:::warning
Within the failure handler, you should never assume that the rejection value is a string. Some rejections within the Promise library are represented by [[Error]] objects. If you want to treat it as a string for debugging, you should call `tostring` on it first.
:::
@param failureHandler (...: any) -> ...any
@return Promise<...any>
]=]
|
function Promise.prototype:catch(failureCallback)
assert(
failureCallback == nil or type(failureCallback) == "function",
string.format(ERROR_NON_FUNCTION, "Promise:catch")
)
return self:_andThen(debug.traceback(nil, 2), nil, failureCallback)
end
|
---------------------------------------------------------------
|
function onChildAdded(child)
script.Parent.Parent.Body.Lightbar.Park.Value = false
end
function onChildRemoved(child)
if script.Parent.Parent.Body.Lightbar.on.Value == true then
script.Parent.Parent.Body.Lightbar.Park.Value = true
end
end
script.Parent.ChildAdded:connect(onChildAdded)
script.Parent.ChildRemoved:connect(onChildRemoved)
|
--☻☻☻☻☻☻☻
|
local P1 = script.Parent.PivotL
local P2 = script.Parent.PivotR
local TS = game:GetService("TweenService")
local CD1 = Instance.new("ClickDetector",script.Parent.L)
local CD2 = Instance.new("ClickDetector",script.Parent.R)
local toggle = false
local deb = false
local function Box()
if not deb then
deb = true
if toggle == false then
TS:Create(P1,
TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
{CFrame = P1.CFrame * CFrame.Angles(math.rad(160),0,0)}
):Play()
local t1 = TS:Create(P2,
TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
{CFrame = P2.CFrame * CFrame.Angles(math.rad(-170),0,0)}
)
t1.Completed:Connect(function()
toggle = not toggle
deb = false
end)
t1:Play()
else
TS:Create(P1,
TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
{CFrame = P1.CFrame * CFrame.Angles(math.rad(-160),0,0)}
):Play()
local t1 = TS:Create(P2,
TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),
{CFrame = P2.CFrame * CFrame.Angles(math.rad(170),0,0)}
)
t1.Completed:Connect(function()
toggle = not toggle
deb = false
end)
t1:Play()
end
end
end
CD1.MouseClick:Connect(function()
Box()
end)
CD2.MouseClick:Connect(function()
Box()
end)
|
-- initialize local variables
|
local camera = workspace.CurrentCamera
local player = game.Players.LocalPlayer
local character = player.Character
local humanoid = character.Humanoid
|
--[[
TableUtil.Copy(Table tbl)
TableUtil.CopyShallow(Table tbl)
TableUtil.Sync(Table tbl, Table templateTbl)
TableUtil.Print(Table tbl, String label, Boolean deepPrint)
TableUtil.FastRemove(Table tbl, Number index)
TableUtil.FastRemoveFirstValue(Table tbl, Variant value)
TableUtil.Map(Table tbl, Function callback)
TableUtil.Filter(Table tbl, Function callback)
TableUtil.Reduce(Table tbl, Function callback [, Number initialValue])
TableUtil.Assign(Table target, ...Table sources)
TableUtil.Extend(Table target, Table extension)
TableUtil.IndexOf(Table tbl, Variant item)
TableUtil.Reverse(Table tbl)
TableUtil.Shuffle(Table tbl)
TableUtil.IsEmpty(Table tbl)
TableUtil.EncodeJSON(Table tbl)
TableUtil.DecodeJSON(String json)
EXAMPLES:
Copy:
Performs a deep copy of the given table. In other words,
all nested tables will also get copied.
local tbl = {"a", "b", "c"}
local tblCopy = TableUtil.Copy(tbl)
CopyShallow:
Performs a shallow copy of the given table. In other words,
all nested tables will not be copied, but only moved by
reference. Thus, a nested table in both the original and
the copy will be the same.
local tbl = {"a", "b", "c"}
local tblCopy = TableUtil.CopyShallow(tbl)
Sync:
Synchronizes a table to a template table. If the table does not have an
item that exists within the template, it gets added. If the table has
something that the template does not have, it gets removed.
local tbl1 = {kills = 0; deaths = 0; points = 0}
local tbl2 = {points = 0}
TableUtil.Sync(tbl2, tbl1) -- In words: "Synchronize table2 to table1"
print(tbl2.deaths)
Print:
Prints out the table to the output in an easy-to-read format. Good for
debugging tables. If deep printing, avoid cyclical references.
local tbl = {a = 32; b = 64; c = 128; d = {x = 0; y = 1; z = 2}}
TableUtil.Print(tbl, "My Table", true)
FastRemove:
Removes an item from an array at a given index. Only use this if you do
NOT care about the order of your array. This works by simply popping the
last item in the array and overwriting the given index with the last
item. This is O(1), compared to table.remove's O(n) speed.
local tbl = {"hello", "there", "this", "is", "a", "test"}
TableUtil.FastRemove(tbl, 2) -- Remove "there" in the array
print(table.concat(tbl, " ")) -- > hello test is a
FastRemoveFirstValue:
Calls FastRemove on the first index that holds the given value.
local tbl = {"abc", "hello", "hi", "goodbye", "hello", "hey"}
local removed, atIndex = TableUtil.FastRemoveFirstValue(tbl, "hello")
if (removed) then
print("Removed at index " .. atIndex)
print(table.concat(tbl, " ")) -- > abc hi goodbye hello hey
else
print("Did not find value")
end
Map:
This allows you to construct a new table by calling the given function
on each item in the table.
local peopleData = {
{firstName = "Bob"; lastName = "Smith"};
{firstName = "John"; lastName = "Doe"};
{firstName = "Jane"; lastName = "Doe"};
}
local people = TableUtil.Map(peopleData, function(item)
return {Name = item.firstName .. " " .. item.lastName}
end)
-- 'people' is now an array that looks like: { {Name = "Bob Smith"}; ... }
Filter:
This allows you to create a table based on the given table and a filter
function. If the function returns 'true', the item remains in the new
table; if the function returns 'false', the item is discluded from the
new table.
local people = {
{Name = "Bob Smith"; Age = 42};
{Name = "John Doe"; Age = 34};
{Name = "Jane Doe"; Age = 37};
}
local peopleUnderForty = TableUtil.Filter(people, function(item)
return item.Age < 40
end)
Reduce:
This allows you to reduce an array to a single value. Useful for quickly
summing up an array.
local tbl = {40, 32, 9, 5, 44}
local tblSum = TableUtil.Reduce(tbl, function(accumulator, value)
return accumulator + value
end)
print(tblSum) -- > 130
Assign:
This allows you to assign values from multiple tables into one. The
Assign function is very similar to JavaScript's Object.Assign() and
is useful for things such as composition-designed systems.
local function Driver()
return {
Drive = function(self) self.Speed = 10 end;
}
end
local function Teleporter()
return {
Teleport = function(self, pos) self.Position = pos end;
}
end
local function CreateCar()
local state = {
Speed = 0;
Position = Vector3.new();
}
-- Assign the Driver and Teleporter components to the car:
return TableUtil.Assign({}, Driver(), Teleporter())
end
local car = CreateCar()
car:Drive()
car:Teleport(Vector3.new(0, 10, 0))
Extend:
Extends on all elements from one table to another.
local t1 = {"a", "b", "c"}
local t2 = {"d", "e", "f"}
TableUtil.Extend(t1, t2)
print(t1) --> { "a", "b", "c", "d", "e", "f" }
IndexOf:
Returns the index of the given item in the table. If not found, this
will return nil.
This is the same as table.find, which Roblox added after this method
was written. To keep backwards compatibility, this method will continue
to exist, but will point directly to table.find.
local tbl = {"Hello", 32, true, "abc"}
local abcIndex = TableUtil.IndexOf(tbl, "abc") -- > 4
local helloIndex = TableUtil.IndexOf(tbl, "Hello") -- > 1
local numberIndex = TableUtil.IndexOf(tbl, 64) -- > nil
Reverse:
Creates a reversed version of the array. Note: This is a shallow
copy, so existing references will remain within the new table.
local tbl = {2, 4, 6, 8}
local rblReversed = TableUtil.Reverse(tbl) -- > {8, 6, 4, 2}
Shuffle:
Shuffles (i.e. randomizes) an array. This uses the Fisher-Yates algorithm.
local tbl = {1, 2, 3, 4, 5, 6, 7, 8, 9}
TableUtil.Shuffle(tbl)
print(table.concat(tbl, ", ")) -- e.g. > 3, 6, 9, 2, 8, 4, 1, 7, 5
--]]
|
local TableUtil = {}
local http = game:GetService("HttpService")
local IndexOf = table.find
local function CopyTable(t)
assert(type(t) == "table", "First argument must be a table")
local tCopy = table.create(#t)
for k,v in pairs(t) do
if (type(v) == "table") then
tCopy[k] = CopyTable(v)
else
tCopy[k] = v
end
end
return tCopy
end
local function CopyTableShallow(t)
local tCopy = table.create(#t)
for k,v in pairs(t) do tCopy[k] = v end
return tCopy
end
local function Sync(tbl, templateTbl)
assert(type(tbl) == "table", "First argument must be a table")
assert(type(templateTbl) == "table", "Second argument must be a table")
-- If 'tbl' has something 'templateTbl' doesn't, then remove it from 'tbl'
-- If 'tbl' has something of a different type than 'templateTbl', copy from 'templateTbl'
-- If 'templateTbl' has something 'tbl' doesn't, then add it to 'tbl'
for k,v in pairs(tbl) do
local vTemplate = templateTbl[k]
-- Remove keys not within template:
if (vTemplate == nil) then
tbl[k] = nil
-- Synchronize data types:
elseif (type(v) ~= type(vTemplate)) then
if (type(vTemplate) == "table") then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
-- Synchronize sub-tables:
elseif (type(v) == "table") then
Sync(v, vTemplate)
end
end
-- Add any missing keys:
for k,vTemplate in pairs(templateTbl) do
local v = tbl[k]
if (v == nil) then
if (type(vTemplate) == "table") then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
end
end
end
local function FastRemove(t, i)
local n = #t
t[i] = t[n]
t[n] = nil
end
local function Map(t, f)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
local newT = table.create(#t)
for k,v in pairs(t) do
newT[k] = f(v, k, t)
end
return newT
end
local function Filter(t, f)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
local newT = table.create(#t)
if (#t > 0) then
local n = 0
for i = 1,#t do
local v = t[i]
if (f(v, i, t)) then
n = (n + 1)
newT[n] = v
end
end
else
for k,v in pairs(t) do
if (f(v, k, t)) then
newT[k] = v
end
end
end
return newT
end
local function Reduce(t, f, init)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
assert(init == nil or type(init) == "number", "Third argument must be a number or nil")
local result = (init or 0)
for k,v in pairs(t) do
result = f(result, v, k, t)
end
return result
end
|
--Services
|
local Marketplace = game:GetService("MarketplaceService")
local Http = game:GetService("HttpService")
|
-- setup variables
|
RootHipJoint = HumanoidRootPart:FindFirstChildOfClass("Motor6D")
RootOldC0 = RootHipJoint.C0
LeftShoulder = Torso:WaitForChild("Left Shoulder")
RightShoulder = Torso:WaitForChild("Right Shoulder")
|
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
|
local function InputBegan(input, processed)
if input.UserInputType == keyboardInput then
local key = input.KeyCode
isDown[key] = true
onKeyDown:Fire(key)
end
end -- InputBegan()
local function InputEnded(input, processed)
if input.UserInputType == keyboardInput then
local key = input.KeyCode
isDown[key] = false
onKeyUp:Fire(key)
end
end -- InputEnded()
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local autoscaling = true --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 140 ,
spInc = 10 , -- Increment between labelled notches
},
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 220 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 240 ,
spInc = 20 , -- Increment between labelled notches
}
}
|
-- Merges four bytes into a uint32 number.
|
function common.bytes_to_uint32(a, b, c, d)
return a * 0x1000000 + b * 0x10000 + c * 0x100 + d
end
|
--
|
FLDisk.CanCollide = true
FRDisk.CanCollide = true
RLDisk.CanCollide = true
RRDisk.CanCollide = true
hitboxF.CanCollide = true
hitboxR.CanCollide = true
weight.CustomPhysicalProperties = PhysicalProperties.new((((VehicleWeight/160)*0.4)-5.2)+0.4,1,1,1,1)
engine.CustomPhysicalProperties = PhysicalProperties.new(0.04,1,1,1,1)
fuel.CustomPhysicalProperties = PhysicalProperties.new(0.06,1,1,1,1)
trans.CustomPhysicalProperties = PhysicalProperties.new(0.1,1,1,1,1)
diff.CustomPhysicalProperties = PhysicalProperties.new(0.1,1,1,1,1)
weight.Transparency = 1
engine.Transparency = 1
fuel.Transparency = 1
trans.Transparency = 1
diff.Transparency = 1
FLDisk.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
FRDisk.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
RLDisk.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
RRDisk.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
FLPad.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
FRPad.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
RLPad.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
RRPad.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
UFLPad.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
UFRPad.CustomPhysicalProperties = PhysicalProperties.new(1,2,0,100,0)
hitboxF.CanCollide = hitboxes
hitboxR.CanCollide = hitboxes
local GUISC = script.Assets.GUI:Clone()
GUISC.Parent = script.Parent
GUISC.Disabled = false
local Plugins = script.Plugins
for _,i in pairs(Plugins:GetChildren()) do i.Parent = script.Parent.Screen end
wait(2)
hitboxF.CanCollide = hitboxes
hitboxR.CanCollide = hitboxes
frontstiffness = 1290 * StiffnessFront
frontdamping = 40 * StiffnessFront
rearstiffness = 1290 * StiffnessRear
reardamping = 40 * StiffnessRear
springFL.Stiffness = frontstiffness
springFR.Stiffness = frontstiffness
springRL.Stiffness = rearstiffness
springRR.Stiffness = rearstiffness
wait(5)
hitboxF.CanCollide = hitboxes
hitboxR.CanCollide = hitboxes
wait(5)
hitboxF.CanCollide = hitboxes
hitboxR.CanCollide = hitboxes end
|
--[=[
Legacy loading logic
@private
@class LegacyLoader
]=]
|
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local LoaderUtils = require(script.Parent.LoaderUtils)
local BounceTemplateUtils = require(script.Parent.BounceTemplateUtils)
local Loader = require(script.Parent.Loader)
local LegacyLoader = {}
LegacyLoader.ClassName = "LegacyLoader"
LegacyLoader.__index = LegacyLoader
function LegacyLoader.new(script)
return setmetatable({
_script = assert(script, "No script");
_container = false;
_locked = false;
_lookupMap = {};
}, LegacyLoader)
end
function LegacyLoader:Lock()
assert(not self._container, "Cannot bootstrap game when legacy loader was already used")
self._locked = true
end
function LegacyLoader:GetLoader(moduleScript)
return Loader.new(moduleScript)
end
function LegacyLoader:Require(value)
assert(not self._locked, "Cannot use legacy loader after already transformed")
self:_setupIfNeeded()
if type(value) == "number" then
return require(value)
elseif type(value) == "string" then
local existing = self._lookupMap[value]
if existing then
return require(existing)
else
error("Error: Library '" .. tostring(value) .. "' does not exist.", 2)
end
elseif typeof(value) == "Instance" and value:IsA("ModuleScript") then
return require(value)
else
error(("Error: module must be a string or ModuleScript, got '%s' for '%s'")
:format(typeof(value), tostring(value)))
end
end
function LegacyLoader:_buildLookupContainer()
for _, instance in pairs(self._container:GetDescendants()) do
if instance:IsA("ModuleScript")
and not instance:FindFirstAncestorWhichIsA("ModuleScript") then
local target = instance
if BounceTemplateUtils.isBounceTemplate(instance) then
target = BounceTemplateUtils.getTarget(instance) or instance
end
local existing = self._lookupMap[instance.Name]
if existing then
if target ~= existing then
warn(("[LegacyLoader] - Duplicate module %q found, using first found\n\t(1) %s (used)\n\t(2) %s")
:format(
instance.Name,
self._lookupMap[instance.Name]:GetFullName(),
instance:GetFullName()))
end
else
self._lookupMap[instance.Name] = target
end
end
end
end
function LegacyLoader:_setupIfNeeded()
local existingContainer = rawget(self, "_container")
if existingContainer then
return existingContainer
end
-- TODO: Handle setup by manual process
assert(self._script.Name == "Nevermore", "Cannot invoke legacy mode if not at ReplicatedStorage.Nevermore")
assert(self._script.Parent == ReplicatedStorage, "Cannot invoke legacy mode if not at ReplicatedStorage.Nevermore")
if not RunService:IsRunning() then
error("Test mode not supported")
elseif RunService:IsServer() and RunService:IsClient() or (not RunService:IsRunning()) then
if RunService:IsRunning() then
error("Warning: Loading all modules in PlaySolo. It's recommended you use accurate play solo.")
end
elseif RunService:IsServer() then
local container = ServerScriptService:FindFirstChild("Nevermore") or error("No ServerScriptService.Nevermore folder")
local clientFolder, serverFolder, sharedFolder = LoaderUtils.toWallyFormat(container)
clientFolder.Name = "_nevermoreClient"
clientFolder.Parent = ReplicatedStorage
sharedFolder.Name = "_nevermoreShared"
sharedFolder.Parent = ReplicatedStorage
serverFolder.Name = "_nevermoreServer"
serverFolder.Parent = ServerScriptService
rawset(self, "_container", serverFolder)
self:_buildLookupContainer()
elseif RunService:IsClient() then
local container = ReplicatedStorage:WaitForChild("_nevermoreClient", 2)
if not container then
warn("[Nevermore] - Be sure to call require(ServerScriptService.Nevermore) on the server to replicate nevermore")
container = ReplicatedStorage:WaitForChild("_nevermoreClient")
end
rawset(self, "_container", container)
self:_buildLookupContainer()
else
error("Error: Unknown RunService state (Not client/server/test mode)")
end
end
return LegacyLoader
|
--[=[
Utility functions for UI padding
@class UIPaddingUtils
]=]
|
local UIPaddingUtils = {}
function UIPaddingUtils.fromUDim(udim)
local uiPadding = Instance.new("UIPadding")
uiPadding.PaddingBottom = udim
uiPadding.PaddingTop = udim
uiPadding.PaddingLeft = udim
uiPadding.PaddingRight = udim
return uiPadding
end
function UIPaddingUtils.getTotalPadding(uiPadding)
return UDim2.new(uiPadding.PaddingLeft + uiPadding.PaddingRight,
uiPadding.PaddingBottom + uiPadding.PaddingTop)
end
function UIPaddingUtils.getTotalAbsolutePadding(uiPadding, absoluteSize)
local padding = UIPaddingUtils.getTotalPadding(uiPadding)
return Vector2.new(
padding.X.Offset + padding.X.Scale*absoluteSize.x,
padding.Y.Offset + padding.Y.Scale*absoluteSize.Y
)
end
function UIPaddingUtils.getHorizontalPadding(uiPadding)
return uiPadding.PaddingLeft + uiPadding.PaddingRight
end
return UIPaddingUtils
|
----------------------------------------------------------------------------------------------------
--------------------=[ OUTROS ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,FastReload = true --- Automatically operates the bolt on reload if needed
,SlideLock = false
,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 = 7
,GunFOVReduction = 6.5
,BoltExtend = Vector3.new(0, 0, 0.4)
,SlideExtend = Vector3.new(0, 0, 0.4)
|
-- else
-- MessageData = HTTPSERVICE:JSONEncode(MessageData)
-- HTTPSERVICE:PostAsync(URL,MessageData)
-- end
--end)
|
return true
|
-- camera settings
|
player.CameraMaxZoomDistance = 0.5 -- force first person
camera.FieldOfView = 80
humanoid.CameraOffset = Vector3.new(0, -1, -1.5)
|
-- ServerComm
-- Stephen Leitnick
-- December 20, 2021
|
local Comm = require(script.Parent)
local Util = require(script.Parent.Parent.Util)
local Types = require(script.Parent.Parent.Types)
|
-- lunge and hold
|
target:FindFirstChild("Humanoid"):TakeDamage(99)
shark.Head.SharkEat:Play()
local emitter = game.ReplicatedStorage.Particles.Teeth:Clone()
emitter.Parent = shark.Head
emitter.EmissionDirection = Enum.NormalId.Top
wait()
emitter:Emit(1)
holdOrder = tick()
holdDuration = 2
end
end
end -- end of MakeAMove()
MakeAMove()
local scanSurroundings = coroutine.wrap(function()
while true do
stance = "wander"
local surroundingParts = workspace:FindPartsInRegion3WithIgnoreList(Region3.new(
shark.PrimaryPart.Position+Vector3.new(-60,-3,-60),
shark.PrimaryPart.Position+Vector3.new(60,10,60)),
shark:GetChildren())
for _,v in next,surroundingParts do
if v.Parent:FindFirstChild("Humanoid") and v.Parent.Humanoid.Health > 0 then
|
-- List of UI elements
|
local UIElements = { 'SelectNote', 'MaterialOption', 'TransparencyOption', 'ReflectanceOption' };
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.4 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.5 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 1.87 ,
--[[ 3 ]] 1.4 ,
--[[ 4 ]] 1.1 ,
--[[ 5 ]] 0.83 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Made by Luckymaxer
|
Debris = game:GetService("Debris")
Camera = game:GetService("Workspace").CurrentCamera
Camera.FieldOfView = 70
Debris:AddItem(script, 2)
|
--{HPattern, Automatic, DualClutch, CVT}
|
if script.Parent.Storage.EngineType.Value ~= "Electric" then
if script.Parent.Storage.TransmissionType.Value == "HPattern" then
if currentgear.Value == 3 and clutch.Value == true then
--script.Parent.Storage.AutoClutch.Value = true
else
--script.Parent.Storage.AutoClutch.Value = false
end
elseif script.Parent.Storage.TransmissionType.Value == "Automatic" then
elseif script.Parent.Storage.TransmissionType.Value == "DualClutch" then
elseif script.Parent.Storage.TransmissionType.Value == "CVT" then
vvv = 0.034
vt = 0.7
if rpm.Value >= 5000*convert and throttle.Value >= 1 then
if gear1.Value > 0.7 and speed > 40 then
gear1.Value = gear1.Value - 0.02*(2-(speed/130))
elseif gear1.Value < 0.5 then
gear1.Value = 0.5
end
elseif rpm.Value <= 4900*convert then
if gear1.Value > 4 then
gear1.Value = 4
else
gear1.Value = gear1.Value + 0.028*(2-(speed/130))
end
end
end
end
if script.Parent.Storage.Brake.Value > 0.2 then
drive =
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/8)
else
if carSeat.Dyno.Value == false then
if script.Parent.Storage.Drivetrain.Value == "RWD" then
drive =
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/8)+
(carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/8)
orderch = ((carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude + carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude)/2)*1.298
TC = rt
torquesplit.Value = 100
elseif script.Parent.Storage.Drivetrain.Value == "FWD" then
drive =
(carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/2)+
(carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/2)
orderch = ((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude + carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude)/2)*1.298
torquesplit.Value = 0
TC = ft
elseif script.Parent.Storage.Drivetrain.Value == "AWD" then
drive =
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/2)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/2)
orderch = ((carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude + carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude + carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude + carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude)/4)*1.298
TC = (rt+ft)/2
end
else
if script.Parent.Storage.Drivetrain.Value == "RWD" then
drive =
(carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/2)+
(carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/2)
elseif script.Parent.Storage.Drivetrain.Value == "FWD" then
drive =
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/2)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/2)
elseif script.Parent.Storage.Drivetrain.Value == "AWD" then
drive =
(carSeat.Parent.Parent.Wheels.FL.Wheel.RotVelocity.Magnitude/4)+
(carSeat.Parent.Parent.Wheels.FR.Wheel.RotVelocity.Magnitude/4)+(carSeat.Parent.Parent.Wheels.RL.Wheel.RotVelocity.Magnitude/4)+
(carSeat.Parent.Parent.Wheels.RR.Wheel.RotVelocity.Magnitude/4)
end
end
end
xxx = (gear[currentgear.Value]/final.Value)*(111)
ovo = (gear[currentgear.Value]/final.Value)*1.5
trans.Value = drive
if currentgear.Value ~= 1 then
x1x = (gear[(currentgear.Value-1)]/final.Value)*(111)
xx1 = (gear[(currentgear.Value+1)]/final.Value)*(111)
else
x1x = 1
end
tran = clutch.Clutch.Value
wheelrpm = trans.Value*xxx
four = (gear[currentgear.Value]/final.Value)
if script.Parent.Functions.ShiftDownRequested.Value ~= true and script.Parent.Functions.ShiftUpRequested.Value ~= true then
rpm.Value = (engine.Value*(1-tran))+(tran*wheelrpm)
end
checkcluch = clutch.Clutch.Value
if clutch.Value == true then
CT = 1
else
CT = 0
end
|
-- Signals:
|
function Replica:ConnectOnClientEvent(listener) --> [ScriptConnection] listener(...)
if type(listener) ~= "function" then
error("[ReplicaController]: Only functions can be passed to Replica:ConnectOnClientEvent()")
end
table.insert(self._signal_listeners, listener)
return Madwork.NewArrayScriptConnection(self._signal_listeners, listener)
end
function Replica:FireServer(...)
rev_ReplicaSignal:FireServer(self.Id, ...)
end
|
--[[
Adds downward thrust on the character so that it cannot get stuck in zero gravity.
]]
|
local DOWNWARDS_THRUST = 8
local downwardThrust = Instance.new("VectorForce")
local attachment = Instance.new("Attachment")
downwardThrust.Force = Vector3.new(0, -DOWNWARDS_THRUST, 0)
attachment.Parent = script.Parent.PrimaryPart
downwardThrust.Parent = attachment
downwardThrust.Attachment0 = attachment
|
-- Initialization
|
if Configurations.TEAMS then
TeamManager:CreateTeams()
end
return TeamManager
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.