prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--// Animations |
-- Idle Anim
IdleAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 1, 0, 0, 0, 1.19248806e-08, 1, 0, -1, 1.19248806e-08), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.0318467021, -2.0621779114, -1.67288721, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- FireMode Anim
FireModeAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0.340285569, 0, -0.0787199363, 0.962304771, 0.271973342, 0, -0.261981696, 0.926952124, -0.268561482, -0.0730415657, 0.258437991, 0.963262498), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(0.67163527, -0.310947895, -1.34432662, 0.766044378, -2.80971371e-008, 0.642787576, -0.620885074, -0.258818865, 0.739942133, 0.166365519, -0.965925872, -0.198266774), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.25)
objs[4]:WaitForChild("Click"):Play()
end;
-- Reload Anim
ReloadAnim = function(char, speed, objs)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.5)
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621779114, -1.63076854, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.5)
wait(0.5)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(objs[4].CFrame)
objs[4].Transparency = 1
objs[6]:WaitForChild("MagOut"):Play()
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621778965, -2.69811869, 0.787567914, -0.220087856, 0.575584888, -0.51537323, 0.276813388, 0.811026871, -0.337826759, -0.935379863, 0.104581922), function(X) return math.sin(math.rad(X)) end, 0.3)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.29060709, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.973990917, -0.226587087, 2.70202394e-09, -0.0646390691, -0.277852833, 0.958446443, -0.217171595, -0.933518112, -0.285272509), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
objs[6]:WaitForChild('MagIn'):Play()
TweenJoint(objs[3], nil , CFrame.new(0.511569798, -0.0621779114, -1.63076854, 0.787567914, -0.220087856, 0.575584888, -0.615963876, -0.308488727, 0.724860668, 0.0180283934, -0.925416589, -0.378522098), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.4)
MagC:Destroy()
objs[4].Transparency = 0
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.295501232, -1.07592201, 0.98480773, -0.171010077, -0.0301536508, 0, -0.173647955, 0.984807789, -0.173648179, -0.969846308, -0.171009853), function(X) return math.sin(math.rad(X)) end, 0.3)
wait(0.3)
objs[7].Parent:WaitForChild('BoltForward'):Play()
TweenJoint(objs[7], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.03)
TweenJoint(objs[2], nil , CFrame.new(-0.902175903, 0.395501226, -1.07592201, 0.98480773, -0.171010077, -0.0301536508, 0, -0.173647955, 0.984807789, -0.173648179, -0.969846308, -0.171009853), function(X) return math.sin(math.rad(X)) end, 0.1)
wait(0.15)
end;
-- Bolt Anim
BoltBackAnim = function(char, speed, objs)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.518400908, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.492658436, -1.55705214, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.4)
objs[5]:WaitForChild("BoltBack"):Play()
TweenJoint(objs[2], nil , CFrame.new(-0.333807141, -0.609481037, -1.02827215, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.230707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.175939053, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.3)
end;
BoltForwardAnim = function(char, speed, objs)
objs[5]:WaitForChild("BoltForward"):Play()
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[2], nil , CFrame.new(-0.84623456, -0.900531948, -0.749261618, 0.140073985, -0.978677034, -0.150234282, -0.955578506, -0.173358306, 0.238361627, -0.259323537, 0.110172354, -0.959486008), function(X) return math.sin(math.rad(X)) end, 0.1)
TweenJoint(objs[3], nil , CFrame.new(-0.603950977, 0.617181182, -1.07592201, 0.984651804, 0.174530268, -2.0812525e-09, 0.0221636202, -0.125041038, 0.991903961, 0.173117265, -0.97668004, -0.12699011), function(X) return math.sin(math.rad(X)) end, 0.2)
wait(0.2)
end;
-- Bolting Back
BoltingBackAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(0, 0, 0.230707675, 1, 0, 0, 0, 1, 0, 0, 0, 1), function(X) return math.sin(math.rad(X)) end, 0.03)
end;
BoltingForwardAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(), function(X) return math.sin(math.rad(X)) end, 0.1)
end;
InspectAnim = function(char, speed, objs)
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.805950999, 0.654529691, -1.92835355, 0.999723792, 0.0109803826, 0.0207702816, -0.0223077796, 0.721017241, 0.692557871, -0.00737112388, -0.692829967, 0.721063137)}):Play()
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-1.49363565, -0.699174881, -1.32277012, 0.66716975, -8.8829113e-09, -0.74490571, 0.651565909, -0.484672248, 0.5835706, -0.361035138, -0.874695837, -0.323358655)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(1.37424219, -0.699174881, -1.03685927, -0.204235911, 0.62879771, 0.750267386, 0.65156585, -0.484672219, 0.58357054, 0.730581641, 0.60803473, -0.310715646)}):Play()
wait(1)
ts:Create(objs[2],TweenInfo.new(1),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.32277012, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(1),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(1)
local MagC = Tool:WaitForChild("Mag"):clone()
MagC:FindFirstChild("Mag"):Destroy()
MagC.Parent = Tool
MagC.Name = "MagC"
local MagCW = Instance.new("Motor6D")
MagCW.Part0 = MagC
MagCW.Part1 = workspace.CurrentCamera:WaitForChild("Arms"):WaitForChild("Left Arm")
MagCW.Parent = MagC
MagCW.C1 = MagC.CFrame:toObjectSpace(Tool:WaitForChild('Mag').CFrame)
Tool.Mag.Transparency = 1
Tool:WaitForChild('Grip'):WaitForChild("MagOut"):Play()
ts:Create(objs[2],TweenInfo.new(0.15),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.55972552, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.13)
ts:Create(objs[2],TweenInfo.new(0.20),{C1 = CFrame.new(-0.902175903, 0.295501232, -1.28149843, 0.935064793, -0.354476899, 4.22709467e-09, -0.110443868, -0.291336805, 0.950223684, -0.336832345, -0.888520718, -0.311568588)}):Play()
wait(0.20)
ts:Create(objs[1],TweenInfo.new(0.5),{C1 = CFrame.new(0.447846293, -0.650498748, -1.82401526, 0.761665463, -0.514432132, 0.393986136, -0.646156013, -0.55753684, 0.521185875, -0.0484529883, -0.651545882, -0.75706023)}):Play()
wait(0.8)
ts:Create(objs[1],TweenInfo.new(0.6),{C1 = CFrame.new(0.447846293, 0.654529572, -2.9755671, 0.761665463, -0.514432132, 0.393986136, -0.568886042, -0.239798605, 0.786679745, -0.31021595, -0.823320091, -0.475299776)}):Play()
wait(0.5)
Tool:WaitForChild('Grip'):WaitForChild("MagIn"):Play()
ts:Create(objs[1],TweenInfo.new(0.3),{C1 = CFrame.new(0.447846293, 0.654529572, -1.81345785, 0.761665463, -0.514432132, 0.393986136, -0.560285628, -0.217437655, 0.799250066, -0.325492471, -0.82950604, -0.453843832)}):Play()
wait(0.3)
MagC:Destroy()
Tool.Mag.Transparency = 0
wait(0.1)
end;
AttachAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , CFrame.new(-2.05413628, -0.386312962, -0.955676377, 0.5, 0, -0.866025329, 0.852868497, -0.17364797, 0.492403895, -0.150383547, -0.984807789, -0.086823985), function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , CFrame.new(0.931334019, 1.66565645, -1.2231313, 0.787567914, -0.220087856, 0.575584888, -0.0180282295, 0.925416708, 0.378521889, -0.615963817, -0.308488399, 0.724860728), function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
-- Patrol Anim
PatrolAnim = function(char, speed, objs)
TweenJoint(objs[1], nil , sConfig.PatrolPosR, function(X) return math.sin(math.rad(X)) end, 0.25)
TweenJoint(objs[2], nil , sConfig.PatrolPosL, function(X) return math.sin(math.rad(X)) end, 0.25)
wait(0.18)
end;
}
return Settings
|
-- Decompiled with the Synapse X Luau decompiler. |
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
return function(p1)
local l__Parent__1 = script.Parent.Parent;
local l__Frame__2 = l__Parent__1.Frame;
local l__Frame__3 = l__Frame__2.Frame;
local l__Message__4 = l__Frame__3.Message;
local l__Title__5 = l__Frame__3.Title;
local l__Left__6 = l__Frame__3.Left;
local l__gIndex__7 = p1.gIndex;
local l__gTable__8 = p1.gTable;
local l__Message__9 = p1.Message;
local l__Scroll__10 = p1.Scroll;
local l__Time__11 = p1.Time;
if not p1.Message or not p1.Title then
l__gTable__8:Destroy();
end;
l__Title__5.Text = p1.Title;
l__Message__4.Text = l__Message__9;
l__Title__5.TextTransparency = 1;
l__Message__4.TextTransparency = 1;
l__Title__5.TextStrokeTransparency = 1;
l__Message__4.TextStrokeTransparency = 1;
l__Frame__2.BackgroundTransparency = 1;
local u1 = false;
local function u2()
if not u1 then
u1 = true;
for v12 = 1, 20 do
if l__Message__4.TextTransparency < 1 then
l__Message__4.TextTransparency = l__Message__4.TextTransparency + 0.8;
l__Title__5.TextTransparency = l__Title__5.TextTransparency + 0.8;
end;
if l__Message__4.TextStrokeTransparency < 1 then
l__Message__4.TextStrokeTransparency = l__Message__4.TextStrokeTransparency + 0.9;
l__Title__5.TextStrokeTransparency = l__Title__5.TextStrokeTransparency + 0.9;
end;
if l__Frame__2.BackgroundTransparency < 1 then
l__Frame__2.BackgroundTransparency = l__Frame__2.BackgroundTransparency + 0.015;
l__Frame__3.BackgroundTransparency = l__Frame__2.BackgroundTransparency;
end;
service.Wait("Stepped");
end;
service.UnWrap(l__Parent__1):Destroy();
end;
end;
function l__gTable__8.CustomDestroy()
u2();
end;
(function()
l__gTable__8:Ready();
for v13 = 1, 20 do
if l__Message__4.TextTransparency > 0 then
l__Message__4.TextTransparency = l__Message__4.TextTransparency - 0.8;
l__Title__5.TextTransparency = l__Title__5.TextTransparency - 0.8;
end;
if l__Frame__2.BackgroundTransparency > 0 then
l__Frame__2.BackgroundTransparency = l__Frame__2.BackgroundTransparency - 0.06;
l__Frame__3.BackgroundTransparency = l__Frame__2.BackgroundTransparency;
end;
service.Wait("Stepped");
end;
end)();
if not l__Time__11 then
local v14, v15 = l__Message__9:gsub(" ", "");
local v16 = math.clamp(v15 / 2, 4, 11) + 1;
l__Left__6.Text = "[" .. v16 .. "]";
for v17 = v16, 1, -1 do
if not l__Left__6 then
break;
end;
l__Left__6.Text = "[" .. v17 .. "]";
wait(1);
end;
else
l__Left__6.Text = "[" .. l__Time__11 .. "]";
for v18 = l__Time__11, 1, -1 do
if not l__Left__6 then
break;
end;
l__Left__6.Text = "[" .. v18 .. "]";
wait(1);
end;
end;
l__Left__6.Text = "[Closing]";
wait(0.3);
if not u1 then
u2();
end;
end;
|
--For R15 avatars |
Animations = {
R15Slash = 522635514,
R15Lunge = 522638767
}
Damage = DamageValues.BaseDamage
Grips = {
Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
}
Sounds = {
Slash = Handle:WaitForChild("SwordSlash"),
Lunge = Handle:WaitForChild("SwordLunge"),
Unsheath = Handle:WaitForChild("Unsheath")
}
ToolEquipped = false
|
--//Variables\\-- |
local players = game:GetService("Players")
local replicatedStorage = game:GetService("ReplicatedStorage")
local remotes = replicatedStorage:WaitForChild("Remotes", 60)
local sendFeed = remotes:WaitForChild("SendFeed", 60)
|
-- print("Keyframe : ".. frameName) |
playToolAnimation(toolAnimName, 0.0, Humanoid)
end
end
function playToolAnimation(animName, transitionTime, humanoid)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while roll > animTable[animName][idx].weight do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end |
-- light script |
local clicks = 0
script.Parent.ClickDetector.MouseClick:Connect(function(clicked)
if clicked then
clicks = clicks + 1
if clicks == 1 then
script.Parent.Light.PointLight.Enabled = true
elseif clicks == 2 then
script.Parent.Light.PointLight.Enabled = false
clicks = clicks - 2
end
end
end)
|
-- Setup animation objects |
function scriptChildModified(child)
local fileList = animNames[child.Name]
if (fileList ~= nil) then
configureAnimationSet(child.Name, fileList)
end
end
script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)
|
-- Leaderboard |
function loadLeaderstats(player)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local highScore = Instance.new("IntValue")
highScore.Name = "High Score"
highScore.Parent = stats
highScore.Value = 0
local currentScore = Instance.new("IntValue")
currentScore.Name = "Score"
currentScore.Parent = stats
stats.Parent = player
end
function initialiseRunStats(player)
if player:FindFirstChild("RunStats") then
player.RunStats.Distance.Value = 0
player.RunStats.CoinsCollected.Value = 0
end
end
function showResults(player)
local resultsGUI = game.ServerStorage.GUIs.PostRunGUI:Clone()
resultsGUI.Frame.DistanceValue.Text = player.RunStats.Distance.Value
resultsGUI.Frame.CoinsValue.Text = player.RunStats.CoinsCollected.Value
resultsGUI.Frame.ScoreValue.Text = player.leaderstats.Score.Value
resultsGUI.Parent = player.PlayerGui
return resultsGUI
end
function initialiseNewRun(player, delayTime, charExpected, showLastResults)
if not path then
while not path do
wait()
end
end
local lastResultsGUI = nil
if showLastResults then
lastResultsGUI = showResults(player)
end
if delayTime ~= 0 then
wait(delayTime)
end
if lastResultsGUI ~= nil then
lastResultsGUI:Destroy()
end
if player and player.Parent then
-- charExpected is needed to avoid calling LoadCharacter on players leaving the game
if player.Character or charExpected == false then
player:LoadCharacter()
initialiseRunStats(player)
local playersPath = path()
lastActivePath[player.Name] = playersPath
playersPath:init(player.Name)
end
end
end
|
--Equip Funciton |
tool.Equipped:connect(function()
--Equip Function 1
if color.Enabled == false then
tool.TheWorld.Playing = true
end
end)
|
-- Start a loop to continuously check for search text changes |
spawn(function()
while true do
onSearchTextChanged()
wait(3) -- Adjust the wait time as needed
end
end)
|
-- ====================
-- BULLET VISUALIZER
-- Enabled the gun to display a fake travelling bullet
-- ==================== |
VisualizerEnabled = true;
BulletSpeed = 25;
BulletSize = Vector3.new(0.25,0.25,100);
BulletColor = BrickColor.new("Bright yellow");
BulletTransparency = 0.25;
BulletMaterial = Enum.Material.SmoothPlastic;
FadeTime = 0.25; --Only work when bullet travel instantly. For this, you have to set BulletSpeed to "math.huge"
|
-- services |
local Workspace = game:GetService("Workspace")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
|
--[=[
Converts an event into a Promise which resolves the next time the event fires.
The optional `predicate` callback, if passed, will receive the event arguments and should return `true` or `false`, based on if this fired event should resolve the Promise or not. If `true`, the Promise resolves. If `false`, nothing happens and the predicate will be rerun the next time the event fires.
The Promise will resolve with the event arguments.
:::tip
This function will work given any object with a `Connect` method. This includes all Roblox events.
:::
```lua
-- Creates a Promise which only resolves when `somePart` is touched
-- by a part named `"Something specific"`.
return Promise.fromEvent(somePart.Touched, function(part)
return part.Name == "Something specific"
end)
```
@since 3.0.0
@param event Event -- Any object with a `Connect` method. This includes all Roblox events.
@param predicate? (...: P) -> boolean -- A function which determines if the Promise should resolve with the given value, or wait for the next event to check again.
@return Promise<P>
]=] |
function Promise.fromEvent(event, predicate)
predicate = predicate or function()
return true
end
return Promise._new(debug.traceback(nil, 2), function(resolve, _, onCancel)
local connection
local shouldDisconnect = false
local function disconnect()
connection:Disconnect()
connection = nil
end
-- We use shouldDisconnect because if the callback given to Connect is called before
-- Connect returns, connection will still be nil. This happens with events that queue up
-- events when there's nothing connected, such as RemoteEvents
connection = event:Connect(function(...)
local callbackValue = predicate(...)
if callbackValue == true then
resolve(...)
if connection then
disconnect()
else
shouldDisconnect = true
end
elseif type(callbackValue) ~= "boolean" then
error("Promise.fromEvent predicate should always return a boolean")
end
end)
if shouldDisconnect and connection then
return disconnect()
end
onCancel(disconnect)
end)
end
|
--[=[
@param player Player
Clears the custom property value for the given player. When
this occurs, the player will reset to use the top-level
value held by this property (either the value set when the
property was created, or the last value set by `Set`).
```lua
remoteProperty:Set("DATA")
remoteProperty:SetFor(somePlayer, "CUSTOM_DATA")
print(remoteProperty:GetFor(somePlayer)) --> "CUSTOM_DATA"
-- DOES NOT CLEAR, JUST SETS CUSTOM DATA TO NIL:
remoteProperty:SetFor(somePlayer, nil)
print(remoteProperty:GetFor(somePlayer)) --> nil
-- CLEAR:
remoteProperty:ClearFor(somePlayer)
print(remoteProperty:GetFor(somePlayer)) --> "DATA"
```
]=] |
function RemoteProperty:ClearFor(player: Player)
if self._perPlayer[player] == nil then return end
self._perPlayer[player] = nil
self._rs:Fire(player, self._value)
end
|
-- Format params: methodName, ctorName |
local ERR_NOT_INSTANCE = "Cannot statically invoke method '%s' - It is an instance method. Call it on an instance of this class created via %s"
function SignalStatic.new(): Signal
return setmetatable({
Connections = {}
}, SignalStatic)
end
local function NewConnection(sig: Signal, func: any): Connection
return setmetatable({
Signal = sig,
Delegate = func,
Index = -1
}, ConnectionStatic)
end
function SignalStatic:Connect(func)
assert(getmetatable(self) == SignalStatic, ERR_NOT_INSTANCE:format("Connect", "Signal.new()"))
local connection = NewConnection(self, func)
connection.Index = #self.Connections + 1
table.insert(self.Connections, connection.Index, connection)
return connection
end
function SignalStatic:Fire(...)
assert(getmetatable(self) == SignalStatic, ERR_NOT_INSTANCE:format("Fire", "Signal.new()"))
local args = table.pack(...)
local allCons = self.Connections
for index = 1, #allCons do
local connection = allCons[index]
if connection.Delegate ~= nil then
-- Catch case for disposed signals.
coroutine.wrap(function ()
connection.Delegate(table.unpack(args))
end)()
end
end
end
function SignalStatic:FireSync(...)
assert(getmetatable(self) == SignalStatic, ERR_NOT_INSTANCE:format("Fire", "Signal.new()"))
local args = table.pack(...)
local allCons = self.Connections
for index = 1, #allCons do
local connection = allCons[index]
if connection.Delegate ~= nil then
-- Catch case for disposed signals.
connection.Delegate(table.unpack(args))
end
end
end
function SignalStatic:Dispose()
assert(getmetatable(self) == SignalStatic, ERR_NOT_INSTANCE:format("Dispose", "Signal.new()"))
local allCons = self.Connections
for index = 1, #allCons do
allCons[index]:Disconnect()
end
self.Connections = {}
setmetatable(self, nil)
end
function ConnectionStatic:Disconnect()
assert(getmetatable(self) == ConnectionStatic, ERR_NOT_INSTANCE:format("Disconnect", "private function NewConnection()"))
table.remove(self.Signal.Connections, self.Index)
self.SignalStatic = nil
self.Delegate = nil
self.Index = -1
setmetatable(self, nil)
end
return SignalStatic
|
--- Creates an alias command |
function Util.MakeAliasCommand(name, commandString)
local commandName, commandDescription = unpack(name:split("|"))
local args = {}
commandString = Util.EncodeEscapedOperators(commandString)
local seenArgs = {}
for arg in commandString:gmatch("$(%d+)") do
if seenArgs[arg] == nil then
seenArgs[arg] = true
local options = commandString:match("$" .. arg .. "(%b{})")
local argType, argName, argDescription
if options then
options = options:sub(2, #options-1) -- remove braces
argType, argName, argDescription = unpack(options:split("|"))
end
argType = argType or "string"
argName = argName or ("Argument " .. arg)
argDescription = argDescription or ""
table.insert(args, {
Type = argType;
Name = argName;
Description = argDescription;
})
end
end
return {
Name = commandName,
Aliases = {},
Description = "<Alias> " .. (commandDescription or commandString),
Group = "UserAlias",
Args = args,
Run = function(context)
return Util.RunCommandString(context.Dispatcher, Util.SubstituteArgs(commandString, context.RawArguments))
end
}
end
|
--https://roblox.com/library/2530470096/rbxscriptsignal
--If you are only going to be requiring this from the server you can require by its asset ID. |
local Signal = require(script:WaitForChild("Signal"))
local RunService = game:GetService("RunService")
|
-- Visualizes a ray. This will not run if FastCast.VisualizeCasts is false. |
function DbgVisualizeSegment(castStartCFrame: CFrame, castLength: number): ConeHandleAdornment?
if FastCast.VisualizeCasts ~= true then return nil end
local adornment = Instance.new("ConeHandleAdornment")
adornment.Adornee = workspace.Terrain
adornment.CFrame = castStartCFrame
adornment.Height = castLength
adornment.Color3 = Color3.new()
adornment.Radius = 0.25
adornment.Transparency = 0.5
adornment.Parent = GetFastCastVisualizationContainer()
return adornment
end
|
--new magazine in, let's get to pushing that pull, kick thing back in its place... |
wait()
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(304), -0.14, math.rad(-82))
wait()
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(302), -0.14, math.rad(-84))
Tool.Handle.Reload.Pitch = 0.95
wait()
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(300), -0.14, math.rad(-86))
wait()
weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-111), math.rad(-2),0.2)
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(298), -0.08, math.rad(-88))
wait()
weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-108), math.rad(-4),0.1)
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(296), -0.02, math.rad(-90))
wait()
weld33.C1 = CFrame.new(-0.75, 0.5, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-105), math.rad(-6),0)
weld55.C1 = CFrame.new(-0.35, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(294), 0.04, math.rad(-90))
wait()
weld33.C1 = CFrame.new(-0.75, 0.6, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-103), math.rad(-8),0)
weld55.C1 = CFrame.new(-0.35, 0.3, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(292), 0.1, math.rad(-90))
wait()
weld33.C1 = CFrame.new(-0.75, 0.7, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-99), math.rad(-10),0)
weld55.C1 = CFrame.new(-0.35, 0.3, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.16, math.rad(-90))
wait()
weld33.C1 = CFrame.new(-0.75, 0.8, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-96), math.rad(-12.5),0)
weld55.C1 = CFrame.new(-0.35, 0.3, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.22, math.rad(-90))
wait()
weld33.C1 = CFrame.new(-0.75, 0.9, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-93), math.rad(-15),0)
weld55.C1 = CFrame.new(-0.35, 0.3, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0.28, math.rad(-90))
|
-- Teknikk Strobe Core V1 -- |
local Status = script.Parent.Parent.Status
local StrobeSync = script.Parent.Parent.StrobeSync
local Run = false
Status.Changed:connect(function()
if Run then return end
Run = true
if Status.Value == 1 --ALARM&STROBE
or Status.Value == 2 --STROBE
or Status.Value == 11 --TEST
then
wait(1)
while true do
wait(1.5)
StrobeSync.Value = true
wait(0.1)
StrobeSync.Value = false
end
end
end)
StrobeSync.Value = false
|
--[[ Roblox Services ]] | --
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local GuiService = game:GetService("GuiService")
local Workspace = game:GetService("Workspace")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local VRService = game:GetService("VRService")
|
--[[Engine]] |
local fFD = _Tune.FinalDrive
local fFDr = fFD*30/math.pi
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)
--Electric Only Setup
if not _Tune.Engine and _Tune.Electric then
_Tune.Redline = _Tune.E_Redline
_Tune.PeakRPM = _Tune.E_Trans2
_Tune.Turbochargers = 0
_Tune.Superchargers = 0
_Tune.Clutch = false
_Tune.IdleRPM = 0
_Tune.AutoShiftType = "DCT"
_Tune.ShiftUpTime = 0.1
_Tune.ShiftDnTime = 0.1
end
--Aspiration Setup
_TCount = _Tune.Turbochargers
_TPsi = _Tune.T_Boost*_Tune.Turbochargers
_SCount = _Tune.Superchargers
_SPsi = _Tune.S_Boost*_Tune.Superchargers
--Engine Curve
local HP_M = _Tune.Horsepower
local HP_T = HP_M*(((_TPsi*(_Tune.T_Efficiency/10))/7.5)/2)
local HP_S = HP_M*(((_SPsi*(_Tune.S_Efficiency/10))/7.5)/2)
local PK_H, PK_T = _Tune.PeakRPM, _Tune.MT_PeakRPM
local MC_H, MC_T = _Tune.MH_CurveMult, _Tune.MT_CurveMult
local TC_H, TC_T = _Tune.TH_CurveMult, _Tune.TT_CurveMult
local SC_H, SC_T = _Tune.SH_CurveMult, _Tune.ST_CurveMult
local MP_H, MP_T = _Tune.MH_PeakSharp, _Tune.MT_PeakSharp
local TP_H, TP_T = _Tune.TH_PeakSharp, _Tune.TT_PeakSharp
local SP_H, SP_T = _Tune.SH_PeakSharp, _Tune.ST_PeakSharp
local V_MT = {HP_M,PK_H,MC_H,MP_H,PK_T,MC_T,MP_T}
local V_TC = {HP_T,PK_H,TC_H,TP_H,PK_T,TC_T,TP_T}
local V_SC = {HP_S,PK_H,SC_H,SP_H,PK_T,SC_T,SP_T}
function getCurve(RPM,HP,Peak,CurveMult,Sharpness)
RPM=RPM/1000
HP=HP/100
Peak=Peak/1000
return ((-(RPM-Peak)^2)*math.min(HP/(Peak^2),CurveMult^(Peak/HP))+HP)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1))))
end
function getPeak(V)
local HP,Peak_H,CurveMult_H,Sharpness_H,Peak_T,CurveMult_T,Sharpness_T=V[1]/100,V[2]/1000,V[3],V[4],V[5]/1000,V[6],V[7]
local hp=((-(Peak_H-Peak_H)^2)*math.min(HP/(Peak_H^2),CurveMult_H^(Peak_H/HP))+HP)*(Peak_H-((Peak_H^Sharpness_H)/(Sharpness_H*Peak_H^(Sharpness_H-1))))
local tq=((-(Peak_T-Peak_T)^2)*math.min(HP/(Peak_T^2),CurveMult_T^(Peak_T/HP))+HP)*(Peak_T-((Peak_T^Sharpness_T)/(Sharpness_T*Peak_T^(Sharpness_T-1))))
return hp, tq
end
local PeakHP_N, PeakTQ_N = getPeak(V_MT)
local PeakHP_T, PeakTQ_T = getPeak(V_TC)
local PeakHP_S, PeakTQ_S = getPeak(V_SC)
--Plot Current Horsepower
function EngineCurve(x,gear,V,eq,peakhp,peaktq)
local hp,peak_h,cm_h,sharp_h,peak_t,cm_t,sharp_t=V[1],V[2],V[3],V[4],V[5],V[6],V[7]
local hp_r=(math.max(getCurve(x,hp,peak_h,cm_h,sharp_h)/(peakhp/hp),0))
local tq_r=(math.max(getCurve(x,hp,peak_t,cm_t,sharp_t)/(peaktq/hp),0))
return hp_r,((tq_r*(eq/x))*_Tune.Ratios[gear+1]*fFD*hpScaling)
end
--Electric Curve
local EHP=_Tune.E_Horsepower/100
local ETQ=_Tune.E_Torque/100
local ETrans1=_Tune.E_Trans1/1000
local ETrans2=_Tune.E_Trans2/1000
local ELimit=_Tune.E_Redline/1000
function elecHP(RPM)
RPM=RPM/1000
local retVal=1e-9
if RPM<=ETrans1 then
retVal=((((RPM/ETrans1)^_Tune.EH_FrontMult)/(1/EHP))*(RPM/ETrans1))+((((RPM/ETrans1)^(1/_Tune.EH_FrontMult))/(1/EHP))*(1-(RPM/ETrans1)))
elseif ETrans1<RPM and RPM<ETrans2 then
retVal=EHP
elseif ETrans2<=RPM then
retVal=EHP-(((RPM-ETrans2)/(ELimit-ETrans2))^_Tune.EH_EndMult)/(1/(EHP*(_Tune.EH_EndPercent/100)))
else
error( "\n\t [NCT: M]: Drive initialization failed!"
.."\n\t An unknown error occured when initializing electric horsepower."
.."\n\t Please send a screenshot of this message to Avxnturador."
.."\n\t R: "..RPM..", T1: "..ETrans1", T2: "..ETrans2", L: "..ELimit".")
end
return retVal
end
function elecTQ(RPM)
RPM=RPM/1000
local retVal=1e-9
if RPM<ETrans1 then
retVal=ETQ
elseif ETrans1<=RPM then
retVal=ETQ-(((RPM-ETrans1)/(ELimit-ETrans1))^_Tune.ET_EndMult)/(1/(ETQ*(_Tune.ET_EndPercent/100)))
else
error( "\n\t [NCT: M]: Drive initialization failed!"
.."\n\t An unknown error occured when initializing electric torque."
.."\n\t Please send a screenshot of this message to Avxnturador."
.."\n\t R: "..RPM..", T1: "..ETrans1", T2: "..ETrans2", L: "..ELimit".")
end
return retVal
end
--Plot Current Electric Horsepower
function ElecCurve(x,gear)
local hp=(math.max(elecHP(x),0))*100
local tq=(math.max(elecTQ(x),0))*100
if gear~=0 then
return hp,math.max(tq*_Tune.Ratios[gear+1]*fFD*hpScaling,0)
else
return 0,0
end
end
--Output Cache
local NCache = {}
local ECache = {}
local TCache = {}
local SCache = {}
for gear,ratio in pairs(_Tune.Ratios) do
local nhpPlot = {}
local ehpPlot = {}
local thpPlot = {}
local shpPlot = {}
for rpm = 0, math.ceil((_Tune.Redline+100)/100) do
local ntqPlot = {}
local etqPlot = {}
local ttqPlot = {}
local stqPlot = {}
if rpm~=0 then
if _Tune.Engine then
ntqPlot.Horsepower,ntqPlot.Torque = EngineCurve(rpm*100,gear-1,V_MT,_Tune.M_EqPoint,PeakHP_N,PeakTQ_N)
if _TCount~=0 then
ttqPlot.Horsepower,ttqPlot.Torque = EngineCurve(rpm*100,gear-1,V_TC,_Tune.M_EqPoint,PeakHP_T,PeakTQ_T)
else
ttqPlot.Horsepower,ttqPlot.Torque = 0,0
end
if _SCount~=0 then
stqPlot.Horsepower,stqPlot.Torque = EngineCurve(rpm*100,gear-1,V_SC,_Tune.M_EqPoint,PeakHP_S,PeakTQ_S)
else
stqPlot.Horsepower,stqPlot.Torque = 0,0
end
else
ntqPlot.Horsepower,ntqPlot.Torque = 0,0
ttqPlot.Horsepower,ttqPlot.Torque = 0,0
stqPlot.Horsepower,stqPlot.Torque = 0,0
end
if _Tune.Electric then
etqPlot.Horsepower,etqPlot.Torque = ElecCurve(rpm*100,gear-1)
else
etqPlot.Horsepower,etqPlot.Torque = 0,0
end
else
ntqPlot.Horsepower,ntqPlot.Torque = 0,0
etqPlot.Horsepower,etqPlot.Torque = 0,0
ttqPlot.Horsepower,ttqPlot.Torque = 0,0
stqPlot.Horsepower,stqPlot.Torque = 0,0
end
if _Tune.Engine then
nhp,ntq = EngineCurve((rpm+1)*100,gear-1,V_MT,_Tune.M_EqPoint,PeakHP_N,PeakTQ_N)
if _TCount~=0 then
thp,ttq = EngineCurve((rpm+1)*100,gear-1,V_TC,_Tune.M_EqPoint,PeakHP_T,PeakTQ_T)
else
thp,ttq = 0,0
end
if _SCount~=0 then
shp,stq = EngineCurve((rpm+1)*100,gear-1,V_SC,_Tune.M_EqPoint,PeakHP_S,PeakTQ_S)
else
shp,stq = 0,0
end
else
nhp,ntq = 0,0
thp,ttq = 0,0
shp,stq = 0,0
end
if _Tune.Electric then
ehp,etq = ElecCurve((rpm+1)*100,gear-1)
else
ehp,etq = 0,0
end
ntqPlot.HpSlope,ntqPlot.TqSlope = (nhp-ntqPlot.Horsepower),(ntq-ntqPlot.Torque)
etqPlot.HpSlope,etqPlot.TqSlope = (ehp-etqPlot.Horsepower),(etq-etqPlot.Torque)
ttqPlot.HpSlope,ttqPlot.TqSlope = (thp-ttqPlot.Horsepower),(ttq-ttqPlot.Torque)
stqPlot.HpSlope,stqPlot.TqSlope = (shp-stqPlot.Horsepower),(stq-stqPlot.Torque)
nhpPlot[rpm] = ntqPlot
ehpPlot[rpm] = etqPlot
thpPlot[rpm] = ttqPlot
shpPlot[rpm] = stqPlot
end
table.insert(NCache,nhpPlot)
table.insert(ECache,ehpPlot)
table.insert(TCache,thpPlot)
table.insert(SCache,shpPlot)
end
--Powertrain
wait()
function Auto()
local maxSpin=0
if Rear.Wheel.RotVelocity.Magnitude>maxSpin then maxSpin = Rear.Wheel.RotVelocity.Magnitude end
if _IsOn then
if _CGear == 0 and not _Tune.NeutralRev then _CGear = 1 _ClPressing = false end
if _CGear >= 1 then
if (_CGear==1 and _InBrake > 0 and bike.DriveSeat.Velocity.Magnitude < 10) and _Tune.NeutralRev then
_CGear = 0 _ClPressing = false
elseif bike.DriveSeat.Velocity.Magnitude > 10 then
if _Tune.AutoShiftMode == "RPM" and not _ClutchSlip then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
if not _ShiftUp and not _Shifting then _ShiftUp = true end
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) and _CGear>1 then
if not _ShiftDn and not _Shifting then _ShiftDn = true end
end
else
if bike.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+1]/fFD) then
if not _ShiftUp and not _Shifting then _ShiftUp = true end
elseif bike.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) and _CGear>1 then
if not _ShiftDn and not _Shifting then _ShiftDn = true end
end
end
end
else
if (_InThrot-(_Tune.IdleThrottle/100) > 0 and bike.DriveSeat.Velocity.Magnitude < 10) and _Tune.NeutralRev then
_CGear = 1 _ClPressing = false
end
end
end
end
function Gear()
local maxSpin=0
if Rear.Wheel.RotVelocity.Magnitude>maxSpin then maxSpin = Rear.Wheel.RotVelocity.Magnitude end
if _ShiftUp and not _Shifting then
local AutoCheck if _TMode~="Manual" then AutoCheck = true end
if (_TMode == "Manual" and ((not _Tune.QuickShifter and not _ClPressing) or (not _ClPressing and (_Tune.QuickShifter and tick()-_BTick>_Tune.QuickShiftTime)))) or _CGear == #_Tune.Ratios-1 or (_TMode ~= "Manual" and not _IsOn) then _ShiftUp = false return end
local NextGear = math.min(_CGear+1,#_Tune.Ratios)
if _TMode~="Manual" then
_Shifting = true
if _CGear>0 then
if _Tune.AutoShiftType=="DCT" then
wait(_Tune.ShiftUpTime)
elseif _Tune.AutoShiftType=="Rev" then
repeat wait() until _RPM<=math.max(math.min(maxSpin*_Tune.Ratios[NextGear]*fFDr,_Tune.Redline-_Tune.RevBounce),_Tune.IdleRPM) or not _IsOn or _ShiftDn
end
end
end
_ShiftUp = false
_Shifting = false
if _TMode ~= "Manual" and not _IsOn then return end
_CGear = math.min(_CGear+1,#_Tune.Ratios-1)
if _TMode ~= "Manual" or (_TMode == "Manual" and (_CGear == 1 or AutoCheck)) and _IsOn then _ClPressing = false end
end
if _ShiftDn and not _Shifting then
local AutoCheck if _TMode~="Manual" then AutoCheck = true end
if (_TMode == "Manual" and ((not _Tune.QuickShifter and not _ClPressing) or (not _ClPressing and (_Tune.QuickShifter and tick()-_TTick>_Tune.QuickShiftTime)))) or _CGear == 0 or (_TMode ~= "Manual" and not _IsOn) then _ShiftDn = false return end
local PrevGear = math.min(_CGear,#_Tune.Ratios)
if _TMode~="Manual" then
_Shifting = true
if _CGear>1 then
if _Tune.AutoShiftType=="DCT" then
wait(_Tune.ShiftDnTime)
elseif _Tune.AutoShiftType=="Rev" then
repeat wait() until _RPM>=math.max(math.min(maxSpin*_Tune.Ratios[PrevGear]*fFDr,_Tune.Redline-_Tune.RevBounce),_Tune.IdleRPM) or not _IsOn or _ShiftUp
end
end
end
_ShiftDn = false
_Shifting = false
if _TMode ~= "Manual" and not _IsOn then return end
_CGear = math.max(_CGear-1,0)
if _TMode ~= "Manual" or (_TMode == "Manual" and (_CGear == 0 or AutoCheck)) and _IsOn then _ClPressing = false end
end
end
local tqTCS = 1
local sthrot = 0
local _StallOK = false
local ticc = tick()
local bticc = tick()
--Apply Power
function Engine(dt)
local deltaTime = (60/(1/dt))
--Determine Clutch Slip
if _TMode~="Manual" and _Tune.SlipClutch then
if _Tune.ABS and _ABS then
if _SlipCount >= _Tune.SlipABSThres then _ClutchSlip = true else _ClutchSlip = false end
else
if tick()-bticc >= _Tune.SlipTimeThres then _ClutchSlip = true else _ClutchSlip = false end
end
else
_ClutchSlip = false
end
--Neutral Gear
if ((_CGear == 0 or _Shifting) and _IsOn) then
_ClPressing = true
_Clutch = 1
_StallOK = false
end
local revMin = _Tune.IdleRPM
local goalMin = _Tune.IdleRPM
if _Tune.Stall and _Tune.Clutch then revMin = 0 end
if _Shifting and _ShiftUp then
_GThrot = 0
elseif _Shifting and _ShiftDn then
_GThrot = (_Tune.ShiftThrot/100)
else
_GThrot = _InThrot
end
_GBrake = _InBrake
if not _IsOn then
ticc = tick()
revMin = 0
goalMin = 0
_GThrot = _Tune.IdleThrottle/100
if _TMode~="Manual" then
_CGear = 0
_ClPressing = true
_Clutch = 1
end
end
--Determine RPM
local maxSpin=0
if Rear.Wheel.RotVelocity.Magnitude>maxSpin then maxSpin = Rear.Wheel.RotVelocity.Magnitude end
local _GoalRPM=0
if _Tune.Engine or _Tune.Electric then
_GoalRPM = math.max(math.min((_RPM-_Tune.RevDecay*deltaTime)+((_Tune.RevDecay+_Tune.RevAccel)*_GThrot*deltaTime),_Tune.Redline+100),goalMin)
end
if _GoalRPM>_Tune.Redline then
if _CGear<#_Tune.Ratios-2 then
_GoalRPM = _GoalRPM-_Tune.RevBounce
else
_GoalRPM = _GoalRPM-_Tune.RevBounce*.5
end
end
local _WheelRPM = maxSpin*_Tune.Ratios[_CGear+1]*fFDr
--Clutch Calculation
if _Tune.Clutch then
if script.Parent.Values.AutoClutch.Value and _IsOn then
if _Tune.ClutchType == "Clutch" then
if _ClPressing or _ClutchSlip then _ClutchKick = 1 end
_ClutchKick = _ClutchKick*(_Tune.ClutchEngage/100)
local ClRPMInfluence = math.max((_RPM-_Tune.IdleRPM)*_Tune.ClutchRPMMult/(_Tune.Redline-_Tune.IdleRPM),0)
if _Tune.ClutchMode == "New" then ClRPMInfluence = 0 end
_ClutchModulate = math.min(((((script.Parent.Values.Velocity.Value.Magnitude/_Tune.SpeedEngage)/math.abs(_CGear)) + ClRPMInfluence) - _ClutchKick), 1)
elseif _Tune.ClutchType == "CVT" or (_Tune.ClutchType == "TorqueConverter" and _Tune.TQLock) then
if (_GThrot-(_Tune.IdleThrottle/100)==0 and script.Parent.Values.Velocity.Value.Magnitude<_Tune.SpeedEngage) or (_GThrot-(_Tune.IdleThrottle/100)~=0 and (_RPM < _Tune.RPMEngage and _WheelRPM < _Tune.RPMEngage)) then
_ClutchModulate = math.min(_ClutchModulate*(_Tune.ClutchEngage/100), 1)
else
_ClutchModulate = math.min(_ClutchModulate*(_Tune.ClutchEngage/100)+(1-(_Tune.ClutchEngage/100)), 1)
end
elseif _Tune.ClutchType == "TorqueConverter" and not _Tune.TQLock then
_ClutchModulate = math.min((_RPM/_Tune.Redline)*0.7, 1)
end
if not _ClPressing and not _ClutchSlip then _Clutch = math.min(1-_ClutchModulate,1) else _Clutch = 1 end
_StallOK = (_Clutch<=0.01) or _StallOK
else
_StallOK = _Tune.Stall
_Clutch = script.Parent.Values.Clutch.Value
end
else
_StallOK = false
if (not _ClPressing and not _ClutchSlip) and not _Shifting then _Clutch = 0 else _Clutch = 1 end
end
local aRPM = math.max(math.min((_GoalRPM*_Clutch) + (_WheelRPM*(1-_Clutch)),_Tune.Redline+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/(_Tune.Flywheel*deltaTime),.9)
if _ClPressing or _ClutchSlip then clutchP = 0 end
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
if _RPM<=(_Tune.IdleRPM/4) and _StallOK and (tick()-ticc>=0.2) then script.Parent.IsOn.Value = not _Tune.Stall end
--Rev Limiter
_spLimit = -((_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+1]))
if _Tune.Limiter then _spLimit = math.min(_spLimit,-_Tune.SpeedLimit) end
if _RPM>_Tune.Redline then
if _CGear<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
--Aspiration
local TPsi = _TPsi/_TCount
local _BThrot = _GThrot
if _Tune.Engine then
if _TCount~=0 then
_TBoost = _TBoost + ((((((_HP*(_BThrot*1.2)/_Tune.Horsepower)/8)-(((_TBoost/TPsi*(TPsi/15)))))*((8/(_Tune.T_Size/(deltaTime)))*2))/TPsi)*15)
if _TBoost < 0.05 then _TBoost = 0.05 elseif _TBoost > 2 then _TBoost = 2 end
else
_TBoost = 0
end
if _SCount~=0 then
if _BThrot>sthrot then
sthrot=math.min(_BThrot,sthrot+_Tune.S_Sensitivity*deltaTime)
elseif _BThrot<sthrot then
sthrot=math.max(_BThrot,sthrot-_Tune.S_Sensitivity*deltaTime)
end
_SBoost = (_RPM/_Tune.Redline)*(.5+(1.5*sthrot))
else
_SBoost = 0
end
else
_TBoost = 0
_SBoost = 0
end
--Torque calculations
if _Tune.Engine then
local cTq = NCache[_CGear+1][math.floor(math.min(_Tune.Redline,math.max(0,_RPM))/100)]
_NH = cTq.Horsepower+(cTq.HpSlope*(((_RPM-math.floor(_RPM/100))/100)%1))
_NT = cTq.Torque+(cTq.TqSlope*(((_RPM-math.floor(_RPM/100))/100)%1))
if _TCount~=0 then
local tTq = TCache[_CGear+1][math.floor(math.min(_Tune.Redline,math.max(0,_RPM))/100)]
_TH = (tTq.Horsepower+(tTq.HpSlope*(((_RPM-math.floor(_RPM/100))/100)%1)))*(_TBoost/2)
_TT = (tTq.Torque+(tTq.TqSlope*(((_RPM-math.floor(_RPM/100))/100)%1)))*(_TBoost/2)
else
_TH,_TT = 0,0
end
if _SCount~=0 then
local sTq = SCache[_CGear+1][math.floor(math.min(_Tune.Redline,math.max(0,_RPM))/100)]
_SH = (sTq.Horsepower+(sTq.HpSlope*(((_RPM-math.floor(_RPM/100))/100)%1)))*(_SBoost/2)
_ST = (sTq.Torque+(sTq.TqSlope*(((_RPM-math.floor(_RPM/100))/100)%1)))*(_SBoost/2)
else
_SH,_ST = 0,0
end
_BH = _TH+_SH
_BT = _TT+_ST
else
_NH,_NT = 0,0
_TH,_TT = 0,0
_SH,_ST = 0,0
_BH,_BT = 0,0
end
if _Tune.Electric and _CGear~=0 then
local eTq = ECache[_CGear+1][math.floor(math.min(_Tune.Redline,math.max(100,_RPM))/100)]
_EH = eTq.Horsepower+(eTq.HpSlope*(((_RPM-math.floor(_RPM/100))/100)%1))
_ET = eTq.Torque+(eTq.TqSlope*(((_RPM-math.floor(_RPM/100))/100)%1))
else
_EH,_ET = 0,0
end
_HP = _NH + _BH + _EH
_OutTorque = _NT + _BT + _ET
--Update Wheels
--Front
_fABSActive = false
--Output
if _PBrake and bike.DriveSeat.Velocity.Magnitude<20 then
--PBrake
Front.Axle.HingeConstraint.MotorMaxTorque=PBrakeForce*(60/workspace:GetRealPhysicsFPS())
else
if _CGear == 0 and bike.DriveSeat.Velocity.Magnitude <= 10 and _Tune.NeutralRev then
Front.Axle.HingeConstraint.MotorMaxTorque=FBrakeForce*_GThrot*(60/workspace:GetRealPhysicsFPS())
else
--Apply ABS
local ftqABS = 1
if _ABS and math.abs(Front.Wheel.RotVelocity.Magnitude*(Front.Wheel.Size.Y/2) - Front.Wheel.Velocity.Magnitude)-_Tune.ABSThreshold>0 then ftqABS = 0 end
if ftqABS < 1 then _fABSActive = true end
local brake = FBrakeForce
if _Tune.LinkedBrakes then
local bias = _Tune.BrakesRatio/100
brake = brake*bias
end
Front.Axle.HingeConstraint.MotorMaxTorque=brake*_GBrake*ftqABS*(60/workspace:GetRealPhysicsFPS())
end
end
--Rear
_TCSActive = false
_rABSActive = false
--Output
if _PBrake and bike.DriveSeat.Velocity.Magnitude>=20 then
--PBrake
_SlipCount = _Tune.SlipABSThres
bticc = tick()-_Tune.SlipTimeThres
Rear.Axle.HingeConstraint.MotorMaxTorque=PBrakeForce*(60/workspace:GetRealPhysicsFPS())
Rear.Axle.HingeConstraint.MotorMaxAcceleration=9e9
Rear.Axle.HingeConstraint.AngularVelocity=0
else
--Apply Power
if _CGear == 0 and bike.DriveSeat.Velocity.Magnitude <= 10 and _Tune.NeutralRev then
bticc = tick()
_SlipCount = 0
Rear.Axle.HingeConstraint.MotorMaxTorque=math.min((500*_GBrake)+(RBrakeForce*_GThrot),500)*(60/workspace:GetRealPhysicsFPS())
Rear.Axle.HingeConstraint.AngularVelocity=7*_GBrake*(1-_GThrot)
elseif _GBrake==0 then
bticc = tick()
_SlipCount = 0
local on=1
if not script.Parent.IsOn.Value then on=0 end
local throt = _GThrot
local clutch=1
if _ClPressing then clutch=0 end
--Apply TCS
local tqTCS = 1
if _TCS then tqTCS = 1-(math.min(math.max(0,math.abs(Rear.Wheel.RotVelocity.Magnitude*(wDia/2) - Rear.Wheel.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100))) end
_TCSAmt = tqTCS
if tqTCS < 1 then
_TCSAmt = tqTCS
_TCSActive = true
end
--Update Forces
Rear.Axle.HingeConstraint.MotorMaxTorque=_OutTorque*throt*tqTCS*on*clutch*(60/workspace:GetRealPhysicsFPS())*(1+(Rear.Wheel.RotVelocity.Magnitude/(120-workspace:GetRealPhysicsFPS()))^(((1-_Tune.Drag)*1.15)+(((1-_Tune.Drag)*.07)*(1-(60/workspace:GetRealPhysicsFPS())))))
Rear.Axle.HingeConstraint.MotorMaxAcceleration=_RPM*(math.pi/30)
Rear.Axle.HingeConstraint.AngularVelocity=_spLimit
--Brakes
else
--Apply ABS
local rtqABS = 1
if math.abs(Rear.Wheel.RotVelocity.Magnitude*(wDia/2) - Rear.Wheel.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
if _ABS then rtqABS = 0 _SlipCount = _SlipCount + 1 end
print("it's happening")
else
bticc = tick()
end
if rtqABS < 1 then _rABSActive = true end
local brake = RBrakeForce
if _Tune.LinkedBrakes then
local bias = _Tune.BrakesRatio/100
brake = brake*(1-bias)
end
Rear.Axle.HingeConstraint.MotorMaxTorque=brake*_GBrake*rtqABS*(60/workspace:GetRealPhysicsFPS())
Rear.Axle.HingeConstraint.MotorMaxAcceleration=9e9
Rear.Axle.HingeConstraint.AngularVelocity=0
end
end
end
|
-- Comprueba si se encontró el sonido |
if sound then
-- Reproduce el sonido
sound:Play()
else
warn("El sonido 'hyperx' no se encontró en SoundService.")
end
|
--[[Steering]] |
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .1 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
-- no touchy |
local path
local waypoint
local oldpoints
local isWandering = 0
if canWander then
spawn(function()
while isWandering == 0 do
isWandering = 1
local desgx, desgz = hroot.Position.x + math.random(-WanderX, WanderX), hroot.Position.z + math.random(-WanderZ, WanderZ)
human:MoveTo( Vector3.new(desgx, 0, desgz) )
wait(math.random(4, 6))
isWandering = 0
end
end)
end
while wait() do
local enemytorso = GetTorso(hroot.Position)
if enemytorso ~= nil then -- if player detected
isWandering = 1
local function checkw(t)
local ci = 3
if ci > #t then
ci = 3
end
if t[ci] == nil and ci < #t then
repeat
ci = ci + 1
wait()
until t[ci] ~= nil
return Vector3.new(1, 0, 0) + t[ci]
else
ci = 3
return t[ci]
end
end
path = pfs:FindPathAsync(hroot.Position, enemytorso.Position)
waypoint = path:GetWaypoints()
oldpoints = waypoint
local connection;
local direct = Vector3.FromNormalId(Enum.NormalId.Front)
local ncf = hroot.CFrame * CFrame.new(direct)
direct = ncf.p.unit
local rootr = Ray.new(hroot.Position, direct)
local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)
if path and waypoint or checkw(waypoint) then
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
human:MoveTo( checkw(waypoint).Position )
human.Jump = false
end
-- CANNOT LET BALDI JUMPS --
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
human.Jump = true
connection = human.Changed:connect(function()
human.Jump = true
end)
human:MoveTo( checkw(waypoint).Position )
else
human.Jump = false
end
hroot.Touched:connect(function(p)
local bodypartnames = GetPlayersBodyParts(enemytorso)
if p:IsA'Part' and not p.Name == bodypartnames and phit and phit.Name ~= bodypartnames and phit:IsA'Part' and rootr:Distance(phit.Position) < 5 then
connection = human.Changed:connect(function()
human.Jump = true
end)
else
human.Jump = false
end
end)
if connection then
connection:Disconnect()
end
else
for i = 3, #oldpoints do
human:MoveTo( oldpoints[i].Position )
end
end
elseif enemytorso == nil and canWander then -- if player not detected
isWandering = 0
path = nil
waypoint = nil
human.MoveToFinished:Wait()
end
end
|
-- Note: The active transparency controller could be made to listen for this event itself. |
function CameraModule:OnCameraSubjectChanged()
if self.activeTransparencyController then
self.activeTransparencyController:SetSubject(game.Workspace.CurrentCamera.CameraSubject)
end
if self.activeOcclusionModule then
self.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject)
end
end
function CameraModule:OnCameraTypeChanged(newCameraType)
if newCameraType == Enum.CameraType.Scriptable then
if UserInputService.MouseBehavior == Enum.MouseBehavior.LockCenter then
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
-- Forward the change to ActivateCameraController to handle
self:ActivateCameraController(nil, newCameraType)
end
|
--// Damage Settings |
BaseDamage = 92; -- Torso Damage
LimbDamage = 84; -- Arms and Legs
ArmorDamage = 38; -- How much damage is dealt against armor (Name the armor "Armor")
HeadDamage = 100; -- If you set this to 100, there's a chance the player won't die because of the heal script
|
--[=[
@within TableUtil
@function Map
@param tbl table
@param predicate (value: any, key: any, tbl: table) -> newValue: any
@return table
Performs a map operation against the given table, which can be used to
map new values based on the old values at given keys/indices.
For example:
```lua
local t = {A = 10, B = 20, C = 30}
local t2 = TableUtil.Map(t, function(key, value)
return value * 2
end)
print(t2) --> {A = 20, B = 40, C = 60}
```
]=] |
local function Map(t: Table, f: MapPredicate): Table
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local newT = table.create(#t)
for k,v in pairs(t) do
newT[k] = f(v, k, t)
end
return newT
end
|
-- ================================================================================
-- Settings - Dart
-- ================================================================================ |
local Settings = {}
Settings.DefaultSpeed = 150 -- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 500 -- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 2 -- Duration of boost in seconds
Settings.Steering = 5 -- How quickly the speeder turns [Range: 1-10] |
--[[
This is a Rotated Region3 Class that behaves much the same as the standard Region3 class expect that it allows
for both rotated regions and also a varying array of shapes.
API:
Constructors:
RotatedRegion3.new(CFrame cframe, Vector3 size)
> Creates a region from a cframe which acts as the center of the region and size which extends to
> the corners like a block part.
RotatedRegion3.Block(CFrame cframe, Vector3 size)
> This is the exact same as the region.new constructor, but has a different name.
RotatedRegion3.Wedge(CFrame cframe, Vector3 size)
> Creates a region from a cframe which acts as the center of the region and size which extends to
> the corners like a wedge part.
RotatedRegion3.CornerWedge(CFrame cframe, Vector3 size)
> Creates a region from a cframe which acts as the center of the region and size which extends to
> the corners like a cornerWedge part.
RotatedRegion3.Cylinder(CFrame cframe, Vector3 size)
> Creates a region from a cframe which acts as the center of the region and size which extends to
> the corners like a cylinder part.
RotatedRegion3.Ball(CFrame cframe, Vector3 size)
> Creates a region from a cframe which acts as the center of the region and size which extends to
> the corners like a ball part.
RotatedRegion3.FromPart(part)
> Creates a region from a part in the game. It can be used on any base part, but the region
> will treat unknown shapes (meshes, unions, etc) as block shapes.
Methods:
RotatedRegion3:CastPoint(Vector3 point)
> returns true or false if the point is within the RotatedRegion3 object
RotatedRegion3:CastPart(BasePart part)
> returns true or false if the part is withing the RotatedRegion3 object
RotatedRegion3:FindPartsInRegion3(Instance ignore, Integer maxParts)
> returns array of parts in the RotatedRegion3 object
> will return a maximum number of parts in array [maxParts] the default is 20
> parts that either are descendants of or actually are the [ignore] instance will be ignored
RotatedRegion3:FindPartsInRegion3WithIgnoreList(Instance Array ignore, Integer maxParts)
> returns array of parts in the RotatedRegion3 object
> will return a maximum number of parts in array [maxParts] the default is 20
> parts that either are descendants of the [ignore array] or actually are the [ignore array] instances will be ignored
RotatedRegion3:FindPartsInRegion3WithWhiteList(Instance Array whiteList, Integer maxParts)
> returns array of parts in the RotatedRegion3 object
> will return a maximum number of parts in array [maxParts] the default is 20
> parts that either are descendants of the [whiteList array] or actually are the [whiteList array] instances are all that will be checked
RotatedRegion3:Cast(Instance or Instance Array ignore, Integer maxParts)
> Same as the `:FindPartsInRegion3WithIgnoreList` method, but will check if the ignore argument is an array or single instance
Properties:
RotatedRegion3.CFrame
> cframe that represents the center of the region
RotatedRegion3.Size
> vector3 that represents the size of the region
RotatedRegion3.Shape
> string that represents the shape type of the RotatedRegion3 object
RotatedRegion3.Set
> array of vector3 that are passed to the support function
RotatedRegion3.Support
> function that is used for support in the GJK algorithm
RotatedRegion3.Centroid
> vector3 that represents the center of the set, again used for the GJK algorithm
RotatedRegion3.AlignedRegion3
> standard region3 that represents the world bounding box of the RotatedRegion3 object
Note: I haven't actually done anything to enforce this, but you should treat all these properties as read only
Enjoy!
- EgoMoose
--]] | |
-- [[ Services ]] |
local Players = game:GetService("Players")
local CollectionService = game:GetService("CollectionService")
|
--- Gets a type definition by name. |
function Registry:GetType (name)
return self.Types[name]
end
|
--[[**
Takes a table where keys are child names and values are functions to check the children against.
Pass an instance tree into the function.
If at least one child passes each check, the overall check passes.
Warning! If you pass in a tree with more than one child of the same name, this function will always return false
@param checkTable The table to check against
@returns A function that checks an instance tree
**--]] |
function t.children(checkTable)
assert(checkChildren(checkTable))
return function(value)
local instanceSuccess = t.Instance(value)
if not instanceSuccess then
return false
end
local childrenByName = {}
for _, child in ipairs(value:GetChildren()) do
local name = child.Name
if checkTable[name] then
if childrenByName[name] then
return false
end
childrenByName[name] = child
end
end
for name, check in pairs(checkTable) do
local success = check(childrenByName[name])
if not success then
return false
end
end
return true
end
end
end
return { t = t }
|
----------------------------------------------
--- Scroll down for settings ---
--- Do not alter the three variables below ---
---------------------------------------------- |
local settings = {}; --// The settings table which contains all settings
local Settings = settings; --// For custom commands that use 'Settings' rather than the lowercase 'settings'
local descs = {}; --// Contains settings descriptions |
-- Getter functions, with a couple of hacks for Ipad pre-focus. |
function ScreenSpace.ViewSizeX()
local x = PlayerMouse.ViewSizeX
local y = PlayerMouse.ViewSizeY
if x == 0 then
return 1024
else
if x > y then
return x
else
return y
end
end
end
function ScreenSpace.ViewSizeY()
local x = PlayerMouse.ViewSizeX
local y = PlayerMouse.ViewSizeY
if y == 0 then
return 768
else
if x > y then
return y
else
return x
end
end
end
|
-- This is an overload function for TransparencyController:Update()
-- Do not call directly, or it will throw an assertion! |
function FpsCamera:UpdateTransparency(...)
assert(self ~= FpsCamera)
self:BaseUpdate(...)
if self.ForceRefresh then
self.ForceRefresh = false
if self.SetSubject then
local camera = workspace.CurrentCamera
self:SetSubject(camera.CameraSubject)
end
end
end
|
--onselected, save shoulders and get player |
script.Parent.Equipped:connect(function()
player = game.Players:playerFromCharacter(script.Parent.Parent)
local ch = script.Parent.Parent
RSH = ch.Torso["Right Shoulder"]
LSH = ch.Torso["Left Shoulder"]
GRP = ch["Right Arm"].RightGrip
--
RSH.Parent = nil
LSH.Parent = nil
--
RW.Part0 = ch.Torso
RW.C0 = CFrame.new(1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.3, 0, -0.5)
RW.C1 = CFrame.new(0, 0.5, 0)
RW.Part1 = ch["Right Arm"]
RW.Parent = ch.Torso
_G.R = RW
--
LW.Part0 = ch.Torso
LW.C0 = CFrame.new(-1.5, 0.5, 0) --* CFrame.fromEulerAnglesXYZ(1.7, 0, 0.8)
LW.C1 = CFrame.new(0, 0.5, 0)
LW.Part1 = ch["Left Arm"]
LW.Parent = ch.Torso
_G.L = LW
--
GRP.C0 = CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(-1, 0, 0)
--Bring_Arm_Up animation
for i = 0, 1, 0.05 do
wait()
RW.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.3*i, 0, -0.5*i)
LW.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(1.7*i, 0, 0.8*i)
LW.C1 = CFrame.new(-0.3*i, 0.5+1.2*i, 0)
end
end)
|
--[[
button.MouseButton1Click:Connect(function()
local pos = userInputService:GetMouseLocation()
--local relativePosition = pos - frame.Parent.AbsolutePosition
frame.Position = UDim2.new(0, pos.X, 0, pos.Y - 36)
end)
]] |
for i,v in pairs (script.Parent.Parent.Folder:GetChildren()) do
v.MouseEnter:Connect(function()
canfollow = true
print("l")
frame.Text = v.showtext.Value
game:GetService("RunService").RenderStepped:Connect(function()
if canfollow == true then
local pos = userInputService:GetMouseLocation()
frame.Position = UDim2.new(0, pos.X -50, 0, pos.Y - 60)
frame.Visible = true
else
end
end)
v.MouseLeave:Connect(function()
canfollow = false
frame.Visible = false
frame.Text = ""
end)
end)
end
|
--- Finds a hitbox object if valid, else return nil
-- @param Object instance |
function RaycastHitbox:GetHitbox(object: any?)
if object then
return HitboxData:_FindHitbox(object)
end
end
return RaycastHitbox
|
--- Skill |
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.F and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = false
Tool.Active.Value = ""
wait(0)
Track1 = Player.Character.Humanoid:LoadAnimation(script.Anim01)
Track1:Play()
wait(0)
script.Fire:FireServer(plr)
local hum = Player.Character.Humanoid
hum.WalkSpeed = 34
wait(4.8)
hum.WalkSpeed = 1
for i = 1,2 do
hum.CameraOffset = Vector3.new(
math.random(0,0),
math.random(0,0),
math.random(0,0)
)
end
hum.CameraOffset = Vector3.new(0,0,0)
wait(0.2)
hum.WalkSpeed = 16
wait(1)
Tool.Active.Value = "None"
Debounce = true
end
end)
|
-- Set the ImageLabel's content to the user thumbnail |
local imageLabel = script.Parent
imageLabel.Image = content
|
--[[ Last synced 7/31/2021 07:05 RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
|
-- GROUPS |
Groups = {
[0] = {
[254] = "Admin";
[1] = "VIP";
};
};
|
-- Setup animation objects |
function scriptChildModified(child)
local fileList = animNames[child.Name]
if (fileList ~= nil) then
configureAnimationSet(child.Name, fileList)
end
end
script.ChildAdded:Connect(scriptChildModified)
script.ChildRemoved:Connect(scriptChildModified)
for name, fileList in pairs(animNames) do
configureAnimationSet(name, fileList)
end
|
-- Player specific convenience variables |
local MyPlayer = nil
local MyCharacter = nil
local MyHumanoid = nil
local MyTorso = nil
local MyMouse = nil
local DebrisService = game:GetService('Debris')
local FireSound
local OnFireConnection = nil
local OnReloadConnection = nil
|
-- check if camera is zoomed into first person |
local function checkfirstperson()
if isfirstperson == false then -- not in first person
if ((camera.focus.p - camera.CFrame.p).magnitude <= 1) then
enableviewmodel()
end
elseif ((camera.focus.p - camera.CFrame.p).magnitude > 1.1) then
disableviewmodel()
end
end
|
--[[
PlayerServer.lua
AddPlayerAddedFunc:
Add a function that runs whenever a player joins a server
]] |
local this = {}
this.__index = this
this.Service = nil
function this.new( )
-- body
local self = this.Service or {}
setmetatable(self,this)
self.BindedPlayerAddedFunctions = {}
self.BindedCharacterAddedFunctions = {}
self.BindedPlayerRemovingFunctions = {}
for _,v in pairs(game.Players:GetPlayers()) do
self:PlayerAdded(v)
end
self.Connections = {
PlayerAdded = game.Players.PlayerAdded:Connect(function(plr)
self:PlayerAdded(plr)
end);
PlayerRemoving = game.Players.PlayerRemoving:Connect(function(plr)
self:PlayerRemoving(plr)
end);
}
this.Service = self
return self
end
function this:PlayerAdded( plr )
for _,v in pairs(self.BindedPlayerAddedFunctions) do
v(plr)
end
if plr.Character then
self:CharacterAdded(plr.Character)
end
plr.CharacterAdded:Connect(function( char )
self:CharacterAdded(char)
end)
end
function this:PlayerRemoving( plr )
for _,v in pairs(self.BindedPlayerRemovingFunctions) do
v(plr)
end
end
function this:CharacterAdded(char)
for _,v in pairs(self.BindedCharacterAddedFunctions) do
v(char)
end
end
function this:AddPlayerAddedFunc(name, func )
-- body
self.BindedPlayerAddedFunctions[name] = func
for i,v in pairs(game.Players:GetPlayers()) do
warn(v.Name.. " was already in the game before we added this player added function")
func(v)
end
end
function this:AddPlayerRemovingFunc(name, func )
-- body
self.BindedPlayerRemovingFunctions[name] = func
end
function this:AddCharacterAddedFunc(name, func )
-- body
self.BindedCharacterAddedFunctions[name] = func
for i,v in pairs(game.Players:GetPlayers()) do
if v.Character then
warn(v.Name.. " was already in the game before we added this Character added function")
func(v.Character)
end
end
end
function this:Deconstruct() -- Delete the player's object
end
return this
|
--[[
CameraModule - This ModuleScript implements a singleton class to manage the
selection, activation, and deactivation of the current camera controller,
character occlusion controller, and transparency controller. This script binds to
RenderStepped at Camera priority and calls the Update() methods on the active
controller instances.
The camera controller ModuleScripts implement classes which are instantiated and
activated as-needed, they are no longer all instantiated up front as they were in
the previous generation of PlayerScripts.
2018 PlayerScripts Update - AllYourBlox
--]] |
local CameraModule = {}
CameraModule.__index = CameraModule
local FFlagUserCameraToggle do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserCameraToggle")
end)
FFlagUserCameraToggle = success and result
end
local FFlagUserRemoveTheCameraApi do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserRemoveTheCameraApi")
end)
FFlagUserRemoveTheCameraApi = success and result
end
|
-- Connection class |
local Connection = {}
Connection.__index = Connection
function Connection.new(signal, fn)
return setmetatable({
_connected = true,
_signal = signal,
_fn = fn,
_next = false,
}, Connection)
end
function Connection:Disconnect()
assert(self._connected, "Can't disconnect a connection twice.")
self._connected = false
-- Unhook the node, but DON'T clear it. That way any fire calls that are
-- currently sitting on this node will be able to iterate forwards off of
-- it, but any subsequent fire calls will not hit it, and it will be GCed
-- when no more fire calls are sitting on it.
if self._signal._handlerListHead == self then
self._signal._handlerListHead = self._next
else
local prev = self._signal._handlerListHead
while prev and prev._next ~= self do
prev = prev._next
end
if prev then
prev._next = self._next
end
end
end
|
-- Player's tank GUI |
GUI = script.Parent.Parent.Parent.PlayerGui.TankGUI;
GUI.HP.Hitpoints.Text = parts.Parent:findFirstChild("Damage").Value
local Hull = parts.Parent:findFirstChild("Damage")
if Hull.Value<0 then
GUI.HP.Hitpoints.Text = "DISABLED"
end
local MGDamage = math.random(45,45)
braking = false;
firingMg = false;
reloading = false;
currRound = tankStats.Round; -- Current loaded ammo (AP/HE)
myMouse = nil;
function updateAmmo()
GUI.Ammo.Text = "Cannon Ammo = " .. tankStats[tankStats.Round.Value .. "Ammo"].Value;
GUI.MG_Ammo.Text = tankStats.MGAmmo.Value;
GUI.HP.Hitpoints.Text = parts.Parent:findFirstChild("Damage").Value
end
function Brakes()
for i = 1, 5 do
parts.Engine.BodyVelocity.Velocity = Vector3.new(0,0,0)
print("Brakes activated")
end
end
|
-- Decompiled with the Synapse X Luau decompiler. |
local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer;
local l__Character__2 = game:GetService("Players").LocalPlayer.Character;
hrp = l__Character__2:WaitForChild("HumanoidRootPart");
hp2 = Instance.new("Part");
hp2.Name = "Door";
hp2.Size = Vector3.new(1.5, 5.26, 1.21);
hp2.CanCollide = false;
hp2.Transparency = 1;
hp2.Parent = l__Character__2;
local v3 = Instance.new("Weld");
v3.Parent = hp2;
v3.Part0 = hp2;
v3.Part1 = l__Character__2.HumanoidRootPart;
v3.C0 = CFrame.new(0, 0.5, 0);
ts = game:GetService("TweenService");
ti2 = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0);
hp2.Touched:connect(function(p1)
if p1.Name == "Trigger" and p1:FindFirstChild("Open") == nil and l__Character__2.Humanoid.Health >= 0 then
local v4 = Instance.new("BoolValue", p1);
local v5 = script.DoorO:Clone();
v5.Parent = p1;
v5:Play();
game.Debris:AddItem(v5, 3);
v4.Name = "Open";
local l__d1__6 = p1.Parent.d1;
local l__d2__7 = p1.Parent.d2;
l__d1__6.CanCollide = false;
l__d2__7.CanCollide = false;
local v8 = ts:Create(l__d1__6, ti2, {
CFrame = l__d1__6.CFrame + Vector3.new(0, 15, 0)
});
ts:Create(l__d2__7, ti2, {
CFrame = l__d2__7.CFrame + Vector3.new(0, 15, 0)
}):Play();
v8:Play();
wait(3);
local v9 = script.DoorC:Clone();
v9.Parent = p1;
v9:Play();
game.Debris:AddItem(v9, 3);
local v10 = ts:Create(l__d2__7, ti2, {
CFrame = p1.Parent.d2.CFrame
});
ts:Create(l__d1__6, ti2, {
CFrame = p1.Parent.d1.CFrame
}):Play();
v10:Play();
wait(1.5);
l__d1__6.CanCollide = true;
l__d2__7.CanCollide = true;
game.Debris:AddItem(v4, 0);
end;
end);
|
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- |
function onRunning(speed)
if speed > 0.01 then
local scale = 15.0
playAnimation("walk", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
local scale = 5.0
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed > 1.00 then
local scale = 10.0
playAnimation("swim", 0.4, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Swimming"
else
playAnimation("swimidle", 0.4, Humanoid)
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
-- Tool Animation handling
local tool = getTool()
if tool then
animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
-- References |
SyncAPI = script.Parent;
Tool = SyncAPI.Parent;
Player = nil;
|
--[[
Takes two tables A, B and a key, returns if two tables have the same value at key
]] |
return function(A, B, key)
if A and B and key and key ~= "" and A[key] and B[key] and A[key] == B[key] then
return true
end
return false
end
|
-- elseif input.UserInputType == self.activeGamepad and input.KeyCode == Enum.KeyCode.ButtonL3 then
-- if (state == Enum.UserInputState.Begin) then
-- self.L3ButtonDown = true
-- elseif (state == Enum.UserInputState.End) then
-- self.L3ButtonDown = false
-- self.currentZoomSpeed = 1.00
-- end
-- end |
end
function BaseCamera:DoKeyboardZoom(name, state, input)
if not self.hasGameLoaded and VRService.VREnabled then
return Enum.ContextActionResult.Pass
end
if state ~= Enum.UserInputState.Begin then
return Enum.ContextActionResult.Pass
end
if self.distanceChangeEnabled and player.CameraMode ~= Enum.CameraMode.LockFirstPerson then
if input.KeyCode == Enum.KeyCode.I then
self:SetCameraToSubjectDistance( self.currentSubjectDistance - 5 )
elseif input.KeyCode == Enum.KeyCode.O then
self:SetCameraToSubjectDistance( self.currentSubjectDistance + 5 )
end
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end
function BaseCamera:BindAction(actionName, actionFunc, createTouchButton, ...)
table.insert(self.boundContextActions, actionName)
ContextActionService:BindActionAtPriority(actionName, actionFunc, createTouchButton,
CAMERA_ACTION_PRIORITY, ...)
end
function BaseCamera:BindGamepadInputActions()
self:BindAction("BaseCameraGamepadPan", function(name, state, input) return self:GetGamepadPan(name, state, input) end,
false, Enum.KeyCode.Thumbstick2)
self:BindAction("BaseCameraGamepadZoom", function(name, state, input) return self:DoGamepadZoom(name, state, input) end,
false, Enum.KeyCode.DPadLeft, Enum.KeyCode.DPadRight, Enum.KeyCode.ButtonR3)
end
function BaseCamera:BindKeyboardInputActions()
self:BindAction("BaseCameraKeyboardPanArrowKeys", function(name, state, input) return self:DoKeyboardPanTurn(name, state, input) end,
false, Enum.KeyCode.Left, Enum.KeyCode.Right)
self:BindAction("BaseCameraKeyboardZoom", function(name, state, input) return self:DoKeyboardZoom(name, state, input) end,
false, Enum.KeyCode.I, Enum.KeyCode.O)
end
local function isInDynamicThumbstickArea(input)
local playerGui = player:FindFirstChildOfClass("PlayerGui")
local touchGui = playerGui and playerGui:FindFirstChild("TouchGui")
local touchFrame = touchGui and touchGui:FindFirstChild("TouchControlFrame")
local thumbstickFrame = touchFrame and touchFrame:FindFirstChild("DynamicThumbstickFrame")
if not thumbstickFrame then
return false
end
local frameCornerTopLeft = thumbstickFrame.AbsolutePosition
local frameCornerBottomRight = frameCornerTopLeft + thumbstickFrame.AbsoluteSize
if input.Position.X >= frameCornerTopLeft.X and input.Position.Y >= frameCornerTopLeft.Y then
if input.Position.X <= frameCornerBottomRight.X and input.Position.Y <= frameCornerBottomRight.Y then
return true
end
end
return false
end
|
-- Constructor. |
function FastCast.new()
return setmetatable({
LengthChanged = Signal:CreateNewSignal(),
RayHit = Signal:CreateNewSignal(),
RayExited = Signal:CreateNewSignal()
}, FastCast)
end
|
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote |
local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
math.randomseed(tick())
function configureAnimationSet(name, fileList)
if (animTable[name] ~= nil) then
for _, connection in pairs(animTable[name].connections) do
connection:disconnect()
end
end
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
animTable[name].connections = {}
-- check for config values
local config = script:FindFirstChild(name)
if (config ~= nil) then |
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- |
function onSwimming(speed)
if speed > 1.00 then
local scale = 10.0
playAnimation("swim", 0.4, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Swimming"
else
playAnimation("swimidle", 0.4, Humanoid)
pose = "Standing"
end
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
local lastTick = 0
function stepAnimate(currentTime)
local amplitude = 1
local frequency = 1
local deltaTime = currentTime - lastTick
lastTick = currentTime
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.2, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
-- Tool Animation handling
local tool = Character:FindFirstChildOfClass("Tool")
if tool and tool:FindFirstChild("Handle") then
local animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = currentTime + .3
end
if currentTime > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
--[=[
Executes on the next event connection.
@param event RBXScriptSignal
@param _function function
@return RBXScriptConnection
]=] |
function SignalUtils.onNext(event, _function)
assert(typeof(event) == "RBXScriptSignal", "Bad event")
assert(type(_function) == "function", "Bad _function")
local conn
conn = event:Connect(function(...)
if conn.Connected then
return -- Multiple events got queued
end
conn:Disconnect()
_function(...)
end)
return conn
end
return SignalUtils
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 300 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 100 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 15000 -- Use sliders to manipulate values
Tune.Redline = 15000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 500 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 0 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--------LEFT DOOR -------- |
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(1023)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.Lighting.flashcurrent.Value = "13" |
--Disable normal death |
repeat wait() until hum.Health == 0 |
-- GuiControls variables |
local PressedColor = Color3.new(79/255,185/255,255/255)
local LiftedColor = Color3.new(255/255,255/255,255/255)
local GuiControls = script.Parent:WaitForChild("GuiControls")
local Accelerate = GuiControls:WaitForChild("Accelerate")
local Steer = GuiControls:WaitForChild("Steer")
local UpButton = Accelerate:WaitForChild("Up")
local DownButton = Accelerate:WaitForChild("Down")
local RightButton = Steer:WaitForChild("Right")
local LeftButton = Steer:WaitForChild("Left")
local OffButton = GuiControls:WaitForChild("OffButton")
|
-- regeneration |
function regenHealth()
if regening then return end
regening = false
while Humanoid.Health < Humanoid.MaxHealth do
local s = task.wait(1)
local health = Humanoid.Health
if health > 0 and health < Humanoid.MaxHealth then
local newHealthDelta = 0.01 * s * Humanoid.MaxHealth
health = health + newHealthDelta
Humanoid.Health = math.min(health,Humanoid.MaxHealth)
end
end
if Humanoid.Health > Humanoid.MaxHealth then
Humanoid.Health = Humanoid.MaxHealth
end
regening = false
end
Humanoid.HealthChanged:connect(regenHealth)
|
-- Number of bullets in a clip |
local ClipSize = 30 |
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {};
local v2 = require(game.ReplicatedStorage.Modules.Lightning);
local v3 = require(game.ReplicatedStorage.Modules.Xeno);
local v4 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function v1.RunStompFx(p1, p2, p3, p4)
local v7 = l__ReplicatedStorage__1.KillFX[p1].Stomp:Clone();
v7.Parent = p2.Parent.UpperTorso and p2;
v7:Play();
game.Debris:AddItem(v7, 4);
local v8 = l__ReplicatedStorage__1.KillFX[p1].Effect:Clone();
v8.Parent = p2.Parent.UpperTorso and p2;
v8.Effect.Enabled = true;
v8.Position = p2.Parent.UpperTorso.Position or p2.Position;
game.Debris:AddItem(v8, 4);
local v9 = Instance.new("WeldConstraint", v8);
v9.Part0 = v8;
v9.Part1 = p2.Parent.UpperTorso and p2;
return nil;
end;
return v1;
|
-- Script GUID: {6BA2CDC4-2490-4BF3-A382-3936CFCA3401}
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = script:FindFirstAncestor("MainUI");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v3 = require(l__LocalPlayer__2:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v4 = game["Run Service"];
local l__UserInputService__5 = game:GetService("UserInputService");
local l__TweenService__6 = game:GetService("TweenService");
local v7 = require(script:WaitForChild("Lightning"));
local l__Bricks__1 = game:GetService("ReplicatedStorage"):WaitForChild("Bricks");
local u2 = require(script.Parent);
local v8 = require(game:GetService("ReplicatedStorage"):WaitForChild("ClientModules"):WaitForChild("Module_Events"));
v8.init(u2);
local v10 = Vector3.new();
local v1110 = workspace
game.SoundService.Main.Volume = 1;
l__Bricks__1:WaitForChild("PadlockHint").OnClientEvent:Connect(function(p1, p2, p3)
local l__Hints__11 = v1.Parent.PermUI.Hints;
l__Hints__11.Visible = true;
if not p1 or not p2 then
l__Hints__11.Visible = false;
for v12, v13 in pairs(l__Hints__11:GetChildren()) do
if v13.Name == "Icon" then
v13:Destroy();
end;
end;
return;
end;
local v14 = l__Hints__11.Template:Clone();
v14.Name = "Icon";
v14.Visible = true;
v14.ImageRectOffset = Vector2.new(50 * p1, 0);
v14.TextLabel.Text = p2;
if p3 and p3 ~= l__LocalPlayer__2.UserId then
v14.User.Visible = true;
v14.User.Image = "rbxthumb://type=AvatarHeadShot&id=" .. p3 .. "&w=48&h=48";
end;
v14.Parent = l__Hints__11;
end);
l__Bricks__1:WaitForChild("MotorReplication").OnClientEvent:Connect(function(p4, p5, p6, p7)
if not p4 or not p4:FindFirstChild("Humanoid") or not p4:FindFirstChild("Humanoid"):GetAttribute("AppearanceFinal") then
return;
end;
local v15 = CFrame.new(0, 0.22, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v16 = CFrame.new(0, -1.1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v17 = CFrame.new(0, 0.88, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v18 = CFrame.new(1, 0.62, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
local v19 = CFrame.new(-1, 0.62, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
if p4 and p4:FindFirstChild("HumanoidRootPart") then
local l__HumanoidRootPart__20 = p4:WaitForChild("HumanoidRootPart", 0.5);
local l__ClientMotors__21 = p4:FindFirstChild("ClientMotors");
local l__Waist__22 = p4:WaitForChild("UpperTorso", 0.5):WaitForChild("Waist", 0.5);
local l__Neck__23 = p4:WaitForChild("Head", 0.5):WaitForChild("Neck", 0.5);
local l__Root__24 = p4:WaitForChild("LowerTorso", 0.5):WaitForChild("Root", 0.5);
local l__RightShoulder__25 = p4:WaitForChild("RightUpperArm", 0.5):WaitForChild("RightShoulder", 0.5);
local l__LeftShoulder__26 = p4:WaitForChild("LeftUpperArm", 0.5):WaitForChild("LeftShoulder", 0.5);
local l__Value__27 = l__Root__24:WaitForChild("CVal").Value;
local l__Value__28 = l__Waist__22:WaitForChild("CVal").Value;
local l__Value__29 = l__Neck__23:WaitForChild("CVal").Value;
local l__Value__30 = l__LeftShoulder__26:WaitForChild("CVal").Value;
local l__Value__31 = l__RightShoulder__25:WaitForChild("CVal").Value;
local v32 = v16 * CFrame.Angles(0, math.rad(p5 * -45), 0);
local v33 = v15 * CFrame.Angles(math.rad(p6 * 0.25), 0, 0) * CFrame.Angles(0, math.rad(p5 * 45), 0) * CFrame.Angles(0, 0, math.rad(p7));
local v34 = v17 * CFrame.Angles(math.rad(p6 * 0.5), 0, 0);
local v35 = v19 * CFrame.Angles(math.rad(p6 * -0.025), 0, 0);
local v36 = v18 * CFrame.Angles(math.rad(p6 * -0.025), 0, 0);
if not l__ClientMotors__21 then
local v37 = Instance.new("BoolValue");
v37.Name = "ClientMotors";
v37.Parent = p4;
end;
if p4.Humanoid:GetAttribute("Stunned") == true then
if l__HumanoidRootPart__20 then
l__Waist__22.Enabled = false;
l__Neck__23.Enabled = false;
l__Root__24.Enabled = false;
l__RightShoulder__25.Enabled = false;
l__LeftShoulder__26.Enabled = false;
return;
end;
else
l__Waist__22.Enabled = true;
l__Neck__23.Enabled = true;
l__Root__24.Enabled = true;
l__RightShoulder__25.Enabled = true;
l__LeftShoulder__26.Enabled = true;
if l__HumanoidRootPart__20 and (l__HumanoidRootPart__20.Position - u2.cam.CFrame.p).Magnitude > 100 then
l__Root__24.C0 = v32;
l__Waist__22.C0 = v33;
l__Neck__23.C0 = v34;
l__LeftShoulder__26.C0 = v35;
l__RightShoulder__25.C0 = v36;
return;
end;
if l__HumanoidRootPart__20 then
local v38 = {};
local v39 = {};
local v40 = {};
local v41 = {};
local v42 = {};
v38.C0 = v32;
v39.C0 = v33;
v40.C0 = v34;
v41.C0 = v35;
v42.C0 = v36;
l__TweenService__6:Create(l__Root__24, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v38):Play();
l__TweenService__6:Create(l__Waist__22, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v39):Play();
l__TweenService__6:Create(l__Neck__23, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v40):Play();
l__TweenService__6:Create(l__RightShoulder__25, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v42):Play();
l__TweenService__6:Create(l__LeftShoulder__26, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), v41):Play();
end;
end;
end;
end);
l__Bricks__1:WaitForChild("SoundToClient").OnClientEvent:Connect(function(p8, p9, p10, p11)
if p8 and p9 then
u2.playaudio(p8, p9, p10, p11);
end;
end);
local u3 = {};
l__Bricks__1:WaitForChild("UseEnemyModule").OnClientEvent:Connect(function(p12, p13, ...)
if not u3[p12] then
u3[p12] = require(game:GetService("ReplicatedStorage").ClientModules.EntityModules:FindFirstChild(p12));
end;
u3[p12][p13](u2, ...);
end);
l__Bricks__1:WaitForChild("UseEventModule").OnClientEvent:Connect(function(p14, ...)
v8[p14](...);
end);
l__Bricks__1:WaitForChild("ReplicateAnimation").OnClientEvent:Connect(function(p15, p16, p17, p18, p19, p20)
local v43 = game.ReplicatedStorage.AnimationRoot:Clone();
local v44 = p15.Humanoid.Animator:LoadAnimation(v43.Animation);
v43:SetPrimaryPartCFrame(p15.PrimaryPart.CFrame);
v43.Parent = u2.cam;
l__TweenService__6:Create(v43.PrimaryPart, TweenInfo.new(0.3, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
CFrame = p17
}):Play();
local v45 = nil;
local v46 = v43.AnimationController:LoadAnimation(p16);
p16 = p15.Humanoid.Animator:LoadAnimation(p16);
local v47 = false;
if u2.char == p15 then
u2.stopcam = true;
v47 = true;
end;
if p19 and p20 and v47 then
p20 = p19:LoadAnimation(p20);
v45 = p19.Parent:FindFirstChild("CamAttach", true) and v45.WorldCFrame;
u2.hideplayers = -1;
end;
for v48 = 1, 1000 do
if p16.Length > 0 then
if p20 == nil then
break;
end;
if p20.Length > 0 then
break;
end;
end;
task.wait();
end;
p16:Play(0, 1, 1);
v44:Play(0, 1, 1);
v46:Play(0, 1, 1);
if p19 and p20 then
p20:Play(0, 1, 1);
end;
local l__CFrame__49 = p15.PrimaryPart.CFrame;
local l__CFrame__50 = u2.cam.CFrame;
local u4 = false;
local u5 = tick();
task.spawn(function()
for v51 = 1, 100000 do
task.wait();
if u4 then
break;
end;
local v52 = l__TweenService__6:GetValue((tick() - u5) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut);
if v45 then
v52 = l__TweenService__6:GetValue((tick() - u5) / 1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
end;
p15.PrimaryPart.CFrame = p15.PrimaryPart.CFrame:Lerp(v43.LowerTorso.CFrame * CFrame.new(0, 0.96, 0), v52);
if v47 then
local v53
if v45 then
v53 = v45;
else
v53 = p15.Head.CFrame * CFrame.new(0, 0.15, -0.25) * CFrame.Angles(math.rad(math.clamp(u2.bobspring.p.Y, -80, 80)), math.rad(math.clamp(u2.bobspring.p.X, -80, 80)), math.rad(math.clamp(u2.bobspring.p.Z, -40, 40))) * CFrame.Angles(0, math.rad(u2.camlockedoffset[1]), 0) * CFrame.Angles(math.rad(u2.camlockedoffset[2]), 0, 0);
end;
u2.cam.CFrame = u2.cam.CFrame:Lerp(v53, v52);
end;
end;
end);
task.wait(p16.Length - 0.1);
u4 = true;
l__TweenService__6:Create(p15.PrimaryPart, TweenInfo.new(0.1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
CFrame = p18
}):Play();
p16:AdjustWeight(0.01);
p16:AdjustSpeed(0.01);
p16:Stop(0);
v46:Stop(0);
v44:Stop(0);
v43:Destroy();
if v47 then
local v54 = tick();
local l__CFrame__55 = u2.cam.CFrame;
for v56 = 1, 10000 do
u2.cam.CFrame = l__CFrame__55:Lerp(u2.basecamcf * u2.csgo, (l__TweenService__6:GetValue((tick() - v54) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)));
task.wait();
if v54 + 0.25 <= tick() then
break;
end;
end;
u2.stopcam = false;
u2.crouching = false;
end;
end);
spawn(function()
while true do
task.wait(0.1)
if v1110:FindFirstChild("FigureSetup", true) then
local l__FigureRagdoll__19 = v1110:FindFirstChild("FigureSetup", true).FigureRagdoll;
local l__Parent__20 = l__FigureRagdoll__19.Parent;
local v21 = 0;
local l__Click__22 = l__FigureRagdoll__19.Head.Click;
local l__Growl__23 = l__FigureRagdoll__19.Head.Growl;
local v24 = {};
for v25, v26 in pairs(l__FigureRagdoll__19:GetDescendants()) do
if v26:IsA("Light") and v26.Name == "BlisterLight" then
v26.Enabled = true;
v26.Brightness = 0;
table.insert(v24, {
Light = v26,
Distance = l__FigureRagdoll__19.Head.Position - v26.Parent.WorldPosition
});
end;
end;
local v27 = TweenInfo.new(0.1, Enum.EasingStyle.Linear);
for v28 = 1, 100000000 do
wait(0.1);
if not l__FigureRagdoll__19 then
break;
end;
if l__FigureRagdoll__19.Parent ~= l__Parent__20 then
break;
end;
local v29 = (l__Click__22.PlaybackLoudness + l__Growl__23.PlaybackLoudness) / 60;
if v29 ~= v21 then
for v30, v31 in v24, nil do
delay(v31.Distance / 2, function()
l__TweenService__6:Create(v31.Light, v27, {
Brightness = v29
}):Play();
end);
end;
end;
v21 = v29;
end;
end;
if v1110:FindFirstChild("FigureAnimatedWelded", true) then
local l__FigureAnimatedWelded__32 = v1110:FindFirstChild("FigureAnimatedWelded", true);
local l__Parent__33 = l__FigureAnimatedWelded__32.Parent;
local v34 = 0;
local l__Click__35 = l__FigureAnimatedWelded__32.Parent.Head.Click;
local l__Growl__36 = l__FigureAnimatedWelded__32.Parent.Head.Growl;
local v37 = {};
for v38, v39 in pairs(l__FigureAnimatedWelded__32:GetDescendants()) do
if v39:IsA("Light") and v39.Name == "BlisterLight" then
v39.Enabled = true;
v39.Brightness = 0;
table.insert(v37, {
Light = v39,
Distance = l__FigureAnimatedWelded__32.Parent.Head.Position - v39.Parent.WorldPosition
});
end;
end;
local v40 = TweenInfo.new(0.1, Enum.EasingStyle.Linear);
for v41 = 1, 100000000 do
wait(0.1);
if not l__FigureAnimatedWelded__32 then
break;
end;
if l__FigureAnimatedWelded__32.Parent ~= l__Parent__33 then
break;
end;
local v42 = (l__Click__35.PlaybackLoudness + l__Growl__36.PlaybackLoudness) / 90 - 0.15;
if v42 ~= v34 then
for v43, v44 in v37, nil do
delay(v44.Distance / 4, function()
l__TweenService__6:Create(v44.Light, v40, {
Brightness = v42
}):Play();
end);
end;
end;
v34 = v42;
end;
end;
end;
end)
local u6 = false;
l__Bricks__1:WaitForChild("Jumpscare").OnClientEvent:Connect(function(p21)
if u6 == true then
return;
end;
u6 = true;
v1.MainFrame.Heartbeat.Visible = false;
if p21 == "Seek" then
u2.deathtick = tick() + 0.5;
if workspace:FindFirstChild("SeekMoving", true) then
local l__SeekMoving__57 = workspace:FindFirstChild("SeekMoving", true);
u2.stopcam = true;
u2.fovtarget = 40;
local v58 = tick();
for v59 = 1, 10000 do
u2.cam.CFrame = (u2.basecamcf * u2.csgo):Lerp(l__SeekMoving__57.PrimaryPart.CamAttach.WorldCFrame, (l__TweenService__6:GetValue((tick() - v58) * 4, Enum.EasingStyle.Sine, Enum.EasingDirection.In)));
task.wait();
if v58 + 0.25 <= tick() then
break;
end;
end;
else
warn("cant find seekmoving");
end;
script.Jumpscare_Seek:Play();
v1.Jumpscare_Seek.Visible = true;
local v60 = tick();
for v61 = 1, 1000 do
local v62 = math.clamp((tick() - v60) * 2, 0.1, 1);
v1.Jumpscare_Seek.ImageLabel.Position = UDim2.new(0.5 + math.random(-100, 100) / (5000 * v62), 0, 0.5 + math.random(-100, 100) / (2500 * v62), 0);
v1.Jumpscare_Seek.BackgroundColor3 = Color3.new(math.random(0, 4) / 12, 0, 0);
game["Run Service"].RenderStepped:wait();
if v60 + 0.7 <= tick() then
break;
end;
end;
u2.stopcam = false;
script.Jumpscare_Seek:Stop();
script.Kill:Play();
v1.Jumpscare_Seek.ImageLabel.Visible = false;
for v63 = 1, 4 do
v1.Jumpscare_Seek.BackgroundColor3 = Color3.new(math.random(0, 1), 0, 0);
wait();
end;
v1.Jumpscare_Seek.Visible = false;
u2.deathtick = tick();
u2.fovtarget = 70;
return;
end;
if p21 == "Rush" then
u2.deathtick = tick() + 10;
game.SoundService.Main.Volume = 0;
script.Jumpscare_Rush:Play();
v1.Jumpscare_Rush.Visible = true;
local v64 = tick();
local v65 = math.random(5, 30) / 10;
local v66 = v65 + math.random(10, 60) / 10;
local v67 = 0.25;
for v68 = 1, 100000 do
task.wait();
if v64 + v65 <= tick() then
v1.Jumpscare_Rush.ImageLabel.Visible = true;
v65 = v65 + math.random(7, 44) / 10;
script.Jumpscare_Rush.Pitch = 1 + math.random(-100, 100) / 500;
v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
v1.Jumpscare_Rush.ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
v67 = v67 + 0.05;
v1.Jumpscare_Rush.ImageLabel.Size = UDim2.new(v67, 0, v67, 0);
end;
if v64 + v66 <= tick() then
break;
end;
end;
v1.Jumpscare_Rush.ImageLabel.Visible = true;
script.Jumpscare_Rush:Stop();
script.Jumpscare_Rush2:Play();
v1.Jumpscare_Rush.ImageLabel.Visible = false;
v1.Jumpscare_Rush.ImageLabelBig.Visible = true;
v1.Jumpscare_Rush.ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
local v69 = tick();
for v70 = 1, 1000 do
local v71 = math.random(0, 10) / 10;
v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(v71, v71, math.clamp(math.random(25, 50) / 50, v71, 1));
v1.Jumpscare_Rush.ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
task.wait(0.016666666666666666);
if v69 + 0.3 <= tick() then
break;
end;
end;
v1.Jumpscare_Rush.ImageLabelBig.Visible = false;
v1.Jumpscare_Rush.BackgroundColor3 = Color3.new(0, 0, 0);
v1.Jumpscare_Rush.Visible = false;
u2.deathtick = tick();
return;
end;
if p21 == "A-60" then
u2.deathtick = tick() + 10;
game.SoundService.Main.Volume = 0;
script["Jumpscare_A-60"]:Play();
v1["Jumpscare_A-60"].Visible = true;
local v64 = tick();
local v65 = math.random(5, 30) / 10;
local v66 = v65 + math.random(10, 60) / 10;
local v67 = 0.25;
for v68 = 1, 100000 do
task.wait();
if v64 + v65 <= tick() then
v1["Jumpscare_A-60"].ImageLabel.Visible = true;
v65 = v65 + math.random(7, 44) / 10;
script["Jumpscare_A-60"].Pitch = 1 + math.random(-100, 100) / 500;
v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(0, 0, math.random(0, 10) / 255);
v1["Jumpscare_A-60"].ImageLabel.Position = UDim2.new(0.5, math.random(-2, 2), 0.5, math.random(-2, 2));
v67 = v67 + 0.05;
v1["Jumpscare_A-60"].ImageLabel.Size = UDim2.new(v67, 0, v67, 0);
end;
if v64 + v66 <= tick() then
break;
end;
end;
v1["Jumpscare_A-60"].ImageLabel.Visible = true;
script["Jumpscare_A-60"]:Stop();
script["Jumpscare_A-60"]:Play();
v1["Jumpscare_A-60"].ImageLabel.Visible = false;
v1["Jumpscare_A-60"].ImageLabelBig.Visible = true;
v1["Jumpscare_A-60"].ImageLabelBig:TweenSize(UDim2.new(2.5, 0, 2.5, 0), "In", "Sine", 0.3, true);
local v69 = tick();
for v70 = 1, 1000 do
local v71 = math.random(0, 10) / 10;
v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(v71, v71, math.clamp(math.random(25, 50) / 50, v71, 1));
v1["Jumpscare_A-60"].ImageLabelBig.Position = UDim2.new(0.5 + math.random(-100, 100) / 5000, 0, 0.5 + math.random(-100, 100) / 3000, 0);
task.wait(0.016666666666666666);
if v69 + 0.3 <= tick() then
break;
end;
end;
v1["Jumpscare_A-60"].ImageLabelBig.Visible = false;
v1["Jumpscare_A-60"].BackgroundColor3 = Color3.new(0, 0, 0);
v1["Jumpscare_A-60"].Visible = false;
u2.deathtick = tick();
return;
end;
if p21 == "Ambush" then
u2.deathtick = tick() + 10;
game.SoundService.Main.Volume = 0;
script.Jumpscare_Ambush:Play();
v1.Jumpscare_Ambush.Visible = true;
local v72 = tick();
local v73 = math.random(5, 30) / 100;
local v74 = v73 + math.random(10, 60) / 100;
local v75 = 0.2;
for v76 = 1, 100000 do
task.wait(0.016666666666666666);
v1.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-15, 15), 0.5, math.random(-15, 15));
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
if v72 + v73 <= tick() then
v1.Jumpscare_Ambush.ImageLabel.Visible = true;
v73 = v73 + math.random(7, 44) / 100;
script.Jumpscare_Ambush.Pitch = math.random(35, 155) / 100;
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, math.random(4, 10) / 255, math.random(0, 3) / 255);
v1.Jumpscare_Ambush.ImageLabel.Position = UDim2.new(0.5, math.random(-25, 25), 0.5, math.random(-25, 25));
v75 = v75 + 0.05;
v1.Jumpscare_Ambush.ImageLabel.Size = UDim2.new(v75, 0, v75, 0);
end;
if v72 + v74 <= tick() then
break;
end;
end;
script.Jumpscare_Ambush2:Play();
v1.Jumpscare_Ambush.ImageLabel.Visible = true;
v1.Jumpscare_Ambush.ImageLabel:TweenSize(UDim2.new(9, 0, 9, 0), "In", "Quart", 0.3, true);
local v77 = tick();
for v78 = 1, 100 do
local v79 = math.random(0, 10) / 10;
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(v79, math.clamp(math.random(25, 50) / 50, v79, 1), math.clamp(math.random(25, 50) / 150, v79, 1));
game["Run Service"].RenderStepped:wait();
if v77 + 0.3 <= tick() then
break;
end;
end;
script.Jumpscare_Ambush:Stop();
v1.Jumpscare_Ambush.ImageLabel.Visible = false;
v1.Jumpscare_Ambush.BackgroundColor3 = Color3.new(0, 0, 0);
v1.Jumpscare_Ambush.Visible = false;
u2.deathtick = tick();
return;
end;
if p21 == "Figure" then
l__TweenService__6:Create(game.SoundService.Main, TweenInfo.new(0.3, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {
Volume = 0
}):Play();
local l__FigureSetup__80 = workspace:FindFirstChild("FigureSetup", true);
if workspace:FindFirstChild("FigureSetup", true) then
local v81 = u2.cam;
if l__FigureSetup__80 then
v81 = l__FigureSetup__80.Parent;
end;
u2.stopcam = true;
u2.fovtarget = 80;
script.Reverse:Play();
script.Figure_Growl:Play();
local v82 = game:GetService("ReplicatedStorage"):WaitForChild("JumpscareModels"):WaitForChild("Figure"):Clone();
if l__FigureSetup__80 then
l__FigureSetup__80.Parent = game:GetService("ReplicatedStorage");
v82:SetPrimaryPartCFrame(l__FigureSetup__80.FigureRagdoll.PrimaryPart.CFrame);
else
v82:SetPrimaryPartCFrame(u2.cam.CFrame);
end;
v82.Parent = u2.cam;
v82:WaitForChild("AnimationController"):LoadAnimation(v82:WaitForChild("Jumpscare")):Play(0, 1, 1);
game.Debris:AddItem(v82, 10);
local l__OriginalCFrame__83 = script:WaitForChild("OriginalCFrame");
l__OriginalCFrame__83.Value = u2.cam.CFrame;
l__TweenService__6:Create(l__OriginalCFrame__83, TweenInfo.new(0.6, Enum.EasingStyle.Exponential, Enum.EasingDirection.Out), {
Value = v82:WaitForChild("CamSpot").CFrame
}):Play();
u2.camShaker:ShakeOnce(20, 12, 0, 0.2);
u2.camShaker:ShakeOnce(2, 24, 0.1, 0.5, Vector3.new(0, 0, 0), Vector3.new(3, 1, 3));
u2.camShaker:ShakeOnce(8, 25, 0.7, 1, Vector3.new(0, 0, 0));
local v84 = tick();
delay(0.55, function()
u2.camShaker:ShakeOnce(1, 35, 0.01, 1, Vector3.new(0, 0, 0), Vector3.new(3, 1, 3));
end);
for v85 = 1, 1000 do
game["Run Service"].RenderStepped:wait();
u2.cam.CFrame = l__OriginalCFrame__83.Value * u2.csgo;
if v84 + 0.8 <= tick() then
break;
end;
end;
if l__FigureSetup__80 then
l__FigureSetup__80.Parent = v81;
end;
v82:Destroy();
end;
script.Kill:Play();
v1.FlashFrame.Visible = true;
for v86 = 1, 8 do
v1.FlashFrame.BackgroundColor3 = Color3.new(math.random(0, 1), 0, 0);
wait();
end;
v1.FlashFrame.BackgroundColor3 = Color3.new(0, 0, 0);
u2.cam.CameraType = Enum.CameraType.Scriptable;
u2.stopcam = false;
u2.deathtick = tick();
v1.FlashFrame.Visible = false;
end;
end);
l__Bricks__1:WaitForChild("Cutscene").OnClientEvent:Connect(function(p22)
local v87 = script.Cutscenes:FindFirstChild(p22);
if v87 then
require(v87)(u2);
end;
end);
l__Bricks__1:WaitForChild("GetOutOfHiding").OnClientEvent:Connect(function()
u2.char:SetAttribute("Hiding", true);
u2.char:SetAttribute("Hiding", false);
end);
u2.char:GetAttributeChangedSignal("Hiding"):Connect(function()
if u2.char:GetAttribute("Hiding") == true then
for v88 = 1, 100000 do
task.wait(0.1);
if u2.char:GetAttribute("Hiding") == false then
u2.ax_t = u2.ax_t + u2.camlockedoffset[1] % 360;
u2.ay_t = math.clamp(u2.ay_t + u2.camlockedoffset[2], -65, 65);
if math.abs(u2.ax_t) > 180 then
u2.ax_t = u2.ax_t - 360;
u2.ax_t = u2.ax_t;
end;
if math.abs(u2.ax) > 180 then
u2.ax = u2.ax - 360;
u2.ax = u2.ax;
end;
u2.camShaker:ShakeOnce(8, 1, 0, 1, Vector3.new(0, 0, 0));
u2.camlock = nil;
--game:GetService("ReplicatedStorage").Bricks.CamLock:FireServer();
v1.HideVignette.Visible = false;
return;
end;
end;
end;
end);
l__Bricks__1:WaitForChild("CamLock").OnClientEvent:Connect(function(p23)
local v89, v90, v91 = CFrame.new(Vector3.new(0, 0, 0), p23):ToOrientation();
if math.abs(u2.ax - math.deg(v90)) > 180 then
u2.ax_t = u2.ax_t - 360;
u2.ax = u2.ax_t;
end;
u2.camlock = {
y = math.deg(v89),
x = math.deg(v90),
z = 0,
last = tick() + 1,
pos = u2.char.PrimaryPart.Position
};
u2.camlockHead = false;
v1.HideVignette.ImageTransparency = 1;
v1.HideVignette.Visible = true;
l__TweenService__6:Create(v1.HideVignette, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), {
ImageTransparency = 0
}):Play();
u2.camShaker:ShakeOnce(12, 1, 0, 1, Vector3.new(0, 0, 0));
end);
l__Bricks__1:WaitForChild("CamLockHead").OnClientEvent:Connect(function(p24)
local v92, v93, v94 = CFrame.new(Vector3.new(0, 0, 0), p24):ToOrientation();
if math.abs(u2.ax - math.deg(v93)) > 180 then
u2.ax_t = u2.ax_t - 360;
end;
u2.camlockHead = true;
u2.camlock = {
y = math.deg(v92),
x = math.deg(v93),
z = 0,
last = tick() + 1,
pos = u2.char.PrimaryPart.Position
};
end);
l__Bricks__1:WaitForChild("CamShake").OnClientEvent:Connect(function(p25, p26, p27, p28, p29, p30)
u2.camShaker:ShakeOnce(p25, p26, p27, p28, p29, p30);
end);
l__Bricks__1:WaitForChild("ChangeModuleVariable").OnClientEvent:Connect(function(p31, p32)
u2[p31] = p32;
end);
local u7 = "HideMonster";
l__Bricks__1:WaitForChild("HideMonster").OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild("HideMonster"))(u2, ...);
end);
u7 = "SpiderJumpscare";
u7 = "SpiderJumpscare";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild(u7))(u2, ...);
end);
l__Bricks__1:WaitForChild("AchievementUnlock").OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild("AchievementUnlock"))(u2, ...);
end);
l__Bricks__1:WaitForChild("Screech").OnClientEvent:Connect(function(...)
require(script:WaitForChild("Modules"):WaitForChild("Screech"))(u2, ...);
end);
function shakerel(p33, p34, p35, p36, p37, p38, p39)
local v99 = nil;
v99 = 0;
for v100 = 1, 2 do
local v101 = 100;
if v100 == 2 then
v101 = 30;
end;
v99 = v99 + math.abs(math.clamp((u2.cam.CFrame.Position - p33).Magnitude, 0, v101) - v101) / v101;
end;
u2.camShaker:ShakeOnce(p34 * v99 * 0.8, p35, p36, p37, p38, p39);
end;
u7 = "CamShakeRelative";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(shakerel);
u7 = "LightningStrike";
l__Bricks__1:WaitForChild(u7).OnClientEvent:Connect(v7);
|
--Both |
local Loudness = .75 --volume of the boost supplier (not exact volume so you kinda have to experiment with it also)
script:WaitForChild("Whistle")
script:WaitForChild("Whine")
script:WaitForChild("BOV")
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
end
end)
handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","Whine",car.DriveSeat,script.Whine.SoundId,0,script.Whine.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
handler:FireServer("playSound","Whine")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("Whine")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = 0
if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Super" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end
while wait() do
local psi = (((script.Parent.Values.Boost.Value)/(_Tune.Boost*_TCount))*2)
local WP,WV,BP,BV,HP,HV = 0
BOVact = math.floor(psi*20)
if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Double" then
WP = (psi)
WV = (psi/4)*Loudness
BP = (1-(-psi/20))*BOV_Pitch
BV = (((-0.5+((psi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))
if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
elseif _Tune.Aspiration == "Super" then
psi = psi/2
HP = psi*Whine_Pitch
HV = (psi/4)*Loudness
end
if FE then
handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
handler:FireServer("updateSound","Whine",script.Whine.SoundId,HP,HV)
handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
else
car.DriveSeat.Whistle.Pitch = WP
car.DriveSeat.Whistle.Volume = WV
car.DriveSeat.Whine.Pitch = HP
car.DriveSeat.Whine.Volume = HV
car.DriveSeat.BOV.Pitch = BP
car.DriveSeat.BOV.Volume = BV
end
if (tick()-ticc) >= 0.1 then
BOVact2 = math.floor(psi*20)
ticc = tick()
end
end
|
-- Fill this with any specific player you want to be able to seek |
local playerIDs = {}
|
--tone hz |
elseif sv.Value==4 then
while s.Pitch<0.9 do
s.Pitch=s.Pitch+0.010
s:Play()
if s.Pitch>0.9 then
s.Pitch=0.9
end
wait(-9)
end
while true do
for x = 1, 500 do
s:play()
wait(-9)
end
wait()
end
|
-- script |
RunService.RenderStepped:Connect(function()
local currentTime = tick()
if humanoid.MoveDirection.Magnitude > 0 then -- we are walking
local bobbleX = math.cos(currentTime * 7) * .10
local bobbleY = math.abs(math.sin(currentTime * 7)) * .20
local bobble = Vector3.new(bobbleX, bobbleY, 0)
humanoid.CameraOffset = humanoid.CameraOffset:lerp(bobble, .25)
else -- we are not walking
local t = tick()
local x = math.cos(t * speed) * intensity
local y = math.sin(t * speed) * intensity
local cf = CFrame.new(Vector3.new(x, y, 0), Vector3.new(x*0.95, y*0.95, -10)) + camera.CFrame.Position
camera.CFrame = camera.CFrame:Lerp(cf * camera.CFrame.Rotation, smoothness)
end
end)
|
-- Children: |
function Replica:ListenToChildAdded(listener) --> [ScriptConnection] listener(replica)
if type(listener) ~= "function" then
error("[ReplicaController]: Only a function can be set as listener")
end
if Replicas[self.Id] == nil then
return -- Replica is destroyed - listener will not be connected
end
-- Getting listener table for replica class:
local listeners = ChildListeners[self.Id]
if listeners == nil then
listeners = {}
ChildListeners[self.Id] = listeners
end
table.insert(listeners, listener)
-- ScriptConnection which allows the disconnection of the listener:
return Madwork.NewArrayScriptConnection(listeners, listener)
end
function Replica:FindFirstChildOfClass(replica_class) --> [Replica] or nil
for _, child in ipairs(self.Children) do
if child.Class == replica_class then
return child
end
end
return nil
end
|
--[=[
Extracts the locale from the folder, or a locale and table.
@param tableName string -- Used for source
@param first Instance | string
@param second table?
@return LocalizationTable
]=] |
function JsonToLocalizationTable.toLocalizationTable(tableName, first, second)
assert(type(tableName) == "string", "Bad tableName")
if typeof(first) == "Instance" then
local result = JsonToLocalizationTable.loadFolder(tableName, first)
-- result.Name = ("JSONTable_%s"):format(first.Name)
return result
elseif type(first) == "string" and type(second) == "table" then
local result = JsonToLocalizationTable.loadTable(tableName, first, second)
return result
else
error("Bad args")
end
end
|
--Right lean Divider |
ZR15RightLegRightLeanD = 1
XR15RightLegRightLeanD = 1
YR15RightLegRightLeanD = 1
R15RightKneeRightLeanD = 1
ZR15RightArmRightLeanD = 1
XR15RightArmRightLeanD = 1
YR15RightArmRightLeanD = 1
R15RightElbowRightLeanD = 1
ZR15LeftLegRightLeanD = 1
XR15LeftLegRightLeanD = 1
YR15LeftLegRightLeanD = 1
R15LeftKneeRightLeanD = 1
ZR15LeftArmRightLeanD = 1
XR15LeftArmRightLeanD = 1
YR15LeftArmRightLeanD = 1
R15LeftElbowRightLeanD = 1
ZR15LowerTorsoRightLeanD = 1
XR15LowerTorsoRightLeanD = 1
YR15LowerTorsoRightLeanD = 1
ZR15UpperTorsoRightLeanD = 1
|
--IT WONT GO AWAY!!!!! |
if string.sub(msg,1,5) == "trip/" then
local player = findplayer(string.sub(msg,6),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
torso.CFrame = CFrame.new(torso.Position.x,torso.Position.y,torso.Position.z,0, 0, 1, 0, -1, 0, 1, 0, 0)--math.random(),math.random(),math.random(),math.random(),math.random(),math.random(),math.random(),math.random(),math.random()) -- i like the people being upside down better.
end end end end end
|
--[=[
@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.
```lua
local function GetSomething(player: Player)
return "Something"
end
serverComm:BindFunction("GetSomething", GetSomething)
```
]=] |
function ServerComm:BindFunction(name: string, fn: Types.FnBind, inboundMiddleware: Types.ServerMiddleware?, outboundMiddleware: Types.ServerMiddleware?): RemoteFunction
return Comm.BindFunction(self._instancesFolder, name, fn, inboundMiddleware, outboundMiddleware)
end
|
--> References |
local Gui = script.Parent
local Frame = Gui.Frame
|
-----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------- |
script.Parent.Treat.Frame.Bandage.MouseButton1Down:connect(function()
script.Parent.Treat.Frame.BandFrame.Visible = true
script.Parent.Treat.Frame.MedFrame.Visible = false
script.Parent.Treat.Frame.NeedFrame.Visible = false
script.Parent.Treat.Frame.OtherFrame.Visible = false
end)
script.Parent.Treat.Frame.Medicine.MouseButton1Down:connect(function()
script.Parent.Treat.Frame.BandFrame.Visible = false
script.Parent.Treat.Frame.MedFrame.Visible = true
script.Parent.Treat.Frame.NeedFrame.Visible = false
script.Parent.Treat.Frame.OtherFrame.Visible = false
end)
script.Parent.Treat.Frame.Needle.MouseButton1Down:connect(function()
script.Parent.Treat.Frame.BandFrame.Visible = false
script.Parent.Treat.Frame.MedFrame.Visible = false
script.Parent.Treat.Frame.NeedFrame.Visible = true
script.Parent.Treat.Frame.OtherFrame.Visible = false
end)
script.Parent.Treat.Frame.Other.MouseButton1Down:connect(function()
script.Parent.Treat.Frame.BandFrame.Visible = false
script.Parent.Treat.Frame.MedFrame.Visible = false
script.Parent.Treat.Frame.NeedFrame.Visible = false
script.Parent.Treat.Frame.OtherFrame.Visible = true
end) |
--Don't worry about the rest of the code, except for line 25. |
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "Skins"
local Cash = Instance.new("StringValue",leader)
Cash.Name = stat
Cash.Value = ds:GetAsync(player.UserId) or startamount
ds:SetAsync(player.UserId, Cash.Value)
Cash.Changed:connect(function()
ds:SetAsync(player.UserId, Cash.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
wait(.1)
ds:SetAsync(player.UserId, player.Skins.Equipped.Value) --Change "Points" to the name of your leaderstat.
end)
|
--------RIGHT DOOR -------- |
game.Workspace.doorright.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l41.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l52.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l71.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorright.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l72.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l51.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l31.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l42.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.defaultlights.Value)
game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.Lighting.flashcurrent.Value = "12" |
------------------------------------------------------------------------------------------------------------------------------------------------------
-- Events
------------------------------------------------------------------------------------------------------------------------------------------------------ |
UserInputService.InputBegan:connect(function(Input)
if Input.KeyCode == Enum.KeyCode.S then
CurrentPath = nil
MouseHolding = false
if PathingThread then coroutine.yield(PathingThread) end
LocalCharacter:WaitForChild('Humanoid'):MoveTo(LocalCharacter.HumanoidRootPart.Position)
end
end)
LocalMouse.Button2Down:connect(function()
MouseHolding = true
repeat --wait(0.05)
if PathingThread then coroutine.yield(PathingThread) end
PathingThread = coroutine.resume(coroutine.create(function()
CreatePath()
end))
print(1)
wait(0.05)
until MouseHolding == false or CurrentPath == nil
end)
LocalMouse.Button2Up:connect(function()
MouseHolding = false
end)
|
--I advise to keep true if this tool has a "FlyScript" created after 20/7/2011 ( see child of this script) |
local Vert_keep = true-- set to false if U DONT want the tool to Go only Up if u press/hold the U/J key |
--// Ammo Settings |
Ammo = 0;
StoredAmmo = 0;
MagCount = 0; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
ExplosiveAmmo = math.huge;
|
-- Initialize the tool |
local MoveTool = {
Name = 'Move Tool';
Color = BrickColor.new 'Deep orange';
-- Default options
Increment = 1;
Axes = 'Global';
-- Selection state
InitialState = nil;
InitialFocusCFrame = nil;
InitialExtentsSize = nil;
InitialExtentsCFrame = nil;
-- Snapping state
SnappedPoint = nil;
PointSnapped = Signal.new();
-- Resource maid
Maid = Maid.new();
-- Signals
DragChanged = Signal.new();
AxesChanged = Signal.new();
}
MoveTool.ManualText = [[<font face="GothamBlack" size="16">Move Tool 🛠</font>
Allows you to move parts.<font size="12"><br /></font>
<font size="12" color="rgb(150, 150, 150)"><b>Axes</b></font>
This option lets you choose in which direction to move each part.<font size="6"><br /></font>
<font color="rgb(150, 150, 150)">•</font> <b>GLOBAL</b> <font color="rgb(150, 150, 150)">—</font> Relative to the <b>world</b>
<font color="rgb(150, 150, 150)">•</font> <b>LOCAL</b> <font color="rgb(150, 150, 150)">—</font> Relative to each <b>individual part</b>
<font color="rgb(150, 150, 150)">•</font> <b>LAST</b> <font color="rgb(150, 150, 150)">—</font> Relative to the <b>last part clicked</b><font size="6"><br /></font>
<b>TIP:</b> Click on any part to focus the handles on it.<font size="6"><br /></font>
<b>TIP: </b>Hit the <b>Enter</b> key to switch between Axes modes quickly.<font size="12"><br /></font>
<font size="12" color="rgb(150, 150, 150)"><b>Increment</b></font>
Lets you choose how many studs to move parts by.<font size="6"><br /></font>
<b>TIP: </b>Hit the – key to quickly type increments.<font size="6"><br /></font>
<b>TIP: </b>Use your number pad to move exactly by the current increment. Holding <b>Shift</b> reverses the increment.<font size="4"><br /></font>
<font color="rgb(150, 150, 150)">•</font> 8 & 2 — up & down
<font color="rgb(150, 150, 150)">•</font> 1 & 9 — back & forth
<font color="rgb(150, 150, 150)">•</font> 4 & 6 — left & right<font size="12"><br /></font>
<font size="12" color="rgb(150, 150, 150)"><b>Snapping</b></font>
You can place parts perfectly together by holding the <b><i>R</i></b> key, and dragging parts by their <b>snap points</b>.<font size="12"><br /></font>
<font size="12" color="rgb(150, 150, 150)"><b>Alignment</b></font>
Press <b><i>T</i></b> while dragging to <b>align</b> the bottom surface of your base part to the current target surface.
]]
|
--Runtime Loop
-- ~60 c/s |
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--Power
Engine()
--Update External Values
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Boost.Value = (_Boost/2)*_TPsi
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.HpNatural.Value = _NH
script.Parent.Values.HpBoosted.Value = _BH*(_Boost/2)
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TqNatural.Value = _NT
script.Parent.Values.TqBoosted.Value = _BT*(_Boost/2)
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot*_GThrotShift
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.TCSAmt.Value = 1-_TCSAmt
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
|
--// Init |
return service.NewProxy({
__call = function(tab, data)
local mutex = service.RunService:FindFirstChild("__Adonis_MODULE_MUTEX")
if mutex then
warn("\n-----------------------------------------------"
.."\nAdonis server-side is already running! Aborting..."
.."\n-----------------------------------------------")
script:Destroy()
return "FAILED"
else
mutex = service.New("StringValue", {Name = "__Adonis_MODULE_MUTEX", Value = "Running"})
local mutexBackup = mutex:Clone()
local function makePersistent(m)
local connection1, connection2 = nil, nil
connection1 = m:GetPropertyChangedSignal("Parent"):Connect(function()
if not m or m.Parent ~= service.RunService then
connection1:Disconnect()
connection2:Disconnect()
warn("Adonis module mutex removed; Regenerating...")
makePersistent(mutexBackup)
mutexBackup.Parent = service.RunService
mutexBackup = mutexBackup:Clone()
end
end)
connection2 = m:GetPropertyChangedSignal("Name"):Connect(function()
if m and m.Name ~= "__Adonis_MODULE_MUTEX" then
warn("Adonis module mutex renamed; Refreshing...")
m.Name = "__Adonis_MODULE_MUTEX"
end
end)
end
makePersistent(mutex)
mutex.Parent = service.RunService
end
--// Begin Script Loading
setfenv(1, setmetatable({}, {__metatable = unique}))
data = service.Wrap(data or {})
if not data or not data.Loader then
warn("WARNING: MainModule loaded without using the loader;")
end
--// Server Variables
local setTab = require(server.Deps.DefaultSettings)
server.Defaults = setTab
server.Settings = data.Settings or setTab.Settings or {}
-- For some reason line 540 errors because CloneTable is nil
local function CloneTable(tab, recursive)
local clone = table.clone(tab)
if recursive then
for i,v in pairs(clone) do
if type(v) == "table" then
clone[i] = CloneTable(v, recursive)
end
end
end
return clone
end
server.OriginalSettings = CloneTable(server.Settings, true)
server.Descriptions = data.Descriptions or setTab.Descriptions or {}
server.Messages = data.Messages or setTab.Settings.Messages or {}
server.Order = data.Order or setTab.Order or {}
server.Data = data or {}
server.Model = data.Model or service.New("Model")
server.ModelParent = data.ModelParent or service.ServerScriptService;
server.Dropper = data.Dropper or service.New("Script")
server.Loader = data.Loader or service.New("Script")
server.Runner = data.Runner or service.New("Script")
server.LoadModule = LoadModule
server.LoadPackage = LoadPackage
server.ServiceSpecific = ServiceSpecific
server.Shared = Folder.Shared
server.ServerPlugins = data.ServerPlugins
server.ClientPlugins = data.ClientPlugins
server.Client = Folder.Parent.Client
locals.Settings = server.Settings
locals.CodeName = server.CodeName
--// THIS NEEDS TO BE DONE **BEFORE** ANY EVENTS ARE CONNECTED
if server.Settings.HideScript and data.Model then
data.Model.Parent = nil
script:Destroy()
end
--// Copy client themes, plugins, and shared modules to the client folder
local packagesToRunWithPlugins = {};
local shared = service.New("Folder", {
Name = "Shared";
Parent = server.Client;
})
for index, module in ipairs(Folder.Shared:GetChildren()) do
module:Clone().Parent = shared;
end
for index,plugin in pairs(data.ClientPlugins or {}) do
plugin:Clone().Parent = server.Client.Plugins;
end
for index,theme in pairs(data.Themes or {}) do
theme:Clone().Parent = server.Client.UI;
end
for index,pkg in pairs(data.Packages or {}) do
LoadPackage(pkg, Folder.Parent, false);
end
for setting,value in pairs(server.Defaults.Settings) do
if server.Settings[setting] == nil then
server.Settings[setting] = value
end
end
for desc,value in pairs(server.Defaults.Descriptions) do
if server.Descriptions[desc] == nil then
server.Descriptions[desc] = value
end
end
--// Bind cleanup
service.DataModel:BindToClose(CleanUp)
--server.CleanUp = CleanUp;
--// Require some dependencies
server.Threading = require(server.Deps.ThreadHandler)
server.Changelog = require(server.Shared.Changelog)
server.Credits = require(server.Shared.Credits)
do
local MaterialIcons = require(server.Shared.MatIcons)
server.MatIcons = setmetatable({}, {
__index = function(self, ind)
local materialIcon = MaterialIcons[ind]
if materialIcon then
self[ind] = string.format("rbxassetid://%d", materialIcon)
return self[ind]
end
end,
__metatable = "Adonis"
})
end
--// Load services
for ind, serv in ipairs(ServicesWeUse) do local temp = service[serv] end
--// Load core modules
for ind,load in ipairs(LoadingOrder) do
local CoreModule = Folder.Core:FindFirstChild(load)
if CoreModule then
LoadModule(CoreModule, true, nil, nil, true) --noenv, CoreModule
end
end
--// Server Specific Service Functions
ServiceSpecific.GetPlayers = server.Functions.GetPlayers
--// Initialize Cores
local runLast = {}
local runAfterInit = {}
local runAfterPlugins = {}
for i,name in ipairs(LoadingOrder) do
local core = server[name]
if core then
if type(core) == "table" or (type(core) == "userdata" and getmetatable(core) == "ReadOnly_Table") then
if core.RunLast then
table.insert(runLast, core.RunLast);
core.RunLast = nil;
end
if core.RunAfterInit then
table.insert(runAfterInit, core.RunAfterInit);
core.RunAfterInit = nil;
end
if core.RunAfterPlugins then
table.insert(runAfterPlugins, core.RunAfterPlugins);
core.RunAfterPlugins = nil;
end
if core.Init then
core.Init(data);
core.Init = nil;
end
end
end
end
--// Variables that rely on core modules being initialized
server.Logs.Errors = ErrorLogs
--// Load any afterinit functions from modules (init steps that require other modules to have finished loading)
for i,f in pairs(runAfterInit) do
f(data);
end
--// Load Plugins
for index,plugin in ipairs(server.PluginsFolder:GetChildren()) do
LoadModule(plugin, false, {script = plugin}, true); --noenv
end
for index,plugin in pairs(data.ServerPlugins or {}) do
LoadModule(plugin, false, {script = plugin});
end
--// We need to do some stuff *after* plugins are loaded (in case we need to be able to account for stuff they may have changed before doing something, such as determining the max length of remote commands)
for i,f in pairs(runAfterPlugins) do
f(data);
end
--// Below can be used to determine when all modules and plugins have finished loading; service.Events.AllModulesLoaded:Connect(function() doSomething end)
server.AllModulesLoaded = true;
service.Events.AllModulesLoaded:Fire(os.time());
--// Queue handler
--service.StartLoop("QueueHandler","Heartbeat",service.ProcessQueue)
--// Stuff to run after absolutely everything else has had a chance to run and initialize and all that
for i,f in pairs(runLast) do
f(data);
end
if data.Loader then
warn("Loading Complete; Required by "..tostring(data.Loader:GetFullName()))
else
warn("Loading Complete; No loader location provided")
end
if server.Logs then
server.Logs.AddLog(server.Logs.Script, {
Text = "Finished Loading";
Desc = "Adonis finished loading";
})
else
warn("SERVER.LOGS TABLE IS MISSING. THIS SHOULDN'T HAPPEN! SOMETHING WENT WRONG WHILE LOADING CORE MODULES(?)");
end
service.Events.ServerInitialized:Fire();
return "SUCCESS"
end;
__tostring = function()
return "Adonis"
end;
__metatable = "Adonis";
})
|
------------------------- |
function onClicked()
R.Function1.Disabled = false
R.loop.Disabled = true
R.BrickColor = BrickColor.new("CGA brown")
R.Function2.Disabled = true
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[[**
ensures Roblox ColorSequenceKeypoint type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]] |
t.ColorSequenceKeypoint = primitive("ColorSequenceKeypoint")
|
-- declarations |
local Figure = script.Parent
local Head = Figure:WaitForChild("Head")
local Humanoid;
for _,Child in pairs(Figure:GetChildren())do
if Child and Child.ClassName=="Humanoid"then
Humanoid=Child;
end;
end;
local regening = false
|
--Light off |
src.left.Value.Value = 0
light.Value = false
else
src.left.Value.Value = 1
light.Value = true
return
end
end
end)
src.Parent.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
src:Stop()
script.Parent:Destroy()
end
end)
|
-- Libraries |
Security = require(Tool.Core.Security);
RegionModule = require(Tool.Libraries.Region);
Support = require(Tool.Libraries.SupportLibrary);
Serialization = require(Tool.Libraries.SerializationV3);
|
--local HighLight = char:WaitForChild("PLayerHighLight") |
function deathCheck(health)
if health <= 0 and dead == false then
dead = true
char.HumanoidRootPart.Anchored = true
deathAnim:Play()
wait(2.5)
hum.BreakJointsOnDeath = true
wait(0.5)
char.HumanoidRootPart.Anchored = false
script:Destroy()
end
end
hum.HealthChanged:Connect(deathCheck)
|
-- MUSIC/SOUNDS |
if Configuration.PrintingEnabled == false then
else
print("DOORS 👁️ Sound Pack: Installing Musics/Ambiences Sounds...")
end
if Configuration.SoundsInSoundService == true then
Folder = game.SoundService
end
if Configuration.MusicLobbyEnabled == false then
Folder.Music.Lobby:Destroy()
end
if Configuration.GuidingLightMusicEnabled == false then
Folder.Music["Guiding Light"]:Destroy()
end
if Configuration.EndingMusicEnabled == false then
Folder.Music.Ending:Destroy()
end
if Configuration.ElevatorJamMusicEnabled == false then
Folder.Music["Elevator Jam"]:Destroy()
end
if Configuration.UnhingedMusicEnabled == false then
Folder.Music.Unhinged:Destroy()
end
if Configuration.AmbienceSoundEnabled == false then
Folder.Ambience.Ambience:Destroy()
end
|
--[[Chassis Assembly]] |
--Create Steering Axle
local arm=Instance.new("Part",v)
arm.Name="Arm"
arm.Anchored=true
arm.CanCollide=false
arm.FormFactor=Enum.FormFactor.Custom
arm.Size=Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
arm.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,100,100)
arm.TopSurface=Enum.SurfaceType.Smooth
arm.BottomSurface=Enum.SurfaceType.Smooth
arm.Transparency=1
--Create Wheel Spindle
local base=arm:Clone()
base.Parent=v
base.Name="Base"
base.CFrame=base.CFrame*CFrame.new(0,_Tune.AxleSize,0)
base.BottomSurface=Enum.SurfaceType.Hinge
--Create Steering Anchor
local axle=arm:Clone()
axle.Parent=v
axle.Name="Axle"
axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle.BackSurface=Enum.SurfaceType.Hinge
--Create Powered Axle (LuaInt)
local axlep=arm:Clone()
axlep.Parent=v
axlep.Name='AxleP'
axlep.CFrame=v.CFrame
MakeWeld(axlep,axle)
if v.Name=="F" or v.Name=="R" then
local axle2=arm:Clone()
axle2.Parent=v
axle2.Name="Axle"
axle2.CFrame=CFrame.new(v.Position+((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle2.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle2.BackSurface=Enum.SurfaceType.Hinge
MakeWeld(arm,axle2)
end
--Create Suspension
if _Tune.SusEnabled then
local sa=arm:Clone()
sa.Parent=v
sa.Name="#SA"
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
local aOff = _Tune.FAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-fDistX,-fDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
else
local aOff = _Tune.RAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-rDistX,-rDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
end
local sb=sa:Clone()
sb.Parent=v
sb.Name="#SB"
sb.CFrame=sa.CFrame*CFrame.new(0,0,_Tune.AxleSize)
sb.FrontSurface=Enum.SurfaceType.Hinge
local g = Instance.new("BodyGyro",sb)
g.Name = "Stabilizer"
g.MaxTorque = Vector3.new(0,0,1)
g.P = 0
local sf1 = Instance.new("Attachment",sa)
sf1.Name = "SAtt"
local sf2 = sf1:Clone()
sf2.Parent = sb
--(Avxnturador) adds spring offset
if v.Name == "FL" or v.Name == "FR" or v.Name == "F" then
local aOff = _Tune.FSpringOffset
if v.Name == "FL" then
sf1.Position = Vector3.new(fDistX-fSLX+aOff[1],-fDistY+fSLY+aOff[2],_Tune.AxleSize/2+aOff[3])
sf2.Position = Vector3.new(fDistX+aOff[1],-fDistY+aOff[2],-_Tune.AxleSize/2+aOff[3])
else
sf1.Position = Vector3.new(fDistX-fSLX+aOff[1],-fDistY+fSLY+aOff[2],_Tune.AxleSize/2-aOff[3])
sf2.Position = Vector3.new(fDistX+aOff[1],-fDistY+aOff[2],-_Tune.AxleSize/2-aOff[3])
end
elseif v.Name == "RL" or v.Name=="RR" or v.Name == "R" then
local aOff = _Tune.RSpringOffset
if v.Name == "RL" then
sf1.Position = Vector3.new(rDistX-rSLX+aOff[1],-rDistY+rSLY+aOff[2],_Tune.AxleSize/2+aOff[3])
sf2.Position = Vector3.new(rDistX+aOff[1],-rDistY+aOff[2],-_Tune.AxleSize/2+aOff[3])
else
sf1.Position = Vector3.new(rDistX-rSLX+aOff[1],-rDistY+rSLY+aOff[2],_Tune.AxleSize/2-aOff[3])
sf2.Position = Vector3.new(rDistX+aOff[1],-rDistY+aOff[2],-_Tune.AxleSize/2-aOff[3])
end
end
sb:MakeJoints()
--(LuaInt) there was axle:makejoints here I believe, but the new powered axle manually welds itself so I ditched it
local sp = Instance.new("SpringConstraint",v)
sp.Name = "Spring"
sp.Attachment0 = sf1
sp.Attachment1 = sf2
sp.LimitsEnabled = true
sp.Visible=_Tune.SusVisible
sp.Radius=_Tune.SusRadius
sp.Thickness=_Tune.SusThickness
sp.Color=BrickColor.new(_Tune.SusColor)
sp.Coils=_Tune.SusCoilCount
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
g.D = _Tune.FAntiRoll
sp.Damping = _Tune.FSusDamping
sp.Stiffness = _Tune.FSusStiffness
sp.FreeLength = _Tune.FSusLength+_Tune.FPreCompress
sp.MaxLength = _Tune.FSusLength+_Tune.FExtensionLim
sp.MinLength = _Tune.FSusLength-_Tune.FCompressLim
else
g.D = _Tune.RAntiRoll
sp.Damping = _Tune.RSusDamping
sp.Stiffness = _Tune.RSusStiffness
sp.FreeLength = _Tune.RSusLength+_Tune.RPreCompress
sp.MaxLength = _Tune.RSusLength+_Tune.RExtensionLim
sp.MinLength = _Tune.RSusLength-_Tune.RCompressLim
end
MakeWeld(car.DriveSeat,sa)
MakeWeld(sb,base)
else
MakeWeld(car.DriveSeat,base)
end
--Lock Rear Steering Axle
if _Tune.FWSteer=='Static' or _Tune.FWSteer=='Speed' or _Tune.FWSteer=='Both' then
else
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
MakeWeld(base,axle)
end
end
--Weld Assembly
if v.Parent.Name == "RL" or v.Parent.Name == "RR" or v.Name=="R" then
MakeWeld(car.DriveSeat,arm)
end
MakeWeld(arm,axle)
arm:MakeJoints()
--Weld Miscelaneous Parts
if v:FindFirstChild("SuspensionFixed")~=nil then
ModelWeld(v.SuspensionFixed,car.DriveSeat)
end
if v:FindFirstChild("WheelFixed")~=nil then
ModelWeld(v.WheelFixed,axle)
end
if v:FindFirstChild("Fixed")~=nil then
ModelWeld(v.Fixed,arm)
end
--Weld Wheel Parts
if v:FindFirstChild("Parts")~=nil then
ModelWeld(v.Parts,v)
end
--Add Steering Gyro
if v:FindFirstChild("Steer") then
v:FindFirstChild("Steer"):Destroy()
end
if v.Name=='FR' or v.Name=='FL' or v.Name=='F' then
local steer=Instance.new("BodyGyro",arm)
steer.Name="Steer"
steer.P=_Tune.SteerP
steer.D=_Tune.SteerD
steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
else
if (_Tune.FWSteer=='Static' or _Tune.FWSteer=='Speed' or _Tune.FWSteer=='Both') then
local steer=Instance.new("BodyGyro",arm)
steer.Name="Steer"
if _Tune.RSteerP~=nil and _Tune.RSteerD~=nil and _Tune.RSteerMaxTorque~=nil then
steer.P=_Tune.RSteerP
steer.D=_Tune.RSteerD
steer.MaxTorque=Vector3.new(0,_Tune.RSteerMaxTorque,0)
else
steer.P=_Tune.SteerP
steer.D=_Tune.SteerD
steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
end
steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
end
end
--Add Stabilization Gyro
local gyro=Instance.new("BodyGyro",v)
gyro.Name="Stabilizer"
gyro.MaxTorque=Vector3.new(1,0,1)
gyro.P=0
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
gyro.D=_Tune.FGyroDamp
else
gyro.D=_Tune.RGyroDamp
end
--Add Motors (LuaInt)
local AV=Instance.new("HingeConstraint",v)
AV.ActuatorType='Motor'
AV.Attachment0=Instance.new("Attachment",v.AxleP)
v.AxleP.Attachment.Name='AA'
AV.Attachment1=Instance.new("Attachment",v)
v.Attachment.Name='AB'
AV.Name="#AV"
AV.AngularVelocity=0
AV.MotorMaxTorque=0
local BV=Instance.new("HingeConstraint",v)
BV.ActuatorType='Motor'
BV.Attachment0=Instance.new("Attachment",v.AxleP)
v.AxleP.Attachment.Name='BA'
BV.Attachment1=Instance.new("Attachment",v)
v.Attachment.Name='BB'
BV.Name="#BV"
BV.AngularVelocity=0
BV.MotorMaxTorque=_Tune.PBrakeForce
for _,c in pairs(v:GetDescendants()) do
if c.ClassName=='Attachment' and c.Name~='SAtt' then
if c.Parent.Name=='FL' or c.Parent.Name=='RL' or c.Parent.Parent.Name=='FL' or c.Parent.Parent.Name=='RL' then c.Orientation=Vector3.new(0,0,90) end
if c.Parent.Name=='F' or c.Parent.Name=='R' or c.Parent.Parent.Name=='F' or c.Parent.Parent.Name=='R'
or c.Parent.Name=='FR' or c.Parent.Name=='RR' or c.Parent.Parent.Name=='FR' or c.Parent.Parent.Name=='RR' then c.Orientation=Vector3.new(180,0,90) end
end
end
end
|
--------SETTINGS-------- |
local ITEM_NAME = "Pistol"
local ITEM_PRICE = 10
local CURRENCY_NAME = "Cash" |
--Check if new player is admin |
for v,numberObject in pairs(Administrators:GetChildren()) do
if numberObject.Value == player.userId then
wait() |
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
game:GetService("RunService").Heartbeat:Wait();
end;
local l__StarterPlayer__2 = v1.StarterPlayer;
local l__CollectionService__3 = v1.CollectionService;
local l__Hoverboards__1 = v1.Directory.Hoverboards;
local u2 = nil;
function Create(p1)
local l____HOVERBOARD__4 = v1.PlayerModule.Get("Character", p1):FindFirstChild("__HOVERBOARD");
if l____HOVERBOARD__4 then
l____HOVERBOARD__4:Destroy();
end;
local v5 = v1.StatService.Get(p1);
if v5 then
if not v5.Hoverboard then
return;
end;
else
return;
end;
local v6 = l__Hoverboards__1[v5.Hoverboard];
if not v6 then
return;
end;
local v7 = v1.PlayerModule.Get("Humanoid");
local v8 = v1.PlayerModule.Get("RootPart");
if v7 then
if v8 then
u2 = v7.HipHeight;
v8.CFrame = v8.CFrame + Vector3.new(0, v7.HipHeight - v6.HipHeight, 0);
v7.HipHeight = v6.HipHeight;
v7.AutoJumpEnabled = false;
end;
end;
end;
local l__LocalPlayer__3 = v1.LocalPlayer;
function Remove(p2)
local v9 = v1.PlayerModule.Get("Humanoid");
local v10 = v1.PlayerModule.Get("RootPart");
if v9 then
if v10 then
if p2 == l__LocalPlayer__3 then
v10.Velocity = Vector3.new();
end;
if u2 then
v9.HipHeight = u2;
u2 = nil;
end;
v9.AutoJumpEnabled = true;
end;
end;
end;
function UpdatePlayer(p3, p4)
local v11 = v1.PlayerModule.Get("Character", p3);
if p4 then
if not v11:FindFirstChild("__HOVERBOARD") then
return Create(p3);
end;
end;
if not p4 then
if v11:FindFirstChild("__HOVERBOARD") then
Remove(p3);
end;
end;
end;
function Toggle()
v1.Variables.UsingHoverboard = not v1.Variables.UsingHoverboard;
if not v1.Variables.UsingHoverboard then
Remove(l__LocalPlayer__3);
else
Create(l__LocalPlayer__3);
end;
v1.Network.Fire("Update Hoverboard State", v1.Variables.UsingHoverboard);
end;
l__CollectionService__3:GetInstanceAddedSignal("UsingHoverboard"):Connect(function(p5)
UpdatePlayer(p5, true);
end);
l__CollectionService__3:GetInstanceRemovedSignal("UsingHoverboard"):Connect(function(p6)
UpdatePlayer(p6, false);
end);
task.defer(function()
while v1.Variables.LoadingWorld do
v1.Heartbeat();
end;
for v12, v13 in ipairs((l__CollectionService__3:GetTagged("UsingHoverboard"))) do
coroutine.wrap(UpdatePlayer)(v13, true);
end;
end);
v1.Signal.Fired("Stat Changed"):Connect(function(p7)
end);
v1.Signal.Fired("Changed Platform"):Connect(function()
end);
v1.Signal.Fired("World Changed"):Connect(function()
if v1.Variables.UsingHoverboard then
Toggle();
end;
end);
|
-- |
local GJK = require(script:WaitForChild("GJK"))
local Supports = require(script:WaitForChild("Supports"))
local Vertices = require(script:WaitForChild("Vertices"))
|
--[[
Higher order component that lets the wrapped component consume the EmoteContext.
]] |
local function withEmoteContext(component)
return function(props)
if props.emoteContext then
warn("Child component has a prop named `emoteContext` and will be overriden by EmoteContext.")
end
return Roact.createElement(Context.Consumer, {
render = function(emoteContext)
local mergedProps = Cryo.Dictionary.join({ emoteContext = emoteContext }, props)
return Roact.createElement(component, mergedProps)
end,
})
end
end
local EmoteContext = {
Consumer = Context.Consumer,
Provider = withConfiguration(EmoteContextProvider),
withEmoteContext = withEmoteContext,
}
return EmoteContext
|
-- declarations |
local sGettingUp = newSound("rbxasset://sounds/action_get_up.mp3")
local sDied = newSound("rbxasset://sounds/uuhhh.mp3")
local sFreeFalling = newSound("rbxasset://sounds/action_falling.mp3")
local sJumping = newSound("rbxasset://sounds/action_jump.mp3")
local sLanding = newSound("rbxasset://sounds/action_jump_land.mp3")
local sSplash = newSound("rbxasset://sounds/impact_water.mp3")
local sRunning = newSound("rbxasset://sounds/action_footsteps_plastic.mp3")
sRunning.Looped = true
local sSwimming = newSound("rbxasset://sounds/action_swim.mp3")
sSwimming.Looped = true
local sClimbing = newSound("rbxasset://sounds/action_footsteps_plastic.mp3")
sClimbing.Looped = true
local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
local prevState = "None"
|