prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- no touchy
|
local path
local waypoint
local oldpoints
local isWandering = 0
if canWander then
spawn(function()
while isWandering == 0 do
isWandering = 1
local desgx, desgz = hroot.Position.x + math.random(-WanderX, WanderX), hroot.Position.z + math.random(-WanderZ, WanderZ)
human:MoveTo( Vector3.new(desgx, 0, desgz) )
wait(math.random(4, 6))
isWandering = 0
end
end)
end
while wait() do
local enemybody = Getbody(hroot.Position)
if enemybody ~= nil then -- if player detected
isWandering = 1
local function checkw(t)
local ci = 3
if ci > #t then
ci = 3
end
if t[ci] == nil and ci < #t then
repeat
ci = ci + 1
wait()
until t[ci] ~= nil
return Vector3.new(1, 0, 0) + t[ci]
else
ci = 3
return t[ci]
end
end
path = pfs:FindPathAsync(hroot.Position, enemybody.Position)
waypoint = path:GetWaypoints()
oldpoints = waypoint
local connection;
local direct = Vector3.FromNormalId(Enum.NormalId.Front)
local ncf = hroot.CFrame * CFrame.new(direct)
direct = ncf.p.unit
local rootr = Ray.new(hroot.Position, direct)
local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)
if path and waypoint or checkw(waypoint) then
if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
human:MoveTo( checkw(waypoint).Position )
human.Jump = false
end
-- CANNOT LET BALDI JUMPS --
--[[if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
human.Jump = true
connection = human.Changed:connect(function()
human.Jump = true
end)
human:MoveTo( checkw(waypoint).Position )
else
human.Jump = false
end]]
--[[hroot.Touched:connect(function(p)
local bodypartnames = GetPlayersbodyParts(enemybody)
if p:IsA'Part' and not p.Name == bodypartnames and phit and phit.Name ~= bodypartnames and phit:IsA'Part' and rootr:Distance(phit.Position) < 5 then
connection = human.Changed:connect(function()
human.Jump = true
end)
else
human.Jump = false
end
end)]]
if connection then
connection:Disconnect()
end
else
for i = 3, #oldpoints do
human:MoveTo( oldpoints[i].Position )
end
end
elseif enemybody == nil and canWander then -- if player not detected
isWandering = 0
path = nil
waypoint = nil
human.MoveToFinished:Wait()
end
end
|
---Flip
|
function Flip()
if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
FlipWait=tick()
else
if tick()-FlipWait>=3 then
FlipDB=true
local gyro = car.DriveSeat.Flip
gyro.maxTorque = Vector3.new(10000,0,10000)
gyro.P=3000
gyro.D=500
wait(1)
gyro.maxTorque = Vector3.new(0,0,0)
gyro.P=0
gyro.D=0
FlipDB=false
end
end
end
|
--- Services ---
|
local PlayerService = game:GetService("Players")
local RunService = game:GetService("RunService")
local CollectionService = game:GetService("CollectionService")
|
-- // Chat Icon Amendment by ChipioIndustries.
-- // Based on latest chat version as of 10/10/2019
-- // Edits on lines 26, 59, 92
|
local clientChatModules = script.Parent.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local util = require(script.Parent:WaitForChild("Util"))
function CreateMessageLabel(messageData, channelName)
local fromSpeaker = messageData.FromSpeaker
local message = messageData.Message
local extraData = messageData.ExtraData or {}
local useFont = extraData.Font or ChatSettings.DefaultFont
local useTextSize = extraData.TextSize or ChatSettings.ChatWindowTextSize
local useNameColor = extraData.NameColor or ChatSettings.DefaultNameColor
local useChatColor = extraData.ChatColor or ChatSettings.DefaultMessageColor
local useChannelColor = extraData.ChannelColor or useChatColor
local tags = extraData.Tags or {}
local icons = extraData.Icons or {}
local formatUseName = string.format("[%s]:", fromSpeaker)
local speakerNameSize = util:GetStringTextBounds(formatUseName, useFont, useTextSize)
local numNeededSpaces = util:GetNumberOfSpaces(formatUseName, useFont, useTextSize) + 1
local BaseFrame, BaseMessage = util:CreateBaseMessage("", useFont, useTextSize, useChatColor)
local NameButton = util:AddNameButtonToBaseMessage(BaseMessage, useNameColor, formatUseName, fromSpeaker)
local ChannelButton = nil
local guiObjectSpacing = UDim2.new(0, 0, 0, 0)
if channelName ~= messageData.OriginalChannel then
local formatChannelName = string.format("{%s}", messageData.OriginalChannel)
ChannelButton = util:AddChannelButtonToBaseMessage(BaseMessage, useChannelColor, formatChannelName, messageData.OriginalChannel)
guiObjectSpacing = UDim2.new(0, ChannelButton.Size.X.Offset + util:GetStringTextBounds(" ", useFont, useTextSize).X, 0, 0)
numNeededSpaces = numNeededSpaces + util:GetNumberOfSpaces(formatChannelName, useFont, useTextSize) + 1
end
local tagLabels = {}
for i, tag in pairs(tags) do
local tagColor = tag.TagColor or Color3.fromRGB(255, 0, 255)
local tagText = tag.TagText or "???"
local formatTagText = string.format("[%s] ", tagText)
local label = util:AddTagLabelToBaseMessage(BaseMessage, tagColor, formatTagText)
label.Position = guiObjectSpacing
numNeededSpaces = numNeededSpaces + util:GetNumberOfSpaces(formatTagText, useFont, useTextSize)
guiObjectSpacing = guiObjectSpacing + UDim2.new(0, label.Size.X.Offset, 0, 0)
table.insert(tagLabels, label)
end
local iconLabels={}
for i,icon in pairs(icons) do
local label=util:AddIconLabelToBaseMessage(BaseMessage,icon)
label.Position=guiObjectSpacing
numNeededSpaces=numNeededSpaces+util:GetNumberOfSpaces(label,useFont,useTextSize)
guiObjectSpacing=guiObjectSpacing+UDim2.new(0,label.Size.X.Offset,0,0)
table.insert(iconLabels,label)
end
NameButton.Position = guiObjectSpacing
local function UpdateTextFunction(messageObject)
if messageData.IsFiltered then
BaseMessage.Text = string.rep(" ", numNeededSpaces) .. messageObject.Message
else
BaseMessage.Text = string.rep(" ", numNeededSpaces) .. string.rep("_", messageObject.MessageLength)
end
end
UpdateTextFunction(messageData)
local function GetHeightFunction(xSize)
return util:GetMessageHeight(BaseMessage, BaseFrame, xSize)
end
local FadeParmaters = {}
FadeParmaters[NameButton] = {
TextTransparency = {FadedIn = 0, FadedOut = 1},
TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
}
FadeParmaters[BaseMessage] = {
TextTransparency = {FadedIn = 0, FadedOut = 1},
TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
}
for i, tagLabel in pairs(tagLabels) do
local index = string.format("Tag%d", i)
FadeParmaters[tagLabel] = {
TextTransparency = {FadedIn = 0, FadedOut = 1},
TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
}
end
for i,icon in pairs(iconLabels) do
FadeParmaters[icon] ={
ImageTransparency={FadedIn=0,FadedOut=1}
}
end
if ChannelButton then
FadeParmaters[ChannelButton] = {
TextTransparency = {FadedIn = 0, FadedOut = 1},
TextStrokeTransparency = {FadedIn = 0.75, FadedOut = 1}
}
end
local FadeInFunction, FadeOutFunction, UpdateAnimFunction = util:CreateFadeFunctions(FadeParmaters)
return {
[util.KEY_BASE_FRAME] = BaseFrame,
[util.KEY_BASE_MESSAGE] = BaseMessage,
[util.KEY_UPDATE_TEXT_FUNC] = UpdateTextFunction,
[util.KEY_GET_HEIGHT] = GetHeightFunction,
[util.KEY_FADE_IN] = FadeInFunction,
[util.KEY_FADE_OUT] = FadeOutFunction,
[util.KEY_UPDATE_ANIMATION] = UpdateAnimFunction
}
end
return {
[util.KEY_MESSAGE_TYPE] = ChatConstants.MessageTypeDefault,
[util.KEY_CREATOR_FUNCTION] = CreateMessageLabel
}
|
--[=[
@within TableUtil
@function Extend
@param target table
@param extension table
@return table
Extends the target array with the extension array.
```lua
local t = {10, 20, 30}
local t2 = {30, 40, 50}
local tNew = TableUtil.Extend(t, t2)
print(tNew) --> {10, 20, 30, 30, 40, 50}
```
:::note Arrays only
This function works on arrays, but not dictionaries.
]=]
|
local function Extend<T, E>(target: { T }, extension: { E }): { T } & { E }
local tbl = table.clone(target) :: { any }
for _, v in extension do
table.insert(tbl, v)
end
return tbl
end
|
-- Auto saving and issue queue managing:
|
RunService.Heartbeat:Connect(function()
-- 1) Auto saving: --
local auto_save_list_length = #AutoSaveList
if auto_save_list_length > 0 then
local auto_save_index_speed = SETTINGS.AutoSaveProfiles / auto_save_list_length
local os_clock = os.clock()
while os_clock - LastAutoSave > auto_save_index_speed do
LastAutoSave = LastAutoSave + auto_save_index_speed
local profile = AutoSaveList[AutoSaveIndex]
if os_clock - profile._load_timestamp < SETTINGS.AutoSaveProfiles then
-- This profile is freshly loaded - auto-saving immediately after loading will cause a warning in the log:
profile = nil
for _ = 1, auto_save_list_length - 1 do
-- Move auto save index to the right:
AutoSaveIndex = AutoSaveIndex + 1
if AutoSaveIndex > auto_save_list_length then
AutoSaveIndex = 1
end
profile = AutoSaveList[AutoSaveIndex]
if os_clock - profile._load_timestamp >= SETTINGS.AutoSaveProfiles then
break
else
profile = nil
end
end
end
-- Move auto save index to the right:
AutoSaveIndex = AutoSaveIndex + 1
if AutoSaveIndex > auto_save_list_length then
AutoSaveIndex = 1
end
-- Perform save call:
if profile ~= nil then
task.spawn(SaveProfileAsync, profile) -- Auto save profile in new thread
end
end
end
-- 2) Issue queue: --
-- Critical state handling:
if ProfileService.CriticalState == false then
if #IssueQueue >= SETTINGS.IssueCountForCriticalState then
ProfileService.CriticalState = true
ProfileService.CriticalStateSignal:Fire(true)
CriticalStateStart = os.clock()
warn("[ProfileService]: Entered critical state")
end
else
if #IssueQueue >= SETTINGS.IssueCountForCriticalState then
CriticalStateStart = os.clock()
elseif os.clock() - CriticalStateStart > SETTINGS.CriticalStateLast then
ProfileService.CriticalState = false
ProfileService.CriticalStateSignal:Fire(false)
warn("[ProfileService]: Critical state ended")
end
end
-- Issue queue:
while true do
local issue_time = IssueQueue[1]
if issue_time == nil then
break
elseif os.clock() - issue_time > SETTINGS.IssueLast then
table.remove(IssueQueue, 1)
else
break
end
end
end)
|
------------------------------------------------------------------------
--
-- * used only in (lparser) luaY:primaryexp()
------------------------------------------------------------------------
|
function luaK:_self(fs, e, key)
self:exp2anyreg(fs, e)
self:freeexp(fs, e)
local func = fs.freereg
self:reserveregs(fs, 2)
self:codeABC(fs, "OP_SELF", func, e.info, self:exp2RK(fs, key))
self:freeexp(fs, key)
e.info = func
e.k = "VNONRELOC"
end
|
-- HELPER FUNCTIONS
----------------------------------------
-- Set the "MotorMaxTorque" property on all of the CylindricalConstraint motors
|
local function setMotorTorque(torque)
motorFR.MotorMaxTorque = torque
motorFL.MotorMaxTorque = torque
motorBR.MotorMaxTorque = torque
motorBL.MotorMaxTorque = torque
end
|
--------------| SYSTEM SETTINGS |--------------
|
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Blue"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 0;
["Admin"] = 0;
["Settings"] = 0;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
RankRequiredToViewIcon = 0;
WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
["fly"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["fly2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["speed"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["jumpPower"] = {
Limit = 10000;
IgnoreLimit = 3;
};
};
CommandLimitPerMinute = 60; -- Command limit per admin per minute
IgnoreCommandLimitPerMinute = 4; -- Rank requires to ignore limit
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397, 1055299}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
ChatVoiceAutoEnabled = false;
ChatVoiceRequiredRank = 0;
|
--[[Transmission]]
|
--
Tune.Clutch = true -- Implements a realistic clutch.
Tune.TransModes = {"DCT"} --[[
[Modes]
"Manual" ; Traditional clutch operated manual transmission
"DCT" ; Dual clutch transmission, where clutch is operated automatically
"Auto" ; Automatic transmission that shifts for you
>Include within brackets
eg: {"Manual"} or {"DCT", "Manual"}
>First mode is default mode ]]
|
-- ANimation
|
local Sound = script:WaitForChild("Haoshoku Sound")
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.V and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = 2
Track1 = plr.Character.Humanoid:LoadAnimation(script.AnimationCharge)
Track1:Play()
script.RemoteEventS:FireServer()
EF = game.ReplicatedStorage.Thunder.Aim:Clone()
EF.Parent = plr.Character
EF.Name = "AIM"
for i = 1,math.huge do
if Debounce == 2 then
EF.CFrame = CFrame.new(Mouse.Hit.p)
plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Mouse.Hit.p)
plr.Character.HumanoidRootPart.Anchored = true
else
break
end
wait()
end
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.V and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Debounce = 3
local Track2 = plr.Character.Humanoid:LoadAnimation(script.AnimationRelease)
Track2:Play()
Track1:Stop()
Sound:Play()
local mousepos = Mouse.Hit
script.RemoteEvent:FireServer(mousepos,Mouse.Hit.p)
wait(0.5)
EF:Destroy()
Track2:Stop()
plr.Character.HumanoidRootPart.Anchored = false
Tool.Active.Value = "None"
wait(3)
Debounce = 1
end
end)
|
--model.Part.Touched:Connect(function(player)
|
--if triggered==false then
-- triggered=true
-- leftTweenOpen:Play()
-- rightTweenOpen:Play()
-- model.Part.DoorStart:Play()
-- wait(4)
-- model.Part.DoorStart:Stop()
-- model.Part.DoorStop:Play()
|
--GAMEPASS--OR--DevProduct--
|
local Gamepass = script.Parent.Parent.GamepassId
local GamepassInfo = MarketplaceService:GetProductInfo(Gamepass.Value, Enum.InfoType.GamePass.Name)
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
BulletSpeed = Handle.BulletSpeed.Value
DisappearTime = Handle.BulletDisappearTime.Value
ReloadTime = Handle.ReloadTime.Value
BulletColor = Handle.BulletColor.Value
NozzleOffset = Vector3.new(0, 0.4, -1.1)
Sounds = {
Fire = Handle:WaitForChild("Fire"),
Reload = Handle:WaitForChild("Reload"),
HitFade = Handle:WaitForChild("HitFade")
}
PointLight = Handle:WaitForChild("PointLight")
ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Tool
ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Tool
ServerControl.OnServerInvoke = (function(player, Mode, Value, arg)
if player ~= Player or Humanoid.Health == 0 or not Tool.Enabled then
return
end
if Mode == "Click" and Value then
Activated(arg)
end
end)
function InvokeClient(Mode, Value)
pcall(function()
ClientControl:InvokeClient(Player, Mode, Value)
end)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function FindCharacterAncestor(Parent)
if Parent and Parent ~= game:GetService("Workspace") then
local humanoid = Parent:FindFirstChild("Humanoid")
if humanoid then
return Parent, humanoid
else
return FindCharacterAncestor(Parent.Parent)
end
end
return nil
end
function GetTransparentsRecursive(Parent, PartsTable)
local PartsTable = (PartsTable or {})
for i, v in pairs(Parent:GetChildren()) do
local TransparencyExists = false
pcall(function()
local Transparency = v["Transparency"]
if Transparency then
TransparencyExists = true
end
end)
if TransparencyExists then
table.insert(PartsTable, v)
end
GetTransparentsRecursive(v, PartsTable)
end
return PartsTable
end
function SelectionBoxify(Object)
local SelectionBox = Instance.new("SelectionBox")
SelectionBox.Adornee = Object
SelectionBox.Color3 = BulletColor
SelectionBox.Parent = Object
return SelectionBox
end
local function Light(Object)
local Light = PointLight:Clone()
Light.Range = (Light.Range + 2)
Light.Parent = Object
end
function FadeOutObjects(Objects, FadeIncrement)
repeat
local LastObject = nil
for i, v in pairs(Objects) do
v.Transparency = (v.Transparency + FadeIncrement)
LastObject = v
end
wait()
until LastObject.Transparency >= 1 or not LastObject
end
function Touched(Projectile, Hit)
if not Hit or not Hit.Parent then
return
end
local character, humanoid = FindCharacterAncestor(Hit)
if character and humanoid and character ~= Character then
local ForceFieldExists = false
for i, v in pairs(character:GetChildren()) do
if v:IsA("ForceField") then
ForceFieldExists = true
end
end
if not ForceFieldExists then
if Projectile then
local HitFadeSound = Projectile:FindFirstChild(Sounds.HitFade.Name)
local torso = humanoid.Torso
if HitFadeSound and torso then
HitFadeSound.Parent = torso
HitFadeSound:Play()
end
end
local script1 = script.Parent.Handle.Infect
local clone1 = script1:Clone()
local script2 = script.Parent.Handle.Damage
local clone2 = script2:Clone()
clone1.Parent = humanoid.Parent.Torso
clone1.Enabled = true
clone2.Parent = humanoid
clone2.Enabled = true
end
if Projectile and Projectile.Parent then
Projectile:Destroy()
end
end
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not Player or not Humanoid or Humanoid.Health == 0 then
return
end
end
function Activated(target)
if Tool.Enabled and Humanoid.Health > 0 then
Tool.Enabled = false
InvokeClient("PlaySound", Sounds.Fire)
local HandleCFrame = Handle.CFrame
local FiringPoint = HandleCFrame.p + HandleCFrame:vectorToWorldSpace(NozzleOffset)
local ShotCFrame = CFrame.new(FiringPoint, target)
local LaserShotClone = BaseShot:Clone()
LaserShotClone.CFrame = ShotCFrame + (ShotCFrame.lookVector * (BaseShot.Size.Z / 2))
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.velocity = ShotCFrame.lookVector * BulletSpeed
BodyVelocity.Parent = LaserShotClone
LaserShotClone.Touched:connect(function(Hit)
if not Hit or not Hit.Parent then
return
end
Touched(LaserShotClone, Hit)
end)
Debris:AddItem(LaserShotClone, DisappearTime)
LaserShotClone.Parent = game:GetService("Workspace")
wait(0.6) -- FireSound length
InvokeClient("PlaySound", Sounds.Reload)
wait(ReloadTime) -- ReloadSound length
Tool.Enabled = true
end
end
function Unequipped()
end
BaseShot = Instance.new("Part")
BaseShot.Name = "Effect"
BaseShot.Color = BulletColor
BaseShot.Material = Enum.Material.Plastic
BaseShot.Shape = Enum.PartType.Block
BaseShot.TopSurface = Enum.SurfaceType.Smooth
BaseShot.BottomSurface = Enum.SurfaceType.Smooth
BaseShot.FormFactor = Enum.FormFactor.Custom
BaseShot.Size = Vector3.new(0.2, 0.2, 3)
BaseShot.CanCollide = false
BaseShot.Locked = true
SelectionBoxify(BaseShot)
Light(BaseShot)
BaseShotSound = Sounds.HitFade:Clone()
BaseShotSound.Parent = BaseShot
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,VRecoil = {0,0} --- Vertical Recoil
,HRecoil = {0,0} --- Horizontal Recoil
,AimRecover = 0 ---- Between 0 & 1
,RecoilPunch = 0
,VPunchBase = 0 --- Vertical Punch
,HPunchBase = 0 --- Horizontal Punch
,DPunchBase = 0 --- Tilt Punch | useless
,AimRecoilReduction = 0 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0
,MinRecoilPower = 0
,MaxRecoilPower = 0
,RecoilPowerStepAmount = 0
,MinSpread = 0 --- Min bullet spread value | Studs
,MaxSpread = 0 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 0
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.05 --- Weapon Base Sway | Studs
,MaxSway = 2 --- Max sway value based on player stamina | Studs
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__MarketplaceService__1 = game:GetService("MarketplaceService");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local l__ReplicatedStorage__3 = game.ReplicatedStorage;
script.Parent.MouseButton1Click:Connect(function()
l__MarketplaceService__1:PromptGamePassPurchase(l__LocalPlayer__2, l__ReplicatedStorage__3.GamepassIDs.ExtraEquipped.Value);
end);
|
-- Services
|
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
|
--end
|
function UpdateGUI(health)
local pgui = game.Players:GetPlayerFromCharacter(humanoid.Parent).PlayerGui
local tray = pgui.HealthGUI.Tray
tray.HealthBar.Size = UDim2.new(0.2, 0, 0.8 * (health / humanoid.MaxHealth), 0)
tray.HealthBar.Position = UDim2.new(0.4, 0, 0.8 * (1- (health / humanoid.MaxHealth)) , 0)
if script.Parent.Humanoid.Health <= 30 then
tray.HealthBar.BackgroundColor3 = Color3.new(255/255, 0/255, 0/255)
print("red")
tray.Color.Value = "Red"
elseif script.Parent.Humanoid.Health <= 70 then
tray.HealthBar.BackgroundColor3 = Color3.new(255/255, 255/255, 0/255)
print("yellow")
tray.Color.Value = "Yellow"
elseif script.Parent.Humanoid.Health > 70 then
tray.HealthBar.BackgroundColor3 = Color3.new(0/255, 255/255, 0/255)
print("green")
tray.Color.Value = "Green"
end
if script.Parent.Humanoid.Health == 0 then
print("dead")
tray.Color.Value = "Dead"
end
end
function HealthChanged(health)
UpdateGUI(health)
end
|
--- Returns Maid[key] if not part of Maid metatable
-- @return Maid[key] value
|
function Maid:__index(index)
if (Maid[index]) then
return Maid[index]
else
return self._tasks[index]
end
end
|
--script.Parent.ZZ.Velocity = script.Parent.ZZ.CFrame.lookVector *script.Parent.Speed.Value
|
script.Parent.ZZZ.Velocity = script.Parent.ZZZ.CFrame.lookVector *script.Parent.Speed.Value
wait(0.1)
end
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Artichoke",Paint)
end)
|
---Green Script---
|
script.Parent.Red.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
while true do
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (1)
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (30)
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (4)
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (3)
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (1)
script.Parent.Red.Transparency = 0.9
script.Parent.SoundBox.Beep:Play()
script.Parent.Gre.Transparency = 0
wait (25)
script.Parent.SoundBox.Beep:Stop()
script.Parent.FlashScript.Disabled = false
wait (5)
script.Parent.FlashScript.Disabled = true
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (4)
script.Parent.Red.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (3)
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer;
local v2 = l__LocalPlayer__1.Character or l__LocalPlayer__1.CharacterAdded:Wait();
local l__HumanoidRootPart__3 = v2:WaitForChild("HumanoidRootPart");
local v4 = Instance.new("BodyVelocity");
v4.Parent = l__HumanoidRootPart__3;
local u1 = nil;
local l__Humanoid__2 = v2:WaitForChild("Humanoid");
local u3 = false;
canjump = 10;
local function u4()
u1 = l__Humanoid__2:GetState();
if u1 ~= Enum.HumanoidStateType.Freefall then
v4.MaxForce = Vector3.new(0, 0, 0);
v4.Velocity = l__HumanoidRootPart__3.Velocity;
u3 = false;
return;
end;
v4.MaxForce = Vector3.new(5000, 0, 5000);
if not u3 then
v4.Velocity = v4.Velocity * 1.25;
u3 = true;
end;
v4.Velocity = v4.Velocity + l__Humanoid__2.MoveDirection * 1;
end;
game:GetService("RunService").RenderStepped:Connect(function()
u4();
canjump = math.clamp(canjump - 1, 0, 10);
end);
l__Humanoid__2.UseJumpPower = true;
game:GetService("UserInputService").JumpRequest:Connect(function()
if canjump == 0 then
l__Humanoid__2.JumpPower = 40;
else
l__Humanoid__2.JumpPower = 0;
end;
canjump = 10;
end);
l__Humanoid__2.Died:Connect(function()
v4:Destroy();
end);
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
function Update()
--- Grab states
local touchEnabled = _L.Services.UserInputService.TouchEnabled
local keyboardEnabled = _L.Services.UserInputService.KeyboardEnabled
local mouseEnabled = _L.Services.UserInputService.MouseEnabled
local gamepadEnabled = _L.Services.UserInputService.GamepadEnabled
local gryoEnabled = _L.Services.UserInputService.GyroscopeEnabled
local meterEnabled = _L.Services.UserInputService.AccelerometerEnabled
local vrEnabled = _L.Services.UserInputService.VREnabled
local isTV = game:GetService("GuiService"):IsTenFootInterface()
--- Vars
local console = false
local mobile = false
local desktop = false
local vr = false
--- Platform logic
if gamepadEnabled then
--- Console (for sure)
console = true
elseif isTV and (not mouseEnabled) then
--- Console (maybeee)
console = true
elseif vrEnabled then
--- VR (for sure)
vr = true
desktop = _L.Settings.SupportsVR or false
elseif touchEnabled and (not mouseEnabled) then
--- Mobile (for sure)
mobile = true
elseif gryoEnabled or meterEnabled then
--- Mobile (maybe)
mobile = true
else
--- Desktop (if all else)
desktop = true
end
--- Variable logic
_L.Variables.Desktop = desktop
_L.Variables.Mobile = mobile
_L.Variables.Console = console
_L.Variables.VR = vr
end
|
--[=[
Provides getting named global [RemoteFunction] resources.
@class GetRemoteFunction
]=]
| |
--local hitsound=waitForChild(Torso,"HitSound")
--[[
local sounds={
waitForChild(Torso,"GroanSound"),
waitForChild(Torso,"RawrSound")
}
--]]
|
if healthregen then
local regenscript=waitForChild(sp,"HealthRegenerationScript")
regenscript.Disabled=false
end
Humanoid.WalkSpeed=wonderspeed
local toolAnim="None"
local toolAnimTime=0
BodyColors.HeadColor=BrickColor.new("Grime")
local randomcolor1=colors[math.random(1,#colors)]
BodyColors.TorsoColor=BrickColor.new(randomcolor1)
BodyColors.LeftArmColor=BrickColor.new(randomcolor1)
BodyColors.RightArmColor=BrickColor.new(randomcolor1)
local randomcolor2=colors[math.random(1,#colors)]
BodyColors.LeftLegColor=BrickColor.new(randomcolor2)
BodyColors.RightLegColor=BrickColor.new(randomcolor2)
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function IsInTable(Table,Value)
for _,v in pairs(Table) do
if v == Value then
return true
end
end
return false
end
function onRunning(speed)
if speed>0 then
pose="Running"
else
pose="Standing"
end
end
function onDied()
pose="Dead"
end
function onJumping()
pose="Jumping"
end
function onClimbing()
pose="Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function moveJump()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle=3.14
LeftShoulder.DesiredAngle=-3.14
RightHip.DesiredAngle=0
LeftHip.DesiredAngle=0
end
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity =0.5
RightShoulder.DesiredAngle=3.14
LeftShoulder.DesiredAngle=-3.14
RightHip.DesiredAngle=0
LeftHip.DesiredAngle=0
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle=3.14 /2
LeftShoulder.DesiredAngle=-3.14 /2
RightHip.DesiredAngle=3.14 /2
LeftHip.DesiredAngle=-3.14 /2
end
function animate(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Seated") then
moveSit()
return
end
local climbFudge = 0
if (pose == "Running") then
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
amplitude = 1
frequency = 9
elseif (pose == "Climbing") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
amplitude = 1
frequency = 9
climbFudge = 3.14
else
amplitude = 0.1
frequency = 1
end
local desiredAngle = amplitude * math.sin(time*frequency)
if not chasing and frequency==9 then
frequency=4
end
if chasing then
RightShoulder.DesiredAngle=math.pi/2
LeftShoulder.DesiredAngle=-math.pi/2
RightHip.DesiredAngle=-desiredAngle*2
LeftHip.DesiredAngle=-desiredAngle*2
else
RightShoulder.DesiredAngle=desiredAngle + climbFudge
LeftShoulder.DesiredAngle=desiredAngle - climbFudge
RightHip.DesiredAngle=-desiredAngle
LeftHip.DesiredAngle=-desiredAngle
end
end
function attack(time,attackpos)
if time-lastattack>=1 then
local hit,pos=raycast(Torso.Position,(attackpos-Torso.Position).unit,attackrange)
if hit and hit.Parent and hit.Parent.Name~=sp.Name then
local h=hit.Parent:FindFirstChildOfClass("Humanoid")
if h then
local creator=sp:FindFirstChild("creator")
if creator then
if creator.Value then
if creator.Value~=game.Players:GetPlayerFromCharacter(h.Parent) then
for i,oldtag in ipairs(h:GetChildren()) do
if oldtag.Name=="creator" then
oldtag:Destroy()
end
end
creator:Clone().Parent=h
else
return
end
end
end
h:TakeDamage(damage)
|
--[[
~= EXAMPLE CODE =~
return function(gui,gTable,guiData)
local name = gTable.Name
if name == "YesNoPrompt" then
local new = Instance.new("ScreenGui")
local frame = Instance.new("Frame",new)
frame.Size = UDim2.new(0,400,0,400)
local yes = Instance.new("TextButton",frame)
yes.Size = UDim2.new(0.5,0,1,0)
yes.Text = "Yes"
local no = yes:Clone()
no.Text = "No"
no.Position = UDim2.new(0.5,0,0,0)
local gTable,gIndex = client.UI.Register(new)
local ans
local waiting = true
gTable.CustomDestroy = function()
waiting = false
end
yes.MouseButton1Click:Connect(function()
ans = "Yes"
gTable:Destroy()
end)
no.MouseButton1Click:Connect(function()
ans = "No"
gTable:Destroy()
end)
repeat wait() until ans or not waiting --// Wait until answer
return ans or false
end
end
--]]
|
service = nil
client = nil
return function(gui: ScreenGui, guiData, gTable)
local TWEEN_TIME = 2
local SEQUENCE = {
Color3.fromRGB(255, 85, 88),
Color3.fromRGB(78, 140, 255),
Color3.fromRGB(78, 255, 149)
}
local CLASSES = {
Frame = true;
TextBox = true;
TextLabel = true;
TextButton = true;
ImageLabel = true;
ImageButton = true;
ScrollingFrame = true;
}
local contents = {}
local OrgColors = {}
local function getCont(obj)
for _, v in obj:GetChildren() do
if CLASSES[v.ClassName] then
local OrgColor = {}
OrgColor.Background = v.BackgroundColor3
if v:IsA("ImageLabel") or v:IsA("ImageButton") then
OrgColor.Image = v.ImageColor3
end
OrgColors[v] = OrgColor
table.insert(contents, v)
getCont(v)
end
end
end
getCont(gui)
if gTable.Name == "List" then
gui.Drag.Main.BackgroundTransparency = 0
end
local function tweenToColor(color1, color2, time)
local Info = TweenInfo.new(time, Enum.EasingStyle.Linear)
for _, v in contents do
local orgcolor = OrgColors[v]
v.BackgroundColor3 = color1:lerp(orgcolor.Background, 0.75)
if orgcolor.Image then
v.ImageColor3 = color1:lerp(orgcolor.Image, 0.75)
service.TweenService:Create(v, Info, {
BackgroundColor3 = color2:lerp(orgcolor.Background, 0.75),
ImageColor3 = color2:lerp(orgcolor.Image, 0.75)
}):Play()
else
service.TweenService:Create(v, Info, {
BackgroundColor3 = color2:lerp(orgcolor.Background, 0.75)
}):Play()
end
end
task.wait(time)
end
service.TrackTask("Thread: Colorize_"..tostring(gTable.Name),function()
repeat
for i in SEQUENCE do
local one, two = SEQUENCE[i], SEQUENCE[i+1] or SEQUENCE[1]
tweenToColor(one, two, TWEEN_TIME)
end
until not task.wait(if gTable.Active then 0 else 1) and gTable.Destroyed
end)
end
|
-- Push dedented lines of markup onto output and return true;
-- otherwise return false because:
-- * props include a multiline string
-- * text has more than one adjacent line
-- * markup does not close
|
function dedentMarkup(input: Array<string>, output: Array<string>): boolean
local line = input[#output + 1]
if not dedentStartTag(input, output) then
return false
end
if string.find(input[#output], "/>") then
return true
end
local isText = false
local stack: Array<number> = {}
table.insert(stack, getIndentationLength(line))
while #stack > 0 and #output < #input do
line = input[#output + 1]
if isFirstLineOfTag(line) then
if string.find(line, "</") then
table.insert(output, dedentLine(line))
table.remove(stack)
else
if not dedentStartTag(input, output) then
return false
end
if not string.find(input[#output], "/>") then
table.insert(stack, getIndentationLength(line))
end
end
isText = false
else
if isText then
return false -- because text has more than one adjacent line
end
local getIndentationLengthOfTag = stack[#stack]
table.insert(output, line:sub(getIndentationLengthOfTag + 3))
isText = true
end
end
return #stack == 0
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
for v1, v2 in pairs(script.Parent.ScrollingFrame:GetChildren()) do
v2.TextButton.Activated:Connect(function()
local l__Size__3 = v2.Size;
v2:TweenSize(l__Size__3 + UDim2.new(-0.05, -0, -0.05, -0), "In", "Quad", 0.05, true);
game.ReplicatedStorage.Remotes.BuyTrail:FireServer(v2.Name);
wait(0.1);
v2:TweenSize(l__Size__3 + UDim2.new(0, 0, 0, 0), "In", "Quad", 0.05, true);
end);
end;
|
-------------------------
--| Exposed Functions |--
-------------------------
|
function PopperCam:Update(EnabledCamera)
if PopperEnabled then
-- First, prep some intermediate vars
local cameraCFrame = Camera.CFrame
local focusPoint = Camera.Focus.p
if FFlagUserPortraitPopperFix and SubjectPart then
focusPoint = SubjectPart.CFrame.p
end
local ignoreList = {}
for _, character in pairs(PlayerCharacters) do
ignoreList[#ignoreList + 1] = character
end
for i = 1, #VehicleParts do
ignoreList[#ignoreList + 1] = VehicleParts[i]
end
-- Get largest cutoff distance
local largest = Camera:GetLargestCutoffDistance(ignoreList)
-- Then check if the player zoomed since the last frame,
-- and if so, reset our pop history so we stop tweening
local zoomLevel = (cameraCFrame.p - focusPoint).Magnitude
if math_abs(zoomLevel - LastZoomLevel) > 0.001 then
LastPopAmount = 0
end
-- Finally, zoom the camera in (pop) by that most-cut-off amount, or the last pop amount if that's more
local popAmount = largest
if LastPopAmount > popAmount then
popAmount = LastPopAmount
end
if popAmount > 0 then
Camera.CFrame = cameraCFrame + (cameraCFrame.lookVector * popAmount)
LastPopAmount = popAmount - POP_RESTORE_RATE -- Shrink it for the next frame
if LastPopAmount < 0 then
LastPopAmount = 0
end
end
LastZoomLevel = zoomLevel
-- Stop shift lock being able to see through walls by manipulating Camera focus inside the wall
if EnabledCamera and EnabledCamera:GetShiftLock() and not EnabledCamera:IsInFirstPerson() then
if EnabledCamera:GetCameraActualZoom() < 1 then
local subjectPosition = EnabledCamera.lastSubjectPosition
if subjectPosition then
Camera.Focus = CFrame_new(subjectPosition)
Camera.CFrame = CFrame_new(subjectPosition - MIN_CAMERA_ZOOM*EnabledCamera:GetCameraLook(), subjectPosition)
end
end
end
end
end
|
-- When tool deselected
|
function onDeselected(mouse)
myMouse = nil
end
rayPart = Instance.new("Part")
rayPart.Name = "MG Ray"
rayPart.Transparency = .5
rayPart.Anchored = true
rayPart.CanCollide = false
rayPart.TopSurface = Enum.SurfaceType.Smooth
rayPart.BottomSurface = Enum.SurfaceType.Smooth
rayPart.formFactor = Enum.FormFactor.Custom
rayPart.BrickColor = BrickColor.new("Bright yellow")
rayPart.Reflectance = 0
rayPart.Material = Enum.Material.SmoothPlastic
function fireCoax()
local MGAmmo = tankStats.MGAmmo;
if MGAmmo.Value <= 0 then
return false;
end;
local machineGun = parts.Parent.Gun.Coax
local PL = Instance.new("PointLight")
PL.Parent = machineGun
PL.Brightness = 50
PL.Color = Color3.new(255, 255, 0)
PL.Range = 15
PL.Shadows = true
MGAmmo.Value = MGAmmo.Value - 1;
machineGun.Sound:Play();
local offset = (parts.Parent.Gun.Muzzle.CFrame * CFrame.new(0,100,0).p
- parts.Parent.Gun.Muzzle.Position).unit * 4500;
local ray = Ray.new(machineGun.Position, offset);
|
--[=[
@param componentClass ComponentClass
@return Component?
Retrieves another component instance bound to the same
Roblox instance.
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
local AnotherComponent = require(somewhere.AnotherComponent)
function MyComponent:Start()
local another = self:GetComponent(AnotherComponent)
end
```
]=]
|
function Component:GetComponent(componentClass)
return componentClass._instancesToComponents[self.Instance]
end
|
--TweenService
|
local TweenService = game:GetService("TweenService")
local OpenTweenInfo = TweenInfo.new(.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local CloseTweenInfo = TweenInfo.new(.5,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
|
------------------------------------------------------------------------
-- constants used by parser
-- * picks up duplicate values from luaX if required
------------------------------------------------------------------------
|
luaY.LUA_QS = luaX.LUA_QS or "'%s'" -- (from luaconf.h)
luaY.SHRT_MAX = 32767 -- (from <limits.h>)
luaY.LUAI_MAXVARS = 200 -- (luaconf.h)
luaY.LUAI_MAXUPVALUES = 60 -- (luaconf.h)
luaY.MAX_INT = luaX.MAX_INT or 2147483645 -- (from llimits.h)
-- * INT_MAX-2 for 32-bit systems
luaY.LUAI_MAXCCALLS = 200 -- (from luaconf.h)
luaY.VARARG_HASARG = 1 -- (from lobject.h)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "TNT" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Features for Sprint
|
game:GetService("RunService").RenderStepped:Connect(function()
if isSprinting and humanoid.MoveDirection.Magnitude > 0 then
FOVIn:Play()
if humanoid:GetState() == Enum.HumanoidStateType.Running or humanoid:GetState() == Enum.HumanoidStateType.RunningNoPhysics then
if not ifSprintAnimPlaying then
sprintAnim:Play()
ifSprintAnimPlaying = true
end
else
if ifSprintAnimPlaying then
sprintAnim:Stop()
ifSprintAnimPlaying = false
end
end
else
FOVOut:Play()
if ifSprintAnimPlaying then
sprintAnim:Stop()
ifSprintAnimPlaying = false
end
end
end)
|
--Libs
|
state = script.Parent.Parent.Parent.State
config = script.Parent.Parent.Parent.Config
|
-- Useful for tuning the chassis until perfect.
-- Will turn on any value with the label (Debug)
| |
-- Gradually deals damage to the player
|
wait()
Debris = game:GetService("Debris")
Fire = script.Parent
Humanoid = Fire.Parent.Parent:FindFirstChild("Humanoid")
Character = Humanoid.Parent
if Humanoid and Humanoid.Parent then
Damage = script:WaitForChild("Damage")
Rate = 100
for i = 1, Rate do
if (Humanoid.Health - Damage.Value) <= 0 then
for i, v in pairs(Humanoid:GetChildren()) do
if v.Name == "creator" then
v:Destroy()
end
end
local creator = script.creator:Clone()
creator.Value = script.creator.Value
Debris:AddItem(creator, 2)
creator.Parent = Humanoid
end
if not Character:FindFirstChild("ForceField") then
Humanoid.Health = Humanoid.Health - (Damage.Value / Rate)
end
wait(0.1)
end
end
Fire:Destroy()
|
--[=[
@param player Player
@param value any
Set the value of the property for a specific player. This
will override the value used by `Set` (and the initial value
set for the property when created).
This value _can_ be `nil`. In order to reset the value for a
given player and let the player use the top-level value held
by this property, either use `Set` to set all players' data,
or use `ClearFor`.
```lua
remoteProperty:SetFor(somePlayer, "CustomData")
```
]=]
|
function RemoteProperty:SetFor(player: Player, value: any)
if player.Parent then
self._perPlayer[player] = if value == nil then None else value
end
self._rs:Fire(player, value)
end
|
--[=[
@param class table | (...any) -> any
@param ... any
@return any
Constructs a new object from either the
table or function given.
If a table is given, the table's `new`
function will be called with the given
arguments.
If a function is given, the function will
be called with the given arguments.
The result from either of the two options
will be added to the trove.
This is shorthand for `trove:Add(SomeClass.new(...))`
and `trove:Add(SomeFunction(...))`.
```lua
local Signal = require(somewhere.Signal)
-- All of these are identical:
local s = trove:Construct(Signal)
local s = trove:Construct(Signal.new)
local s = trove:Construct(function() return Signal.new() end)
local s = trove:Add(Signal.new())
-- Even Roblox instances can be created:
local part = trove:Construct(Instance, "Part")
```
]=]
|
function Trove:Construct(class, ...)
local object = nil
local t = type(class)
if t == "table" then
object = class.new(...)
elseif t == "function" then
object = class(...)
end
return self:Add(object)
end
|
--[=[
Construct a new Promise that will be resolved or rejected with the given callbacks.
If you `resolve` with a Promise, it will be chained onto.
You can safely yield within the executor function and it will not block the creating thread.
```lua
local myFunction()
return Promise.new(function(resolve, reject, onCancel)
wait(1)
resolve("Hello world!")
end)
end
myFunction():andThen(print)
```
You do not need to use `pcall` within a Promise. Errors that occur during execution will be caught and turned into a rejection automatically. If `error()` is called with a table, that table will be the rejection value. Otherwise, string errors will be converted into `Promise.Error(Promise.Error.Kind.ExecutionError)` objects for tracking debug information.
You may register an optional cancellation hook by using the `onCancel` argument:
* This should be used to abort any ongoing operations leading up to the promise being settled.
* Call the `onCancel` function with a function callback as its only argument to set a hook which will in turn be called when/if the promise is cancelled.
* `onCancel` returns `true` if the Promise was already cancelled when you called `onCancel`.
* Calling `onCancel` with no argument will not override a previously set cancellation hook, but it will still return `true` if the Promise is currently cancelled.
* You can set the cancellation hook at any time before resolving.
* When a promise is cancelled, calls to `resolve` or `reject` will be ignored, regardless of if you set a cancellation hook or not.
:::caution
If the Promise is cancelled, the `executor` thread is closed with `coroutine.close` after the cancellation hook is called.
You must perform any cleanup code in the cancellation hook: any time your executor yields, it **may never resume**.
:::
@param executor (resolve: (...: any) -> (), reject: (...: any) -> (), onCancel: (abortHandler?: () -> ()) -> boolean) -> ()
@return Promise
]=]
|
function Promise.new(executor)
return Promise._new(debug.traceback(nil, 2), executor)
end
function Promise:__tostring()
return string.format("Promise(%s)", self._status)
end
|
--[[Steering]]
|
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .03 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .05 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
--[[Controls]]
|
--
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 15 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 15 , -- Controller steering R-deadzone (0 - 100%)
}
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.B ,
--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.P ,
--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 ,
}
--[[ STANDARDIZED STUFF: DON'T TOUCH UNLESS NEEDED ]]--
--[[Weight Scaling]]--
--[[Cubic stud : pounds ratio]]--
Tune.WeightScaling = 1/130 --Default = 1/130 (1 cubic stud = 130 lbs)
return Tune
|
--Objects
|
local DriverSeat = Chassis.driverSeat
local function unbindActions()
ContextActionService:UnbindAction(RAW_INPUT_ACTION_NAME)
ContextActionService:UnbindAction(EXIT_ACTION_NAME)
end
local function onExitSeat(Seat)
unbindActions()
_clearInput()
ProximityPromptService.Enabled = true
LocalVehicleSeating.DisconnectFromSeatExitEvent(onExitSeat)
script.Disabled = true
end
LocalVehicleSeating.OnSeatExitEvent(onExitSeat)
|
---[[ Window Settings ]]
|
module.MinimumWindowSize = UDim2.new(0.3, 0, 0.25, 0)
module.MaximumWindowSize = UDim2.new(.3, 0, .25, 0) -- if you change this to be greater than full screen size, weird things start to happen with size/position bounds checking.
module.DefaultPCWindowPosition = UDim2.new(0, 0, 1, 0)
module.DefaultMobileWindowPosition = UDim2.new(.075,0,0,0)
module.DefaultPCWindowAnchorPoint = Vector2.new(0,1)
module.DefaultMobileWindowAnchorPoint = Vector2.new(0,0)
local extraOffset = 0 --(7 * 2) + (5 * 2) -- Extra chatbar vertical offset
module.DefaultWindowSizePhone = UDim2.new(0.4, 0, 0.3, extraOffset)
module.DefaultWindowSizeTablet = UDim2.new(0.4, 0, 0.3, extraOffset)
module.DefaultWindowSizeDesktop = UDim2.new(0.3, 0, 0.25, extraOffset)
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 200 -- 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 = 6000 -- 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 = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--Made by Luckymaxer
|
Debris = game:GetService("Debris")
Creator = script:FindFirstChild("Creator")
Model = script:WaitForChild("Model")
function DestroyModel()
if Model and Model.Parent then
Debris:AddItem(Model, 1)
if Model and Model.Parent then
Model:Destroy()
end
end
Debris:AddItem(script, 1)
if script and script.Parent then
script:Destroy()
end
end
if not Creator or not Creator.Value or not Creator.Value:IsA("Player") or not Creator.Value.Parent or not Model or not Model.Value then
DestroyModel()
return
end
Creator = Creator.Value
Model = Model.Value
Character = Creator.Character
if not Character then
DestroyModel()
return
end
Creator.Changed:connect(function(Property)
if Property == "Parent" and not Creator.Parent then
DestroyModel()
end
end)
Character.Changed:connect(function(Property)
if Property == "Parent" and not Character.Parent then
DestroyModel()
end
end)
Model.Changed:connect(function(Property)
if Property == "Parent" and not Model.Parent then
DestroyModel()
end
end)
|
-- Initialize surface tool
|
local SurfaceTool = require(CoreTools:WaitForChild 'Surface')
Core.AssignHotkey('B', Core.Support.Call(Core.EquipTool, SurfaceTool));
Core.AddToolButton(Core.Assets.SurfaceIcon, 'B', SurfaceTool)
|
--yep
|
local deb = false
local info = TweenInfo.new(tweenTime, easingStyle, easingDirection, repeats, reverse, delayTime)
local function tweenModel(model, CF)
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = model:GetPrimaryPartCFrame()
CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
model:SetPrimaryPartCFrame(CFrameValue.Value)
end)
local tween = tweenService:Create(CFrameValue, info, {Value = CF})
tween:Play()
tween.Completed:Connect(function()
CFrameValue:Destroy()
end)
end
wait(0)
tweenModel(Model, goal1.CFrame)
|
--!strict
|
local Presets = require(script.Parent.Presets)
local Context = {}
function Context.new(presetIndex: string?): Presets.Preset
local DefaultPresetInfo = Presets['Default']
local self: Presets.Preset = presetIndex and Presets[presetIndex] or DefaultPresetInfo
for propertyKey, propertyValue in next, DefaultPresetInfo do
if not self[propertyKey] then
self[propertyKey] = propertyValue
end
end
return self
end
return Context
|
-- Variables
|
LoadSceneRemoteEventModule.RespawnConnection = nil
LoadSceneRemoteEventModule.lastCalledLoadSceneTime = 0
LoadSceneRemoteEventModule.rng = Random.new()
LoadSceneRemoteEventModule.Player = Players.LocalPlayer
LoadSceneRemoteEventModule.RunService = RunService
|
--[[Maid
Manages the cleaning of events and other things.
API:
HireMaid() Returns a new Maid object.
Maid[key] = (function) Adds a task to perform when cleaning up.
Maid[key] = (event connection) Manages an event connection. Anything that isn't a function is assumed to be this.
Maid[key] = nil Removes a named task. If the task is an event, it is disconnected.
Maid:GiveTask(task) Same as above, but uses an incremented number as a key.
Maid:DoCleaning() Disconnects all managed events and performs all clean-up tasks.
]]
|
local MakeMaid do
local index = {
GiveTask = function(self, task)
local n = #self.Tasks+1
self.Tasks[n] = task
return n
end;
DoCleaning = function(self)
local tasks = self.Tasks
for name,task in pairs(tasks) do
if type(task) == 'function' then
task()
else
task:disconnect()
end
tasks[name] = nil
end
-- self.Tasks = {}
end;
};
local mt = {
__index = function(self, k)
if index[k] then
return index[k]
else
return self.Tasks[k]
end
end;
__newindex = function(self, k, v)
local tasks = self.Tasks
if v == nil then
-- disconnect if the task is an event
if type(tasks[k]) ~= 'function' and tasks[k] then
tasks[k]:disconnect()
end
elseif tasks[k] then
-- clear previous task
self[k] = nil
end
tasks[k] = v
end;
}
function MakeMaid()
return setmetatable({Tasks={},Instances={}},mt)
end
end
local function GetCharacter(Descendant)
-- Returns the Player and Charater that a descendent is part of, if it is part of one.
-- @param Descendant A child of the potential character.
local Charater = Descendant
local Player = Players:GetPlayerFromCharacter(Charater)
while not Player do
if Charater.Parent then
Charater = Charater.Parent
Player = Players:GetPlayerFromCharacter(Charater)
else
return nil
end
end
-- Found the player, character must be true.
return Charater, Player
end
|
--Muffins stuff that has to do with the module things
|
local ComfShift = _Tune.ComfortShift
|
-------------------
-- Adonis Client --
-------------------
--!nocheck
|
--[[
This module is part of Adonis 1.0 and contains lots of old code;
future updates will generally only be made to fix bugs, typos or functionality-affecting problems.
If you find bugs or similar issues, please submit an issue report
on our GitHub repository here: https://github.com/Epix-Incorporated/Adonis/issues/new/choose
]]
|
-- holding down gun
|
GUI.MobileButtons.HoldDownButton.MouseButton1Click:connect(function()
if not Reloading and not HoldDown and Module.HoldDownEnabled then
HoldDown = true
IdleAnim:Stop()
if HoldDownAnim then HoldDownAnim:Play(nil,nil,Module.HoldDownAnimationSpeed) end
if AimDown then
TweeningService:Create(Camera, TweenInfo.new(Module.TweenLengthNAD, Module.EasingStyleNAD, Module.EasingDirectionNAD), {FieldOfView = 70}):Play()
CrosshairModule:setcrossscale(1)
--[[local GUI = game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("ZoomGui")
if GUI then GUI:Destroy() end]]
Scoping = false
game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.Classic
UserInputService.MouseDeltaSensitivity = InitialSensitivity
AimDown = false
end
else
HoldDown = false
IdleAnim:Play(nil,nil,Module.IdleAnimationSpeed)
if HoldDownAnim then HoldDownAnim:Stop() end
end
end)
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.KuromiStaff -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
-- the Tool, reffered to here as "Block." Do not change it!
|
Block = script.Parent.Key -- You CAN change the name in the quotes "Example Tool"
|
--- Makes a type that contains a sequence, e.g. Vector3 or Color3
|
function Util.MakeSequenceType(options)
options = options or {}
assert(options.Parse ~= nil or options.Constructor ~= nil, "MakeSequenceType: Must provide one of: Constructor, Parse")
options.TransformEach = options.TransformEach or function(...)
return ...
end
options.ValidateEach = options.ValidateEach or function()
return true
end
return {
Transform = function (text)
return Util.Map(Util.SplitPrioritizedDelimeter(text, {",", "%s"}), function(value)
return options.TransformEach(value)
end)
end;
Validate = function (components)
if options.Length and #components > options.Length then
return false, ("Maximum of %d values allowed in sequence"):format(options.Length)
end
for i = 1, options.Length or #components do
local valid, reason = options.ValidateEach(components[i], i)
if not valid then
return false, reason
end
end
return true
end;
Parse = options.Parse or function(components)
return options.Constructor(unpack(components))
end
}
end
|
--Impletion [awful coding i know]
|
wait()
explode=false
soundlock=false
lock=false
script.Parent.Activated:connect(function(click)
if lock==false then
lock=true
local char=script.Parent.Parent
local anim=char.Humanoid:LoadAnimation(script.Parent.Animation)
anim:Play()
wait(1.4)
lock=false
end
end)
script.Parent.Handle.Touched:connect(function(hit)
local gethum=hit.Parent:GetChildren()
for i=1,#gethum do
if gethum[i].ClassName=="Humanoid" and gethum[i] ~= nil and hit.Parent.Name ~= game.Players.LocalPlayer.Name and lock==true then
local hum=gethum[i]
hum.Sit=true
if soundlock==false then
soundlock=true
script.Parent.Smash:Play()
end
local character=hit.Parent
local b=character:GetChildren()
for i=1,#b do
if b[i]:IsA("Part") and b[i] ~= nil then
b[i].CanCollide=false
b[i].Anchored=false
end
end
local torso=hit.Parent:findFirstChild("Torso")
character.Torso.Velocity=game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 1200
character.Torso.Velocity=character.Torso.Velocity + Vector3.new(0,300,0)
wait(1.8)
if explode==false then
explode=true
local expl=Instance.new("Explosion", workspace)
expl.BlastPressure=9000000
expl.BlastRadius=100
expl.Position=torso.Position
character:BreakJoints()
local p=game.Players:GetPlayerFromCharacter(character)
character:Destroy()
if p ~= nil then
p:Destroy()
end
end
end
end
wait(1)
soundlock=false
explode=false
end)
script.Parent.Equipped:connect(function(equip)
game.Players.LocalPlayer.Character.Humanoid.MaxHealth=math.huge
game.Players.LocalPlayer.Character.Humanoid.Health=math.huge
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed=25
end)
|
-- FLAMGOik was here 2/16/2021
|
script.Parent.Humanoid.HealthChanged:Connect(function()
if script.Parent.Humanoid.Health <= 92 then
Instance.new("Decal", script.Parent["Left Leg"])
script.Parent["Left Leg"].Decal.Texture = "rbxassetid://508050906"
script.Parent["Left Leg"].Decal.Face = Region3int16
end
end)
|
-- Remote variables
|
local RemoteFolder = script.Parent.Parent:WaitForChild("RemoteEvents")
local PlaySound = RemoteFolder:WaitForChild("PlaySound")
local StopSound = RemoteFolder:WaitForChild("StopSound")
local AnchorSegway = RemoteFolder:WaitForChild("AnchorSegway")
local UndoTags = RemoteFolder:WaitForChild("UndoTags")
local UndoHasWelded = RemoteFolder:WaitForChild("UndoHasWelded")
local DeleteWelds = RemoteFolder:WaitForChild("DeleteWelds")
local ConfigHumanoid = RemoteFolder:WaitForChild("ConfigHumanoid")
local ConfigLights = RemoteFolder:WaitForChild("ConfigLights")
|
-- canonicalize an angle to +-180 degrees
|
function CameraUtils.sanitizeAngle(a: number): number
return (a + math.pi)%(2*math.pi) - math.pi
end
|
--[=[
Destroys the RemoteProperty object.
]=]
|
function RemoteProperty:Destroy()
self._rs:Destroy()
self._playerRemoving:Disconnect()
end
return RemoteProperty
|
--[=[
Alias for `trove:Clean()`.
]=]
|
function Trove:Destroy()
self:Clean()
end
return Trove
|
--------END SIDE SQUARES--------
--------LIGHT SET 1--------
|
game.Workspace.lightset1.l1.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.lightset1.l2.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.lightset1.l3.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.lightset1.l4.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.lightset1.l5.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1, p2, p3, p4)
if type(p1) ~= "table" then
p1 = { p1 };
end;
local v1 = {};
for v2,v3 in pairs(p1) do
if p3 == nil then
p3 = { 1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out };
else
if p3[2] == nil then
p3[2] = Enum.EasingStyle.Sine;
elseif type(p3[2]) == "string" then
if string.lower(p3[2]) == "expo" then
p3[2] = Enum.EasingStyle.Exponential;
else
p3[2] = Enum.EasingStyle[p3[2]];
end;
end;
if p3[3] == nil then
p3[3] = Enum.EasingDirection.InOut;
elseif type(p3[3]) == "string" then
p3[3] = Enum.EasingDirection[p3[3]];
end;
end;
local v5 = u1.TweenService:Create(v3, TweenInfo.new(unpack(p3)), p2);
if p4 then
task.delay(p4, function()
v5:Play();
end);
else
v5:Play();
end;
table.insert(v1, v5);
end;
return unpack(v1);
end;
|
--Put this script in the StarterPack to work!
|
local Player = game.Players.LocalPlayer
game:GetService("RunService").RenderStepped:connect(function()
local c = game.Workspace:FindFirstChild(Player.Name)
if c then
c["LeftFoot"].LocalTransparencyModifier = 0
c["LeftHand"].LocalTransparencyModifier = 0
c["LeftLowerArm"].LocalTransparencyModifier = 0
c["LeftLowerLeg"].LocalTransparencyModifier = 0
c["LeftUpperArm"].LocalTransparencyModifier = 0
c["LeftUpperLeg"].LocalTransparencyModifier =0
c["RightFoot"].LocalTransparencyModifier = 0
c["RightHand"].LocalTransparencyModifier = 0
c["RightLowerArm"].LocalTransparencyModifier = 0
c["RightLowerLeg"].LocalTransparencyModifier = 0
c["RightUpperArm"].LocalTransparencyModifier = 0
c["RightUpperLeg"].LocalTransparencyModifier = 0
end
end)
|
--------------------- KODLAND GUN ---------------------------
|
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
local Damage = 18
|
--[[
Type definitions for data passed into CallToAction class
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TagEnumType = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.TagEnumType)
local PlayerDataKey = require(ReplicatedStorage.Source.SharedConstants.PlayerDataKey)
export type PromptTriggeredCallback = (promptParent: Instance) -> nil
export type PromptData = {
getActionText: (promptParent: Instance) -> string,
getObjectText: (promptParent: Instance) -> string,
onTriggered: PromptTriggeredCallback,
}
export type CtaData = {
tag: TagEnumType.EnumType,
imageColor3: Color3,
backgroundColor3: Color3,
imageId: number,
listenToPlayerDataValues: { PlayerDataKey.EnumType }?,
listenToTags: { TagEnumType.EnumType }?,
promptData: PromptData?,
shouldEnable: ((promptParent: Instance) -> boolean)?,
}
return nil
|
--// 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, tick, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, elapsedTime, 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, tick, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, elapsedTime, 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;
end
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
client.GUIs = {}
client.GUIHolder = service.New("Folder")
client.Variables = {
Init = Init;
CodeName = "";
UIKeepAlive = true;
KeybindsEnabled = true;
ParticlesEnabled = true;
CapesEnabled = true;
Particles = {};
KeyBinds = {};
Aliases = {};
Capes = {};
savedUI = {};
localSounds = {};
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
|
-- local AttackRange, FieldOfView, AggroRange, ChanceOfBoredom, BoredomDuration,
-- Damage, DamageCooldown
|
local configTable = model.Configurations
local configs = {}
local function loadConfig(configName, defaultValue)
if configTable:FindFirstChild(configName) then
configs[configName] = configTable:FindFirstChild(configName).Value
else
configs[configName] = defaultValue
end
end
loadConfig("AttackRange", 3)
loadConfig("FieldOfView", 180)
loadConfig("AggroRange", 200)
loadConfig("ChanceOfBoredom", .5)
loadConfig("BoredomDuration", 10)
loadConfig("Damage", 10)
loadConfig("DamageCooldown", 1)
local StateMachine = require(game.ServerStorage.ROBLOX_StateMachine).new()
local PathLib = require(game.ServerStorage.ROBLOX_PathfindingLibrary).new()
local ZombieTarget = nil
local ZombieTargetLastLocation = nil
local lastBored = os.time()
-- STATE DEFINITIONS
-- IdleState: NPC stays still. Refreshes bored timer when started to
-- allow for random state change
local IdleState = StateMachine.NewState()
IdleState.Name = "Idle"
IdleState.Action = function()
end
IdleState.Init = function()
lastBored = os.time()
end
-- SearchState: NPC wanders randomly increasing chance of spotting
-- enemy. Refreshed bored timer when started to allow for random state
-- change
local SearchState = StateMachine.NewState()
SearchState.Name = "Search"
local lastmoved = os.time()
local searchTarget = nil
SearchState.Action = function()
-- move to random spot nearby
if model then
local now = os.time()
if now - lastmoved > 2 then
lastmoved = now
local xoff = math.random(5, 10)
if math.random() > .5 then
xoff = xoff * -1
end
local zoff = math.random(5, 10)
if math.random() > .5 then
zoff = zoff * -1
end
local testtarg = AIUtilities:FindCloseEmptySpace(model)
--if testtarg then print(testtarg) else print("could not find") end
searchTarget = Vector3.new(model.Torso.Position.X + xoff,model.Torso.Position.Y,model.Torso.Position.Z + zoff)
--local target = Vector3.new(model.Torso.Position.X + xoff,model.Torso.Position.Y,model.Torso.Position.Z + zoff)
--model.Humanoid:MoveTo(target)
searchTarget = testtarg
end
if searchTarget then
PathLib:MoveToTarget(model, searchTarget)
end
end
end
SearchState.Init = function()
lastBored = os.time()
end
-- PursueState: Enemy has been spotted, need to give chase.
local PursueState = StateMachine.NewState()
PursueState.Name = "Pursue"
PursueState.Action = function()
-- Double check we still have target
if ZombieTarget then
-- Get distance to target
local distance = (model.Torso.Position - ZombieTarget.Torso.Position).magnitude
-- If we're far from target use pathfinding to move. Otherwise just MoveTo
if distance > configs["AttackRange"] + 5 then
PathLib:MoveToTarget(model, ZombieTarget.Torso.Position)
else
model.Humanoid:MoveTo(ZombieTarget.Torso.Position)
|
--script.Parent.Parent.CameraMode="LockFirstPerson" --first person
|
local head = game.Workspace:findFirstChild(person.Name):findFirstChild("Head")
|
--// Special Variables
|
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
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 = Vargs.Service
local client = Vargs.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;
};
KeycodeNames = require(client.Shared.KeycodeNames);
};
end
|
--[=[
Set a handler that will be called only if the Promise resolves or is cancelled. This method is similar to `finally`, except it doesn't catch rejections.
:::caution
`done` should be reserved specifically when you want to perform some operation after the Promise is finished (like `finally`), but you don't want to consume rejections (like in <a href="/roblox-lua-promise/lib/Examples.html#cancellable-animation-sequence">this example</a>). You should use `andThen` instead if you only care about the Resolved case.
:::
:::warning
Like `finally`, if the Promise is cancelled, any Promises chained off of it with `andThen` won't run. Only Promises chained with `done` and `finally` will run in the case of cancellation.
:::
Returns a new promise chained from this promise.
@param doneHandler (status: Status) -> ...any
@return Promise<...any>
]=]
|
function Promise.prototype:done(doneHandler)
assert(doneHandler == nil or isCallable(doneHandler), string.format(ERROR_NON_FUNCTION, "Promise:done"))
return self:_finally(debug.traceback(nil, 2), doneHandler, true)
end
|
--[=[
Clears the custom property value for the given player. When
this occurs, the player will reset to use the top-level
value held by this property (either the value set when the
property was created, or the last value set by `Set`).
```lua
remoteProperty:Set("DATA")
remoteProperty:SetFor(somePlayer, "CUSTOM_DATA")
print(remoteProperty:GetFor(somePlayer)) --> "CUSTOM_DATA"
-- DOES NOT CLEAR, JUST SETS CUSTOM DATA TO NIL:
remoteProperty:SetFor(somePlayer, nil)
print(remoteProperty:GetFor(somePlayer)) --> nil
-- CLEAR:
remoteProperty:ClearFor(somePlayer)
print(remoteProperty:GetFor(somePlayer)) --> "DATA"
```
]=]
|
function RemoteProperty:ClearFor(player: Player)
if self._perPlayer[player] == nil then
return
end
self._perPlayer[player] = nil
self._rs:Fire(player, self._value)
end
|
-- When key pressed
|
function onKeyDown(key)
if key == nil then return end
key = key:lower()
-- Coaxial Machine Gun Control
if key == 'c' then
if firingMg then return end
firingMg = true;
while firingMg do
if not fireCoax() then
firingMg = false;
wait()
end
updateAmmo();
end
end
if key == 'f' then
if tankStats.Round.Value == "AP" then
tankStats.Round.Value = "HE";
else
tankStats.Round.Value = "AP";
end
updateAmmo();
end
-- Switch ammo type
if key == 'e' then
parts.Engine.BodyGyro.MaxTorque = Vector3.new(0,0,100)
print("Flipping Vehicle")
wait(5)
parts.Engine.BodyGyro.MaxTorque = Vector3.new(0,0,0)
end
if key == 'q' then
if braking then return end
braking = true;
while braking do
if not Brakes() then
braking = false;
end
updateAmmo();
end
end
end
|
-- Get latest copy of tool
|
local NewTool = GetLatestTool();
if NewTool then
-- Prevent update attempt loops since fetched version is now cached
NewTool.AutoUpdate.Value = false;
-- Cancel replacing current tool if fetched version is the same
if NewTool.Version.Value == Tool.Version.Value then
return;
end;
-- Detach update script from tool and save old tool parent
script.Parent = nil;
local ToolParent = Tool.Parent;
-- Remove current tool (delayed to prevent parenting conflicts)
wait(0.05);
Tool.Parent = nil;
-- Remove the tool again if anything attempts to reparent it
Tool.Changed:connect(function (Property)
if Property == 'Parent' and Tool.Parent then
wait(0.05);
Tool.Parent = nil;
end;
end);
-- Add the new tool
NewTool.Parent = ToolParent;
end;
|
-- light functions
|
F.SignalLeft = function(flash_rate, state, active, tb, type, seq, max_segs, current_segment)
if active then
if not seq then
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 1
child.Range = 16
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
end
wait(flash_rate)
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
wait(flash_rate)
end
else
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
child.Transparency = 0.02
end
end
end
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
end
end
end
else
if not seq then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
wait(flash_rate)
else
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
child.Transparency = 0.02
end
end
end
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
end
end
end
end
end
F.SignalRight = function(flash_rate, state, active, tb, type, seq, max_segs, current_segment)
if active then
if not seq then
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 1
child.Range = 16
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
end
wait(flash_rate)
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
wait(flash_rate)
end
else
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
child.Transparency = 0.02
end
end
end
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
end
end
end
else
if not seq then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
wait(flash_rate)
else
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
child.Transparency = 0.02
end
end
end
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe:Play()
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
end
end
end
end
end
F.Hazards = function(flash_rate, state, active, tb, type, seq, max_segs, current_segment)
if active then
if not seq then
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 2
child.Range = 16
elseif child.Name == "LN" then
child.Transparency = 0
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 2
child.Range = 16
elseif child.Name == "LN" then
child.Transparency = 0
end
end
end
wait(flash_rate)
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
wait(flash_rate)
end
else
if state then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
child.Transparency = 0.02
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child.Name == "SI"..tostring(current_segment) then
child.Transparency = 0.02
end
end
end
wait(flash_rate)
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
end
wait(flash_rate)
end
end
else
if not seq then
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
wait(flash_rate)
else
if type == "Halogen" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.LeftInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
for idx, child in pairs(lights.RightInd:GetDescendants()) do
if string.sub(child.Name, 1, 2) == "SI" then
child.Transparency = 1
end
end
end
wait(flash_rate)
end
end
end
F.Headlights = function(state, fade_time, tb, type)
if type == "Halogen" then
if state == 0 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
if plactive then
for idx, child in pairs(lights.Headlights.Low:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.7})
tw:Play()
end
end
for idx, child in pairs(lights.Headlights.High:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif not plactive then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
end
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights.Low:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 2, Range = 48})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.2})
tw:Play()
end
end
elseif state == 2 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 3.5, Range = 60})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif state == 3 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 4.25, Range = 60})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
end
elseif type == "LED" then
if state == 0 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
if plactive then
for idx, child in pairs(lights.Headlights.Low:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 0.7
end
end
for idx, child in pairs(lights.Headlights.High:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
elseif not plactive then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 2
child.Range = 48
elseif child.Name == "LN" then
child.Transparency = 0.2
end
end
elseif state == 2 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 3.5
child.Range = 60
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
elseif state == 3 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 4.25
child.Range = 60
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
end
end
end
F.Popups = function(state, enabled)
if enabled then
local motor = PHeadlights.Hinge:WaitForChild("Motor")
motor.MaxVelocity = 0.08
if state then
motor.DesiredAngle = -0.9
elseif not state then
motor.DesiredAngle = 0
end
end
end
F.PopupLights = function(state, fade_time, tb, type)
if type == "Halogen" then
if state == 0 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
if plactive then
for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.7})
tw:Play()
end
end
elseif not plactive then
for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
end
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 2, Range = 48})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.2})
tw:Play()
end
end
elseif state == 2 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 3.5, Range = 60})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif state == 3 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 4.25, Range = 60})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
end
elseif type == "LED" then
if state == 0 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
if plactive then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 0.7
end
end
elseif not plactive then
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 2
child.Range = 48
elseif child.Name == "LN" then
child.Transparency = 0.2
end
end
elseif state == 2 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 3.5
child.Range = 60
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
elseif state == 3 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
gtwe2:Play()
for idx, child in pairs(lights.Headlights:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 4.25
child.Range = 60
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
end
end
end
F.FogLights = function(state, fade_time, tb, type)
if state then
if type == "Halogen" then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
for idx, child in pairs(lights.Fog:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 3.75, Range = 60})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe1:Play()
for idx, child in pairs(lights.Fog:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 3.75
child.Range = 60
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
end
elseif not state then
if type == "Halogen" then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
for idx, child in pairs(lights.Fog:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
elseif type == "LED" then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe1:Play()
for idx, child in pairs(lights.Fog:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
end
end
F.ParkLights = function(state, tb)
if state then
local gtwe = TweenService:Create(tb[3], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
gtwe:Play()
plactive = true
else
local gtwe = TweenService:Create(tb[3], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
gtwe:Play()
plactive = false
end
end
F.BrakeLights = function(state, fade_time, type)
if type == "Halogen" then
if state then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Brake:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 2.5, Range = 38})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.02})
tw:Play()
end
end
else
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Brake:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
end
elseif type == "LED" then
if state then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Brake:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 3.5
child.Range = 38
elseif child.Name == "LN" then
child.Transparency = 0.02
end
end
else
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Brake:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
end
end
F.RearLights = function(state, fade_time, type)
if type == "Halogen" then
if state == 0 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
if plactive then
for idx, child in pairs(lights.Rear:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.7})
tw:Play()
end
end
elseif not plactive then
for idx, child in pairs(lights.Rear:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
end
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Rear:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 1.5, Range = 25})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.2})
tw:Play()
end
end
end
elseif type == "LED" then
if state == 0 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
if plactive then
for idx, child in pairs(lights.Rear:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 0.7
end
end
elseif not plactive then
for idx, child in pairs(lights.Rear:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
elseif state == 1 then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Rear:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 1.5
child.Range = 25
elseif child.Name == "LN" then
child.Transparency = 0.2
end
end
end
end
end
F.DashboardIndicators = function(headlights, indicators, parklights)
end
F.Reverse = function(state, fade_time, type)
if type == "Halogen" then
if state then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Reverse:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 1, Range = 20})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 0.03})
tw:Play()
end
end
else
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Reverse:GetDescendants()) do
if child:IsA("SpotLight") then
local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
tw:Play()
elseif child.Name == "LN" then
local tw = TweenService:Create(child, t, {Transparency = 1})
tw:Play()
end
end
end
elseif type == "LED" then
if state then
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Reverse:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 1
child.Range = 20
elseif child.Name == "LN" then
child.Transparency = 0.03
end
end
else
local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
for idx, child in pairs(lights.Reverse:GetDescendants()) do
if child:IsA("SpotLight") then
child.Brightness = 0
child.Range = 0
elseif child.Name == "LN" then
child.Transparency = 1
end
end
end
end
end
F.IndsOnLeave = function(left, right, hazard, sequential, segs, fr, type)
event.IndicatorsAfterLeave.Disabled = false
wait()
leaveseatevent:Fire(left, right, hazard, sequential, segs, fr, type)
end
event.OnServerEvent:Connect(function(pl, Fnc, ...)
F[Fnc](...)
end)
|
-- Written By Kip Turner, Copyright Roblox 2014
-- Updated by Garnold to utilize the new PathfindingService API, 2017
|
local UIS = game:GetService("UserInputService")
local PathfindingService = game:GetService("PathfindingService")
local PlayerService = game:GetService("Players")
local RunService = game:GetService("RunService")
local DebrisService = game:GetService('Debris')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local tweenService = game:GetService("TweenService")
local CameraScript = script:FindFirstAncestor("CameraScript")
local InvisicamModule = require(CameraScript:WaitForChild("Invisicam"))
local OrbitalCamModule = require(CameraScript:WaitForChild('RootCamera'):WaitForChild('OrbitalCamera'))
local Player = PlayerService.LocalPlayer
local PlayerScripts = Player.PlayerScripts
local ControlScript = PlayerScripts:FindFirstChild("ControlScript")
local MasterControl, TouchJump
if ControlScript then
MasterControl = ControlScript:FindFirstChild("MasterControl")
if MasterControl then
local TouchJumpModule = MasterControl:FindFirstChild("TouchJump")
if TouchJumpModule then
TouchJump = require(TouchJumpModule)
end
end
end
local SHOW_PATH = true
local RayCastIgnoreList = workspace.FindPartOnRayWithIgnoreList
local math_min = math.min
local math_max = math.max
local math_pi = math.pi
local math_atan2 = math.atan2
local Vector3_new = Vector3.new
local Vector2_new = Vector2.new
local CFrame_new = CFrame.new
local CurrentSeatPart = nil
local DrivingTo = nil
local XZ_VECTOR3 = Vector3_new(1, 0, 1)
local ZERO_VECTOR3 = Vector3_new(0, 0, 0)
local ZERO_VECTOR2 = Vector2_new(0, 0)
local lastFailedPosition = nil
local BindableEvent_OnFailStateChanged = nil
if UIS.TouchEnabled then
BindableEvent_OnFailStateChanged = Instance.new('BindableEvent')
BindableEvent_OnFailStateChanged.Name = "OnClickToMoveFailStateChange"
BindableEvent_OnFailStateChanged.Parent = PlayerScripts
end
|
--[[**
creates a union type
@param ... The checks to union
@returns A function that will return true iff the condition is passed
**--]]
|
function t.union(...)
local checks = { ... }
assert(callbackArray(checks))
return function(value)
for _, check in ipairs(checks) do
if check(value) then
return true
end
end
return false, "bad type for union"
end
end
|
-- Make alias public on class
|
Expectation.an = Expectation.a
|
--[=[
Constructs a new signal.
@return Signal<T>
]=]
|
function Signal.new()
local self = setmetatable({}, Signal)
self._bindableEvent = Instance.new("BindableEvent")
self._argMap = {}
self._source = ENABLE_TRACEBACK and debug.traceback() or ""
-- Events in Roblox execute in reverse order as they are stored in a linked list and
-- new connections are added at the head. This event will be at the tail of the list to
-- clean up memory.
self._bindableEvent.Event:Connect(function(key)
self._argMap[key] = nil
-- We've been destroyed here and there's nothing left in flight.
-- Let's remove the argmap too.
-- This code may be slower than leaving this table allocated.
if (not self._bindableEvent) and (not next(self._argMap)) then
self._argMap = nil
end
end)
return self
end
|
-- Set up quest triggers
|
for _,trigger in pairs(workspace.QuestTriggers:GetChildren()) do
local quest = replicatedStorage.Quests:FindFirstChild(trigger.Name)
if quest then
trigger.Touched:Connect(function(part)
local player = players:GetPlayerFromCharacter(part.Parent)
if player and not script:FindFirstChild(player.Name .. "Deciding") and not player.Quests:FindFirstChild(quest.Name) and not player.CompletedQuests:FindFirstChild(quest.Name) then
local tag = Instance.new("Model")
tag.Name = player.Name .. "Deciding"
tag.Parent = script
local acceptedQuest
pcall(function() -- Player might leave during the invoke, causing the tag to stay forever
acceptedQuest = replicatedStorage.ClientRemotes.OfferQuest:InvokeClient(player, quest)
end)
if acceptedQuest then
local quest = require(questSystem).GiveQuest(player, quest.Name)
require(questSystem[quest.QuestType.Value]).CheckIfCompleted(player, quest) -- Player may have already met the completion requirements
end
wait(2)
tag:Destroy()
end
end)
else
warn('Could not find a matching quest in ReplicatedStorage.Quests for the trigger named "' .. trigger.Name .. '"')
end
end
for _,quest in pairs(replicatedStorage.Quests:GetChildren()) do
if quest.QuestType.Value == "TouchOrb" then -- Make quest touch connections
local destinationOrb = quest.Requirements:FindFirstChildOfClass("ObjectValue")
if destinationOrb and destinationOrb.Value then
destinationOrb.Value.Touched:Connect(function(part)
local player = players:GetPlayerFromCharacter(part.Parent)
if player then
local matchingQuest = player.Quests:FindFirstChild(quest.Name)
if matchingQuest then
require(questSystem.TouchOrb).CheckIfCompleted(player, matchingQuest)
end
end
end)
end
end
end
|
--//Controller//--
|
for _, StatHolder in pairs(Holder:GetChildren()) do
if StatHolder:IsA("Frame") then
local DisplayText = StatHolder.DisplayText
local DisplayFrame = StatHolder.DisplayFrame
Player:GetAttributeChangedSignal(StatHolder.Name):Connect(function()
TweenService:Create(
DisplayFrame,
TweenInfo.new(
0.25,
Enum.EasingStyle.Linear
),
{
Size = UDim2.new(Player:GetAttribute(StatHolder.Name) / 100, 0, 1, 0)
}
):Play()
DisplayText.Text = Player:GetAttribute(StatHolder.Name) .. " / 100"
end)
end
end
|
--[[Transmission]]
|
Tune.TransModes = {"Semi", "Manual"} --[[
[Modes]
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 5.20 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.50 ,
--[[ 3 ]] 1.40 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Basic settings
|
local MAXIMUM_DIFFERENT_ITEMS = 6
local plr = game.Players.LocalPlayer
function getItemTable()
-- Formulate and return a table of items
local items = {}
for _, i in pairs(script.Parent:GetChildren()) do
if i.Name == "Item" then
for _=1, i.Count.Value do
table.insert(items, i.Item.Value.Name)
end
end
end
return items
end
function refreshOutlines()
-- Create table of item names
local items = {}
for _, i in pairs(script.Parent:GetChildren()) do
if i.Name == "Item" then
table.insert(items, i.Item.Value.Name)
end
end
-- Check size
if #items > 0 then
-- Create table of connected items
local connectedItems = {}
for _, i in pairs(game.ReplicatedStorage.Recipes:GetChildren()) do
local okay = true
for _, o in pairs(items) do
if i.Ingredients:FindFirstChild(o) == nil then
okay = false
break
end
end
if okay then
for _, o in pairs(i.Ingredients:GetChildren()) do
table.insert(connectedItems, o.Name)
end
end
end
-- Go through displayed items adding/removing outlines
for _, i in pairs(script.Parent.Parent.Parent.Display.Container:GetChildren()) do
if i.Name == "Item" then
local okay = false
for n, o in pairs(connectedItems) do
if o == i.Item.Value.Name then
okay = true
table.remove(connectedItems, n)
break
end
end
i.BlueEdge.Visible = okay
end
end
else
-- Remove all outlines
for _, i in pairs(script.Parent.Parent.Parent.Display.Container:GetChildren()) do
if i.Name == "Item" then
i.BlueEdge.Visible = false
end
end
end
end
script.Parent.AddItem.OnInvoke = function(item)
-- Check if there already is an entry for the item
local existing = nil
for _, i in pairs(script.Parent:GetChildren()) do
if i.Name == "Item" then
if i.Item.Value == item then
existing = i
break
end
end
end
if existing == nil then
-- Check if the item count maximum has been reached
local entryCount = #script.Parent:GetChildren() - 5
if entryCount >= MAXIMUM_DIFFERENT_ITEMS then
return false
end
-- Create an item GUI element and add to container
local itemGui = script.Parent.ItemTemplate:clone()
itemGui.Name = "Item"
itemGui.Item.Value = item
itemGui.ItemIcon.Image = item.IconAsset.Value
itemGui.ItemNameLabel.Text = item.Name
itemGui.ItemNameLabel.TextColor3 = plr.PlayerScripts.Functions.GetRarityColor:Invoke(item.Rarity.Value)
if item.Rarity.Value == "Immortal" or item.Rarity.Value == "Developer" then
itemGui.ItemName.TextStrokeColor3 = Color3.fromRGB(255, 255, 255)
end
itemGui.Position = UDim2.new(0, (entryCount % 3) * 116 + 10, 0, math.floor(entryCount / 3) * 40 + 10)
itemGui.Parent = script.Parent
itemGui.Visible = true
itemGui.InteractionHandler.Disabled = false
-- Tell preview to refresh
plr.PlayerGui.MainGui.Crafting.MainFrame.Preview.Refresh:Fire(getItemTable())
refreshOutlines()
-- Return success
return true
else
-- Increment count value
existing.Count.Value = existing.Count.Value + 1
existing.ItemCount.Text = "x " .. existing.Count.Value
-- Tell preview to refresh
plr.PlayerGui.MainGui.Crafting.MainFrame.Preview.Refresh:Fire(getItemTable())
-- Return success
return true
end
end
script.Parent.RemoveItem.Event:connect(function(itemGui)
-- Get item
local item = itemGui.Item.Value
-- Decrement count
itemGui.Count.Value = itemGui.Count.Value - 1
-- Check if none left
if itemGui.Count.Value <= 0 then
-- Calculate gui rank to be used below
local thisRank = (((itemGui.Position.Y.Offset - 10) / 40) * 3) + ((itemGui.Position.X.Offset - 10) / 116)
-- Destroy the gui
itemGui:destroy()
-- Move each item over/up
for _, i in pairs(script.Parent:GetChildren()) do
if i.Name == "Item" then
local rank = (((i.Position.Y.Offset - 10) / 40) * 3) + ((i.Position.X.Offset - 10) / 116)
if rank > thisRank then
i.Position = i.Position + UDim2.new(0, -116, 0, 0)
if i.Position.X.Offset < 0 then
i.Position = i.Position + UDim2.new(0, 348, 0, -40)
end
end
end
end
elseif itemGui.Count.Value > 1 then
-- Change text
itemGui.ItemCount.Text = "x " .. itemGui.Count.Value
else
-- Change text
itemGui.ItemCount.Text = ""
end
-- Add back to main display
plr.PlayerGui.MainGui.Crafting.MainFrame.Display.Container.AddItem:Fire(item)
-- Tell preview to refresh
plr.PlayerGui.MainGui.Crafting.MainFrame.Preview.Refresh:Fire(getItemTable())
refreshOutlines()
end)
script.Parent.ClearItems.Event:connect(function()
-- Destroy all items
for _, i in pairs(script.Parent:GetChildren()) do
if i.Name == "Item" then
i:destroy()
end
end
-- Tell preview to refresh
plr.PlayerGui.MainGui.Crafting.MainFrame.Preview.Refresh:Fire({})
end)
|
--- Cleans up tracking resources.
|
function ScopeHUD:willUnmount()
self.Maid:Destroy()
end
function ScopeHUD:render()
return new('Frame', {
Active = true;
Draggable = true;
Position = self.state.IsToolModeEnabled and
UDim2.new(0, 10/2, 1, -8/2) or
UDim2.new(0, 10/2, 0, 8/2);
AnchorPoint = self.state.IsToolModeEnabled and
Vector2.new(0, 1) or
Vector2.new(0, 0);
Size = self.ContainerSize;
BackgroundTransparency = 1;
[Roact.Event.InputBegan] = self.OnInputBegin;
[Roact.Event.InputEnded] = self.OnInputEnd;
},
Support.Merge(self:BuildScopeHierarchyButtons(), {
Layout = new('UIListLayout', {
[Roact.Ref] = self.LayoutRef;
FillDirection = Enum.FillDirection.Horizontal;
HorizontalAlignment = Enum.HorizontalAlignment.Left;
VerticalAlignment = Enum.VerticalAlignment.Center;
SortOrder = Enum.SortOrder.LayoutOrder;
Padding = UDim.new(0, 5/2);
});
ModeToggle = new(ModeToggle, {
Core = self.props.Core;
IsToolModeEnabled = self.state.IsToolModeEnabled;
});
}))
end
|
-- Gradually regenerates the Humanoid's Health over time.
|
local REGEN_RATE = 1 / 100 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 5 -- Wait this long between each regeneration step.
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
if currentlyPlayingEmote then
oldAnim = "idle"
currentlyPlayingEmote = false
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
for _,v in pairs(locomotionMap) do
if v.track then
v.track:Stop()
v.track:Destroy()
v.track = nil
end
end
return oldAnim
end
local function getRigScale()
if userAnimateScaleRun then
return Character:GetScale()
else
return 1
end
end
function getHeightScale()
if Humanoid then
if not Humanoid.AutomaticScalingEnabled then
-- When auto scaling is not enabled, the rig scale stands in for
-- a computed scale.
return getRigScale()
end
local scale = Humanoid.HipHeight / HumanoidHipHeight
if AnimationSpeedDampeningObject == nil then
AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
end
if AnimationSpeedDampeningObject ~= nil then
scale = 1 + (Humanoid.HipHeight - HumanoidHipHeight) * AnimationSpeedDampeningObject.Value / HumanoidHipHeight
end
return scale
end
return getRigScale()
end
local function signedAngle(a, b)
return -math.atan2(a.x * b.y - a.y * b.x, a.x * b.x + a.y * b.y)
end
local angleWeight = 2.0
local function get2DWeight(px, p1, p2, sx, s1, s2)
local avgLength = 0.5 * (s1 + s2)
local p_1 = {x = (sx - s1)/avgLength, y = (angleWeight * signedAngle(p1, px))}
local p12 = {x = (s2 - s1)/avgLength, y = (angleWeight * signedAngle(p1, p2))}
local denom = smallButNotZero + (p12.x*p12.x + p12.y*p12.y)
local numer = p_1.x * p12.x + p_1.y * p12.y
local r = math.clamp(1.0 - numer/denom, 0.0, 1.0)
return r
end
local function blend2D(targetVelo, targetSpeed)
if userAnimateScaleRun then
local heightScale = getHeightScale()
targetVelo /= heightScale
targetSpeed /= heightScale
end
local h = {}
local sum = 0.0
for n,v1 in pairs(locomotionMap) do
if targetVelo.x * v1.lv.x < 0.0 or targetVelo.y * v1.lv.y < 0 then
-- Require same quadrant as target
h[n] = 0.0
continue
end
h[n] = math.huge
for j,v2 in pairs(locomotionMap) do
if targetVelo.x * v2.lv.x < 0.0 or targetVelo.y * v2.lv.y < 0 then
-- Require same quadrant as target
continue
end
h[n] = math.min(h[n], get2DWeight(targetVelo, v1.lv, v2.lv, targetSpeed, v1.speed, v2.speed))
end
sum += h[n]
end
--truncates below 10% contribution
local sum2 = 0.0
local weightedVeloX = 0
local weightedVeloY = 0
for n,v in pairs(locomotionMap) do
if (h[n] / sum > 0.1) then
sum2 += h[n]
weightedVeloX += h[n] * v.lv.x
weightedVeloY += h[n] * v.lv.y
else
h[n] = 0.0
end
end
local animSpeed
local weightedSpeedSquared = weightedVeloX * weightedVeloX + weightedVeloY * weightedVeloY
if weightedSpeedSquared > smallButNotZero then
animSpeed = math.sqrt(targetSpeed * targetSpeed / weightedSpeedSquared)
else
animSpeed = 0
end
if not userAnimateScaleRun then
animSpeed = animSpeed / getHeightScale()
end
local groupTimePosition = 0
for n,v in pairs(locomotionMap) do
if v.track.IsPlaying then
groupTimePosition = v.track.TimePosition
break
end
end
for n,v in pairs(locomotionMap) do
-- if not loco
if h[n] > 0.0 then
if not v.track.IsPlaying then
v.track:Play(runBlendtime)
v.track.TimePosition = groupTimePosition
end
local weight = math.max(smallButNotZero, h[n] / sum2)
v.track:AdjustWeight(weight, runBlendtime)
v.track:AdjustSpeed(animSpeed)
else
v.track:Stop(runBlendtime)
end
end
end
local function getWalkDirection()
local walkToPoint = Humanoid.WalkToPoint
local walkToPart = Humanoid.WalkToPart
if Humanoid.MoveDirection ~= Vector3.zero then
return Humanoid.MoveDirection
elseif walkToPart or walkToPoint ~= Vector3.zero then
local destination
if walkToPart then
destination = walkToPart.CFrame:PointToWorldSpace(walkToPoint)
else
destination = walkToPoint
end
local moveVector = Vector3.zero
if Humanoid.RootPart then
moveVector = destination - Humanoid.RootPart.CFrame.Position
moveVector = Vector3.new(moveVector.x, 0.0, moveVector.z)
local mag = moveVector.Magnitude
if mag > 0.01 then
moveVector /= mag
end
end
return moveVector
else
return Humanoid.MoveDirection
end
end
local function updateVelocity(currentTime)
local tempDir
if locomotionMap == strafingLocomotionMap then
local moveDirection = getWalkDirection()
if not Humanoid.RootPart then
return
end
local cframe = Humanoid.RootPart.CFrame
if math.abs(cframe.UpVector.Y) < smallButNotZero or pose ~= "Running" or humanoidSpeed < 0.001 then
-- We are horizontal! Do something (turn off locomotion)
for n,v in pairs(locomotionMap) do
if v.track then
v.track:AdjustWeight(smallButNotZero, runBlendtime)
end
end
return
end
local lookat = cframe.LookVector
local direction = Vector3.new(lookat.X, 0.0, lookat.Z)
direction = direction / direction.Magnitude --sensible upVector means this is non-zero.
local ly = moveDirection:Dot(direction)
if ly <= 0.0 and ly > -0.05 then
ly = smallButNotZero -- break quadrant ties in favor of forward-friendly strafes
end
local lx = direction.X*moveDirection.Z - direction.Z*moveDirection.X
local tempDir = Vector2.new(lx, ly) -- root space moveDirection
local delta = Vector2.new(tempDir.x-cachedLocalDirection.x, tempDir.y-cachedLocalDirection.y)
-- Time check serves the purpose of the old keyframeReached sync check, as it syncs anim timePosition
if delta:Dot(delta) > 0.001 or math.abs(humanoidSpeed - cachedRunningSpeed) > 0.01 or currentTime - lastBlendTime > 1 then
cachedLocalDirection = tempDir
cachedRunningSpeed = humanoidSpeed
lastBlendTime = currentTime
blend2D(cachedLocalDirection, cachedRunningSpeed)
end
else
if math.abs(humanoidSpeed - cachedRunningSpeed) > 0.01 or currentTime - lastBlendTime > 1 then
cachedRunningSpeed = humanoidSpeed
lastBlendTime = currentTime
blend2D(Vector2.yAxis, cachedRunningSpeed)
end
end
end
function setAnimationSpeed(speed)
if currentAnim ~= "walk" then
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
if currentlyPlayingEmote then
if currentAnimTrack.Looped then
-- Allow the emote to loop
return
end
repeatAnim = "idle"
currentlyPlayingEmote = false
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Humanoid)
setAnimationSpeed(animSpeed)
end
end
function rollAnimation(animName)
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
return idx
end
local function switchToAnim(anim, animName, transitionTime, humanoid)
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimSpeed = 1.0
currentAnim = animName
currentAnimInstance = anim -- nil in the case of locomotion
if animName == "walk" then
setupWalkAnimations()
else
destroyWalkAnimations()
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
currentAnimTrack:Play(transitionTime)
-- set up keyframe name triggers
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
local anim = animTable[animName][idx].anim
switchToAnim(anim, animName, transitionTime, humanoid)
currentlyPlayingEmote = false
end
function playEmote(emoteAnim, transitionTime, humanoid)
switchToAnim(emoteAnim, emoteAnim.Name, transitionTime, humanoid)
currentlyPlayingEmote = true
end
|
-- подготовка массива моделей участков
|
for a,b in pairs (tmp) do
if b.ClassName == "Model" then -- проверить дочек на модель
table.insert(models,b:Clone()) -- добавляем клон в массив моделей
b:Destroy() -- удаляем оригинал
end
end
|
--
--inputS.TouchStarted:Connect(function(object)
-- if object == Enum.KeyCode.DPadUp or seat.Throttle == 1 then
-- w=true
-- elseif object == Enum.KeyCode.DPadLeft or seat.Steer == -1 then
-- a=true
-- elseif object == Enum.KeyCode.DPadDown or seat.Throttle == -1 then
-- s=true
-- elseif object == Enum.KeyCode.DPadRight or seat.Steer == 1 then
-- d=true
-- end
--end)
|
inputS.InputEnded:connect(function(input)
local code=input.KeyCode
if code==Enum.KeyCode.LeftShift then
up=false
elseif input.KeyCode==Enum.KeyCode.LeftControl then
dn=false
end
end)
|
-- Color shortcuts: you can use these strings instead of full property names
|
local propertyShortcuts = {}
propertyShortcuts.Color = "TextColor3"
propertyShortcuts.StrokeColor = "TextStrokeColor3"
propertyShortcuts.ImageColor = "ImageColor3"
|
-- << VARIABLES >>
|
local topBar = main.gui.CustomTopBar
local coreToHide = {"Chat", "PlayerList"}
local originalCoreStates = {};
local cmdBar = main.gui.CmdBar
local isOpen = false
local currentProps = {}
local originalTopBarTransparency = 1
local originalTopBarVisibility = true
local mainProps
mainProps = {
maxSuggestions = 5;
mainParent = cmdBar;
textBox = cmdBar.SearchFrame.TextBox;
rframe = cmdBar.ResultsFrame;
suggestionPos = 1;
suggestionDisplayed = 0;
forceExecute = false;
highlightColor = Color3.fromRGB(50,50,50);
otherColor = Color3.fromRGB(80,80,80);
suggestionLabels = {};
currentBarCommand = nil;
}
|
--
|
event.OnClientEvent:Connect(function(msg, color)
channels.RBXGeneral:DisplaySystemMessage(msg)--, color)
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Players__1 = game:GetService("Players");
local u1 = {
Climbing = {
SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
Looped = true
},
Died = {
SoundId = "rbxasset://sounds/uuhhh.mp3"
},
FreeFalling = {
SoundId = "rbxasset://sounds/action_falling.mp3",
Looped = true
},
GettingUp = {
SoundId = "rbxasset://sounds/action_get_up.mp3"
},
Jumping = {
SoundId = "rbxasset://sounds/action_jump.mp3"
},
Landing = {
SoundId = "rbxasset://sounds/action_jump_land.mp3"
},
Running = {
SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
Looped = true,
Pitch = 1.85
},
Splash = {
SoundId = "rbxasset://sounds/impact_water.mp3"
},
Swimming = {
SoundId = "rbxasset://sounds/action_swim.mp3",
Looped = true,
Pitch = 1.6
}
};
local function u2(p1)
local v2 = {};
for v3, v4 in pairs(p1) do
v2[v3] = v4;
end;
return v2;
end;
local function u3(p2)
p2.TimePosition = 0;
p2.Playing = true;
end;
local function u4(p3, p4, p5, p6, p7)
return (p3 - p4) * (p7 - p6) / (p5 - p4) + p6;
end;
local l__RunService__5 = game:GetService("RunService");
local function u6(...)
local u7 = { ... };
local u8 = Instance.new("BindableEvent");
local function v5(...)
for v6 = 1, #u7 do
u7[v6]:Disconnect();
end;
return u8:Fire(...);
end;
for v7 = 1, #u7 do
u7[v7] = u7[v7]:Connect(v5);
end;
return u8.Event:Wait();
end;
local function u9(p8, p9, p10)
local v8 = {};
for v9, v10 in pairs(u1) do
local v11 = Instance.new("Sound");
v11.Name = v9;
v11.Archivable = false;
v11.EmitterSize = 5;
v11.MaxDistance = 150;
v11.Volume = 0.65;
for v12, v13 in pairs(v10) do
v11[v12] = v13;
end;
v11.Parent = p10;
v8[v9] = v11;
end;
local u10 = {};
local v14 = {};
local function u11(p11)
for v15, v16 in pairs(u2(u10)) do
if v15 ~= p11 then
v15.Playing = false;
u10[v15] = nil;
end;
end;
end;
v14[Enum.HumanoidStateType.FallingDown] = function()
u11();
end;
v14[Enum.HumanoidStateType.GettingUp] = function()
u11();
u3(v8.GettingUp);
end;
v14[Enum.HumanoidStateType.Jumping] = function()
u11();
u3(v8.Jumping);
end;
v14[Enum.HumanoidStateType.Swimming] = function()
local v17 = math.abs(p10.Velocity.Y);
if v17 > 0.1 then
v8.Splash.Volume = math.clamp(u4(v17, 100, 350, 0.28, 1), 0, 1);
u3(v8.Splash);
end;
u11(v8.Swimming);
v8.Swimming.Playing = true;
u10[v8.Swimming] = true;
end;
v14[Enum.HumanoidStateType.Freefall] = function()
v8.FreeFalling.Volume = 0;
u11(v8.FreeFalling);
u10[v8.FreeFalling] = true;
end;
v14[Enum.HumanoidStateType.Landed] = function()
u11();
local v18 = math.abs(p10.Velocity.Y);
if v18 > 75 then
v8.Landing.Volume = math.clamp(u4(v18, 50, 100, 0, 1), 0, 1);
u3(v8.Landing);
end;
end;
v14[Enum.HumanoidStateType.Running] = function()
u11(v8.Running);
v8.Running.Playing = true;
u10[v8.Running] = true;
end;
v14[Enum.HumanoidStateType.Climbing] = function()
local l__Climbing__19 = v8.Climbing;
if math.abs(p10.Velocity.Y) > 0.1 then
l__Climbing__19.Playing = true;
u11(l__Climbing__19);
else
u11();
end;
u10[l__Climbing__19] = true;
end;
v14[Enum.HumanoidStateType.Seated] = function()
u11();
end;
v14[Enum.HumanoidStateType.Dead] = function()
u11();
u3(v8.Died);
end;
local v20 = {
[v8.Climbing] = function(p12, p13, p14)
p13.Playing = p14.Magnitude > 0.1;
end,
[v8.FreeFalling] = function(p15, p16, p17)
if not (p17.Magnitude > 75) then
p16.Volume = 0;
return;
end;
p16.Volume = math.clamp(p16.Volume + 0.9 * p15, 0, 1);
end
};
v20[v8.Running] = function(p18, p19, p20)
local v21 = false;
if p20.Magnitude > 0.5 then
v21 = p9.MoveDirection.Magnitude > 0.5;
end;
p19.Playing = v21;
end;
local v22 = {
[Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running
};
local u12 = v22[p9:GetState()] or p9:GetState();
local u13 = p9.StateChanged:Connect(function(p21, p22)
p22 = v22[p22] and p22;
if p22 ~= u12 then
local v23 = v14[p22];
if v23 then
v23();
end;
u12 = p22;
end;
end);
local u14 = l__RunService__5.Stepped:Connect(function(p23, p24)
for v24, v25 in pairs(u10) do
local v26 = v20[v24];
if v26 then
v26(p24, v24, p10.Velocity);
end;
end;
end);
local u15 = nil;
local u16 = nil;
local u17 = nil;
local function u18()
u13:Disconnect();
u14:Disconnect();
u15:Disconnect();
u16:Disconnect();
u17:Disconnect();
end;
u15 = p9.AncestryChanged:Connect(function(p25, p26)
if not p26 then
u18();
end;
end);
u16 = p10.AncestryChanged:Connect(function(p27, p28)
if not p28 then
u18();
end;
end);
u17 = p8.CharacterAdded:Connect(u18);
end;
local function v27(p29)
local function v28(p30)
if not p30.Parent then
u6(p30.AncestryChanged, p29.CharacterAdded);
end;
if p29.Character ~= p30 or not p30.Parent then
return;
end;
local v29 = p30:FindFirstChildOfClass("Humanoid");
while p30:IsDescendantOf(game) and not v29 do
u6(p30.ChildAdded, p30.AncestryChanged, p29.CharacterAdded);
v29 = p30:FindFirstChildOfClass("Humanoid");
end;
if p29.Character ~= p30 or not p30:IsDescendantOf(game) then
return;
end;
local v30 = p30:FindFirstChild("HumanoidRootPart");
while p30:IsDescendantOf(game) and not v30 do
u6(p30.ChildAdded, p30.AncestryChanged, v29.AncestryChanged, p29.CharacterAdded);
v30 = p30:FindFirstChild("HumanoidRootPart");
end;
if v30 and v29:IsDescendantOf(game) and p30:IsDescendantOf(game) and p29.Character == p30 then
u9(p29, v29, v30);
end;
end;
if p29.Character then
v28(p29.Character);
end;
p29.CharacterAdded:Connect(v28);
end;
l__Players__1.PlayerAdded:Connect(v27);
for v31, v32 in ipairs(l__Players__1:GetPlayers()) do
v27(v32);
end;
|
--- Add a task to clean up
-- @usage
-- Maid[key] = (function) Adds a task to perform
-- Maid[key] = (event connection) Manages an event connection
-- Maid[key] = (thread) Manages a thread
-- Maid[key] = (Maid) Maids can act as an event connection, allowing a Maid to have other maids to clean up.
-- Maid[key] = (Object) Maids can cleanup objects with a `Destroy` method
-- Maid[key] = nil Removes a named task. If the task is an event, it is disconnected. If it is an object,
-- it is destroyed.
|
function Maid:__newindex(index, newTask)
if Maid[index] ~= nil then
error(("Cannot use '%s' as a Maid key"):format(tostring(index)), 2)
end
local tasks = self._tasks
local oldTask = tasks[index]
if oldTask == newTask then
return
end
tasks[index] = newTask
if oldTask then
if type(oldTask) == "function" then
oldTask()
elseif type(oldTask) == "thread" then
local cancelled
if coroutine.running() ~= oldTask then
cancelled = pcall(function()
task.cancel(oldTask)
end)
end
if not cancelled then
task.defer(function()
task.cancel(oldTask)
end)
end
elseif typeof(oldTask) == "RBXScriptConnection" then
oldTask:Disconnect()
elseif oldTask.Destroy then
oldTask:Destroy()
end
end
end
|
-- 1 == if two players vote yes, and two players vote no, the player gets kicked
|
conf.MinimumVotesRequired = 2 -- This is recommended to be at 2 to prevent a player from kicking the second player in the server
conf.PlayerVoteKickCooldown = 120 -- How long between a single player being able to start a vote kick
conf.VoteKickCooldown = 30 -- How long between all vote kicks
conf.KickTime = 15 -- How much time is given to vote kick
return conf
|
--[[
Updates all Tween objects.
]]
|
local function updateAllTweens()
local now = os.clock()
-- FIXME: Typed Luau doesn't understand this loop yet
for tween in allTweens :: any do
local currentTime = now - tween._currentTweenStartTime
if currentTime > tween._currentTweenDuration then
if tween._currentTweenInfo.Reverses then
tween._currentValue = tween._prevValue
else
tween._currentValue = tween._nextValue
end
tween._currentlyAnimating = false
updateAll(tween)
TweenScheduler.remove(tween)
else
local ratio = getTweenRatio(tween._currentTweenInfo, currentTime)
local currentValue = lerpType(tween._prevValue, tween._nextValue, ratio)
tween._currentValue = currentValue
tween._currentlyAnimating = true
updateAll(tween)
end
end
end
RunService:BindToRenderStep(
"__FusionTweenScheduler",
Enum.RenderPriority.First.Value,
updateAllTweens
)
return TweenScheduler
|
--Declared variables
|
local hum = script.Parent:WaitForChild("Humanoid")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.