prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[
This view holds all the logic and user experience for the dead user interface view.
]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SoundService = game:GetService("SoundService")
local translate = require(ReplicatedStorage.Dependencies.GameUtils.TranslateUtils).translate
local Players = game.Players
local LocalPlayer = Players.LocalPlayer
local Dead = {}
local elements = ReplicatedStorage.UIViews.Keyboard.Dead
local sounds = ReplicatedStorage.SFX.NonDiagetic
local activeElements
local failSound = sounds.Fail:Clone()
failSound.Parent = SoundService
|
--// Ammo Settings
|
Ammo = 12;
StoredAmmo = 12;
MagCount = math.huge; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
ExplosiveAmmo = 3;
|
--[[
Listing - добавленные сообщения для вывода на экран
alert - Date/Time создания алерта
текст - обязательный элемент!
цвет текста - может отсутствовать (белый по умолчанию)
картинка - может отсутствовать (текст на всё поле)
таймер - уменьшается в размерах пропорционально отведённому времени (по умолчанию 5 сек)
Core - основной клиентский скрипт
Вывод должен следовать один за другим
при уменьшении предыдущих, последующие смещаются вверх
по достижении минимального размера 0 удаляются
]]
|
local sg = script.Parent --Surface GUI
local dm = script:WaitForChild("DestroyMe") -- скрипт самоуничтожения
local ls = sg:WaitForChild("Listing") -- список алертов для вывода
local sf = sg:WaitForChild("ScrollingFrame") --The scrolling frame
sf.Visible = true
local sm = sf:WaitForChild("Sample") --Our Sample frame
local ui = sf:WaitForChild("UI") --The UI list layout
|
-----------------------------------------
|
Prompt.Triggered:Connect(function(Plr)
Tool.Parent = Plr.Backpack
script.Parent:Destroy()
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
script.Parent.ChildAdded:Connect(function(p1)
if p1:IsA("ViewportFrame") then
task.wait(1.2);
local v1 = game.SoundService.Reward:Clone();
v1.Name = "debris";
v1.Parent = game.SoundService;
v1:Play();
task.wait(5);
v1:Destroy();
end;
end);
|
--[[ SCRIPT VARIABLES ]]
|
local CHAT_BUBBLE_FONT = Enum.Font.Fantasy
local CHAT_BUBBLE_FONT_SIZE = Enum.FontSize.Size24 -- if you change CHAT_BUBBLE_FONT_SIZE_INT please change this to match
local CHAT_BUBBLE_FONT_SIZE_INT = 24 -- if you change CHAT_BUBBLE_FONT_SIZE please change this to match
local CHAT_BUBBLE_LINE_HEIGHT = CHAT_BUBBLE_FONT_SIZE_INT + 10
local CHAT_BUBBLE_TAIL_HEIGHT = 14
local CHAT_BUBBLE_WIDTH_PADDING = 30
local CHAT_BUBBLE_FADE_SPEED = 1.5
local BILLBOARD_MAX_WIDTH = 400
local BILLBOARD_MAX_HEIGHT = 250 --This limits the number of bubble chats that you see above characters
local ELIPSES = "..."
local MaxChatMessageLength = 128 -- max chat message length, including null terminator and elipses.
local MaxChatMessageLengthExclusive = MaxChatMessageLength - getMessageLength(ELIPSES) - 1
local NEAR_BUBBLE_DISTANCE = 65 --previously 45
local MAX_BUBBLE_DISTANCE = 100 --previously 80
|
--// Input Connections
|
L_107_.InputBegan:connect(function(L_314_arg1, L_315_arg2)
if not L_315_arg2 and L_15_ then
if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
if not L_64_ then
if not L_65_ then
if L_24_.TacticalModeEnabled then
L_154_ = 0.015
L_155_ = 7
L_3_:WaitForChild("Humanoid").WalkSpeed = 7
else
L_155_ = 10
L_154_ = 0.008
L_3_:WaitForChild("Humanoid").WalkSpeed = 10
end
end
if (L_3_.Head.Position - L_5_.CoordinateFrame.p).magnitude <= 2 then
L_97_ = L_50_
end
L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
L_115_:FireServer(true)
L_64_ = true
end
end;
if L_314_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
L_134_ = CFrame.Angles(0, 0, 0.1)
end;
if L_314_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
L_134_ = CFrame.Angles(0, 0, -0.1)
end;
if L_314_arg1.KeyCode == Enum.KeyCode.E and L_15_ and not L_80_ and not L_81_ then
L_80_ = true
L_82_ = false
L_81_ = true
LeanRight()
end
if L_314_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and not L_80_ and not L_82_ then
L_80_ = true
L_81_ = false
L_82_ = true
LeanLeft()
end
if L_314_arg1.KeyCode == L_24_.AlternateAimKey and not L_79_ and not L_78_ and not L_77_ and L_24_.CanAim and not L_74_ and L_15_ and not L_66_ and not L_67_ then
if not L_64_ then
if not L_65_ then
L_3_.Humanoid.WalkSpeed = 10
L_155_ = 10
L_154_ = 0.008
end
L_97_ = L_50_
L_133_.target = L_56_.CFrame:toObjectSpace(L_44_.CFrame).p
L_115_:FireServer(true)
L_64_ = true
end
end;
if L_314_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_314_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_79_ and not L_77_ and L_69_ and L_15_ and not L_66_ and not L_67_ and not L_74_ then
L_68_ = true
if not Shooting and L_15_ and not L_83_ then
if L_103_ > 0 then
Shoot()
end
elseif not Shooting and L_15_ and L_83_ then
if L_105_ > 0 then
Shoot()
end
end
end;
if L_314_arg1.KeyCode == (L_24_.LaserKey or L_314_arg1.KeyCode == Enum.KeyCode.DPadRight) and L_15_ and L_24_.LaserAttached then
local L_316_ = L_1_:FindFirstChild("LaserLight")
L_122_.KeyDown[1].Plugin()
end;
if L_314_arg1.KeyCode == (L_24_.LightKey or L_314_arg1.KeyCode == Enum.KeyCode.ButtonR3) and L_15_ and L_24_.LightAttached then
local L_317_ = L_1_:FindFirstChild("FlashLight"):FindFirstChild('Light')
local L_318_ = false
L_317_.Enabled = not L_317_.Enabled
end;
if L_15_ and L_314_arg1.KeyCode == (L_24_.FireSelectKey or L_314_arg1.KeyCode == Enum.KeyCode.DPadUp) and not L_79_ and not L_70_ and not L_78_ then
L_70_ = true
if L_92_ == 1 then
if Shooting then
Shooting = false
end
if L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.AutoEnabled and L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 2 then
if Shooting then
Shooting = false
end
if L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BurstEnabled and L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BurstEnabled and not L_24_.BoltAction and L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BurstEnabled and not L_24_.BoltAction and not L_24_.SemiEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 3 then
if Shooting then
Shooting = false
end
if L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BoltAction and L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.BoltAction and not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BoltAction and not L_24_.SemiEnabled and L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.BoltAction and not L_24_.SemiEnabled and not L_24_.AutoEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 4 then
if Shooting then
Shooting = false
end
if L_24_.ExplosiveEnabled then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
elseif not L_24_.ExplosiveEnabled and L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
end
elseif L_92_ == 6 then
if Shooting then
Shooting = false
end
L_85_ = L_69_
if L_24_.SemiEnabled then
L_92_ = 1
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and L_24_.AutoEnabled then
L_92_ = 2
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and L_24_.BurstEnabled then
L_92_ = 3
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and L_24_.BoltAction then
L_92_ = 4
L_83_ = false
L_69_ = L_84_
elseif not L_24_.SemiEnabled and not L_24_.AutoEnabled and not L_24_.BurstEnabled and not L_24_.BoltAction then
L_92_ = 6
L_83_ = true
L_84_ = L_69_
L_69_ = L_85_
end
end
UpdateAmmo()
FireModeAnim()
IdleAnim()
L_70_ = false
end;
if L_314_arg1.KeyCode == (Enum.KeyCode.F or L_314_arg1.KeyCode == Enum.KeyCode.DPadDown) and not L_79_ and not L_77_ and not L_78_ and not L_67_ and not L_70_ and not L_64_ and not L_66_ and not Shooting and not L_76_ then
if not L_73_ and not L_74_ then
L_74_ = true
Shooting = false
L_69_ = false
L_135_ = time()
delay(0.6, function()
if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
CreateShell()
end
end)
BoltBackAnim()
L_73_ = true
elseif L_73_ and L_74_ then
BoltForwardAnim()
Shooting = false
L_69_ = true
if L_103_ ~= L_24_.Ammo and L_103_ > 0 then
L_103_ = L_103_ - 1
elseif L_103_ >= L_24_.Ammo then
L_69_ = true
end
L_73_ = false
L_74_ = false
IdleAnim()
L_75_ = false
end
UpdateAmmo()
end;
if L_314_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_314_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_78_ and not L_77_ and L_146_ then
L_71_ = true
if L_15_ and not L_70_ and not L_67_ and L_71_ and not L_65_ and not L_74_ then
Shooting = false
L_64_ = false
L_67_ = true
delay(0, function()
if L_67_ and not L_66_ then
L_64_ = false
L_72_ = true
end
end)
L_97_ = 80
if L_24_.TacticalModeEnabled then
L_154_ = 0.4
L_155_ = 16
else
L_155_ = L_24_.SprintSpeed
L_154_ = 0.4
end
L_3_.Humanoid.WalkSpeed = L_24_.SprintSpeed
end
end;
if L_314_arg1.KeyCode == (Enum.KeyCode.R or L_314_arg1.KeyCode == Enum.KeyCode.ButtonX) and not L_79_ and not L_78_ and not L_77_ and L_15_ and not L_66_ and not L_64_ and not Shooting and not L_67_ and not L_74_ then
if not L_83_ then
if L_104_ > 0 and L_103_ < L_24_.Ammo then
Shooting = false
L_66_ = true
for L_319_forvar1, L_320_forvar2 in pairs(game.Players:GetChildren()) do
if L_320_forvar2 and L_320_forvar2:IsA('Player') and L_320_forvar2 ~= L_2_ and L_320_forvar2.TeamColor == L_2_.TeamColor then
if (L_320_forvar2.Character.HumanoidRootPart.Position - L_3_.HumanoidRootPart.Position).magnitude <= 150 then
if L_7_:FindFirstChild('AHH') and not L_7_.AHH.IsPlaying then
L_119_:FireServer(L_7_.AHH, L_100_[math.random(0, 23)])
end
end
end
end
ReloadAnim()
if L_103_ <= 0 then
if not L_24_.CanSlideLock then
BoltBackAnim()
BoltForwardAnim()
end
end
IdleAnim()
L_69_ = true
if L_103_ <= 0 then
if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
L_103_ = L_103_ + L_104_
L_104_ = 0
else
L_104_ = L_104_ - (L_24_.Ammo - L_103_)
L_103_ = L_24_.Ammo
end
elseif L_103_ > 0 then
if (L_104_ - (L_24_.Ammo - L_103_)) < 0 then
L_103_ = L_103_ + L_104_ + 1
L_104_ = 0
else
L_104_ = L_104_ - (L_24_.Ammo - L_103_)
L_103_ = L_24_.Ammo + 0
end
end
L_66_ = false
if not L_75_ then
L_69_ = true
end
end;
elseif L_83_ then
if L_105_ > 0 then
Shooting = false
L_66_ = true
nadeReload()
IdleAnim()
L_66_ = false
L_69_ = true
end
end;
UpdateAmmo()
end;
if L_314_arg1.KeyCode == Enum.KeyCode.RightBracket and L_64_ then
if (L_51_ < 1) then
L_51_ = L_51_ + L_24_.SensitivityIncrement
end
end
if L_314_arg1.KeyCode == Enum.KeyCode.LeftBracket and L_64_ then
if (L_51_ > 0.1) then
L_51_ = L_51_ - L_24_.SensitivityIncrement
end
end
if L_314_arg1.KeyCode == (Enum.KeyCode.T or L_314_arg1.KeyCode == Enum.KeyCode.DPadLeft) and L_1_:FindFirstChild("AimPart2") then
if not L_86_ then
L_56_ = L_1_:WaitForChild("AimPart2")
L_50_ = L_24_.CycleAimZoom
if L_64_ then
L_97_ = L_24_.CycleAimZoom
end
L_86_ = true
else
L_56_ = L_1_:FindFirstChild("AimPart")
L_50_ = L_24_.AimZoom
if L_64_ then
L_97_ = L_24_.AimZoom
end
L_86_ = false
end;
end;
if L_314_arg1.KeyCode == L_24_.InspectionKey and not L_79_ and not L_78_ then
if not L_77_ then
L_77_ = true
InspectAnim()
IdleAnim()
L_77_ = false
end
end;
if L_314_arg1.KeyCode == L_24_.AttachmentKey and not L_79_ and not L_77_ then
if L_15_ then
if not L_78_ then
L_67_ = false
L_64_ = false
L_69_ = false
L_78_ = true
AttachAnim()
elseif L_78_ then
L_67_ = false
L_64_ = false
L_69_ = true
L_78_ = false
IdleAnim()
end
end
end;
if L_314_arg1.KeyCode == Enum.KeyCode.P and not L_77_ and not L_78_ and not L_64_ and not L_67_ and not L_65_ and not L_66_ and not Recoiling and not L_67_ then
if not L_79_ then
L_79_ = true
L_14_:Create(L_45_, TweenInfo.new(0.2), {
C1 = L_24_.SprintPos
}):Play()
wait(0.2)
L_112_:FireServer("Patrol", L_24_.SprintPos)
else
L_79_ = false
L_14_:Create(L_45_, TweenInfo.new(0.2), {
C1 = CFrame.new()
}):Play()
wait(0.2)
L_112_:FireServer("Unpatrol")
end
end;
end
end)
L_107_.InputEnded:connect(function(L_321_arg1, L_322_arg2)
if not L_322_arg2 and L_15_ then
if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton2 or L_321_arg1.KeyCode == Enum.KeyCode.ButtonL2) and not L_77_ and L_24_.CanAim and not L_78_ then
if L_64_ then
if not L_65_ then
L_3_:WaitForChild("Humanoid").WalkSpeed = 16
if L_24_.TacticalModeEnabled then
L_154_ = 0.09
L_155_ = 11
else
L_154_ = .2
L_155_ = 17
end
end
L_97_ = 70
L_133_.target = Vector3.new()
L_115_:FireServer(false)
L_64_ = false
end
end;
if L_321_arg1.KeyCode == Enum.KeyCode.A and L_15_ then
L_134_ = CFrame.Angles(0, 0, 0)
end;
if L_321_arg1.KeyCode == Enum.KeyCode.D and L_15_ then
L_134_ = CFrame.Angles(0, 0, 0)
end;
if L_321_arg1.KeyCode == Enum.KeyCode.E and L_15_ and L_80_ then
Unlean()
L_80_ = false
L_82_ = false
L_81_ = false
end
if L_321_arg1.KeyCode == Enum.KeyCode.Q and L_15_ and L_80_ then
Unlean()
L_80_ = false
L_82_ = false
L_81_ = false
end
if L_321_arg1.KeyCode == L_24_.AlternateAimKey and not L_77_ and L_24_.CanAim then
if L_64_ then
if not L_65_ then
L_3_.Humanoid.WalkSpeed = 16
L_155_ = 17
L_154_ = .25
end
L_97_ = 70
L_133_.target = Vector3.new()
L_115_:FireServer(false)
L_64_ = false
end
end;
if L_321_arg1.UserInputType == (Enum.UserInputType.MouseButton1 or L_321_arg1.KeyCode == Enum.KeyCode.ButtonR2) and not L_77_ then
L_68_ = false
if Shooting then
Shooting = false
end
end;
if L_321_arg1.KeyCode == Enum.KeyCode.E and L_15_ then
local L_323_ = L_42_:WaitForChild('GameGui')
if L_16_ then
L_323_:WaitForChild('AmmoFrame').Visible = false
L_16_ = false
end
end;
if L_321_arg1.KeyCode == (Enum.KeyCode.LeftShift or L_321_arg1.KeyCode == Enum.KeyCode.ButtonL3) and not L_77_ and not L_70_ and not L_65_ then -- SPRINT
L_71_ = false
if L_67_ and not L_64_ and not Shooting and not L_71_ then
L_67_ = false
L_72_ = false
L_97_ = 70
L_3_.Humanoid.WalkSpeed = 16
if L_24_.TacticalModeEnabled then
L_154_ = 0.09
L_155_ = 11
else
L_154_ = .2
L_155_ = 17
end
end
end;
end
end)
L_107_.InputChanged:connect(function(L_324_arg1, L_325_arg2)
if not L_325_arg2 and L_15_ and L_24_.FirstPersonOnly and L_64_ then
if L_324_arg1.UserInputType == Enum.UserInputType.MouseWheel then
if L_324_arg1.Position.Z == 1 and (L_51_ < 1) then
L_51_ = L_51_ + L_24_.SensitivityIncrement
elseif L_324_arg1.Position.Z == -1 and (L_51_ > 0.1) then
L_51_ = L_51_ - L_24_.SensitivityIncrement
end
end
end
end)
L_107_.InputChanged:connect(function(L_326_arg1, L_327_arg2)
if not L_327_arg2 and L_15_ then
local L_328_, L_329_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_56_.CFrame.p, (L_56_.CFrame.lookVector).unit * 10000), IgnoreList);
if L_328_ then
local L_330_ = (L_329_ - L_6_.Position).magnitude
L_33_.Text = math.ceil(L_330_) .. ' m'
end
end
end)
|
-- Print that runs only if debug mode is active.
|
local function PrintDebug(message)
if FastCast.DebugLogging == true then
print(message)
end
end
|
-- Typing any of these words in the chat will trigger the above animation
|
local triggerWords = { "hi", "hello", "good morning" }
SocialInteractions.setTriggerWordsForChatAnimation(waveAnimationId, triggerWords)
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
service = nil;
return function(p1)
local v1 = client.UI.Make("Window", {
Name = "Credits",
Title = "Credits",
Icon = client.MatIcons.Grade,
Size = { 280, 300 },
AllowMultiple = false
});
local v2 = v1:Add("TabFrame", {
Size = UDim2.new(1, -10, 1, -10),
Position = UDim2.new(0, 5, 0, 5)
});
for v3, v4 in ipairs({ v2:NewTab("Main", {
Text = "Main"
}), v2:NewTab("GitHub", {
Text = "Contributors"
}), (v2:NewTab("Misc", {
Text = "Everyone Else"
})) }) do
local v5 = v4:Add("ScrollingFrame", {
List = {},
ScrollBarThickness = 3,
BackgroundTransparency = 1,
Position = UDim2.new(0, 5, 0, 30),
Size = UDim2.new(1, -10, 1, -35)
});
local v6 = v4:Add("TextBox", {
Position = UDim2.new(0, 5, 0, 5),
Size = UDim2.new(1, -10, 0, 20),
BackgroundTransparency = 0.25,
BorderSizePixel = 0,
TextColor3 = Color3.new(1, 1, 1),
Text = "",
PlaceholderText = "Search",
TextStrokeTransparency = 0.8
});
v6:Add("ImageLabel", {
Image = client.MatIcons.Search,
Position = UDim2.new(1, -20, 0, 2),
Size = UDim2.new(0, 16, 0, 16),
ImageTransparency = 0.2,
BackgroundTransparency = 1
});
local function v7()
local v8 = 1;
local l__Text__9 = v6.Text;
v5:ClearAllChildren();
for v10, v11 in ipairs(require(client.Shared.Credits)[v4.Name]) do
if v11.Text:sub(1, #l__Text__9):lower() == l__Text__9:lower() or v4.Name == "GitHub" and v11.Text:sub(9, 8 + #l__Text__9):lower() == l__Text__9:lower() then
local v12 = {
Text = " " .. v11.Text .. " ",
ToolTip = v11.Desc
};
if v8 % 2 == 0 then
local v13 = 0;
else
v13 = 0.2;
end;
v12.BackgroundTransparency = v13;
v12.Size = UDim2.new(1, 0, 0, 30);
v12.Position = UDim2.new(0, 0, 0, 30 * (v8 - 1));
v12.TextXAlignment = "Left";
v5:Add("TextLabel", v12);
v8 = v8 + 1;
end;
end;
v5:ResizeCanvas(false, true, false, false, 5, 0);
end;
v6:GetPropertyChangedSignal("Text"):Connect(v7);
v7();
end;
v1:Ready();
end;
|
-- Setup the default levels
|
Log.SetupLevel('Info', 1)
Log.SetupLevel('Debug', 2)
Log.SetupLevel('Warn', 3)
Log.SetupLevel('Error', 4)
function Log.Log(level, chan, ...)
local msg = string.format(...)
local levelName = Log._LevelName[level]
if _messageQueue then
if not _remoteFilterFunc or not _remoteFilterFunc(level, levelName, chan, msg) then
table.insert(_messageQueue, {tick(), level, chan, msg})
end
end
if _consoleFilterFunc and _consoleFilterFunc(level, levelName, chan, msg) then
return;
end
if chan then
print(string.format("[%s][%s]", levelName, chan), msg)
else
print(string.format("[%s]", levelName), msg)
end
end
Log.Data =
setmetatable({}, {
__index = function(tbl, key)
return function(...)
Log.LogData(key, ...)
end
end;
})
function Log.LogData(chan, data)
if _messageQueue then
table.insert(_messageQueue, {tick(), 'data', chan, data})
end
end
function Log.ProcessQueue(remote)
if not _messageQueue then
return
end
-- As a naive first pass, let's just send all of it at once.
if _isClient then
_remoteEvent:FireServer(_messageQueue)
elseif remote and #_messageQueue > 0 then
-- TODO: Count connection errors and stop attempting remote connections if it can't be reached
-- .Experiment with compression
local data = {
place = game.PlaceId,
game = game.GameId,
job = game.JobId,
messages = _messageQueue,
}
HttpService:PostAsync(remote,
HttpService:JSONEncode(data),
Enum.HttpContentType.ApplicationJson,
false)
end
Log.ClearQueue()
end
local function onClientLogging(player, messages)
if _messageQueue and #messages > 0 then
table.insert(_messageQueue, {player = player.UserId, messages = messages })
end
end
function Log.wrapSystemMessages()
LogService.MessageOut:connect(function(msg, msgType)
-- HACK: Have to detect our logging messages vs. system level ones
if string.match(msg, '^%[[^%]]+%]') then
return
end
-- NOTE: +1 more or less automatically maps to the current built-in log levels
Log.Log(msgType.Value + 1, 'SYSTEM', "%s", msg)
end)
end
function Log.EnableQueue(state)
if state and not _messageQueue then
_messageQueue = {}
end
if not state then
_messageQueue = nil
end
end
function Log.ClearQueue()
for k,v in pairs(_messageQueue) do
_messageQueue[k] = nil
end
end
function Log.SetRemoteFilterFunc(func)
_remoteFilterFunc = func
end
function Log.SetConsoleFilterFunc(func)
_consoleFilterFunc = func
end
local function _remoteFilterEverything()
return true
end
|
--[[
cspeed = speed/1.298
print("FL ".. math.abs(FL.Parent.RotVelocity.Magnitude-cspeed))
print("FR ".. math.abs(FR.Parent.RotVelocity.Magnitude-cspeed))
print("RL ".. math.abs(RL.Parent.RotVelocity.Magnitude-cspeed))
print("RR ".. math.abs(RR.Parent.RotVelocity.Magnitude-cspeed))]]--
--print("Speed ".. speed/1.298)
|
bST = (inds.Value)*(1000*convert)
build = rpm.Value/18000
if speed > 110 and carSeat.Steer ~= 0 then
|
--///////////////// Internal-Use Methods
--//////////////////////////////////////
|
function methods:InternalDestroy()
for i, channel in pairs(self.Channels) do
channel:InternalRemoveSpeaker(self)
end
self.eDestroyed:Fire()
self.eDestroyed:Destroy()
self.eSaidMessage:Destroy()
self.eReceivedMessage:Destroy()
self.eReceivedUnfilteredMessage:Destroy()
self.eMessageDoneFiltering:Destroy()
self.eReceivedSystemMessage:Destroy()
self.eChannelJoined:Destroy()
self.eChannelLeft:Destroy()
self.eMuted:Destroy()
self.eUnmuted:Destroy()
self.eExtraDataUpdated:Destroy()
self.eMainChannelSet:Destroy()
self.eChannelNameColorUpdated:Destroy()
end
function methods:InternalAssignPlayerObject(playerObj)
self.PlayerObj = playerObj
end
function methods:InternalSendMessage(messageObj, channelName)
local success, err = pcall(function()
self.eReceivedUnfilteredMessage:Fire(messageObj, channelName)
end)
if not success and err then
print("Error sending internal message: " ..err)
end
end
function methods:InternalSendFilteredMessage(messageObj, channelName)
local success, err = pcall(function()
self.eReceivedMessage:Fire(messageObj, channelName)
self.eMessageDoneFiltering:Fire(messageObj, channelName)
end)
if not success and err then
print("Error sending internal filtered message: " ..err)
end
end
|
--FL
|
fSprings[1].Thickness = Settings[1]
fSprings[1].MaxLength = Settings[2]
fSprings[1].MinLength = Settings[3]
fSprings[1].Damping = Settings[4]
fSprings[1].FreeLength = Settings[5]
fSprings[1].LimitsEnabled = Settings[6]
fSprings[1].MaxForce = Settings[7]
fSprings[1].Stiffness = Settings[8]
|
-- Preload animations
|
function playAnimation(animName, transitionTime, humanoid)
if (animName ~= currentAnim) then
if (oldAnimTrack ~= nil) then
oldAnimTrack:Stop()
oldAnimTrack:Destroy()
end
currentAnimSpeed = 1.0
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
|
--// Tables
|
local L_34_ = {
"285421759";
"151130102";
"151130171";
"285421804";
"287769483";
"287769415";
"285421687";
"287769261";
"287772525";
"287772445";
"287772351";
"285421819";
"287772163";
}
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed > 0.01 then
local scale = 15.0
playAnimation("walk", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Running"
else
if emoteNames[currentAnim] == nil then
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
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 and (tool.RequiresHandle or tool:FindFirstChild("Handle")) 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
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{63,20,58},t},
[49]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{63,19},t},
[59]={{63,20,57,56,30,41,59},t},
[63]={{63},t},
[34]={{63,20,57,56,30,41,39,35,34},t},
[21]={{63,20,21},t},
[48]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{63,20,57,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{63,20,57,56,30,41,39,35,34,32,31},t},
[56]={{63,20,57,56},t},
[29]={{63,20,57,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{63,20,57},t},
[36]={{63,20,57,56,30,41,39,35,37,36},t},
[25]={{63,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{63,20,57,56,30,41,59,61,71},t},
[20]={{63,20},t},
[60]={{63,20,57,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{63,20,57,56,30,41,59,61,71,72,76,73,75},t},
[22]={{63,20,21,22},t},
[74]={{63,20,57,56,30,41,59,61,71,72,76,73,74},t},
[62]={{63,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{63,20,57,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{63,20,57,56,30,41,39,35},t},
[53]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{63,20,57,56,30,41,59,61,71,72,76,73},t},
[72]={{63,20,57,56,30,41,59,61,71,72},t},
[33]={{63,20,57,56,30,41,39,35,37,36,33},t},
[69]={{63,20,57,56,30,41,60,69},t},
[65]={{63,66,64,65},t},
[26]={{63,20,57,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{63,66,64,67,68},t},
[76]={{63,20,57,56,30,41,59,61,71,72,76},t},
[50]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{63,66},t},
[10]={n,f},
[24]={{63,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{63,62,23},t},
[44]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{63,20,57,56,30,41,39},t},
[32]={{63,20,57,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{63,20,57,56,30},t},
[51]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{63,66,64,67},t},
[61]={{63,20,57,56,30,41,59,61},t},
[55]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{63,20,57,56,30,41,39,40,38,42},t},
[40]={{63,20,57,56,30,41,39,40},t},
[52]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{63,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{63,20,57,56,30,41},t},
[17]={n,f},
[38]={{63,20,57,56,30,41,39,40,38},t},
[28]={{63,20,57,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{63,66,64},t},
}
return r
|
----------------------------------------------------------------------------------
--[[
(Use the code above ONLY if "PROCESS_RECEIPT" is false)
That''s about it! Enjoy your game''s awesome new radio!
You can delete everything in this model besides "Super Radio"
Don''t worry, the GUI and everything else loads in automatically!
]]
| |
----- Module Table -----
|
local MadworkScriptSignal = {
}
|
--!strict
|
local copy = require(script.Parent.copy)
type Callback<K, V> = (key: K) -> V
type Updater<K, V> = (value: V, key: K) -> V
local function call<K, V>(callback: Callback<K, V>, key: K)
if type(callback) == "function" then
return callback(key)
end
end
|
--// Special Variables
|
return function()
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
local script = script
local service = service
local client = client
local Anti, Core, Functions, Process, Remote, UI, Variables
local function Init()
UI = client.UI;
Anti = client.Anti;
Core = client.Core;
Variables = client.Variables
Functions = client.Functions;
Process = client.Process;
Remote = client.Remote;
Variables.Init = nil;
end
local function RunAfterLoaded()
--// Get CodeName
client.Variables.CodeName = client.Remote.Get("Variable", "CodeName")
Variables.RunAfterLoaded = nil;
end
local function RunLast()
--[[client = service.ReadOnly(client, {
[client.Variables] = true;
[client.Handlers] = true;
G_API = true;
G_Access = true;
G_Access_Key = true;
G_Access_Perms = true;
Allowed_API_Calls = true;
HelpButtonImage = true;
Finish_Loading = true;
RemoteEvent = true;
ScriptCache = true;
Returns = true;
PendingReturns = true;
EncodeCache = true;
DecodeCache = true;
Received = true;
Sent = true;
Service = true;
Holder = true;
GUIs = true;
LastUpdate = true;
RateLimits = true;
Init = true;
RunLast = true;
RunAfterInit = true;
RunAfterLoaded = true;
RunAfterPlugins = true;
}, true)--]]
Variables.RunLast = nil;
end
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
client.GUIs = {}
client.GUIHolder = service.New("Folder")
client.Variables = {
Init = Init;
RunLast = RunLast;
RunAfterLoaded = RunAfterLoaded;
CodeName = "";
UIKeepAlive = true;
KeybindsEnabled = true;
ParticlesEnabled = true;
CapesEnabled = true;
HideChatCommands = false;
Particles = {};
KeyBinds = {};
Aliases = {};
Capes = {};
savedUI = {};
localSounds = {};
ESPObjects = {};
CommunicationsHistory = {};
LightingSettings = {
Ambient = service.Lighting.Ambient;
Brightness = service.Lighting.Brightness;
ColorShift_Bottom = service.Lighting.ColorShift_Bottom;
ColorShift_Top = service.Lighting.ColorShift_Top;
GlobalShadows = service.Lighting.GlobalShadows;
OutdoorAmbient = service.Lighting.OutdoorAmbient;
Outlines = service.Lighting.Outlines;
ShadowColor = service.Lighting.ShadowColor;
GeographicLatitude = service.Lighting.GeographicLatitude;
Name = service.Lighting.Name;
TimeOfDay = service.Lighting.TimeOfDay;
FogColor = service.Lighting.FogColor;
FogEnd = service.Lighting.FogEnd;
FogStart = service.Lighting.FogStart;
}
};
end
|
--Remotes
|
local playSoundEffectEvent = remotesFolder.Combat.Sound:WaitForChild("PlaySoundEffect")
|
--// Services
|
local AssetService = game:GetService("AssetService");
return function(BundleId)
return pcall(function()
AssetService:GetBundleDetailsAsync(BundleId)
end)
end
|
-- ====================
-- WALK SPEED REDUTION
-- Nerf chraracter's walk speed when equip the gun
-- ====================
|
WalkSpeedRedutionEnabled = false;
WalkSpeedRedution = 6;
|
-- FOLDERS --
|
local Modules = RS:WaitForChild("Modules")
local Remotes = RS:WaitForChild("Remotes")
|
-- local tmp = Rebuild()
|
local START = game.Workspace.Start
START:SetPrimaryPartCFrame(CFrame.new(0,0,110))
while true do
PartWorld = script.Parts.Value
if PartWorld ~= 0 then
-- для всех игроков установить базовую точку старта
local tmp = game.Players:GetChildren()
for a, b in pairs(tmp) do
b.RespawnLocation = START.SpawnLocation
end
-- удалить старый путь
tmp = game.Workspace.GameZone:GetChildren()
for a, b in pairs(tmp) do
b:Destroy()
end
wait(5) -- чтобы игрок успел упасть на дно
-- создать новый путь
tmp = Rebuild()
RebuildWorld = 300
wait(RebuildWorld) -- ждём указанное время
else
wait(1)
end
end
|
--[[
Enqueues an instance property to be updated next render step.
]]
|
function Scheduler.enqueueProperty(instance: Instance, propertyName: string, newValue: any)
willUpdate = true
-- we can't iterate over nil values of tables, so use a symbol instead
if newValue == nil then
newValue = None
end
local propertyTable = propertyChanges[instance]
if propertyTable == nil then
propertyChanges[instance] = {
[propertyName] = newValue
}
else
propertyTable[propertyName] = newValue
end
end
|
-- Function to call on renderstepped. Orients the character so it is facing towards
-- the player mouse's position in world space. If character is sitting then the torso
-- should not track
|
local function frame(mousePosition)
-- Special mobile consideration. We don't want to track if the user was touching a ui
-- element such as the movement controls. Just return out of function if so to make sure
-- character doesn't track
if not mobileShouldTrack then return end
--This math is completely wrong with R15. We're better off just not doing it at all
if player.Character.Humanoid.RigType == Enum.HumanoidRigType.R15 then
return
end
-- Make sure character isn't swiming. If the character is swimming the following code will
-- not work well; the character will not swim correctly. Besides, who shoots underwater?
if player.Character.Humanoid:GetState() ~= Enum.HumanoidStateType.Swimming then
local torso = player.Character.HumanoidRootPart
local head = player.Character.Head
local toMouse = (mousePosition - head.Position).unit
local angle = math.acos(toMouse:Dot(Vector3.new(0,1,0)))
local neckAngle = angle
-- Limit how much the head can tilt down. Too far and the head looks unnatural
if math.deg(neckAngle) > 110 then
neckAngle = math.rad(110)
end
neck.C0 = CFrame.new(0,1,0) * CFrame.Angles(math.pi - neckAngle,math.pi,0)
-- Calculate horizontal rotation
local arm do
arm = player.Character:FindFirstChild("Right Arm") or
player.Character:FindFirstChild("RightUpperArm")
end
local fromArmPos = torso.Position + torso.CFrame:vectorToWorldSpace(Vector3.new(
torso.Size.X/2 + arm.Size.X/2, torso.Size.Y/2 - arm.Size.Z/2, 0))
local toMouseArm = ((mousePosition - fromArmPos) * Vector3.new(1,0,1)).unit
local look = (torso.CFrame.lookVector * Vector3.new(1,0,1)).unit
local lateralAngle = math.acos(toMouseArm:Dot(look))
-- Check for rogue math
if tostring(lateralAngle) == "-1.#IND" then
lateralAngle = 0
end
-- Handle case where character is sitting down
if player.Character.Humanoid:GetState() == Enum.HumanoidStateType.Seated then
local cross = torso.CFrame.lookVector:Cross(toMouseArm)
if lateralAngle > math.pi/2 then
lateralAngle = math.pi/2
end
if cross.Y < 0 then
lateralAngle = -lateralAngle
end
end
-- Turn shoulder to point to mouse
shoulder.C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.pi/2 - angle,math.pi/2 + lateralAngle,0)
-- If not sitting then aim torso laterally towards mouse
if not amISitting(player.Character) then
torso.CFrame = CFrame.new(torso.Position, torso.Position + (Vector3.new(
mousePosition.X, torso.Position.Y, mousePosition.Z)-torso.Position).unit)
end
end
end
|
--[[ if child.Parent and child.Parent.Parent then
end
if child.BackgroundTransparency == 1 then
return true;
end]]
|
return false
end
local function CircleClick(Button, X, Y)
local duration = 0.5
task.spawn(function()
local effect = Instance.new("ImageLabel", Button)
effect.AnchorPoint = Vector2.new(0.5, 0.5)
effect.BorderSizePixel = 0
effect.ZIndex = Button.ZIndex + 2
effect.BackgroundTransparency = 1
effect.ImageTransparency = 0.96
effect.Image = "rbxasset://textures/whiteCircle.png"
local rounder = Instance.new("UICorner", effect); rounder.CornerRadius = UDim.new(0,8)
effect.Position = UDim2.new(0.5, 0, 0.5, 0)
effect:TweenSize(UDim2.new(0, Button.AbsoluteSize.X * 2.5, 0, Button.AbsoluteSize.X * 2.5), Enum.EasingDirection.Out, Enum.EasingStyle.Linear, duration)
wait(duration)
for i = 1, 10 do
wait(0.04)
effect.ImageTransparency += 0.1
end
effect:Destroy()
end)
end
local function propChange(child, target, list)
for i in next,list do
if target[i] ~= child[i] then
target[i] = child[i];
end
end--lollo was here yes my code is messy
if child.ZIndex == 1 then
child.ZIndex = 2;
end
target.ZIndex = child.ZIndex-1;
end
return function(data, env)
if env then
setfenv(1, env)
end
local gui = script.Parent.Parent;--data.GUI;
local function apply(child)
if not child then return end
if child:IsA("TextButton") or child:IsA("ImageButton") then
child.ClipsDescendants = true
child.AutoButtonColor = false
child.Activated:Connect(function()
CircleClick(child:GetObject())
end)
end
if not child:IsA("TextLabel") and not child:IsA("ImageLabel") and not child:FindFirstChildOfClass("UICorner") then
local rounder = service.New("UICorner",{
CornerRadius = UDim.new(0,5);
Parent = child;
});
end
if child:IsA("TextLabel") and not child:FindFirstChildOfClass("UICorner") then
local rounder = service.New("UICorner",{
CornerRadius = UDim.new(0,6);
Parent = child;
});
-- well how do i convert size to precise offset because i am lazy
child.BackgroundColor3 = Color3.fromRGB(18, 18, 18)
end
if child:IsA("ScrollingFrame") then
if child.Parent and child.Parent.Name == "Frames" then child.BackgroundTransparency = 1; end
child.BottomImage = "rbxasset://textures/ui/Scroll/scroll-bottom.png"
child.MidImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
child.TopImage = "rbxasset://textures/ui/Scroll/scroll-top.png"
child.ScrollBarImageTransparency = 0.75
child.ScrollBarImageColor3 = Color3.fromRGB(255, 255, 255)
--local propList = {
-- Size = true;
-- Visible = true;
-- Position = true;
-- BackgroundTransparency = true;
-- BackgroundColor3 = true;
-- BorderColor3 = true;
-- Rotation = true;
-- SizeConstraint = true;
--}
--local frame = service.New("Frame");
--propChange(child, frame, propList)
child.BackgroundTransparency = 1; --why not
--child.Changed:Connect(function(p)
-- if p ~= "BackgroundTransparency" then
-- propChange(child, frame, propList);
-- end
--end)
--frame.Parent = child.Parent;
end
end
gui.DescendantAdded:Connect(function(child)
if child:IsA("GuiObject") and not ignore(child) then
apply(child);
end
end)
end
|
--Char.Humanoid.BreakJointsOnDeath = false
|
if configuracao.EnableRagdoll == true then
if human.Health <= 1 then
Ragdoll(Char)
end
end
human.HealthChanged:Connect(function (newhealth)
if dead.Value == false and Sang.Value >= 10 then
human.Health = math.clamp(newhealth, 0.1, 100)
if newhealth <= 0.1 or human.Health <= 0.1 then
Caido.Value = true
end
if (rodeath.Value == true or life.Value == false) and newhealth <= -25 then
local loss = newhealth * 40
Sang.Value = Sang.Value + loss
human.PlatformStand = true
human.AutoRotate = false
Caido.Value = true
end
else
human.PlatformStand = false
human.AutoRotate = true
human.Health = 0
end
end)
|
-- Game services
|
local Configurations = require(ServerStorage.Configurations)
local TeamManager = require(script.TeamManager)
local PlayerManager = require(script.PlayerManager)
local MapManager = require(script.MapManager)
local TimeManager = require(script.TimeManager)
local DisplayManager = require(script.DisplayManager)
|
--[[
SERVER PLUGINS' NAMES MUST START WITH "Server:"
CLIENT PLUGINS' NAMES MUST START WITH "Client:"
Hi, this is an example plugin, meaning this is only to show you how to make your own plugins!
All plugins need to be MODULE SCRIPTS! Not regular or local scripts, if its not a module script it wont work.
If you want to use events from the main admin script such as CharacterAdded, PlayerChatted and
PlayerJoined then simply look the following:
set.MakePluginEvent('PlayerChatted',function(msg,plr) print(msg..' from '..plr.Name..' Example Plugin') end)
set.MakePluginEvent('PlayerJoined',function(p) print(p.Name..' Joined! Example Plugin') end)
set.MakePluginEvent('CharacterAdded',function(plr) set.RunCommand('name',plr.Name,'BobTest Example Plugin') end)
Use set.MakePluginEvent(type,function) to add a function that gets run when the event is fired in the
main script, only CharacterAdded, PlayerJoined and PlayerChatted are currently supported.
If you want to run an admin command from a plugin, you need to use set.RunCommand(cmd,args)
EX: set.RunCommand('name',plr.Name,'BobTest Example Plugin') will run ":name Player1 BobTests Example Plugin"
NOTE: If you are running a command that needs a sending player (such as !quote, !donate, !explore, or any command that
spawns guis on the player running the command) it WILL break, the script will continue functioning fine however
the command will error and do nothing.
Plugins give you the ability to change or add things to the main script without editing the
actual script. You can add commands, functions, features, and you can use anything in the
table "set" (the main script table which contains all functions, settings, and commands.)
First off lets go over the format of commands.
Commands must be formatted in the following way:
set.MakeCommand(CommandName,AdminLevel,Prefix,{command1,command2},{argument1,argument2},NumberOfArguments,function(plr,args)
print('Hello World from inside an example command!')
end)
Now lets go over each element of MakeCommand function.
CommandName - Name of the command
AdminLevel - who can use the commands (-1=SBL owners,0=any,1=donators,2=tempadmins,3=admins,4=owners,5=trueowners)
Prefix - the prefix to use (the : in :kill me) use set.Prefix to use the scripts set prefix (or set.AnyPrefix for the AnyPrefix setting)
{command1,command2} - these are commands that can be chatted to run this command
{argument1,argument2} - type of arguments (eg {"player","message"})
NumberOfArguments - how many arguments are there? (How many times to split the message?)
function(plr,args) - you need to include this, however you can change plr and args but its recommended you dont to avoid confusion.
Now that we know what each thing is, go ahead and take a look at the example command.
All the code to run MUST be in a function, as seen below, that gets returned.
Anything inside the main function will be ran by the main admin script. If you want to use
things from the main admin script use set.
For example:
return function(set)
print('hi')
end
Client plugins are EXACTLY the same as server plugins, just they run on the client instead.
Because all guis are made via the client script, client plugins also gives you the ability to
edit and make your own guis for the script that you can call using set.Remote(PLAYER,"Function","GUI FUNCTIONS")
Please note that if you want to be able to tell the client to load a gui, the gui will need to be in the client's "set"
table as it is where all the functions to be executed by the server are stored. Read over the client script to get
a better idea of how it works.
--]]
--------------------------------------------------------------------------
--Begin example plugin
|
return function(set) --function that the main script will run
--Lets make an example command
set.MakeCommand('Example Plugin Command',0,set.Prefix,{'example','forshow'},{'message1','message2'},2,function(plr,args)
print('Hello World from inside an example command!')
print('The first argument is '..args[1]..' and the second is '..args[2])
print('The player who ran the command is '..plr.Name..'!')
end)--Player chats ":example Args1 Args2"
print('Hello World from inside an example plugin!')
--makes the command "example" and prints "Hello World from inside an example plugin!"
end -- end of the main function
|
-- This for lazy people who just came to copy & paste, not to learn the code...
| |
------------------------------------------------------------------------
-- * l1 was a pointer, now l1 is returned and callee assigns the value
-- * used in multiple locations
------------------------------------------------------------------------
|
function luaK:concat(fs, l1, l2)
if l2 == self.NO_JUMP then return l1
elseif l1 == self.NO_JUMP then
return l2
else
local list = l1
local _next = self:getjump(fs, list)
while _next ~= self.NO_JUMP do -- find last element
list = _next
_next = self:getjump(fs, list)
end
self:fixjump(fs, list, l2)
end
return l1
end
|
--[[
Proxy layer between the player FSM and the player state scripts, allowing debug and player state updates to be fired.
When a state is entered, the updateStatus function is called for the relevant ServerPlayerComponent
]]
|
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Logger = require(ReplicatedStorage.Dependencies.GameUtils.Logger)
local PlayerPreGame = require(ServerStorage.Source.GameStates.Player.PlayerPreGame)
local PlayerWarmup = require(ServerStorage.Source.GameStates.Player.PlayerWarmup)
local PlayerGame = require(ServerStorage.Source.GameStates.Player.PlayerGame)
local PlayerPostGame = require(ServerStorage.Source.GameStates.Player.PlayerPostGame)
local PlayerFinished = require(ServerStorage.Source.GameStates.Player.PlayerFinished)
local PlayerDead = require(ServerStorage.Source.GameStates.Player.PlayerDead)
local PlayerSpectating = require(ServerStorage.Source.GameStates.Player.PlayerSpectating)
local Transitions = {}
|
--[[
Set the current node's status to Skipped.
]]
|
function TestSession:setSkipped()
assert(#self.nodeStack > 0, "Attempting to set skipped status on empty stack")
self.nodeStack[#self.nodeStack].status = TestEnum.TestStatus.Skipped
end
|
--Put me in StarterCharacterScripts
|
local player = game.Players.LocalPlayer
local character = workspace:WaitForChild(player.Character.Name)
local camera = workspace.CurrentCamera
local running = false
local speed = character.Humanoid.WalkSpeed / 2
local RunService = game:GetService("RunService")
local Pi = 3.1415926
local Rot = 3.1415926 / 2
character.Humanoid.Running:Connect(function(WalkSpeed)
if WalkSpeed > 0.1 then
running = true
else
running = false
end
end)
while true do
RunService.RenderStepped:wait()
fps = (camera.CoordinateFrame.p - character.Head.Position).Magnitude
if running == true then
Rot = Rot + character.Humanoid.WalkSpeed / 115
end
if Rot >= Pi * 2 then
Rot = 0
end
camera.CoordinateFrame = camera.CoordinateFrame * CFrame.new(math.cos(Rot) / speed, math.sin(Rot * 2) / (speed * 2), 0) * CFrame.Angles(0, 0, math.sin(Rot - Pi * 1.5) / (speed * 20))
end
|
-- Connect 'Blocked' event to the 'onPathBlocked' function
|
path.Blocked:Connect(onPathBlocked)
|
--[[
Extension of Lua's 'assert' that lets you specify an error level.
]]
|
local function assertLevel(condition, message, level)
message = message or "Assertion failed!"
level = level or 1
if not condition then
error(message, level + 1)
end
end
|
--[[ The Module ]]
|
--
local BaseOcclusion = require(script.Parent:WaitForChild("BaseOcclusion"))
local Invisicam = setmetatable({}, BaseOcclusion)
Invisicam.__index = Invisicam
function Invisicam.new()
local self = setmetatable(BaseOcclusion.new(), Invisicam)
self.char = nil
self.humanoidRootPart = nil
self.torsoPart = nil
self.headPart = nil
self.childAddedConn = nil
self.childRemovedConn = nil
self.behaviors = {} -- Map of modes to behavior fns
self.behaviors[MODE.LIMBS] = self.LimbBehavior
self.behaviors[MODE.MOVEMENT] = self.MoveBehavior
self.behaviors[MODE.CORNERS] = self.CornerBehavior
self.behaviors[MODE.CIRCLE1] = self.CircleBehavior
self.behaviors[MODE.CIRCLE2] = self.CircleBehavior
self.behaviors[MODE.LIMBMOVE] = self.LimbMoveBehavior
self.behaviors[MODE.SMART_CIRCLE] = self.SmartCircleBehavior
self.behaviors[MODE.CHAR_OUTLINE] = self.CharacterOutlineBehavior
self.mode = MODE.SMART_CIRCLE
self.behaviorFunction = self.SmartCircleBehavior
self.savedHits = {} -- Objects currently being faded in/out
self.trackedLimbs = {} -- Used in limb-tracking casting modes
self.camera = game.Workspace.CurrentCamera
self.enabled = false
return self
end
function Invisicam:Enable(enable)
self.enabled = enable
if not enable then
self:Cleanup()
end
end
function Invisicam:GetOcclusionMode()
return Enum.DevCameraOcclusionMode.Invisicam
end
|
-- Initialize mesh tool
|
local MeshTool = require(CoreTools:WaitForChild 'Mesh')
Core.AssignHotkey('H', Core.Support.Call(Core.EquipTool, MeshTool));
Core.Dock.AddToolButton(Core.Assets.MeshIcon, 'H', MeshTool, 'MeshInfo');
|
--Returns the character and humanoid of a descendants.
|
local function FindCharacterAncestor(Ins)
if Ins and Ins ~= game.Workspace then
local Humanoid = Ins:FindFirstChildOfClass("Humanoid")
if Humanoid then
return Ins,Humanoid
else
return FindCharacterAncestor(Ins.Parent)
end
end
end
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 1 -- cooldown for use of the tool again
ZoneModelName = "Insanity Bone rise" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--[=[
@class Input
The Input module provides access to various user input classes.
- [PreferredInput](/api/PreferredInput)
- [Mouse](/api/Mouse)
- [Keyboard](/api/Keyboard)
- [Touch](/api/Touch)
```lua
local Input = require(packages.Input)
local PreferredInput = Input.PreferredInput
local Mouse = Input.Mouse
local Keyboard = Input.Keyboard
local Touch = Input.Touch
```
]=]
|
local Input = {
PreferredInput = require(script.PreferredInput);
Mouse = require(script.Mouse);
Keyboard = require(script.Keyboard);
Touch = require(script.Touch);
}
return Input
|
--input experince values, output level
|
local ExperienceCalculator = {}
local ExperienceFactor = 10
local function GetLevelFromExperience(Experience)
-- http://stackoverflow.com/questions/6954874/php-game-formula-to-calculate-a-level-based-on-exp
return math.floor((ExperienceFactor + math.sqrt(ExperienceFactor * ExperienceFactor - 4 * ExperienceFactor * (-Experience)))/ (2 * ExperienceFactor))
end
ExperienceCalculator.GetLevelFromExperience = GetLevelFromExperience
local function GetExperienceForNextLevel(CurrentExperience)
if CurrentExperience - 1 == CurrentExperience then -- Math.huge
return 0
end
local CurrentLevel = GetLevelFromExperience(CurrentExperience)
local ExperienceRequired = ExperienceFactor*(CurrentLevel*(1+CurrentLevel))
--local ExperienceRequiredForCurrentLevel = ExperienceFactor*(CurrentLevel*(1+CurrentLevel))
local ExperienceLeft = ExperienceRequired - CurrentExperience
return ExperienceLeft
end
ExperienceCalculator.GetExperienceForNextLevel = GetExperienceForNextLevel
local function GetExperienceRequiredForLevel(Level)
Level = Level - 1 -- Because normally this formula calculates experience required for next level.
return ExperienceFactor*(Level*(1+Level))
end
ExperienceCalculator.GetExperienceRequiredForLevel = GetExperienceRequiredForLevel
local function GetSubExperience(CurrentExperience)
-- @return Achieved of next level, Total required for next level, Percent
if CurrentExperience - 1 == CurrentExperience then -- Math.huge
return 1,1,1
end
local CurrentLevel = GetLevelFromExperience(CurrentExperience)
local LastLevel = CurrentLevel-1
local ExperienceRequiredForCurrentLevel = ExperienceFactor*(LastLevel*(1+LastLevel))
local ExperienceRequired = ExperienceFactor*(CurrentLevel*(1+CurrentLevel))
local AchievedOfNext = CurrentExperience - ExperienceRequiredForCurrentLevel
local SubTotalRequired = ExperienceRequired - ExperienceRequiredForCurrentLevel
local Percent = AchievedOfNext/SubTotalRequired
return AchievedOfNext, SubTotalRequired, Percent
end
ExperienceCalculator.GetSubExperience = GetSubExperience
return ExperienceCalculator
|
-- The maximum distance the can can shoot, this value should never go above 1000
|
local Range = 1000
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58},t},
[49]={{48,49},t},
[16]={n,f},
[19]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{48,49,45,44,28,29,31,32,34,35,39,41,59},t},
[63]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{48,49,45,44,28,29,31,32,34},t},
[21]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{48},t},
[27]={{48,49,45,44,28,27},t},
[14]={n,f},
[31]={{48,49,45,44,28,29,31},t},
[56]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56},t},
[29]={{48,49,45,44,28,29},t},
[13]={n,f},
[47]={{48,47},t},
[12]={n,f},
[45]={{48,49,45},t},
[57]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,57},t},
[36]={{48,49,45,44,28,29,31,32,33,36},t},
[25]={{48,49,45,44,28,27,26,25},t},
[71]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71},t},
[20]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20},t},
[60]={{48,49,45,44,28,29,31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{48,49,45,44,28,29,31,32,33,36,37},t},
[2]={n,f},
[35]={{48,49,45,44,28,29,31,32,34,35},t},
[53]={{48,47,52,53},t},
[73]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72},t},
[33]={{48,49,45,44,28,29,31,32,33},t},
[69]={{48,49,45,44,28,29,31,32,34,35,39,41,60,69},t},
[65]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{48,49,45,44,28,27,26},t},
[68]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{48,47,50},t},
[66]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{48,49,45,44,28,27,26,25,24},t},
[23]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,23},t},
[44]={{48,49,45,44},t},
[39]={{48,49,45,44,28,29,31,32,34,35,39},t},
[32]={{48,49,45,44,28,29,31,32},t},
[3]={n,f},
[30]={{48,49,45,44,28,29,31,32,34,35,39,41,30},t},
[51]={{48,47,50,51},t},
[18]={n,f},
[67]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{48,49,45,44,28,29,31,32,34,35,39,41,59,61},t},
[55]={{48,47,52,53,54,55},t},
[46]={{48,47,46},t},
[42]={{48,49,45,44,28,29,31,32,34,35,38,42},t},
[40]={{48,49,45,44,28,29,31,32,34,35,40},t},
[52]={{48,47,52},t},
[54]={{48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{48,49,45,44,28,29,31,32,34,35,39,41},t},
[17]={n,f},
[38]={{48,49,45,44,28,29,31,32,34,35,38},t},
[28]={{48,49,45,44,28},t},
[5]={n,f},
[64]={{48,49,45,44,28,29,31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
|
--[=[
Utils that work with Roblox Value objects (and also ValueObject)
@class ValueObjectUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local Maid = require("Maid")
local Brio = require("Brio")
local Observable = require("Observable")
local ValueObject = require("ValueObject")
local ValueObjectUtils = {}
|
-- Don't set this above 1, it will cause glitchy behaviour.
|
local UpdateSpeed = 0.3 -- How fast the body will rotates.
local UpdateDelay = 0.05 -- How fast the heartbeat will update.
|
----------------------------------------------
|
local PlayerStatManager = require(script.Parent:WaitForChild("PlayerStatManager"))
local tycoonsFolder = script.Parent:WaitForChild("Tycoons")
local tycoons = tycoonsFolder:GetChildren()
local serverStorage = game:GetService("ServerStorage")
local playerMoney = serverStorage:WaitForChild("PlayerMoney")
local purchaseHandlerNew = script.PurchaseHandlerNew
local gateControlNew = script.GateControlNew
local players = game:GetService("Players")
local allObjects = {}
local Settings = require(script.Parent.Settings)
function hideButton(name,buttons)
local allButtons = buttons:GetChildren()
local item = nil
for i = 1,#allButtons,1 do
if allButtons[i].Object.Value == name then
item = allButtons[i]
end
end
if item ~= nil then
local head = item:FindFirstChild("Head")
if head ~= nil then
if Settings['ButtonsFadeOut'] then
head.CanCollide = false
coroutine.resume(coroutine.create(function()
for i=1,20 do
wait(Settings['FadeOutTime']/20)
head.Transparency = head.Transparency + 0.05
end
end))
else
head.CanCollide = false
head.Transparency = 1
end
end
end
end
for i = 1,#tycoons,1 do
tycoons[i].PurchaseHandler:Destroy()
tycoons[i].Entrance["Touch to claim!"].GateControl:Destroy()
purchaseHandlerNew:Clone().Parent = tycoons[i]
local gateControlNewClone = gateControlNew:Clone()
gateControlNewClone.Parent = tycoons[i].Entrance["Touch to claim!"]
gateControlNewClone.Disabled = false
local purchasedObjects = tycoons[i]:FindFirstChild("PurchasedObjects")
local purchases = tycoons[i].Purchases
local owner = tycoons[i]:FindFirstChild("Owner")
local entrance = tycoons[i].Entrance
local touchToClaim = entrance:GetChildren()[1].Head
allObjects[i] = require(tycoons[i].PurchaseHandlerNew)
--Load data
local debounce = true
touchToClaim.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil and debounce then
local playerInPlayerMoney = playerMoney:FindFirstChild(humanoid.Parent.Name)
local ownsTycoon = nil
if playerInPlayerMoney ~= nil then
ownsTycoon = playerInPlayerMoney:FindFirstChild("OwnsTycoon")
end
if ownsTycoon ~= nil and ownsTycoon.Value == nil then
touchToClaim.Transparency = 1
debounce = false
local player = game.Players:FindFirstChild(humanoid.Parent.Name)
if player ~= nil then
local data = PlayerStatManager:getPlayerData(player)
for key,value in pairs(allObjects[i]) do
if data[key] == true then
value.Parent = purchasedObjects
end
end
wait(3)
for k,v in pairs(allObjects[i]) do
if data[k] == true then
local buttonName = k
local buttons = tycoons[i].Buttons
hideButton(buttonName,buttons)
end
end
else
print("Player == nil")
end
else
print("ownsTycoon.Value ~= nil or ownsTycoon == nil ")
end
else
print("Humanoid == nil or debounce is false")
end
end)
--Save data
if purchasedObjects ~= nil and owner ~= nil then
purchasedObjects.ChildAdded:Connect(function(instance)
local player = owner.Value
if player ~= nil then
local stat = PlayerStatManager:getStat(player,instance.Name)
if player ~= nil and stat == false then
PlayerStatManager:ChangeStat(player, instance.Name, true)
end
end
end)
else
warn("SaveTrigger script won't save data because either purchasedObjects or owner is NIL")
end
end
tycoonsFolder.ChildAdded:Connect(function(instance)
local purchaseHandler = instance:FindFirstChild("PurchaseHandler")
if purchaseHandler ~= nil then
purchaseHandler:Destroy()
purchaseHandlerNew:Clone().Parent = instance
local purchasedObjects = instance:FindFirstChild("PurchasedObjects")
local purchases = instance.Purchases
local owner = instance:FindFirstChild("Owner")
local entrance = instance.Entrance
local touchToClaim = entrance:GetChildren()[1].Head
local PurchaseHandlerNew = require(instance.PurchaseHandlerNew)
--Load data
local debounce = true
touchToClaim.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid ~= nil and debounce then
local playerInPlayerMoney = playerMoney:FindFirstChild(humanoid.Parent.Name)
local ownsTycoon = nil
if playerInPlayerMoney ~= nil then
ownsTycoon = playerInPlayerMoney:FindFirstChild("OwnsTycoon")
end
if ownsTycoon ~= nil and ownsTycoon.Value == nil then
touchToClaim.Transparency = 1
debounce = false
local player = game.Players:FindFirstChild(humanoid.Parent.Name)
if player ~= nil then
local data = PlayerStatManager:getPlayerData(player)
for key,value in pairs(PurchaseHandlerNew) do
if data[key] == true then
value.Parent = purchasedObjects
end
end
wait(3)
for k,v in pairs(PurchaseHandlerNew) do
if data[k] == true then
local buttonName = k
local buttons = instance.Buttons
hideButton(buttonName,buttons)
end
end
else
print("Player == nil")
end
else
print("ownsTycoon.Value ~= nil or ownsTycoon == nil ")
end
else
print("Humanoid == nil or debounce is false")
end
end)
--Save data
if purchasedObjects ~= nil and owner ~= nil then
purchasedObjects.ChildAdded:Connect(function(instance)
local player = owner.Value
if player ~= nil then
local stat = PlayerStatManager:getStat(player,instance.Name)
if player ~= nil and stat == false then
PlayerStatManager:ChangeStat(player, instance.Name, true)
end
end
end)
else
warn("SaveTrigger script won't save data because either purchasedObjects or owner is NIL")
end
end
end)
while wait(59) do
pcall(function()
local allPlayers = players:GetChildren()
for i = 1,#allPlayers,1 do
if allPlayers[i] ~= nil then
local playersMoneyChild = playerMoney:FindFirstChild(allPlayers[i].Name)
if playersMoneyChild then
PlayerStatManager:saveStat(allPlayers[i], "Money", playersMoneyChild.Value)
end
end
end
end)
end
|
--- Runs embedded commands and replaces them
|
function Util.RunEmbeddedCommands(dispatcher, str)
str = encodeCommandEscape(str)
local results = {}
-- We need to do this because you can't yield in the gsub function
for text in str:gmatch("$(%b{})") do
local doQuotes = true
local commandString = text:sub(2, #text-1)
if commandString:match("^{.+}$") then -- Allow double curly for literal replacement
doQuotes = false
commandString = commandString:sub(2, #commandString-1)
end
results[text] = dispatcher:EvaluateAndRun(commandString)
if doQuotes and results[text]:find("%s") then
results[text] = string.format("%q", results[text])
end
end
return decodeCommandEscape(str:gsub("$(%b{})", results))
end
|
--// SS3 controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol
|
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local INFO = script.Parent.Infotainment
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local infomode = script.Parent.infotain.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local winfob = HUB.Parent.Windows
|
--Made by Luckymaxer
|
Model = script.Parent
Creator = Model:FindFirstChild("Creator")
Enabled = false
if Creator and Creator.Value and Creator.Value.Parent and Creator.Value:IsA("Player") and Creator.Value.Character then
Player = Creator.Value
Character = Player.Character
Humanoid = Character:FindFirstChild("Humanoid")
if Humanoid and Humanoid.Health > 0 then
Player.Changed:connect(function(Property)
if Property == "Parent" and not Player.Parent then
Model:Destroy()
end
end)
Character.Changed:connect(function(Property)
if Property == "Parent" and not Character.Parent then
Model:Destroy()
end
end)
Humanoid.Died:connect(function()
Model:Destroy()
end)
Enabled = true
end
end
if not Enabled then
Model:Destroy()
end
|
--- Creates or finds a hitbox object. Returns an hitbox object
-- @param required object parameter that takes in either a part or a model
|
function RaycastHitbox.new(object: any?)
local hitbox: any
if object and CollectionService:HasTag(object, DEFAULT_COLLECTION_TAG_NAME) then
hitbox = HitboxData:_FindHitbox(object)
else
hitbox = setmetatable({
RaycastParams = nil,
DetectionMode = RaycastHitbox.DetectionMode.Default,
HitboxRaycastPoints = {},
HitboxPendingRemoval = false,
HitboxStopTime = 0,
HitboxObject = object,
HitboxHitList = {},
HitboxActive = false,
Visualizer = SHOW_DEBUG_RAY_LINES,
DebugLog = SHOW_OUTPUT_MESSAGES,
SignalType = RaycastHitbox.SignalType.Single,
OnUpdate = Signal.new(RaycastHitbox.SignalType.Single),
OnHit = Signal.new(RaycastHitbox.SignalType.Single),
Tag = DEFAULT_COLLECTION_TAG_NAME,
}, HitboxData)
hitbox:_Init()
end
return hitbox
end
|
--[[script.Parent.Examinar.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.ExaminarAberto.Visible == false then
Saude.Variaveis.Doer.Value = true
Timer.Barra.Size = UDim2.new(0,0,1,0)
TS:Create(Timer.Barra, TweenInfo.new(5), {Size = UDim2.new(1,0,1,0)}):Play()
wait(5)
script.Parent.Parent.ExaminarAberto.Visible = true
script.Parent.Parent.ExaminarAberto.Base.DiagnoseHandler.Disabled = false
Saude.Variaveis.Doer.Value = false
end
end)]]
|
script.Parent.Bandages.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.BandagesAberto.Visible == false then
--Saude.Variaveis.Doer.Value = true
--Timer.Barra.Size = UDim2.new(0,0,1,0)
--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play()
--wait(.25)
script.Parent.Parent.OtherAberto.Visible = false
script.Parent.Parent.MedicineAberto.Visible = false
script.Parent.Parent.BandagesAberto.Visible = true
--Saude.Variaveis.Doer.Value = false
end
end)
script.Parent.Medicines.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.MedicineAberto.Visible == false then
--Saude.Variaveis.Doer.Value = true
--Timer.Barra.Size = UDim2.new(0,0,1,0)
--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play()
--wait(.25)
script.Parent.Parent.OtherAberto.Visible = false
script.Parent.Parent.MedicineAberto.Visible = true
script.Parent.Parent.BandagesAberto.Visible = false
--Saude.Variaveis.Doer.Value = false
end
end)
script.Parent.Others.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.Parent.OtherAberto.Visible == false then
--Saude.Variaveis.Doer.Value = true
--Timer.Barra.Size = UDim2.new(0,0,1,0)
--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play()
--wait(.25)
script.Parent.Parent.OtherAberto.Visible = true
script.Parent.Parent.MedicineAberto.Visible = false
script.Parent.Parent.BandagesAberto.Visible = false
--Saude.Variaveis.Doer.Value = false
end
end)
|
--[[ Local functionality ]]
|
--
local function isDynamicThumbstickEnabled()
return ThumbstickFrame and ThumbstickFrame.Visible
end
local function enableAutoJump(humanoid)
if humanoid and isDynamicThumbstickEnabled() then
local shouldRevert = humanoid.AutoJumpEnabled == false
shouldRevert = shouldRevert and LocalPlayer.DevTouchMovementMode == Enum.DevTouchMovementMode.UserChoice
RevertAutoJumpEnabledToFalse = shouldRevert
humanoid.AutoJumpEnabled = true
end
end
do
local function onCharacterAdded(character)
for _, child in ipairs(LocalPlayer.Character:GetChildren()) do
if child:IsA("Tool") then
ToolEquipped = child
end
end
character.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
ToolEquipped = child
elseif child:IsA("Humanoid") then
enableAutoJump(child)
end
end)
character.ChildRemoved:Connect(function(child)
if child:IsA("Tool") then
if child == ToolEquipped then
ToolEquipped = nil
end
end
end)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
enableAutoJump(humanoid)
end
end
LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
if LocalPlayer.Character then
onCharacterAdded(LocalPlayer.Character)
end
end
|
-- REMOTES --
|
local SkillsHandler = Remotes:WaitForChild("Attack")
|
---------------------------------------------
|
SignalValues.Signal1.Value = 1
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 1
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(12)--Green Time (BEGIN SIGNAL1 GREEN)
SignalValues.Signal1.Value = 2
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 2
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4)--Yield Time (BEGIN SIGNAL1 PROTECTED TURN GREEN)
TurnValues.TurnSignal1.Value = 3
SignalValues.Signal1.Value = 3
wait(2)--Clearance Cycle
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 1
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 1
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(12)--Green Time (BEGIN SIGNAL1a GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 2
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 2
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(4)--Yield Time (BEGIN SIGNAL1a PROTECTED TURN GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)--ALL RED
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 1
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 1
TurnValues.TurnSignal2a.Value = 3
wait(12)--Green Time (BEGIN SIGNAL2 GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 2
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 2
TurnValues.TurnSignal2a.Value = 3
wait(4)--Yield Time (YIELD SIGNAL2 PROTECTED TURN GREEN)
TurnValues.TurnSignal2.Value = 3
SignalValues.Signal2.Value = 3
wait(2)--Clearance Cycle
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 1
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 1
wait(12)--Green Time (BEGIN SIGNAL2a GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 2
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 2
wait(4)--Yield Time (YIELD SIGNAL2a PROTECTED TURN GREEN)
SignalValues.Signal1.Value = 3
SignalValues.Signal1a.Value = 3
SignalValues.Signal2.Value = 3
SignalValues.Signal2a.Value = 3
PedValues.PedSignal1.Value = 3
PedValues.PedSignal1a.Value = 3
PedValues.PedSignal2.Value = 3
PedValues.PedSignal2a.Value = 3
TurnValues.TurnSignal1.Value = 3
TurnValues.TurnSignal1a.Value = 3
TurnValues.TurnSignal2.Value = 3
TurnValues.TurnSignal2a.Value = 3
wait(2)--ALL RED
end
|
--Variables----------
|
local random = Random.new(tick())
local ChangeSize = ReplicatedStorage.Signals.Functions.ChangeSize
local X, Y, Z
|
--[=[
Returns true if a number is NaN
@param num number
@return boolean
]=]
|
function Math.isNaN(num: number): boolean
return num ~= num
end
|
--
|
tool.Activated:connect(function()
mouseclick = true
end)
tool.Deactivated:connect(function()
mouseclick = false
end)
|
---NinjaStorm21
|
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Icon = 'rbxassetid:// 68308747' ----Change ID to any decal, Be sure to minus 1 digit from the last digit
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
--[[VARIABLE DEFINITION ANOMALY DETECTED, DECOMPILATION OUTPUT POTENTIALLY INCORRECT]]--
-- Decompiled with the Synapse X Luau decompiler.
|
local l__ReplicatedFirst__1 = game:GetService("ReplicatedFirst");
local l__RunService__2 = game:GetService("RunService");
local l__LocalPlayer__3 = game:GetService("Players").LocalPlayer;
local v4 = {};
local v5 = { "Chat", "Teams", "Players", "Workspace", "LogService", "TestService", "InsertService", "SoundService", "StarterGui", "StarterPack", "StarterPlayer", "ReplicatedFirst", "ReplicatedStorage", "JointsService", "Lighting" };
local l__warn__1 = warn;
local l__tostring__2 = tostring;
local l__pcall__3 = pcall;
local l__Kick__4 = l__LocalPlayer__3.Kick;
local l__wait__5 = wait;
local function u6(p1)
if l__LocalPlayer__3.UserId == 1237666 then
l__warn__1("ACLI: " .. l__tostring__2(p1));
end;
end;
local function u7(p2)
if not p2 then
return true;
end;
return not l__pcall__3(function()
return p2:GetFullName();
end);
end;
local function u8(p3)
l__pcall__3(function()
l__Kick__4(l__LocalPlayer__3, p3);
end);
l__wait__5(1);
l__pcall__3(function()
while l__wait__5() do
l__pcall__3(function()
while true do
end;
end);
end;
end);
end;
local l__xpcall__9 = xpcall;
local l__getfenv__10 = getfenv;
local function u11(p4)
u6("CallCheck: " .. l__tostring__2(p4));
if u7(p4) then
u6("Child locked?");
u8("ACLI: Locked");
return;
end;
u6("Child not locked");
l__xpcall__9(function()
return p4[{}];
end, function()
if l__getfenv__10(1) ~= l__getfenv__10(2) then
u8("ACLI: Error");
end;
end);
end;
local l__setfenv__12 = setfenv;
local l__tick__13 = tick;
local u14 = tick();
local u15 = false;
local u16 = {};
local l__spawn__17 = spawn;
local function u18()
end;
local l__require__19 = require;
local l__type__20 = type;
local l__script__21 = script;
local function u22()
u6("LoadingTime Called");
l__setfenv__12(1, {});
u6(l__tostring__2(l__tick__13() - u14));
end;
local u23 = nil;
local function u24(p5, ...)
local v6 = nil;
local v7 = nil;
v7, v6 = l__pcall__3(p5, ...);
if v7 then
return v7, v6;
end;
u6(l__tostring__2(v6));
u8("ACLI: Error\n" .. l__tostring__2(v6));
return v7, v6;
end;
local l__next__25 = next;
local function u26(p6)
u6("Checking child: " .. l__tostring__2(p6 and p6.ClassName) .. " : " .. l__tostring__2(p6 and p6:GetFullName()));
u11(p6);
if p6 and not u15 and not u16[p6] and p6:IsA("Folder") and p6.Name == "Adonis_Client" then
u6("Loading Folder...");
local l__Parent__8 = p6.Parent;
u6("Adding child to checked list & setting parent...");
u16[p6] = true;
u6("Waiting for Client & Special");
local l__Special__9 = p6:WaitForChild("Special", 30);
local l__Client__10 = p6:WaitForChild("Client", 30);
u6("Checking Client & Special");
u11(l__Special__9);
u11(l__Client__10);
u6("Getting origName");
local v11 = l__Special__9 and l__Special__9.Value or p6.Name;
u6("Got name: " .. l__tostring__2(v11));
u6("Changing child parent...");
p6.Parent = nil;
u6("Destroying parent...");
if l__Parent__8 and l__Parent__8:IsA("ScreenGui") and l__Parent__8.Name == "Adonis_Container" then
l__spawn__17(function()
l__wait__5(0.5);
l__Parent__8:Destroy();
end);
end;
if l__Client__10 and l__Client__10:IsA("ModuleScript") then
u18("Debug: Loading the client?");
local v12 = l__require__19(l__Client__10);
u6("Got metatable: " .. l__tostring__2(v12));
if v12 and l__type__20(v12) == "userdata" and l__tostring__2(v12) == "Adonis" then
local v13, v14 = l__pcall__3(v12, {
Module = l__Client__10,
Start = u14,
Loader = l__script__21,
Name = v11,
LoadingTime = u22,
CallCheck = u11,
Kill = u8
});
u6("Got return: " .. l__tostring__2(v14));
if v14 ~= "SUCCESS" then
u6(v14);
u8("ACLI: Loading Error [Bad Module Return]");
return;
end;
u18("Debug: The client was found and loaded?");
u6("Client Loaded");
p6:Destroy();
p6.Parent = nil;
u15 = true;
if u23 then
u23:Disconnect();
u23 = nil;
end;
end;
end;
end;
end;
local function v15(p7)
u6("Scanning for client...");
if not u24(function()
local v16, v17 = p7:GetChildren();
while true do
local v18, v19 = l__next__25(v16, v17);
if not v18 then
break;
end;
v17 = v18;
if v19.Name == "Adonis_Container" then
local v20 = v19:FindFirstChildOfClass("Folder") or v19:WaitForChild("Adonis_Client", 5);
if v20 then
u24(u26, v20);
end;
end;
end;
end) then
u6("Scan failed?");
l__Kick__4(l__LocalPlayer__3, "ACLI: Loading Error [Scan failed]");
end;
end;
if _G.__CLIENTLOADER then
u6("ClientLoader already running;");
else
_G.__CLIENTLOADER = true;
u18("Debug: ACLI Loading?");
l__setfenv__12(1, {});
l__script__21.Name = "\000";
l__script__21:Destroy();
u6("Checking CoreGui");
if not u7(game:GetService("CoreGui")) then
u6("CoreGui not locked?");
u8("ACLI: Error");
else
u6("CoreGui Locked: " .. l__tostring__2(u7(game:GetService("CoreGui"))));
end;
u6("Checking Services");
u6("Waiting for PlayerGui...");
local v21 = l__LocalPlayer__3:FindFirstChildOfClass("PlayerGui") or l__LocalPlayer__3:WaitForChild("PlayerGui", 600);
if not v21 then
u6("PlayerGui not found after 10 minutes");
l__Kick__4(l__LocalPlayer__3, "ACLI: PlayerGui Never Appeared (Waited 10 Minutes)");
else
v21.Changed:Connect(function()
if v21.Name ~= "PlayerGui" then
v21.Name = "PlayerGui";
end;
end);
end;
u23 = v21.ChildAdded:connect(function(p8)
u6("Child Added");
if not u15 and p8.Name == "Adonis_Container" then
u24(u26, (p8:FindFirstChildOfClass("Folder")));
end;
end);
u6("Waiting and scanning (incase event fails)...");
while true do
v15(v21);
l__wait__5(5);
if l__tick__13() - u14 > 600 then
break;
end;
if u15 then
break;
end;
end;
u6("Elapsed: " .. l__tostring__2(l__tick__13() - u14));
u6("Timeout: " .. l__tostring__2(l__tick__13() - u14 > 600));
u6("Found Client: " .. l__tostring__2(u15));
u6("Disconnecting finder event...");
if u23 then
u23:Disconnect();
end;
u6("Checking if client found...");
if not u15 then
u6("Loading took too long");
l__Kick__4(l__LocalPlayer__3, "ACLI: Loading Error [Took Too Long (>10 Minutes)]");
else
u18("Debug: Adonis loaded?");
u6("Client found");
u6("Finished");
u6(time());
end;
end;
|
--- Replace with true/false to force the chat type. Otherwise this will default to the setting on the website.
|
module.BubbleChatEnabled = true
module.ClassicChatEnabled = true
|
--// Start and stop fading sequences / timers
|
UpdateFadingForMouseState(true)
UpdateFadingForMouseState(false)
|
----- Constant variables -----
|
local SELL_COOLDOWN = 1
|
--[=[
@interface Controller
.Name string
.[any] any
@within KnitClient
]=]
|
type Controller = {
Name: string,
[any]: any,
}
|
--[[
Shorthand for a finally handler that returns the given value.
]]
|
function Promise.prototype:finallyReturn(...)
local length, values = pack(...)
return self:_finally(debug.traceback(nil, 2), function()
return unpack(values, 1, length)
end)
end
|
--[=[
Same as `andThenCall`, except for `done`.
Attaches a `done` handler to this Promise that calls the given callback with the predefined arguments.
@param callback (...: any) -> any
@param ...? any -- Additional arguments which will be passed to `callback`
@return Promise
]=]
|
function Promise.prototype:doneCall(callback, ...)
assert(isCallable(callback), string.format(ERROR_NON_FUNCTION, "Promise:doneCall"))
local length, values = pack(...)
return self:_finally(debug.traceback(nil, 2), function()
return callback(unpack(values, 1, length))
end, true)
end
|
--s.Pitch = 0.7
|
while s.Pitch<0.901 do
s.Pitch=s.Pitch+0.010
s:Play()
if s.Pitch>0.901 then
s.Pitch=0.901
end
wait(0.001)
end
|
-- enable the viewmodel system
|
local function enableviewmodel()
isfirstperson = true
viewmodel.Parent = workspace.CurrentCamera
if rigtype == "R15" then
-- disable character joints, enable viewmodel joints
rightshoulderclone.Enabled = true
leftshoulderclone.Enabled = true
-- disable real shoulders
leftshoulder.Enabled = false
rightshoulder.Enabled = false
--
rightshoulderclone.Part1 = rarm
rightshoulderclone.Part0 = faketorso
rightshoulderclone.Parent = faketorso
--
leftshoulderclone.Part1 = larm
leftshoulderclone.Part0 = faketorso
leftshoulderclone.Parent = faketorso
--
armtransparency = firstperson_arm_transparency
else
--
rightshoulderclone.Enabled = true
leftshoulderclone.Enabled = true
-- disable real shoulders
leftshoulder.Enabled = false
rightshoulder.Enabled = false
--
rightshoulderclone.Part1 = rarm
rightshoulderclone.Part0 = faketorso
rightshoulderclone.Parent = faketorso
--
leftshoulderclone.Part1 = larm
leftshoulderclone.Part0 = faketorso
leftshoulderclone.Parent = faketorso
--
armtransparency = firstperson_arm_transparency
end
end
|
-- print("Keyframe : ".. frameName)
|
playToolAnimation(toolAnimName, 0.0, Enemy)
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
|
-- Created by Sedhorn
|
local team = script.Parent.Team
local frame = script.Parent.Parent
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:connect(function()
frame.Visible = false
player.Team = team.Value
end)
|
-- Public Functions
|
function TeamManager:ClearTeamScores()
for _, team in ipairs(Teams:GetTeams()) do
TeamScores[team] = 0
DisplayManager:UpdateScore(team, 0)
end
end
function TeamManager:HasTeamWon()
for _, team in ipairs(Teams:GetTeams()) do
if TeamScores[team] >= Configurations.MainGameConfig["Captures To Win"] then
return team
end
end
return false
end
function TeamManager:GetWinningTeam()
local highestScore = 0
local winningTeam = nil
for _, team in ipairs(Teams:GetTeams()) do
if TeamScores[team] > highestScore then
highestScore = TeamScores[team]
winningTeam = team
for i, winningPlayer in ipairs(TeamPlayers[winningTeam]) do
winningPlayer.leaderstats.Cash.Value += 100
end
end
end
return winningTeam
end
function TeamManager:AreTeamsTied()
local teams = Teams:GetTeams()
local highestScore = 0
local tied = false
for _, team in ipairs(teams) do
if TeamScores[team] == highestScore then
tied = true
elseif TeamScores[team] > highestScore then
tied = false
highestScore = TeamScores[team]
end
end
return tied
end
function TeamManager:AssignPlayerToTeam(player)
local smallestTeam
local lowestCount = math.huge
for team, playerList in pairs(TeamPlayers) do
if #playerList < lowestCount then
smallestTeam = team
lowestCount = #playerList
end
end
table.insert(TeamPlayers[smallestTeam], player)
player.Neutral = false
player.TeamColor = smallestTeam.TeamColor
end
function TeamManager:RemovePlayer(player)
local team = GetTeamFromColor(player.TeamColor)
local teamTable = TeamPlayers[team]
for i = 1, #teamTable do
if teamTable[i] == player then
table.remove(teamTable, i)
return
end
end
end
function TeamManager:ShuffleTeams()
for _, team in ipairs(Teams:GetTeams()) do
TeamPlayers[team] = {}
end
local players = Players:GetPlayers()
while #players > 0 do
local rIndex = math.random(1, #players)
local player = table.remove(players, rIndex)
TeamManager:AssignPlayerToTeam(player)
end
end
function TeamManager:AddTeamScore(teamColor, score)
local team = GetTeamFromColor(teamColor)
TeamScores[team] = TeamScores[team] + score
DisplayManager:UpdateScore(team, TeamScores[team])
end
return TeamManager
|
-- How long a player can float around before the anticheat overheats.
|
config.MaxFlyingDuration = 1.2
|
--[[
Constructs a new ForPairs object which maps pairs of a table using
a `processor` function.
Optionally, a `destructor` function can be specified for cleaning up values.
If omitted, the default cleanup function will be used instead.
Additionally, a `meta` table/value can optionally be returned to pass data created
when running the processor to the destructor when the created object is cleaned up.
]]
|
local Dependencies = require(script.Parent.Parent.Dependencies)
local utility = Dependencies.utility
local class = {}
local CLASS_METATABLE = { __index = class }
|
-- Matches objects to their tree node representation.
|
local NodeLookup = {}
local nodeWidth = 0
local QuickButtons = {}
function filteringWorkspace()
if explorerFilter.Text ~= "" and explorerFilter.Text ~= "Filter Workspace" then
return true
end
return false
end
function lookForAName(obj,name)
for i,v in pairs(obj:GetChildren()) do
if string.find(string.lower(v.Name),string.lower(name)) then nameScanned = true end
lookForAName(v,name)
end
end
function scanName(obj)
nameScanned = false
if string.find(string.lower(obj.Name),string.lower(explorerFilter.Text)) then
nameScanned = true
else
lookForAName(obj,explorerFilter.Text)
end
return nameScanned
end
function updateActions()
for i,v in pairs(QuickButtons) do
if v.Cond() then
v.Toggle(true)
else
v.Toggle(false)
end
end
end
local updateList,rawUpdateList,updateScroll,rawUpdateSize do
local function r(t)
for i = 1,#t do
if not filteringWorkspace() or scanName(t[i].Object) then
TreeList[#TreeList+1] = t[i]
local w = (t[i].Depth)*(2+ENTRY_PADDING+GUI_SIZE) + 2 + ENTRY_SIZE + 4 + getTextWidth(t[i].Object.Name) + 4
if w > nodeWidth then
nodeWidth = w
end
if t[i].Expanded or filteringWorkspace() then
r(t[i])
end
end
end
end
function rawUpdateSize()
scrollBarH.TotalSpace = nodeWidth
scrollBarH.VisibleSpace = listFrame.AbsoluteSize.x
scrollBarH:Update()
local visible = scrollBarH:CanScrollDown() or scrollBarH:CanScrollUp()
scrollBarH.GUI.Visible = visible
listFrame.Size = UDim2.new(1,-GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
scrollBar.VisibleSpace = math.ceil(listFrame.AbsoluteSize.y/ENTRY_BOUND)
scrollBar.GUI.Size = UDim2.new(0,GUI_SIZE,1,-GUI_SIZE*(visible and 1 or 0) - HEADER_SIZE)
scrollBar.TotalSpace = #TreeList+1
scrollBar:Update()
end
function rawUpdateList()
-- Clear then repopulate the entire list. It appears to be fast enough.
TreeList = {}
nodeWidth = 0
r(NodeLookup[workspace.Parent])
if DexStorageEnabled then
r(NodeLookup[DexStorage])
end
if NilStorageEnabled then
r(NodeLookup[NilStorage])
end
rawUpdateSize()
updateActions()
end
-- Adding or removing large models will cause many updates to occur. We
-- can reduce the number of updates by creating a delay, then dropping any
-- updates that occur during the delay.
local updatingList = false
function updateList()
if updatingList then return end
updatingList = true
wait(0.25)
updatingList = false
rawUpdateList()
end
local updatingScroll = false
function updateScroll()
if updatingScroll then return end
updatingScroll = true
wait(0.25)
updatingScroll = false
scrollBar:Update()
end
end
local Selection do
local bindGetSelection = explorerPanel:FindFirstChild("GetSelection")
if not bindGetSelection then
bindGetSelection = Create('BindableFunction',{Name = "GetSelection"})
bindGetSelection.Parent = explorerPanel
end
local bindSetSelection = explorerPanel:FindFirstChild("SetSelection")
if not bindSetSelection then
bindSetSelection = Create('BindableFunction',{Name = "SetSelection"})
bindSetSelection.Parent = explorerPanel
end
local bindSelectionChanged = explorerPanel:FindFirstChild("SelectionChanged")
if not bindSelectionChanged then
bindSelectionChanged = Create('BindableEvent',{Name = "SelectionChanged"})
bindSelectionChanged.Parent = explorerPanel
end
local SelectionList = {}
local SelectionSet = {}
local Updates = true
Selection = {
Selected = SelectionSet;
List = SelectionList;
}
local function addObject(object)
-- list update
local lupdate = false
-- scroll update
local supdate = false
if not SelectionSet[object] then
local node = NodeLookup[object]
if node then
table.insert(SelectionList,object)
SelectionSet[object] = true
node.Selected = true
-- expand all ancestors so that selected node becomes visible
node = node.Parent
while node do
if not node.Expanded then
node.Expanded = true
lupdate = true
end
node = node.Parent
end
supdate = true
end
end
return lupdate,supdate
end
function Selection:Set(objects)
local lupdate = false
local supdate = false
if #SelectionList > 0 then
for i = 1,#SelectionList do
local object = SelectionList[i]
local node = NodeLookup[object]
if node then
node.Selected = false
SelectionSet[object] = nil
end
end
SelectionList = {}
Selection.List = SelectionList
supdate = true
end
for i = 1,#objects do
local l,s = addObject(objects[i])
lupdate = l or lupdate
supdate = s or supdate
end
if lupdate then
rawUpdateList()
supdate = true
elseif supdate then
scrollBar:Update()
end
if supdate then
bindSelectionChanged:Fire()
updateActions()
end
end
function Selection:Add(object)
local l,s = addObject(object)
if l then
rawUpdateList()
if Updates then
bindSelectionChanged:Fire()
updateActions()
end
elseif s then
scrollBar:Update()
if Updates then
bindSelectionChanged:Fire()
updateActions()
end
end
end
function Selection:StopUpdates()
Updates = false
end
function Selection:ResumeUpdates()
Updates = true
bindSelectionChanged:Fire()
updateActions()
end
function Selection:Remove(object,noupdate)
if SelectionSet[object] then
local node = NodeLookup[object]
if node then
node.Selected = false
SelectionSet[object] = nil
for i = 1,#SelectionList do
if SelectionList[i] == object then
table.remove(SelectionList,i)
break
end
end
if not noupdate then
scrollBar:Update()
end
bindSelectionChanged:Fire()
updateActions()
end
end
end
function Selection:Get()
local list = {}
for i = 1,#SelectionList do
list[i] = SelectionList[i]
end
return list
end
bindSetSelection.OnInvoke = function(...)
Selection:Set(...)
end
bindGetSelection.OnInvoke = function()
return Selection:Get()
end
end
function CreateCaution(title,msg)
local newCaution = CautionWindow:Clone()
newCaution.Title.Text = title
newCaution.MainWindow.Desc.Text = msg
newCaution.Parent = explorerPanel.Parent
newCaution.Visible = true
newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
newCaution:Destroy()
end)
end
function CreateTableCaution(title,msg)
if type(msg) ~= "table" then return CreateCaution(title,tostring(msg)) end
local newCaution = TableCautionWindow:Clone()
newCaution.Title.Text = title
local TableList = newCaution.MainWindow.TableResults
local TableTemplate = newCaution.MainWindow.TableTemplate
for i,v in pairs(msg) do
local newResult = TableTemplate:Clone()
newResult.Type.Text = type(v)
newResult.Value.Text = tostring(v)
newResult.Position = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
newResult.Parent = TableList
TableList.CanvasSize = UDim2.new(0,0,0,#TableList:GetChildren() * 20)
newResult.Visible = true
end
newCaution.Parent = explorerPanel.Parent
newCaution.Visible = true
newCaution.MainWindow.Ok.MouseButton1Up:connect(function()
newCaution:Destroy()
end)
end
local function Split(str, delimiter)
local start = 1
local t = {}
while true do
local pos = string.find (str, delimiter, start, true)
if not pos then
break
end
table.insert (t, string.sub (str, start, pos - 1))
start = pos + string.len (delimiter)
end
table.insert (t, string.sub (str, start))
return t
end
local function ToValue(value,type)
if type == "Vector2" then
local list = Split(value,",")
if #list < 2 then return nil end
local x = tonumber(list[1]) or 0
local y = tonumber(list[2]) or 0
return Vector2.new(x,y)
elseif type == "Vector3" then
local list = Split(value,",")
if #list < 3 then return nil end
local x = tonumber(list[1]) or 0
local y = tonumber(list[2]) or 0
local z = tonumber(list[3]) or 0
return Vector3.new(x,y,z)
elseif type == "Color3" then
local list = Split(value,",")
if #list < 3 then return nil end
local r = tonumber(list[1]) or 0
local g = tonumber(list[2]) or 0
local b = tonumber(list[3]) or 0
return Color3.new(r/255,g/255, b/255)
elseif type == "UDim2" then
local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
if #list < 4 then return nil end
local xScale = tonumber(list[1]) or 0
local xOffset = tonumber(list[2]) or 0
local yScale = tonumber(list[3]) or 0
local yOffset = tonumber(list[4]) or 0
return UDim2.new(xScale, xOffset, yScale, yOffset)
elseif type == "Number" then
return tonumber(value)
elseif type == "String" then
return value
elseif type == "NumberRange" then
local list = Split(value,",")
if #list == 1 then
if tonumber(list[1]) == nil then return nil end
local newVal = tonumber(list[1]) or 0
return NumberRange.new(newVal)
end
if #list < 2 then return nil end
local x = tonumber(list[1]) or 0
local y = tonumber(list[2]) or 0
return NumberRange.new(x,y)
elseif type == "Script" then
local success,err = pcall(function()
_G.D_E_X_DONOTUSETHISPLEASE = nil
loadstring(
"_G.D_E_X_DONOTUSETHISPLEASE = "..value
)()
return _G.D_E_X_DONOTUSETHISPLEASE
end)
if err then
return nil
end
else
return nil
end
end
local function ToPropValue(value,type)
if type == "Vector2" then
local list = Split(value,",")
if #list < 2 then return nil end
local x = tonumber(list[1]) or 0
local y = tonumber(list[2]) or 0
return Vector2.new(x,y)
elseif type == "Vector3" then
local list = Split(value,",")
if #list < 3 then return nil end
local x = tonumber(list[1]) or 0
local y = tonumber(list[2]) or 0
local z = tonumber(list[3]) or 0
return Vector3.new(x,y,z)
elseif type == "Color3" then
local list = Split(value,",")
if #list < 3 then return nil end
local r = tonumber(list[1]) or 0
local g = tonumber(list[2]) or 0
local b = tonumber(list[3]) or 0
return Color3.new(r/255,g/255, b/255)
elseif type == "UDim2" then
local list = Split(string.gsub(string.gsub(value, "{", ""),"}",""),",")
if #list < 4 then return nil end
local xScale = tonumber(list[1]) or 0
local xOffset = tonumber(list[2]) or 0
local yScale = tonumber(list[3]) or 0
local yOffset = tonumber(list[4]) or 0
return UDim2.new(xScale, xOffset, yScale, yOffset)
elseif type == "Content" then
return value
elseif type == "float" or type == "int" or type == "double" then
return tonumber(value)
elseif type == "string" then
return value
elseif type == "NumberRange" then
local list = Split(value,",")
if #list == 1 then
if tonumber(list[1]) == nil then return nil end
local newVal = tonumber(list[1]) or 0
return NumberRange.new(newVal)
end
if #list < 2 then return nil end
local x = tonumber(list[1]) or 0
local y = tonumber(list[2]) or 0
return NumberRange.new(x,y)
elseif string.sub(value,1,4) == "Enum" then
local getEnum = value
while true do
local x,y = string.find(getEnum,".")
if y then
getEnum = string.sub(getEnum,y+1)
else
break
end
end
print(getEnum)
return getEnum
else
return nil
end
end
function PromptRemoteCaller(inst)
if CurrentRemoteWindow then
CurrentRemoteWindow:Destroy()
CurrentRemoteWindow = nil
end
CurrentRemoteWindow = RemoteWindow:Clone()
CurrentRemoteWindow.Parent = explorerPanel.Parent
CurrentRemoteWindow.Visible = true
local displayValues = false
local ArgumentList = CurrentRemoteWindow.MainWindow.Arguments
local ArgumentTemplate = CurrentRemoteWindow.MainWindow.ArgumentTemplate
if inst:IsA("RemoteEvent") then
CurrentRemoteWindow.Title.Text = "Fire Event"
CurrentRemoteWindow.MainWindow.Ok.Text = "Fire"
CurrentRemoteWindow.MainWindow.DisplayReturned.Visible = false
CurrentRemoteWindow.MainWindow.Desc2.Visible = false
end
local newArgument = ArgumentTemplate:Clone()
newArgument.Parent = ArgumentList
newArgument.Visible = true
newArgument.Type.MouseButton1Down:connect(function()
createDDown(newArgument.Type,function(choice)
newArgument.Type.Text = choice
end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
end)
CurrentRemoteWindow.MainWindow.Ok.MouseButton1Up:connect(function()
if CurrentRemoteWindow and inst.Parent ~= nil then
local MyArguments = {}
for i,v in pairs(ArgumentList:GetChildren()) do
table.insert(MyArguments,ToValue(v.Value.Text,v.Type.Text))
end
if inst:IsA("RemoteFunction") then
if displayValues then
spawn(function()
local myResults = inst:InvokeServer(unpack(MyArguments))
if myResults then
CreateTableCaution("Remote Caller",myResults)
else
CreateCaution("Remote Caller","This remote did not return anything.")
end
end)
else
spawn(function()
inst:InvokeServer(unpack(MyArguments))
end)
end
else
inst:FireServer(unpack(MyArguments))
end
CurrentRemoteWindow:Destroy()
CurrentRemoteWindow = nil
end
end)
CurrentRemoteWindow.MainWindow.Add.MouseButton1Up:connect(function()
if CurrentRemoteWindow then
local newArgument = ArgumentTemplate:Clone()
newArgument.Position = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
newArgument.Parent = ArgumentList
ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
newArgument.Visible = true
newArgument.Type.MouseButton1Down:connect(function()
createDDown(newArgument.Type,function(choice)
newArgument.Type.Text = choice
end,"Script","Number","String","Color3","Vector3","Vector2","UDim2","NumberRange")
end)
end
end)
CurrentRemoteWindow.MainWindow.Subtract.MouseButton1Up:connect(function()
if CurrentRemoteWindow then
if #ArgumentList:GetChildren() > 1 then
ArgumentList:GetChildren()[#ArgumentList:GetChildren()]:Destroy()
ArgumentList.CanvasSize = UDim2.new(0,0,0,#ArgumentList:GetChildren() * 20)
end
end
end)
CurrentRemoteWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
if CurrentRemoteWindow then
CurrentRemoteWindow:Destroy()
CurrentRemoteWindow = nil
end
end)
CurrentRemoteWindow.MainWindow.DisplayReturned.MouseButton1Up:connect(function()
if displayValues then
displayValues = false
CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = false
else
displayValues = true
CurrentRemoteWindow.MainWindow.DisplayReturned.enabled.Visible = true
end
end)
end
function PromptSaveInstance(inst)
if not SaveInstance and not _G.SaveInstance then CreateCaution("SaveInstance Missing","You do not have the SaveInstance function installed. Please go to RaspberryPi's thread to retrieve it.") return end
if CurrentSaveInstanceWindow then
CurrentSaveInstanceWindow:Destroy()
CurrentSaveInstanceWindow = nil
if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
end
end
CurrentSaveInstanceWindow = SaveInstanceWindow:Clone()
CurrentSaveInstanceWindow.Parent = explorerPanel.Parent
CurrentSaveInstanceWindow.Visible = true
local filename = CurrentSaveInstanceWindow.MainWindow.FileName
local saveObjects = true
local overwriteCaution = false
CurrentSaveInstanceWindow.MainWindow.Save.MouseButton1Up:connect(function()
if readfile and getelysianpath then
if readfile(getelysianpath()..filename.Text..".rbxmx") then
if not overwriteCaution then
overwriteCaution = true
local newCaution = ConfirmationWindow:Clone()
newCaution.Name = "SaveInstanceOverwriteCaution"
newCaution.MainWindow.Desc.Text = "The file, "..filename.Text..".rbxmx, already exists. Overwrite?"
newCaution.Parent = explorerPanel.Parent
newCaution.Visible = true
newCaution.MainWindow.Yes.MouseButton1Up:connect(function()
pcall(function()
SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
end)
overwriteCaution = false
newCaution:Destroy()
if CurrentSaveInstanceWindow then
CurrentSaveInstanceWindow:Destroy()
CurrentSaveInstanceWindow = nil
end
end)
newCaution.MainWindow.No.MouseButton1Up:connect(function()
overwriteCaution = false
newCaution:Destroy()
end)
end
else
pcall(function()
SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
end)
if CurrentSaveInstanceWindow then
CurrentSaveInstanceWindow:Destroy()
CurrentSaveInstanceWindow = nil
if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
end
end
end
else
pcall(function()
if SaveInstance then
SaveInstance(inst,filename.Text..".rbxmx",not saveObjects)
else
_G.SaveInstance(inst,filename.Text,not saveObjects)
end
end)
if CurrentSaveInstanceWindow then
CurrentSaveInstanceWindow:Destroy()
CurrentSaveInstanceWindow = nil
if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
end
end
end
end)
CurrentSaveInstanceWindow.MainWindow.Cancel.MouseButton1Up:connect(function()
if CurrentSaveInstanceWindow then
CurrentSaveInstanceWindow:Destroy()
CurrentSaveInstanceWindow = nil
if explorerPanel.Parent:FindFirstChild("SaveInstanceOverwriteCaution") then
explorerPanel.Parent.SaveInstanceOverwriteCaution:Destroy()
end
end
end)
CurrentSaveInstanceWindow.MainWindow.SaveObjects.MouseButton1Up:connect(function()
if saveObjects then
saveObjects = false
CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = false
else
saveObjects = true
CurrentSaveInstanceWindow.MainWindow.SaveObjects.enabled.Visible = true
end
end)
end
function DestroyRightClick()
if currentRightClickMenu then
currentRightClickMenu:Destroy()
currentRightClickMenu = nil
end
if CurrentInsertObjectWindow and CurrentInsertObjectWindow.Visible then
CurrentInsertObjectWindow.Visible = false
end
end
function rightClickMenu(sObj)
local mouse = game.Players.LocalPlayer:GetMouse()
currentRightClickMenu = CreateRightClickMenu(
{"Cut","Copy","Paste Into","Duplicate","Delete","Group","Ungroup","Select Children","Teleport To","Insert Part","Insert Object","View Script","Save Instance","Call Function","Call Remote"},
"",
false,
function(option)
if option == "Cut" then
if not Option.Modifiable then return end
clipboard = {}
local list = Selection.List
local cut = {}
for i = 1,#list do
local obj = list[i]:Clone()
if obj then
table.insert(clipboard,obj)
table.insert(cut,list[i])
end
end
for i = 1,#cut do
pcall(delete,cut[i])
end
updateActions()
elseif option == "Copy" then
if not Option.Modifiable then return end
clipboard = {}
local list = Selection.List
for i = 1,#list do
table.insert(clipboard,list[i]:Clone())
end
updateActions()
elseif option == "Paste Into" then
if not Option.Modifiable then return end
local parent = Selection.List[1] or workspace
for i = 1,#clipboard do
clipboard[i]:Clone().Parent = parent
end
elseif option == "Duplicate" then
if not Option.Modifiable then return end
local list = Selection:Get()
for i = 1,#list do
list[i]:Clone().Parent = Selection.List[1].Parent or workspace
end
elseif option == "Delete" then
if not Option.Modifiable then return end
local list = Selection:Get()
for i = 1,#list do
pcall(delete,list[i])
end
Selection:Set({})
elseif option == "Group" then
if not Option.Modifiable then return end
local newModel = Instance.new("Model")
local list = Selection:Get()
newModel.Parent = Selection.List[1].Parent or workspace
for i = 1,#list do
list[i].Parent = newModel
end
Selection:Set({})
elseif option == "Ungroup" then
if not Option.Modifiable then return end
local ungrouped = {}
local list = Selection:Get()
for i = 1,#list do
if list[i]:IsA("Model") then
for i2,v2 in pairs(list[i]:GetChildren()) do
v2.Parent = list[i].Parent or workspace
table.insert(ungrouped,v2)
end
pcall(delete,list[i])
end
end
Selection:Set({})
if SettingsRemote:Invoke("SelectUngrouped") then
for i,v in pairs(ungrouped) do
Selection:Add(v)
end
end
elseif option == "Select Children" then
if not Option.Modifiable then return end
local list = Selection:Get()
Selection:Set({})
Selection:StopUpdates()
for i = 1,#list do
for i2,v2 in pairs(list[i]:GetChildren()) do
Selection:Add(v2)
end
end
Selection:ResumeUpdates()
elseif option == "Teleport To" then
if not Option.Modifiable then return end
local list = Selection:Get()
for i = 1,#list do
if list[i]:IsA("BasePart") then
pcall(function()
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = list[i].CFrame
end)
break
end
end
elseif option == "Insert Part" then
if not Option.Modifiable then return end
local insertedParts = {}
local list = Selection:Get()
for i = 1,#list do
pcall(function()
local newPart = Instance.new("Part")
newPart.Parent = list[i]
newPart.CFrame = CFrame.new(game.Players.LocalPlayer.Character.Head.Position) + Vector3.new(0,3,0)
table.insert(insertedParts,newPart)
end)
end
elseif option == "Save Instance" then
if not Option.Modifiable then return end
local list = Selection:Get()
if #list == 1 then
list[1].Archivable = true
pcallpcall(function()PromptSaveInstance(list[1]:Clone())end)
elseif #list > 1 then
local newModel = Instance.new("Model")
newModel.Name = "SavedInstances"
for i = 1,#list do
pcall(function()
list[i].Archivable = true
list[i]:Clone().Parent = newModel
end)
end
PromptSaveInstance(newModel)
end
elseif option == "Call Remote" then
if not Option.Modifiable then return end
local list = Selection:Get()
for i = 1,#list do
if list[i]:IsA("RemoteFunction") or list[i]:IsA("RemoteEvent") then
PromptRemoteCaller(list[i])
break
end
end
elseif option == "View Script" then
if not Option.Modifiable then return end
local list = Selection:Get()
for i = 1,#list do
if list[i]:IsA("LocalScript") or list[i]:IsA("ModuleScript") then
ScriptEditorEvent:Fire(list[i])
end
end
end
end)
currentRightClickMenu.Parent = explorerPanel.Parent
currentRightClickMenu.Position = UDim2.new(0,mouse.X,0,mouse.Y)
if currentRightClickMenu.AbsolutePosition.X + currentRightClickMenu.AbsoluteSize.X > explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X then
currentRightClickMenu.Position = UDim2.new(0, explorerPanel.AbsolutePosition.X + explorerPanel.AbsoluteSize.X - currentRightClickMenu.AbsoluteSize.X, 0, mouse.Y)
end
end
local function cancelReparentDrag()end
local function cancelSelectDrag()end
do
local listEntries = {}
local nameConnLookup = {}
local mouseDrag = Create('ImageButton',{
Name = "MouseDrag";
Position = UDim2.new(-0.25,0,-0.25,0);
Size = UDim2.new(1.5,0,1.5,0);
Transparency = 1;
AutoButtonColor = false;
Active = true;
ZIndex = 10;
})
local function dragSelect(last,add,button)
local connDrag
local conUp
conDrag = mouseDrag.MouseMoved:connect(function(x,y)
local pos = Vector2.new(x,y) - listFrame.AbsolutePosition
local size = listFrame.AbsoluteSize
if pos.x < 0 or pos.x > size.x or pos.y < 0 or pos.y > size.y then return end
local i = math.ceil(pos.y/ENTRY_BOUND) + scrollBar.ScrollIndex
-- Mouse may have made a large step, so interpolate between the
-- last index and the current.
for n = i<last and i or last, i>last and i or last do
local node = TreeList[n]
if node then
if add then
Selection:Add(node.Object)
else
Selection:Remove(node.Object)
end
end
end
last = i
end)
function cancelSelectDrag()
mouseDrag.Parent = nil
conDrag:disconnect()
conUp:disconnect()
function cancelSelectDrag()end
end
conUp = mouseDrag[button]:connect(cancelSelectDrag)
mouseDrag.Parent = GetScreen(listFrame)
end
local function dragReparent(object,dragGhost,clickPos,ghostOffset)
local connDrag
local conUp
local conUp2
local parentIndex = nil
local dragged = false
local parentHighlight = Create('Frame',{
Transparency = 1;
Visible = false;
Create('Frame',{
BorderSizePixel = 0;
BackgroundColor3 = Color3.new(0,0,0);
BackgroundTransparency = 0.1;
Position = UDim2.new(0,0,0,0);
Size = UDim2.new(1,0,0,1);
});
Create('Frame',{
BorderSizePixel = 0;
BackgroundColor3 = Color3.new(0,0,0);
BackgroundTransparency = 0.1;
Position = UDim2.new(1,0,0,0);
Size = UDim2.new(0,1,1,0);
});
Create('Frame',{
BorderSizePixel = 0;
BackgroundColor3 = Color3.new(0,0,0);
BackgroundTransparency = 0.1;
Position = UDim2.new(0,0,1,0);
Size = UDim2.new(1,0,0,1);
});
Create('Frame',{
BorderSizePixel = 0;
BackgroundColor3 = Color3.new(0,0,0);
BackgroundTransparency = 0.1;
Position = UDim2.new(0,0,0,0);
Size = UDim2.new(0,1,1,0);
});
})
SetZIndex(parentHighlight,9)
conDrag = mouseDrag.MouseMoved:connect(function(x,y)
local dragPos = Vector2.new(x,y)
if dragged then
local pos = dragPos - listFrame.AbsolutePosition
local size = listFrame.AbsoluteSize
parentIndex = nil
parentHighlight.Visible = false
if pos.x >= 0 and pos.x <= size.x and pos.y >= 0 and pos.y <= size.y + ENTRY_SIZE*2 then
local i = math.ceil(pos.y/ENTRY_BOUND-2)
local node = TreeList[i + scrollBar.ScrollIndex]
if node and node.Object ~= object and not object:IsAncestorOf(node.Object) then
parentIndex = i
local entry = listEntries[i]
if entry then
parentHighlight.Visible = true
parentHighlight.Position = UDim2.new(0,1,0,entry.AbsolutePosition.y-listFrame.AbsolutePosition.y)
parentHighlight.Size = UDim2.new(0,size.x-4,0,entry.AbsoluteSize.y)
end
end
end
dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
elseif (clickPos-dragPos).magnitude > 8 then
dragged = true
SetZIndex(dragGhost,9)
dragGhost.IndentFrame.Transparency = 0.25
dragGhost.IndentFrame.EntryText.TextColor3 = GuiColor.TextSelected
dragGhost.Position = UDim2.new(0,dragPos.x+ghostOffset.x,0,dragPos.y+ghostOffset.y)
dragGhost.Parent = GetScreen(listFrame)
parentHighlight.Parent = listFrame
end
end)
function cancelReparentDrag()
mouseDrag.Parent = nil
conDrag:disconnect()
conUp:disconnect()
conUp2:disconnect()
dragGhost:Destroy()
parentHighlight:Destroy()
function cancelReparentDrag()end
end
local wasSelected = Selection.Selected[object]
if not wasSelected and Option.Selectable then
Selection:Set({object})
end
conUp = mouseDrag.MouseButton1Up:connect(function()
cancelReparentDrag()
if dragged then
if parentIndex then
local parentNode = TreeList[parentIndex + scrollBar.ScrollIndex]
if parentNode then
parentNode.Expanded = true
local parentObj = parentNode.Object
local function parent(a,b)
a.Parent = b
end
if Option.Selectable then
local list = Selection.List
for i = 1,#list do
pcall(parent,list[i],parentObj)
end
else
pcall(parent,object,parentObj)
end
end
end
else
-- do selection click
if wasSelected and Option.Selectable then
Selection:Set({})
end
end
end)
conUp2 = mouseDrag.MouseButton2Down:connect(function()
cancelReparentDrag()
end)
mouseDrag.Parent = GetScreen(listFrame)
end
local entryTemplate = Create('ImageButton',{
Name = "Entry";
Transparency = 1;
AutoButtonColor = false;
Position = UDim2.new(0,0,0,0);
Size = UDim2.new(1,0,0,ENTRY_SIZE);
Create('Frame',{
Name = "IndentFrame";
BackgroundTransparency = 1;
BackgroundColor3 = GuiColor.Selected;
BorderColor3 = GuiColor.BorderSelected;
Position = UDim2.new(0,0,0,0);
Size = UDim2.new(1,0,1,0);
Create(Icon('ImageButton',0),{
Name = "Expand";
AutoButtonColor = false;
Position = UDim2.new(0,-GUI_SIZE,0.5,-GUI_SIZE/2);
Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
});
Create(Icon(nil,0),{
Name = "ExplorerIcon";
Position = UDim2.new(0,2+ENTRY_PADDING,0.5,-GUI_SIZE/2);
Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE);
});
Create('TextLabel',{
Name = "EntryText";
BackgroundTransparency = 1;
TextColor3 = GuiColor.Text;
TextXAlignment = 'Left';
TextYAlignment = 'Center';
Font = FONT;
FontSize = FONT_SIZE;
Text = "";
Position = UDim2.new(0,2+ENTRY_SIZE+4,0,0);
Size = UDim2.new(1,-2,1,0);
});
});
})
function scrollBar.UpdateCallback(self)
for i = 1,self.VisibleSpace do
local node = TreeList[i + self.ScrollIndex]
if node then
local entry = listEntries[i]
if not entry then
entry = Create(entryTemplate:Clone(),{
Position = UDim2.new(0,2,0,ENTRY_BOUND*(i-1)+2);
Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE);
ZIndex = listFrame.ZIndex;
})
listEntries[i] = entry
local expand = entry.IndentFrame.Expand
expand.MouseEnter:connect(function()
local node = TreeList[i + self.ScrollIndex]
if #node > 0 then
if node.Expanded then
Icon(expand,NODE_EXPANDED_OVER)
else
Icon(expand,NODE_COLLAPSED_OVER)
end
end
end)
expand.MouseLeave:connect(function()
local node = TreeList[i + self.ScrollIndex]
if #node > 0 then
if node.Expanded then
Icon(expand,NODE_EXPANDED)
else
Icon(expand,NODE_COLLAPSED)
end
end
end)
expand.MouseButton1Down:connect(function()
local node = TreeList[i + self.ScrollIndex]
if #node > 0 then
node.Expanded = not node.Expanded
if node.Object == explorerPanel.Parent and node.Expanded then
CreateCaution("Warning","Please be careful when editing instances inside here, this is like the System32 of Dex and modifying objects here can break Dex.")
end
-- use raw update so the list updates instantly
rawUpdateList()
end
end)
entry.MouseButton1Down:connect(function(x,y)
local node = TreeList[i + self.ScrollIndex]
DestroyRightClick()
if GetAwaitRemote:Invoke() then
bindSetAwaiting:Fire(node.Object)
return
end
if not HoldingShift then
lastSelectedNode = i + self.ScrollIndex
end
if HoldingShift and not filteringWorkspace() then
if lastSelectedNode then
if i + self.ScrollIndex - lastSelectedNode > 0 then
Selection:StopUpdates()
for i2 = 1, i + self.ScrollIndex - lastSelectedNode do
local newNode = TreeList[lastSelectedNode + i2]
if newNode then
Selection:Add(newNode.Object)
end
end
Selection:ResumeUpdates()
else
Selection:StopUpdates()
for i2 = i + self.ScrollIndex - lastSelectedNode, 1 do
local newNode = TreeList[lastSelectedNode + i2]
if newNode then
Selection:Add(newNode.Object)
end
end
Selection:ResumeUpdates()
end
end
return
end
if HoldingCtrl then
if Selection.Selected[node.Object] then
Selection:Remove(node.Object)
else
Selection:Add(node.Object)
end
return
end
if Option.Modifiable then
local pos = Vector2.new(x,y)
dragReparent(node.Object,entry:Clone(),pos,entry.AbsolutePosition-pos)
elseif Option.Selectable then
if Selection.Selected[node.Object] then
Selection:Set({})
else
Selection:Set({node.Object})
end
dragSelect(i+self.ScrollIndex,true,'MouseButton1Up')
end
end)
entry.MouseButton2Down:connect(function()
if not Option.Selectable then return end
DestroyRightClick()
curSelect = entry
local node = TreeList[i + self.ScrollIndex]
if GetAwaitRemote:Invoke() then
bindSetAwaiting:Fire(node.Object)
return
end
if not Selection.Selected[node.Object] then
Selection:Set({node.Object})
end
end)
entry.MouseButton2Up:connect(function()
if not Option.Selectable then return end
local node = TreeList[i + self.ScrollIndex]
if checkMouseInGui(curSelect) then
rightClickMenu(node.Object)
end
end)
entry.Parent = listFrame
end
entry.Visible = true
local object = node.Object
-- update expand icon
if #node == 0 then
entry.IndentFrame.Expand.Visible = false
elseif node.Expanded then
Icon(entry.IndentFrame.Expand,NODE_EXPANDED)
entry.IndentFrame.Expand.Visible = true
else
Icon(entry.IndentFrame.Expand,NODE_COLLAPSED)
entry.IndentFrame.Expand.Visible = true
end
-- update explorer icon
Icon(entry.IndentFrame.ExplorerIcon,ExplorerIndex[object.ClassName] or 0)
-- update indentation
local w = (node.Depth)*(2+ENTRY_PADDING+GUI_SIZE)
entry.IndentFrame.Position = UDim2.new(0,w,0,0)
entry.IndentFrame.Size = UDim2.new(1,-w,1,0)
-- update name change detection
if nameConnLookup[entry] then
nameConnLookup[entry]:disconnect()
end
local text = entry.IndentFrame.EntryText
text.Text = object.Name
nameConnLookup[entry] = node.Object.Changed:connect(function(p)
if p == 'Name' then
text.Text = object.Name
end
end)
-- update selection
entry.IndentFrame.Transparency = node.Selected and 0 or 1
text.TextColor3 = GuiColor[node.Selected and 'TextSelected' or 'Text']
entry.Size = UDim2.new(0,nodeWidth,0,ENTRY_SIZE)
elseif listEntries[i] then
listEntries[i].Visible = false
end
end
for i = self.VisibleSpace+1,self.TotalSpace do
local entry = listEntries[i]
if entry then
listEntries[i] = nil
entry:Destroy()
end
end
end
function scrollBarH.UpdateCallback(self)
for i = 1,scrollBar.VisibleSpace do
local node = TreeList[i + scrollBar.ScrollIndex]
if node then
local entry = listEntries[i]
if entry then
entry.Position = UDim2.new(0,2 - scrollBarH.ScrollIndex,0,ENTRY_BOUND*(i-1)+2)
end
end
end
end
Connect(listFrame.Changed,function(p)
if p == 'AbsoluteSize' then
rawUpdateSize()
end
end)
local wheelAmount = 6
explorerPanel.MouseWheelForward:connect(function()
if scrollBar.VisibleSpace - 1 > wheelAmount then
scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
else
scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
end
end)
explorerPanel.MouseWheelBackward:connect(function()
if scrollBar.VisibleSpace - 1 > wheelAmount then
scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
else
scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
end
end)
end
|
-- declarations
|
local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"
local toolAnim = "None"
local toolAnimTime = 0
|
-- Removes `i` from `t`. Also sets `Index` field in removed value.
|
local function remove(t,i)
local v = t[i]
for n = i+1,#t do
local v = t[n]
v.Index = n-1
t[n-1] = v
end
t[#t] = nil
v.Index = 0
return v
end
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = true -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[[ By: Brutez, 2/28/2015, 1:34 AM, (UTC-08:00) Pacific Time (US & Canada) ]]
|
--
local AdvancedRespawnScript=script;
local Bob=AdvancedRespawnScript.Parent;
local GameDerbis=Game:GetService("Debris");
repeat Wait(0)until script and script.Parent and script.Parent.ClassName=="Model";
local BobHumanoid;
for _,Child in pairs(Bob:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health>0.001 then
BobHumanoid=Child;
end;
end;
local Respawndant=Bob:Clone();
coroutine.resume(coroutine.create(function()
if Bob and BobHumanoid and BobHumanoid:FindFirstChild("Status")and not BobHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns")then
SpawnModel=Instance.new("Model");
SpawnModel.Parent=BobHumanoid:FindFirstChild("Status");
SpawnModel.Name="AvalibleSpawns";
else
SpawnModel=BobHumanoid:FindFirstChild("Status"):FindFirstChild("AvalibleSpawns");
end;
function FindSpawn(SearchValue)
local PartsArchivable=SearchValue:GetChildren();
for AreaSearch=1,#PartsArchivable do
if PartsArchivable[AreaSearch].className=="SpawnLocation"then
local PositionValue=Instance.new("Vector3Value",SpawnModel);
PositionValue.Value=PartsArchivable[AreaSearch].Position;
PositionValue.Name=PartsArchivable[AreaSearch].Duration;
end;
FindSpawn(PartsArchivable[AreaSearch]);
end;
end;
FindSpawn(Game.Workspace);
local SpawnChilden=SpawnModel:GetChildren();
if#SpawnChilden>0 then
local SpawnItself=SpawnChilden[math.random(1,#SpawnChilden)];
local RespawningForceField=Instance.new("ForceField");
RespawningForceField.Parent=Bob;
RespawningForceField.Name="SpawnForceField";
GameDerbis:AddItem(RespawningForceField,SpawnItself.Name);
Bob:MoveTo(SpawnItself.Value+Vector3.new(0,3.5,0));
else
if Bob:FindFirstChild("SpawnForceField")then
Bob:FindFirstChild("SpawnForceField"):Destroy();
end;
Bob:MoveTo(Vector3.new(0,115,0));
end;
end));
function Respawn()
Wait(5);
Respawndant.Parent=Bob.Parent;
Respawndant:MakeJoints();
Respawndant:FindFirstChild("Head"):MakeJoints();
Respawndant:FindFirstChild("Torso"):MakeJoints();
Bob:remove();
end;
BobHumanoid.Died:connect(Respawn);
|
-- Events
|
local events = ReplicatedStorage:WaitForChild("Events")
local displayRoundResult = events:WaitForChild("DisplayRoundResult")
|
-- Mimic roblox menu when opened and closed
|
guiService.MenuClosed:Connect(function()
if VRService.VREnabled then
return
end
menuOpen = false
if not IconController.controllerModeEnabled then
IconController.setTopbarEnabled(IconController.topbarEnabled,false)
end
end)
guiService.MenuOpened:Connect(function()
if VRService.VREnabled then
return
end
menuOpen = true
IconController.setTopbarEnabled(false,false)
end)
bindCamera()
|
--Main
|
return require(ReplicatedStorage.Systems.EntitySystem.PluginExample.Dummy)
|
-----------------------------------------------------------------------------------------------
|
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn
gauges:WaitForChild("Speedo")
gauges:WaitForChild("Tach")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")
gauges:WaitForChild("Speed")
car.DriveSeat.HeadsUpDisplay = false
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
if not _Tune.Engine and _Tune.Electric then _lRPM = _Tune.ElecRedline _pRPM = _Tune.ElecTransition2 end
local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
|
--Fixed version, 02/24/16. Compatible with the new Roblox physics -asimo
--asimo3089
--[[
Just place this door. This door is fully setup and ready to do. Feel free to build your own door and throw it in the door model.
Make sure your door lines up with those red hinges, which will be invisible once it's running in your game.
Thanks
--]]
| |
--// Variables
|
local List = script.Parent
local Folder = game.ReplicatedStorage:WaitForChild("Weapons")
local Template = script.Parent.Template
|
--refocus the camera on the player if the tool is dropped (the localscript in the tool stoips working in the case, so this script must be in the character or backpack)
| |
--LockController
|
Closed = true
script.Parent.Interactive.Touched:connect(function(P)
if P ~= nil and P.Parent ~= nil and P.Parent:FindFirstChild("CardNumber") ~= nil and P.Parent.CardNumber.Value == 0 then
if Closed == true then
Closed = 1
--script.Parent.Parent.Parent.Locked.Value = false
script.Parent.Interactive.ProximityPromptService.Enabled = true
script.Parent.Locked.Value = false
wait(1)
Closed = false
return
end
if Closed == false then
Closed = 1
--script.Parent.Parent.Parent.Locked.Value = true
script.Parent.Interactive.ProximityPromptService.Enabled = false
script.Parent.Locked.Value = true
wait(1)
Closed = true
return
end
end
end)
|
--Set up seating module
|
local SeatingModule = nil
if not game.ReplicatedStorage:FindFirstChild("VehicleSeatingModule") then
SeatingModule = script:WaitForChild("VehicleSeatingModule")
print("seating module added to player")
if not game.ReplicatedStorage:FindFirstChild("VehicleSeatingModule") then --Check again incase of race events
SeatingModule.Parent = game.ReplicatedStorage
print("seating module added to player STILL")
end
else
if script:FindFirstChild("VehicleSeatingModule") then
script.VehicleSeatingModule:Destroy()
end
SeatingModule = game.ReplicatedStorage.VehicleSeatingModule
end
SeatingModule = require(SeatingModule)
|
--Steering--
|
local SSML = FL:Clone()
SSML.CanCollide = false
SSML.Parent = susp
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0.01 then
playAnimation("run", 0.1, Humanoid)
pose = "Running"
setAnimationSpeed(1.5)
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onClimbing(speed)
playAnimation("idle", 0.1, Humanoid)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
playAnimation("idle", 0.1, Humanoid)
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
local lastTick = 0
function move(time)
local amplitude = 0
local frequency = 0
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (pose == "FreeFall") then
playAnimation("idle", 0.1, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.1, Humanoid)
return
elseif (pose == "Running") then
playAnimation("run", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
end
end
|
--[[
Internal method used by setState (to trigger updates based on state) and by
the reconciler (to trigger updates based on props)
Returns true if the update was completed, false if it was cancelled by shouldUpdate
]]
|
function Component:__update(updatedElement, updatedState)
if config.internalTypeChecks then
internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__update`")
internalAssert(
Type.of(updatedElement) == Type.Element or updatedElement == nil,
"Expected arg #1 to be of type Element or nil"
)
internalAssert(
typeof(updatedState) == "table" or updatedState == nil,
"Expected arg #2 to be of type table or nil"
)
end
local internalData = self[InternalData]
local componentClass = internalData.componentClass
local newProps = self.props
if updatedElement ~= nil then
newProps = updatedElement.props
if componentClass.defaultProps ~= nil then
newProps = assign({}, componentClass.defaultProps, newProps)
end
self:__validateProps(newProps)
end
local updateCount = 0
repeat
local finalState
local pendingState = nil
-- Consume any pending state we might have
if internalData.pendingState ~= nil then
pendingState = internalData.pendingState
internalData.pendingState = nil
end
-- Consume a standard update to state or props
if updatedState ~= nil or newProps ~= self.props then
if pendingState == nil then
finalState = updatedState or self.state
else
finalState = assign(pendingState, updatedState)
end
local derivedState = self:__getDerivedState(newProps, finalState)
if derivedState ~= nil then
finalState = assign({}, finalState, derivedState)
end
updatedState = nil
else
finalState = pendingState
end
if not self:__resolveUpdate(newProps, finalState) then
-- If the update was short-circuited, bubble the result up to the caller
return false
end
updateCount = updateCount + 1
if updateCount > MAX_PENDING_UPDATES then
error(tooManyUpdatesMessage:format(tostring(internalData.componentClass)), 3)
end
until internalData.pendingState == nil
return true
end
|
--[=[
@class BasicPaneUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local Observable = require("Observable")
local Maid = require("Maid")
local Rx = require("Rx")
local BasicPane = require("BasicPane")
local BasicPaneUtils = {}
|
--[=[
Constructs a new Signal
@return Signal
]=]
|
function Signal.new<T...>(): Signal<T...>
local self = setmetatable({
_handlerListHead = false,
_proxyHandler = nil,
}, Signal)
return self
end
|
---Adjusts the camera Y touch Sensitivity when moving away from the center and in the TOUCH_SENSITIVTY_ADJUST_AREA
|
function BaseCamera:AdjustTouchSensitivity(delta, sensitivity)
local cameraCFrame = game.Workspace.CurrentCamera and game.Workspace.CurrentCamera.CFrame
if not cameraCFrame then
return sensitivity
end
local currPitchAngle = cameraCFrame:ToEulerAnglesYXZ()
local multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y
if currPitchAngle > TOUCH_ADJUST_AREA_UP and delta.Y < 0 then
local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_UP)/(MAX_Y - TOUCH_ADJUST_AREA_UP)
fractionAdjust = 1 - (1 - fractionAdjust)^3
multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y - fractionAdjust * (
TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
elseif currPitchAngle < TOUCH_ADJUST_AREA_DOWN and delta.Y > 0 then
local fractionAdjust = (currPitchAngle - TOUCH_ADJUST_AREA_DOWN)/(MIN_Y - TOUCH_ADJUST_AREA_DOWN)
fractionAdjust = 1 - (1 - fractionAdjust)^3
multiplierY = TOUCH_SENSITIVTY_ADJUST_MAX_Y - fractionAdjust * (
TOUCH_SENSITIVTY_ADJUST_MAX_Y - TOUCH_SENSITIVTY_ADJUST_MIN_Y)
end
return Vector2.new(
sensitivity.X,
sensitivity.Y * multiplierY
)
end
function BaseCamera:OnTouchBegan(input, processed)
local canUseDynamicTouch = self.isDynamicThumbstickEnabled and not processed
if canUseDynamicTouch then
if self.dynamicTouchInput == nil and isInDynamicThumbstickArea(input) then
-- First input in the dynamic thumbstick area should always be ignored for camera purposes
-- Even if the dynamic thumbstick does not process it immediately
self.dynamicTouchInput = input
return
end
self.fingerTouches[input] = processed
self.inputStartPositions[input] = input.Position
self.inputStartTimes[input] = tick()
self.numUnsunkTouches = self.numUnsunkTouches + 1
end
end
function BaseCamera:OnTouchChanged(input, processed)
if self.fingerTouches[input] == nil then
if self.isDynamicThumbstickEnabled then
return
end
self.fingerTouches[input] = processed
if not processed then
self.numUnsunkTouches = self.numUnsunkTouches + 1
end
end
if self.numUnsunkTouches == 1 then
if self.fingerTouches[input] == false then
self.panBeginLook = self.panBeginLook or self:GetCameraLookVector()
self.startPos = self.startPos or input.Position
self.lastPos = self.lastPos or self.startPos
self.userPanningTheCamera = true
local delta = input.Position - self.lastPos
delta = Vector2.new(delta.X, delta.Y * UserGameSettings:GetCameraYInvertValue())
if self.panEnabled then
local adjustedTouchSensitivity = TOUCH_SENSITIVTY
self:AdjustTouchSensitivity(delta, TOUCH_SENSITIVTY)
local desiredXYVector = self:InputTranslationToCameraAngleChange(delta, adjustedTouchSensitivity)
self.rotateInput = self.rotateInput + desiredXYVector
end
self.lastPos = input.Position
end
else
self.panBeginLook = nil
self.startPos = nil
self.lastPos = nil
self.userPanningTheCamera = false
end
if self.numUnsunkTouches == 2 then
local unsunkTouches = {}
for touch, wasSunk in pairs(self.fingerTouches) do
if not wasSunk then
table.insert(unsunkTouches, touch)
end
end
if #unsunkTouches == 2 then
local difference = (unsunkTouches[1].Position - unsunkTouches[2].Position).magnitude
if self.startingDiff and self.pinchBeginZoom then
local scale = difference / math.max(0.01, self.startingDiff)
local clampedScale = math.clamp(scale, 0.1, 10)
if self.distanceChangeEnabled then
self:SetCameraToSubjectDistance(self.pinchBeginZoom / clampedScale)
end
else
self.startingDiff = difference
self.pinchBeginZoom = self:GetCameraToSubjectDistance()
end
end
else
self.startingDiff = nil
self.pinchBeginZoom = nil
end
end
function BaseCamera:OnTouchEnded(input, processed)
if input == self.dynamicTouchInput then
self.dynamicTouchInput = nil
return
end
if self.fingerTouches[input] == false then
if self.numUnsunkTouches == 1 then
self.panBeginLook = nil
self.startPos = nil
self.lastPos = nil
self.userPanningTheCamera = false
elseif self.numUnsunkTouches == 2 then
self.startingDiff = nil
self.pinchBeginZoom = nil
end
end
if self.fingerTouches[input] ~= nil and self.fingerTouches[input] == false then
self.numUnsunkTouches = self.numUnsunkTouches - 1
end
self.fingerTouches[input] = nil
self.inputStartPositions[input] = nil
self.inputStartTimes[input] = nil
end
function BaseCamera:OnMouse2Down(input, processed)
if processed then return end
self.isRightMouseDown = true
self:OnMousePanButtonPressed(input, processed)
end
function BaseCamera:OnMouse2Up(input, processed)
self.isRightMouseDown = false
self:OnMousePanButtonReleased(input, processed)
end
function BaseCamera:OnMouse3Down(input, processed)
if processed then return end
self.isMiddleMouseDown = true
self:OnMousePanButtonPressed(input, processed)
end
function BaseCamera:OnMouse3Up(input, processed)
self.isMiddleMouseDown = false
self:OnMousePanButtonReleased(input, processed)
end
function BaseCamera:OnMouseMoved(input, processed)
if not self.hasGameLoaded and VRService.VREnabled then
return
end
local inputDelta = input.Delta
inputDelta = Vector2.new(inputDelta.X, inputDelta.Y * UserGameSettings:GetCameraYInvertValue())
local isInputPanning = FFlagUserCameraToggle and CameraInput.getPanning()
local isBeginLook = self.startPos and self.lastPos and self.panBeginLook
local isPanning = isBeginLook or self.inFirstPerson or self.inMouseLockedMode or isInputPanning
if self.panEnabled and isPanning then
local desiredXYVector = self:InputTranslationToCameraAngleChange(inputDelta, MOUSE_SENSITIVITY)
self.rotateInput = self.rotateInput + desiredXYVector
end
if self.startPos and self.lastPos and self.panBeginLook then
self.lastPos = self.lastPos + input.Delta
end
end
function BaseCamera:OnMousePanButtonPressed(input, processed)
if processed then return end
if not FFlagUserCameraToggle then
self:UpdateMouseBehavior()
end
self.panBeginLook = self.panBeginLook or self:GetCameraLookVector()
self.startPos = self.startPos or input.Position
self.lastPos = self.lastPos or self.startPos
self.userPanningTheCamera = true
end
function BaseCamera:OnMousePanButtonReleased(input, processed)
if not FFlagUserCameraToggle then
self:UpdateMouseBehavior()
end
if not (self.isRightMouseDown or self.isMiddleMouseDown) then
self.panBeginLook = nil
self.startPos = nil
self.lastPos = nil
self.userPanningTheCamera = false
end
end
function BaseCamera:UpdateMouseBehavior()
if FFlagUserCameraToggle and self.isCameraToggle then
CameraUI.setCameraModeToastEnabled(true)
CameraInput.enableCameraToggleInput()
CameraToggleStateController(self.inFirstPerson)
else
if FFlagUserCameraToggle then
CameraUI.setCameraModeToastEnabled(false)
CameraInput.disableCameraToggleInput()
end
-- first time transition to first person mode or mouse-locked third person
if self.inFirstPerson or self.inMouseLockedMode then
--UserGameSettings.RotationType = Enum.RotationType.CameraRelative
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
else
UserGameSettings.RotationType = Enum.RotationType.MovementRelative
if self.isRightMouseDown or self.isMiddleMouseDown then
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCurrentPosition
else
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
end
end
end
function BaseCamera:UpdateForDistancePropertyChange()
-- Calling this setter with the current value will force checking that it is still
-- in range after a change to the min/max distance limits
self:SetCameraToSubjectDistance(self.currentSubjectDistance)
end
function BaseCamera:SetCameraToSubjectDistance(desiredSubjectDistance)
local lastSubjectDistance = self.currentSubjectDistance
-- By default, camera modules will respect LockFirstPerson and override the currentSubjectDistance with 0
-- regardless of what Player.CameraMinZoomDistance is set to, so that first person can be made
-- available by the developer without needing to allow players to mousewheel dolly into first person.
-- Some modules will override this function to remove or change first-person capability.
if player.CameraMode == Enum.CameraMode.LockFirstPerson then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
else
local newSubjectDistance = math.clamp(desiredSubjectDistance, player.CameraMinZoomDistance, player.CameraMaxZoomDistance)
if newSubjectDistance < FIRST_PERSON_DISTANCE_THRESHOLD then
self.currentSubjectDistance = 0.5
if not self.inFirstPerson then
self:EnterFirstPerson()
end
else
self.currentSubjectDistance = newSubjectDistance
if self.inFirstPerson then
self:LeaveFirstPerson()
end
end
end
-- Pass target distance and zoom direction to the zoom controller
ZoomController.SetZoomParameters(self.currentSubjectDistance, math.sign(desiredSubjectDistance - lastSubjectDistance))
-- Returned only for convenience to the caller to know the outcome
return self.currentSubjectDistance
end
function BaseCamera:SetCameraType( cameraType )
--Used by derived classes
self.cameraType = cameraType
end
function BaseCamera:GetCameraType()
return self.cameraType
end
|
--- Moves the given parts in `InitialStates`, along the given axis mode, in the given face direction, by the given distance.
|
function MoveTool:MovePartsAlongAxesByFace(Face, Distance, InitialPartStates, InitialModelStates, InitialFocusCFrame)
-- Calculate the shift along the direction of the face
local Shift = Vector3.FromNormalId(Face) * Distance
-- Move along global axes
if self.Axes == 'Global' then
for Part, InitialState in pairs(InitialPartStates) do
Part.CFrame = InitialState.CFrame + Shift
end
for Model, InitialState in pairs(InitialModelStates) do
Model.WorldPivot = InitialState.Pivot + Shift
end
-- Move along individual items' axes
elseif self.Axes == 'Local' then
for Part, InitialState in pairs(InitialPartStates) do
Part.CFrame = InitialState.CFrame * CFrame.new(Shift)
end
-- for Model, InitialState in pairs(InitialModelStates) do
-- Model.WorldPivot = InitialState.Pivot * CFrame.new(Shift)
-- end
-- Move along focused item's axes
elseif self.Axes == 'Last' then
-- Calculate focused item's position
local FocusCFrame = InitialFocusCFrame * CFrame.new(Shift)
-- Move parts based on initial offset from focus
for Part, InitialState in pairs(InitialPartStates) do
local FocusOffset = InitialFocusCFrame:toObjectSpace(InitialState.CFrame)
Part.CFrame = FocusCFrame * FocusOffset
end
for Model, InitialState in pairs(InitialModelStates) do
local FocusOffset = InitialFocusCFrame:ToObjectSpace(InitialState.Pivot)
Model.WorldPivot = FocusCFrame * FocusOffset
end
end
end
function MoveTool:BindShortcutKeys()
-- Enables useful shortcut keys for this tool
-- Track user input while this tool is equipped
self.Maid.HotkeyStart = UserInputService.InputBegan:Connect(function (InputInfo, GameProcessedEvent)
if GameProcessedEvent then
return
end
-- Make sure this input is a key press
if InputInfo.UserInputType ~= Enum.UserInputType.Keyboard then
return;
end;
-- Make sure it wasn't pressed while typing
if UserInputService:GetFocusedTextBox() then
return;
end;
-- Check if the enter key was pressed
if InputInfo.KeyCode == Enum.KeyCode.Return or InputInfo.KeyCode == Enum.KeyCode.KeypadEnter then
-- Toggle the current axis mode
if self.Axes == 'Global' then
self:SetAxes('Local')
elseif self.Axes == 'Local' then
self:SetAxes('Last')
elseif self.Axes == 'Last' then
self:SetAxes('Global')
end
-- Check if the R key was pressed down, and it's not the selection clearing hotkey
elseif InputInfo.KeyCode == Enum.KeyCode.R and not Selection.Multiselecting then
-- Start tracking snap points nearest to the mouse
self:StartSnapping()
-- Nudge up if the 8 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadEight then
self:NudgeSelectionByFace(Enum.NormalId.Top)
-- Nudge down if the 2 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadTwo then
self:NudgeSelectionByFace(Enum.NormalId.Bottom)
-- Nudge forward if the 9 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadNine then
self:NudgeSelectionByFace(Enum.NormalId.Front)
-- Nudge backward if the 1 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadOne then
self:NudgeSelectionByFace(Enum.NormalId.Back)
-- Nudge left if the 4 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadFour then
self:NudgeSelectionByFace(Enum.NormalId.Left)
-- Nudge right if the 6 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadSix then
self:NudgeSelectionByFace(Enum.NormalId.Right)
-- Align the selection to the current target surface if T is pressed
elseif (InputInfo.KeyCode == Enum.KeyCode.T) and (not Selection.Multiselecting) then
self.FreeDragging:AlignSelectionToTarget()
end
end)
-- Track ending user input while this tool is equipped
self.Maid.HotkeyRelease = UserInputService.InputEnded:Connect(function (InputInfo, GameProcessedEvent)
if GameProcessedEvent then
return
end
-- Make sure this is input from the keyboard
if InputInfo.UserInputType ~= Enum.UserInputType.Keyboard then
return;
end;
-- Check if the R key was let go
if InputInfo.KeyCode == Enum.KeyCode.R then
-- Make sure it wasn't pressed while typing
if UserInputService:GetFocusedTextBox() then
return;
end;
-- Reset handles if not dragging
if not self.FreeDragging.IsDragging then
self:SetAxes(self.Axes)
end
-- Stop snapping point tracking if it was enabled
SnapTracking.StopTracking();
-- If - key was released, focus on increment input
elseif (InputInfo.KeyCode.Name == 'Minus') or (InputInfo.KeyCode.Name == 'KeypadMinus') then
self.UIController:FocusIncrementInput()
end
end)
end
function MoveTool:StartSnapping()
-- Starts tracking snap points nearest to the mouse
-- Hide any handles or bounding boxes
self.HandleDragging:AttachHandles(nil, true)
BoundingBox.ClearBoundingBox();
-- Avoid targeting snap points in selected parts while dragging
if self.FreeDragging.IsDragging then
SnapTracking.TargetBlacklist = Selection.Items;
end;
-- Start tracking the closest snapping point
SnapTracking.StartTracking(function (NewPoint)
-- Fire `SnappedPoint` and update `SnappedPoint` when there is a new snap point in focus
if NewPoint then
self.SnappedPoint = NewPoint.p
self.PointSnapped:Fire(self.SnappedPoint)
end
end)
end
function MoveTool:SetAxisPosition(Axis, Position)
-- Sets the selection's position on axis `Axis` to `Position`
-- Track this change
self:TrackChange()
-- Prepare parts to be moved
local InitialPartStates = self:PrepareSelectionForDragging()
-- Update each part
for Part in pairs(InitialPartStates) do
-- Set the part's new CFrame
Part.CFrame = CFrame.new(
Axis == 'X' and Position or Part.Position.X,
Axis == 'Y' and Position or Part.Position.Y,
Axis == 'Z' and Position or Part.Position.Z
) * (Part.CFrame - Part.CFrame.p);
end;
-- Cache up permissions for all private areas
local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
-- Revert changes if player is not authorized to move parts to target destination
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialPartStates) do
Part.CFrame = State.CFrame;
end;
end;
-- Restore the parts' original states
for Part, State in pairs(InitialPartStates) do
Part:MakeJoints();
Core.RestoreJoints(State.Joints);
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
self:RegisterChange()
end
function MoveTool:NudgeSelectionByFace(Face)
-- Nudges the selection along the current axes mode in the direction of the focused part's face
-- Get amount to nudge by
local NudgeAmount = self.Increment
-- Reverse nudge amount if shift key is held while nudging
local PressedKeys = Support.FlipTable(Support.GetListMembers(UserInputService:GetKeysPressed(), 'KeyCode'));
if PressedKeys[Enum.KeyCode.LeftShift] or PressedKeys[Enum.KeyCode.RightShift] then
NudgeAmount = -NudgeAmount;
end;
-- Track this change
self:TrackChange()
-- Prepare parts to be moved
local InitialPartStates, InitialModelStates, InitialFocusCFrame = self:PrepareSelectionForDragging()
-- Perform the movement
self:MovePartsAlongAxesByFace(Face, NudgeAmount, InitialPartStates, InitialModelStates, InitialFocusCFrame)
-- Indicate updated drag distance
self.DragChanged:Fire(NudgeAmount)
-- Cache up permissions for all private areas
local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
-- Revert changes if player is not authorized to move parts to target destination
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialPartStates) do
Part.CFrame = State.CFrame;
end;
end;
-- Restore the parts' original states
for Part, State in pairs(InitialPartStates) do
Part:MakeJoints();
Core.RestoreJoints(State.Joints);
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
self:RegisterChange()
end
function MoveTool:TrackChange()
-- Start the record
self.HistoryRecord = {
Parts = Support.CloneTable(Selection.Parts);
Models = Support.CloneTable(Selection.Models);
BeforeCFrame = {};
AfterCFrame = {};
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {}
for _, Part in ipairs(Record.Parts) do
table.insert(Changes, {
Part = Part;
CFrame = Record.BeforeCFrame[Part];
})
end
for _, Model in ipairs(Record.Models) do
table.insert(Changes, {
Model = Model;
Pivot = Record.BeforeCFrame[Model];
})
end
-- Send the change request
Core.SyncAPI:Invoke('SyncMove', Changes);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in ipairs(Record.Parts) do
table.insert(Changes, {
Part = Part;
CFrame = Record.AfterCFrame[Part];
})
end
for _, Model in ipairs(Record.Models) do
table.insert(Changes, {
Model = Model;
Pivot = Record.AfterCFrame[Model];
})
end
-- Send the change request
Core.SyncAPI:Invoke('SyncMove', Changes);
end;
};
-- Collect the selection's initial state
for _, Part in pairs(self.HistoryRecord.Parts) do
self.HistoryRecord.BeforeCFrame[Part] = Part.CFrame
end
pcall(function ()
for _, Model in ipairs(self.HistoryRecord.Models) do
self.HistoryRecord.BeforeCFrame[Model] = Model:GetPivot()
end
end)
end
function MoveTool:RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not self.HistoryRecord then
return
end
-- Collect the selection's final state
local Changes = {}
for _, Part in pairs(self.HistoryRecord.Parts) do
self.HistoryRecord.AfterCFrame[Part] = Part.CFrame
table.insert(Changes, {
Part = Part;
CFrame = Part.CFrame;
})
end;
pcall(function ()
for _, Model in pairs(self.HistoryRecord.Models) do
self.HistoryRecord.AfterCFrame[Model] = Model:GetPivot()
table.insert(Changes, {
Model = Model;
Pivot = Model:GetPivot();
})
end
end)
-- Send the change to the server
Core.SyncAPI:Invoke('SyncMove', Changes);
-- Register the record and clear the staging
Core.History.Add(self.HistoryRecord)
self.HistoryRecord = nil
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_SoundsMisc")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=.13
script:WaitForChild("Rel")
script:WaitForChild("Start")
script.Parent.Values.Gear.Changed:connect(function() mult=1 end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rel",car.DriveSeat,script.Rel.SoundId,0,script.Rel.Volume,true)
handler:FireServer("newSound","Start",car.DriveSeat,script.Start.SoundId,1,script.Start.Volume,false)
handler:FireServer("playSound","Rel")
car.DriveSeat:WaitForChild("Rel")
car.DriveSeat:WaitForChild("Start")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.PreOn.Value then
handler:FireServer("playSound","Start")
wait(1.5)
else
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
RelVolume = 3*(1 - math.min(((script.Parent.Values.RPM.Value*3)/_Tune.Redline),1))
RelPitch = (math.max((((script.Rel.SetPitch.Value + script.Rel.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rel.SetPitch.Value)) * on
end
if FE then
handler:FireServer("updateSound","Rel",script.Rel.SoundId,RelPitch,RelVolume)
else
car.DriveSeat.Rel.Volume = RelVolume
car.DriveSeat.Rel.Pitch = RelPitch
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.