prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--// Ported from Kronos |
return function(data)
local gTable
local window = client.UI.Make("Window",{
Name = "Aliases";
Title = "Alias Editor";
Size = {420, 240};
AllowMultiple = false;
})
local template = {
Alias = "",
Args = {Names = {}, Defaults = {}},
Command = "",
Description = ""
}
for i,v in pairs(template) do
if not data[i] then
data[i] = v
end
end
if window then
local bg = window:Add("ScrollingFrame", {
BackgroundColor3 = Color3.fromRGB(31, 31, 31):lerp(Color3.new(1,1,1), 0.2);
Size = UDim2.new(1, -10, 1, -10);
Position = UDim2.new(0, 5, 0, 5)
})
local content = bg:Add("ScrollingFrame", {
Size = UDim2.new(1, -10, 1, -35);
Position = UDim2.new(0, 5, 0, 5);
BackgroundTransparency = 0.5;
})
local draw;
local curArgName, curArgDefault, argIndex;
local argBox; argBox = window:Add("Frame", {
Visible = false;
Size = UDim2.new(0, 200, 0, 150);
Position = UDim2.new(0.5, -100, 0.5, -75);
Children = {
{
Class = "TextLabel";
Text = "Argument Name:";
Position = UDim2.new(0, 0, 0, 10);
Size = UDim2.new(1, 0, 0, 20);
BackgroundTransparency = 1;
};
{
Class = "TextLabel";
Text = "Default:";
Position = UDim2.new(0, 0, 0, 65);
Size = UDim2.new(1, 0, 0, 20);
BackgroundTransparency = 1;
};
{
Class = "TextButton";
Text = "Save";
Position = UDim2.new(0.5, 0, 1, -30);
Size = UDim2.new(0.5, -20, 0, 20);
BackgroundTransparency = 1;
OnClicked = function()
if argIndex == 0 then
table.insert(data.Args.Names, curArgName)
table.insert(data.Args.Defaults, curArgDefault or "")
else
data.Args.Names[argIndex] = curArgName
data.Args.Defaults[argIndex] = curArgDefault or ""
end
draw()
curArgName = nil
curArgDefault = nil
argBox.Visible = false
end
};
}
})
local endBtn = argBox:Add({
Class = "TextButton";
Text = "Remove";
Position = UDim2.new(0, 10, 1, -30);
Size = UDim2.new(0.5, -20, 0, 20);
BackgroundTransparency = 1;
OnClicked = function()
if argIndex ~= 0 then
table.remove(data.Args.Names, argIndex)
table.remove(data.Args.Defaults, argIndex)
end
draw()
curArgName = nil
curArgDefault = nil
argBox.Visible = false
end
})
local argNameBox = argBox:Add("TextBox", {
Text = curArgName or "name";
Position = UDim2.new(0, 10, 0, 35);
Size = UDim2.new(1, -20, 0, 20);
TextChanged = function(newText, enter, box)
curArgName = newText
end
});
local argDefaultBox = argBox:Add("TextBox", {
Text = curArgDefault or "";
Position = UDim2.new(0, 10, 0, 90);
Size = UDim2.new(1, -20, 0, 20);
TextChanged = function(newText, enter, box)
curArgDefault = newText
end
});
argBox.BackgroundColor3 = argBox.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.05)
argNameBox.BackgroundColor3 = argNameBox.BackgroundColor3:lerp(Color3.new(1, 1, 1), 0.1)
argDefaultBox.BackgroundColor3 = argNameBox.BackgroundColor3
local function showArgBox(argData)
if not argBox.Visible then
if argData then
curArgName = argData.Name
curArgDefault = argData.Default
end
if argIndex == 0 then
endBtn.Text = "Cancel"
else
endBtn.Text = "Remove"
end
argNameBox.Text = curArgName or "name"
argDefaultBox.Text = curArgDefault or ""
argBox.Visible = true
end
end
function draw()
content:ClearAllChildren();
local i = 1
content:Add("TextLabel", {
Text = " ".."Alias"..": ";
ToolTip = "Set the alias Adonis should check for in chat";
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1))+5);
TextXAlignment = "Left";
Children = {
[data.ExistingAlias and "TextLabel" or "TextBox"] = {
Text = data.Alias or "";
Size = UDim2.new(0, 200, 1, 0);
Position = UDim2.new(1, -200, 0, 0);
BackgroundTransparency = 1;
TextChanged = not data.ExistingAlias and function(text, enter, new)
data.Alias = text
end or nil
}
}
})
i = i + 1
content:Add("TextLabel", {
Text = " ".."Command"..": ";
ToolTip = "Set the command(s) Adonis should execute when finding the alias";
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1))+5);
TextXAlignment = "Left";
Children = {
TextBox = {
Text = data.Command or "";
Size = UDim2.new(0, 200, 1, 0);
Position = UDim2.new(1, -200, 0, 0);
BackgroundTransparency = 1;
TextChanged = function(text, enter, new)
data.Command = text
end
}
}
})
i = i + 1
content:Add("TextLabel", {
Text = " ".."Description"..": ";
ToolTip = "What does the alias do?";
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1))+5);
TextXAlignment = "Left";
Children = {
TextBox = {
Text = data.Description or "";
Size = UDim2.new(0, 200, 1, 0);
Position = UDim2.new(1, -200, 0, 0);
BackgroundTransparency = 1;
TextChanged = function(text, enter, new)
data.Description = text
end
}
}
})
i = i + 2
content:Add("TextButton", {
Text = "Add Argument",
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1))+5);
OnClicked = function(button)
argIndex = 0
showArgBox()
end
})
for index,arg in ipairs(data.Args.Names) do
i = i + 1
content:Add("TextButton", {
Text = "Argument: ".. arg .." | Default: "..data.Args.Defaults[index];
BackgroundTransparency = (i%2 == 0 and 0) or 0.2;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, (30*(i-1))+5);
OnClicked = function(button)
argIndex = index
showArgBox({Name = arg, Default = data.Args.Defaults[index]})
end
})
end
content:ResizeCanvas(false, true, false, false, 5, 5)
bg:Add("TextButton", {
Text = "Cancel";
Position = UDim2.new(0, 5, 1, -25);
Size = UDim2.new(1/3, -8, 0, 20);
OnClicked = function(button)
window:Close()
end
})
bg:Add("TextButton", {
Text = "Remove";
Position = UDim2.new(1/3, 3, 1, -25);
Size = UDim2.new(1/3, -7, 0, 20);
OnClicked = function(button)
if data.ExistingAlias then
client.Functions.RemoveAlias(data.Alias)
client.UI.Remove("UserPanel")
client.UI.Make("UserPanel", {Tab = "Aliases"})
end
window:Close()
end
})
bg:Add("TextButton", {
Text = "Save";
Position = UDim2.new(2/3, 3, 1, -25);
Size = UDim2.new(1/3, -8, 0, 20);
OnClicked = function(button)
if data.Alias == "" or data.Command == "" then
client.UI.Make("Output", {Message = "A required field is missing!"})
else
client.Functions.SetAlias(data.Alias, data)
client.UI.Remove("UserPanel")
client.UI.Make("UserPanel", {Tab = "Aliases"})
window:Close()
end
end
})
end
draw()
gTable = window.gTable
window:Ready()
end
end
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
---------------------------------------------------------------------------------------------------- |
,VRecoil = {3,7} --- Vertical Recoil
,HRecoil = {3,7} --- Horizontal Recoil
,AimRecover = 1 ---- Between 0 & 1
,RecoilPunch = .25
,VPunchBase = 5 --- Vertical Punch
,HPunchBase = 1.5 --- Horizontal Punch
,DPunchBase = 1 --- Tilt Punch | useless
,AimRecoilReduction = 1 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0.2
,MinRecoilPower = 1
,MaxRecoilPower = 3
,RecoilPowerStepAmount = .5
,MinSpread = 5 --- Min bullet spread value | Studs
,MaxSpread = 40 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 2.5
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.25 --- Weapon Base Sway | Studs
,MaxSway = 1 --- Max sway value based on player stamina | Studs |
--while true do
-- wait(0.1)
-- while Tool.Parent~=workspace do
-- wait(0.1)
-- end
-- --Tool is in workspace, assumed dropped
-- Holster:Destroy()
-- print("Destroying holster!!!")
-- while Tool.Parent==workspace do
-- wait(0.1)
-- end
-- --Tool is not in workspace anymore, assumed picked up by player in either a backpack or in the player model | |
--[=[
@within Plasma
@function create
@param className string -- The class name of the Instance to create
@param props CreateProps
@return Instance -- The created instance
@tag utilities
A function that creates an Instance tree.
CreateProps is a table:
- String keys are interpreted as properties to set
- Numerical keys are interpreted as children
- Function values are interpreted as event handlers
- Table keys can be used to get references to instances deep in the tree, the value becomes the key in the table
This function doesn't do anything special. It just creates an instance.
```lua
create("Frame", {
BackgroundTransparency = 1,
Name = "Checkbox",
create("TextButton", {
BackgroundColor3 = Color3.fromRGB(54, 54, 54),
Size = UDim2.new(0, 30, 0, 30),
create("UICorner", {
CornerRadius = UDim.new(0, 8),
}),
Activated = function()
setClicked(true)
end,
}),
})
```
Getting references to instances deep in a tree:
```lua
local ref = {}
create("Frame", {
create("TextButton", {
[ref] = "button",
Text = "hi"
})
})
print(ref.button.Text) --> hi
```
]=] |
local function create(className, props)
props = props or {}
local eventCallback = Runtime.useEventCallback()
local instance = Instance.new(className)
for key, value in pairs(props) do
if type(value) == "function" then
if eventCallback then
eventCallback(instance, key, value)
else
instance[key]:Connect(value)
end
elseif type(key) == "number" then
value.Parent = instance
elseif type(key) == "table" then
key[value] = instance
if props.Name == nil then
instance.Name = value
end
else
instance[key] = value
end
end
return instance
end
return create
|
--// gets gun values from configuration folders |
function module.getValue(folder : Instance, name : string)
return folder:WaitForChild(name,1000).Value
end
function module.loadAnimation(folder : Instance, name : string, animator : Animator)
return animator:LoadAnimation(folder:WaitForChild(name, 1000))
end
function module.getHumanoidFromPart(part : BasePart)
local parent = part.Parent
if parent ~= workspace and not parent:IsA("Accessory") then
local Humanoid = parent:FindFirstChildWhichIsA("Humanoid",true)
return Humanoid
elseif part.Parent:IsA("Accessory") then
parent = part.Parent.Parent
local Humanoid = parent:FindFirstChildWhichIsA("Humanoid",true)
return Humanoid
end
end
function module.getRandomInstanceOfType(folder : Instance, instanceType : string)
local folderChildren = folder:GetChildren()
local random
repeat random = folderChildren[math.random(1,#folderChildren)] until random:IsA(instanceType)
return random
end
function module.normalIdFromVector(vector)
print(vector)
local epsilon = 0.01
for _, normalId in pairs(Enum.NormalId:GetEnumItems()) do
if vector.unit:Dot(Vector3.FromNormalId(normalId)) > 1 - epsilon then
print(normalId)
return normalId
end
end
end
function module.SetStatValue(player : Player, statName : string, newValue : number)
local leaderstatsFolder = player:WaitForChild("leaderstats", 1000)
if leaderstatsFolder then
local stat = leaderstatsFolder:WaitForChild(statName, 1000)
if stat then
stat.Value = newValue
else
return false
end
else
return false
end
end
function module.GetStatValue(player : Player, statName : string)
local leaderstatsFolder = player:WaitForChild("leaderstats", 1000)
if leaderstatsFolder then
local stat = leaderstatsFolder:WaitForChild(statName, 1000)
if stat then
return stat.Value
else
return false
end
else
return false
end
end
return module
|
--------LEFT DOOR -------- |
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(21)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(21) |
-- Комбинации данных |
DataStore2.Combine(DB, "stage")
|
-- RemoteProperty
-- Stephen Leitnick
-- December 20, 2021 |
local Players = game:GetService("Players")
local Util = require(script.Parent.Parent.Util)
local Types = require(script.Parent.Parent.Types)
local RemoteSignal = require(script.Parent.RemoteSignal)
local None = Util.None
|
--[[ The Module ]] | --
local TransparencyController = {}
TransparencyController.__index = TransparencyController
function TransparencyController.new()
local self = setmetatable({}, TransparencyController)
self.lastUpdate = tick()
self.transparencyDirty = false
self.enabled = false
self.lastTransparency = nil
self.descendantAddedConn, self.descendantRemovingConn = nil, nil
self.toolDescendantAddedConns = {}
self.toolDescendantRemovingConns = {}
self.cachedParts = {}
return self
end
function TransparencyController:HasToolAncestor(object)
if object.Parent == nil then return false end
return false
end
function TransparencyController:IsValidPartToModify(part)
if part:IsA('BasePart') or part:IsA('Decal') then
return not self:HasToolAncestor(part)
end
return false
end
function TransparencyController:CachePartsRecursive(object)
if object then
if self:IsValidPartToModify(object) then
self.cachedParts[object] = true
self.transparencyDirty = true
end
for _, child in pairs(object:GetChildren()) do
self:CachePartsRecursive(child)
end
end
end
function TransparencyController:TeardownTransparency()
for child, _ in pairs(self.cachedParts) do
child.LocalTransparencyModifier = 0
end
self.cachedParts = {}
self.transparencyDirty = true
self.lastTransparency = nil
if self.descendantAddedConn then
self.descendantAddedConn:disconnect()
self.descendantAddedConn = nil
end
if self.descendantRemovingConn then
self.descendantRemovingConn:disconnect()
self.descendantRemovingConn = nil
end
for object, conn in pairs(self.toolDescendantAddedConns) do
conn:Disconnect()
self.toolDescendantAddedConns[object] = nil
end
for object, conn in pairs(self.toolDescendantRemovingConns) do
conn:Disconnect()
self.toolDescendantRemovingConns[object] = nil
end
end
function TransparencyController:SetupTransparency(character)
self:TeardownTransparency()
if self.descendantAddedConn then self.descendantAddedConn:disconnect() end
self.descendantAddedConn = character.DescendantAdded:Connect(function(object)
-- This is a part we want to invisify
if self:IsValidPartToModify(object) then
self.cachedParts[object] = true
self.transparencyDirty = true
-- There is now a tool under the character
end
end)
if self.descendantRemovingConn then self.descendantRemovingConn:disconnect() end
self.descendantRemovingConn = character.DescendantRemoving:connect(function(object)
if self.cachedParts[object] then
self.cachedParts[object] = nil
-- Reset the transparency
object.LocalTransparencyModifier = 0
end
end)
self:CachePartsRecursive(character)
end
function TransparencyController:Enable(enable)
if self.enabled ~= enable then
self.enabled = enable
self:Update()
end
end
function TransparencyController:SetSubject(subject)
local character = nil
if subject and subject:IsA("Humanoid") then
character = subject.Parent
end
if subject and subject:IsA("VehicleSeat") and subject.Occupant then
character = subject.Occupant.Parent
end
if character then
self:SetupTransparency(character)
else
self:TeardownTransparency()
end
end
function TransparencyController:Update()
local instant = false
local now = tick()
local currentCamera = workspace.CurrentCamera
if currentCamera then
local transparency = 0
if not self.enabled then
instant = true
else
local distance = (currentCamera.Focus.p - currentCamera.CoordinateFrame.p).magnitude
transparency = (distance<2) and (1.0-(distance-0.5)/1.5) or 0 --(7 - distance) / 5
if transparency < 0.5 then
transparency = 0
end
if self.lastTransparency then
local deltaTransparency = transparency - self.lastTransparency
-- Don't tween transparency if it is instant or your character was fully invisible last frame
if not instant and transparency < 1 and self.lastTransparency < 0.95 then
local maxDelta = MAX_TWEEN_RATE * (now - self.lastUpdate)
deltaTransparency = math.clamp(deltaTransparency, -maxDelta, maxDelta)
end
transparency = self.lastTransparency + deltaTransparency
else
self.transparencyDirty = true
end
transparency = math.clamp(Util.Round(transparency, 2), 0, 1)
end
if self.transparencyDirty or self.lastTransparency ~= transparency then
for child, _ in pairs(self.cachedParts) do
child.LocalTransparencyModifier = transparency
end
self.transparencyDirty = false
self.lastTransparency = transparency
end
end
self.lastUpdate = now
end
return TransparencyController
|
-- ========================================
-- Local action functions
-- ========================================
-- Returns whether part is in the map folder |
local function isInMap(part)
local mapAncestor = part:FindFirstAncestor("Map")
return mapAncestor and mapAncestor:IsA("Folder")
end
|
-- Subtracting position from the CFrame leaves you with just the rotational elements of the CFrame |
local rotationOffset = (npcModel.PrimaryPart.CFrame - npcModel.PrimaryPart.CFrame.Position):Inverse()
local Animations = {
SuperheroIdle = 616111295,
Wave = 507770239,
}
local NPC = {
Waist = npcModel.UpperTorso.Waist,
Root = npcModel.LowerTorso.Root,
Neck = npcModel.Head.Neck,
}
local TwistProportions = {
Root = .2,
Waist = .3,
Neck = .5,
Full = 1,
}
|
--- Skill |
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Mouse = plr:GetMouse()
local Debounce = true
Player = game.Players.LocalPlayer
local Track1 : Animation = script:WaitForChild("Anim01")
Track1 = Player.Character:WaitForChild("Humanoid"):LoadAnimation(script.Anim01)
local PrevWalkSpeed = nil
local PrevJumpPower = nil
local Tween = game:GetService("TweenService")
local Gui = Player.PlayerGui:WaitForChild("Mochi_Skill_List".. Player.Name):WaitForChild("Frame")
local Cooldown = 7
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "None" then
Tool.Active.Value = "3BuzzCutDough"
Gui:FindFirstChild(Tool.Active.Value).Frame.Size = UDim2.new(1, 0, 1, 0)
PrevWalkSpeed = Player.Character:WaitForChild("Humanoid").WalkSpeed
PrevJumpPower = Player.Character:WaitForChild("Humanoid").JumpPower
Player.Character:WaitForChild("Humanoid").WalkSpeed = 2.5
Player.Character:WaitForChild("Humanoid").JumpPower = 0
Track1:Play()
Track1:AdjustSpeed(0)
wait(0.15)
script.Fire:FireServer("hold")
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C and Debounce == true and Tool.Equip.Value == true and Tool.Active.Value == "3BuzzCutDough" then
Debounce = false
Tool.Active.Value = "3BuzzCutDough"
Player.Character:WaitForChild("Humanoid").WalkSpeed = 0
Track1:Stop()
script.Fire:FireServer("unhold")
wait(1.5)
local hum = Player.Character.Humanoid
local CamOffsetMulti = 6
for i = 1,20 do
hum.CameraOffset = Vector3.new(
math.random(-CamOffsetMulti,CamOffsetMulti),
math.random(-CamOffsetMulti,CamOffsetMulti),
math.random(-CamOffsetMulti,CamOffsetMulti))
CamOffsetMulti = CamOffsetMulti/1.05
wait()
end
hum.CameraOffset = Vector3.new(0,0,0)
Tween:Create(Gui:FindFirstChild(Tool.Active.Value).Frame, TweenInfo.new(Cooldown), {Size = UDim2.new(0, 0, 1, 0)}):Play()
Tool.Active.Value = "None"
Player.Character:WaitForChild("Humanoid").WalkSpeed = PrevWalkSpeed
Player.Character:WaitForChild("Humanoid").JumpPower = PrevJumpPower
wait(Cooldown)
Debounce = true
end
end)
|
-- Destroy script 10 seconds later (prevents multiple things trying to set parent at same time) |
wait(10)
script:destroy()
|
--]] |
function getHumanoid(model)
for _, v in pairs(model:GetChildren()) do
if v:IsA'Humanoid' then
return v
end
end
end
local ai = script.Parent
local human = getHumanoid(ai)
local hroot = ai.HumanoidRootPart
local zspeed = hroot.Velocity.magnitude
local pfs = game:GetService("PathfindingService")
function GetPlayerNames()
local players = game:GetService('Players'):GetChildren()
local name = nil
for _, v in pairs(players) do
if v:IsA'Player' then
name = tostring(v.Name)
end
end
return name
end
function GetPlayersBodyParts(t)
local torso = t
if torso then
local figure = torso.Parent
for _, v in pairs(figure:GetChildren()) do
if v:IsA'Part' then
return v.Name
end
end
else
return "HumanoidRootPart"
end
end
function GetTorso(part)
local chars = game.Workspace:GetChildren()
local torso = nil
for _, v in pairs(chars) do
if v:IsA'Model' and v ~= script.Parent and v.Name == GetPlayerNames() then
local charRoot = v:FindFirstChild'HumanoidRootPart'
if (charRoot.Position - part).magnitude < SearchDistance then
torso = charRoot
end
end
end
return torso
end
for _, zambieparts in pairs(ai:GetChildren()) do
if zambieparts:IsA'Part' then
zambieparts.Touched:connect(function(p)
if p.Parent.Name == GetPlayerNames() and p.Parent.Name ~= ai.Name then -- damage
local enemy = p.Parent
local enemyhuman = getHumanoid(enemy)
enemyhuman:TakeDamage(aiDamage)
end
end)
end
end
|
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- |
function onRunning(speed)
if speed > 0.01 then
playAnimation("walk", 0.1, Humanoid)
if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
setAnimationSpeed(speed / 14.5)
end
pose = "Running"
else
if emoteNames[currentAnim] == nil then
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / 12.0)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed > 0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid, Enum.AnimationPriority.Idle)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid, Enum.AnimationPriority.Action)
return
end
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then |
-- Define the function to open or close the window with gene-alike effect |
local function toggleWindow()
if window.Visible then
window.Visible = false
else
opened.Visible = true
window.Visible = true
end
end
|
-- @Return Model |
function WeaponRuntimeData:GetOwningCharacter()
return self.character
end
function WeaponRuntimeData:SetMaxAmmo()
self.currentAmmo = self.weaponDefinition:GetMaxAmmo()
end
|
-- Written by Coercii |
local Verifier = {}
function Verifier.typeValid(data)
return type(data) ~= "userdata", typeof(data)
end
function Verifier.scanValidity(tbl, passed, path)
if type(tbl) ~= "table" then
return Verifier.scanValidity({input = tbl}, {}, {})
end
passed, path = passed or {}, path or {"input"}
passed[tbl] = true
local tblType
do
local key = next(tbl)
if type(key) == "number" then
tblType = "Array"
else
tblType = "Dictionary"
end
end
local last = 0
for key, value in next, tbl do
path[#path + 1] = tostring(key)
if type(key) == "number" then
if tblType == "Dictionary" then
return false, path, "Mixed Array/Dictionary"
elseif key%1 ~= 0 then -- if not an integer
return false, path, "Non-integer index"
elseif key == math.huge or key == -math.huge then
return false, path, "(-)Infinity index"
end
elseif type(key) ~= "string" then
return false, path, "Non-string key", typeof(key)
elseif tblType == "Array" then
return false, path, "Mixed Array/Dictionary"
end
if tblType == "Array" then
if last ~= key - 1 then
return false, path, "Array with non-sequential indexes"
end
last = key
end
local isTypeValid, valueType = Verifier.typeValid(value)
if not isTypeValid then
return false, path, "Invalid type", valueType
end
if type(value) == "table" then
if passed[value] then
return false, path, "Cyclic"
end
local isValid, keyPath, reason, extra = Verifier.scanValidity(value, passed, path)
if not isValid then
return isValid, keyPath, reason, extra
end
end
path[#path] = nil
end
passed[tbl] = nil
return true
end
function Verifier.getStringPath(path)
return table.concat(path, ".")
end
function Verifier.testValidity(input)
local isValid, keyPath, reason, extra = Verifier.scanValidity(input)
if not isValid then
if extra then
return "Invalid at "..Verifier.getStringPath(keyPath).." because: "..reason.." ("..tostring(extra)..")"
else
return "Invalid at "..Verifier.getStringPath(keyPath).." because: "..reason
end
end
end
return Verifier
|
----- NO EDITING BELOW ----- |
local weldedParts = {}
table.insert(weldedParts,mainPart)
function Weld(x, y)
weld = Instance.new("Weld")
weld.Part0 = x
weld.Part1 = y
local CJ = CFrame.new(x.Position)
weld.C0 = x.CFrame:inverse() * CJ
weld.C1 = y.CFrame:inverse() * CJ
weld.Parent = x
table.insert(weldedParts,y)
end
function WeldRec(instance)
local childs = instance:GetChildren()
for _,v in pairs(childs) do
if v:IsA("BasePart") or v:IsA("MeshPart") then
if v.Name ~= "WeldPart" and v.Name ~= "A" and v.Name ~= "B" then
Weld(mainPart, v)
end
end
if v.Name ~= "AnimationParts" then
WeldRec(v)
end
end
end
wait(1)
WeldRec(P) |
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!! |
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.TimeToFly-- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--------------------------UTIL LIBRARY------------------------------- |
local Utility = {}
do
local Signal = {}
function Signal.Create()
local sig = {}
local mSignaler = Instance.new('BindableEvent')
local mArgData = nil
local mArgDataCount = nil
function sig:fire(...)
mArgData = {...}
mArgDataCount = select('#', ...)
mSignaler:Fire()
end
function sig:connect(f)
if not f then error("connect(nil)", 2) end
return mSignaler.Event:connect(function()
f(unpack(mArgData, 1, mArgDataCount))
end)
end
function sig:wait()
mSignaler.Event:wait()
assert(mArgData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
return unpack(mArgData, 1, mArgDataCount)
end
return sig
end
Utility.Signal = Signal
function Utility.Create(instanceType)
return function(data)
local obj = Instance.new(instanceType)
for k, v in pairs(data) do
if type(k) == 'number' then
v.Parent = obj
else
obj[k] = v
end
end
return obj
end
end
local function ViewSizeX()
local camera = workspace.CurrentCamera
local x = camera and camera.ViewportSize.X or 0
local y = camera and camera.ViewportSize.Y or 0
if x == 0 then
return 1024
else
if x > y then
return x
else
return y
end
end
end
Utility.ViewSizeX = ViewSizeX
local function ViewSizeY()
local camera = workspace.CurrentCamera
local x = camera and camera.ViewportSize.X or 0
local y = camera and camera.ViewportSize.Y or 0
if y == 0 then
return 768
else
if x > y then
return y
else
return x
end
end
end
Utility.ViewSizeY = ViewSizeY
local function AspectRatio()
return ViewSizeX() / ViewSizeY()
end
Utility.AspectRatio = AspectRatio
local function FindChacterAncestor(part)
if part then
local humanoid = part:FindFirstChild("Humanoid")
if humanoid then
return part, humanoid
else
return FindChacterAncestor(part.Parent)
end
end
end
Utility.FindChacterAncestor = FindChacterAncestor
local function GetUnitRay(x, y, viewWidth, viewHeight, camera)
return camera:ScreenPointToRay(x, y)
end
Utility.GetUnitRay = GetUnitRay
local function Raycast(ray, ignoreNonCollidable, ignoreList)
local ignoreList = ignoreList or {}
local hitPart, hitPos = RayCastIgnoreList(workspace, ray, ignoreList)
if hitPart then
if ignoreNonCollidable and hitPart.CanCollide == false then
table.insert(ignoreList, hitPart)
return Raycast(ray, ignoreNonCollidable, ignoreList)
end
return hitPart, hitPos
end
return nil, nil
end
Utility.Raycast = Raycast
Utility.Round = function(num, roundToNearest)
roundToNearest = roundToNearest or 1
return math_floor((num + roundToNearest/2) / roundToNearest) * roundToNearest
end
local function AveragePoints(positions)
local avgPos = ZERO_VECTOR2
if #positions > 0 then
for i = 1, #positions do
avgPos = avgPos + positions[i]
end
avgPos = avgPos / #positions
end
return avgPos
end
Utility.AveragePoints = AveragePoints
local function FuzzyEquals(numa, numb)
return numa + 0.1 > numb and numa - 0.1 < numb
end
Utility.FuzzyEquals = FuzzyEquals
local LastInput = 0
UIS.InputBegan:connect(function(inputObject, wasSunk)
if not wasSunk then
if inputObject.UserInputType == Enum.UserInputType.Touch or
inputObject.UserInputType == Enum.UserInputType.MouseButton1 or
inputObject.UserInputType == Enum.UserInputType.MouseButton2 then
LastInput = tick()
end
end
end)
Utility.GetLastInput = function()
return LastInput
end
end
local humanoidCache = {}
local function findPlayerHumanoid(player)
local character = player and player.Character
if character then
local resultHumanoid = humanoidCache[player]
if resultHumanoid and resultHumanoid.Parent == character then
return resultHumanoid
else
humanoidCache[player] = nil -- Bust Old Cache
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoidCache[player] = humanoid
end
return humanoid
end
end
end
local GetThetaBetweenCFrames; do
local components = CFrame.new().components
local inverse = CFrame.new().inverse
local acos = math.acos
GetThetaBetweenCFrames = function(c0, c1) -- (CFrame from, CFrame to) -> (float theta)
local _, _, _, xx, yx, zx,
xy, yy, zy,
xz, yz, zz = components(inverse(c0)*c1)
local cosTheta = (xx + yy + zz - 1)/2
if cosTheta >= 0.999 then
-- Same rotation
return 0
elseif cosTheta <= -0.999 then
-- Oposite rotations
return math_pi
else
return acos(cosTheta)
end
end
end
|
------------------------- |
function onClicked()
R.Function1.Disabled = true
FX.CRUSH.BrickColor = BrickColor.new("Really red")
FX.CRUSH.loop.Disabled = true
FX.JET.BrickColor = BrickColor.new("Really red")
FX.JET.loop.Disabled = true
FX.LPF.BrickColor = BrickColor.new("Really red")
FX.LPF.loop.Disabled = true
FX.NOISE.BrickColor = BrickColor.new("Really red")
FX.NOISE.loop.Disabled = true
FX.HPF.BrickColor = BrickColor.new("Really red")
FX.HPF.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- constants |
local PLAYER = Players.LocalPlayer
local NUM_SLASHES = 10
local SLASH_SIZE = 10
local SLASH_DISTANCE = 6
local SLASH_TIME = 0.1
return function(character)
local effects = character.Effects
local rootPart = character.HumanoidRootPart
for i = 1, NUM_SLASHES do
spawn(function()
local center = rootPart.Position + Vector3.new(0, 1, 0)
local slice = script.Slice:Clone()
slice.CFrame = CFrame.new(center) * CFrame.Angles(math.rad(math.random(360)), math.rad(math.random(360)), math.rad(math.random(360)))
slice.Size = Vector3.new(0.3, 1, 1)
slice.Mesh.Scale = Vector3.new(1, 0, 0)
slice.Mesh.Offset = Vector3.new(0, 0, SLASH_DISTANCE)
slice.Parent = effects
rootPart.Velocity = slice.CFrame.LookVector * 50
local infoA = TweenInfo.new(SLASH_TIME/2, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local infoB = TweenInfo.new(SLASH_TIME/2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local tweenA = TweenService:Create(slice.Mesh, infoA, {Scale = Vector3.new(1, 1, SLASH_SIZE); Offset = Vector3.new()})
tweenA:Play()
wait(SLASH_TIME/2)
local tweenB = TweenService:Create(slice.Mesh, infoA, {Scale = Vector3.new(1, 0, 0); Offset = Vector3.new(0, 0, -SLASH_DISTANCE)})
tweenB:Play()
wait(SLASH_TIME/2)
slice:Destroy()
end)
wait(SLASH_TIME/2)
end
end
|
-- 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
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
return oldAnim
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.0, Humanoid)
setAnimationSpeed(animSpeed)
end
end
|
--// SS3.33T Police Edit originally for 2017 Mercedes-Benz E300 by Itzt and MASERATl, base SS by Inspare |
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local limitButton = HUB:FindFirstChild("Name")
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
|
--Note this must be used with the accompanying weld script
--This is an edited version of my V3 KeyCommand Script.
--Heavily edited from a free model crouch script, ~ukwarrior6~ | |
------------------------------------------------------------------------
-- emulation of TValue macros (these are from lobject.h)
-- * TValue is a table since lcode passes references around
-- * tt member field removed, using Lua's type() instead
-- * for setsvalue, sethvalue, parameter L (deleted here) in lobject.h
-- is used in an assert for testing, see checkliveness(g,obj)
------------------------------------------------------------------------ |
function luaK:ttisnumber(o)
if o then return type(o.value) == "number" else return false end
end
function luaK:nvalue(o) return o.value end
function luaK:setnilvalue(o) o.value = nil end
function luaK:setsvalue(o, x) o.value = x end
luaK.setnvalue = luaK.setsvalue
luaK.sethvalue = luaK.setsvalue
luaK.setbvalue = luaK.setsvalue
|
--[[
game["Run Service"].RenderStepped:connect(function()
local s = script.Parent.Parent.Sound
if s and s.IsPlaying then
local pbl = s.PlaybackLoudness
Tool.UpdatePlaybackLoudness:FireServer(pbl)
end
end)
]] | --
local GetPlaybackLoudness = Tool.RemoteFunction
GetPlaybackLoudness.OnClientInvoke = function()
local s = script.Parent.Parent.Sound
if s and s.IsPlaying then
local pbl = s.PlaybackLoudness
return pbl
end
return 0
end
|
--[[Tires]] | --
-- Tire Curve Profiler: https://www.desmos.com/calculator/og4x1gyzng
Tune.TireCylinders = 6 -- How many cylinders are used for the tires. More means a smoother curve but way more parts meaning lag. (Default = 4)
Tune.TiresVisible = false -- Makes the tires visible (Debug)
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 700 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7000 -- Use sliders to manipulate values
Tune.Redline = 7500 -- Copy and paste slider values into the respective tune values
Tune.ComfortShift = 3500
Tune.EqPoint = 7500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--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)
|
--end of key up function |
bin.Deselected:connect(onDeselected)
bin.Selected:connect(onSelected)
|
--------- MODULE BEGIN --------- |
local textService = game:GetService("TextService")
local runService = game:GetService("RunService")
local animationCount = 0
function getLayerCollector(frame)
if not frame then
return nil
elseif frame:IsA("LayerCollector") then
return frame
elseif frame and frame.Parent then
return getLayerCollector(frame.Parent)
else
return nil
end
end
function shallowCopy(tab)
local ret = {}
for key, value in pairs(tab) do
ret[key] = value
end
return ret
end
function getColorFromString(value)
if richText.ColorShortcuts[value] then
return richText.ColorShortcuts[value]
else
local r, g, b = value:match("(%d+),(%d+),(%d+)")
return Color3.new(r / 255, g / 255, b / 255)
end
end
function getVector2FromString(value)
local x, y = value:match("(%d+),(%d+)")
return Vector2.new(x, y)
end
function setHorizontalAlignment(frame, alignment)
if alignment == "Left" then
frame.AnchorPoint = Vector2.new(0, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
elseif alignment == "Center" then
frame.AnchorPoint = Vector2.new(0.5, 0)
frame.Position = UDim2.new(0.5, 0, 0, 0)
elseif alignment == "Right" then
frame.AnchorPoint = Vector2.new(1, 0)
frame.Position = UDim2.new(1, 0, 0, 0)
end
end
function richText:New(frame, text, startingProperties, allowOverflow, prevTextObject)
for _, v in pairs(frame:GetChildren()) do
v:Destroy()
end
if allowOverflow == nil then
allowOverflow = true
end
local properties = {}
local defaultProperties = {}
if prevTextObject then
text = prevTextObject.Text
startingProperties = prevTextObject.StartingProperties
end
local lineFrames = {}
local textFrames = {}
local frameProperties = {}
local linePosition = 0
local overflown = false
local textLabel = Instance.new("TextLabel")
local imageLabel = Instance.new("ImageLabel")
local layerCollector = getLayerCollector(frame)
local applyProperty, applyMarkup, formatLabel, printText, printImage, printSeries
----- Apply properties / markups -----
function applyMarkup(key, value)
--print(key,value)
key = propertyShortcuts[key] or key
if value == "/" then
if defaultProperties[key] then
value = defaultProperties[key]
else
warn("Attempt to default <"..key.."> to value with no default")
end
end
if tonumber(value) then
value = tonumber(value)
elseif value == "false" or value == "true" then
value = value == "true"
end
properties[key] = value
if applyProperty(key, value) then
-- Ok
elseif key == "ContainerHorizontalAlignment" and lineFrames[#lineFrames] then
setHorizontalAlignment(lineFrames[#lineFrames].Container, value)
elseif defaults[key] then
-- Ok
elseif key == "Img" then
printImage(value)
else
-- Unknown value
return false
end
return true
end
function applyProperty(name, value, frame)
local propertyType
local ret = false
for _, label in pairs(frame and {frame} or {textLabel, imageLabel}) do
local isProperty = pcall(function() propertyType = typeof(label[name]) end) -- is there a better way to check if it's a property?
if isProperty then
if propertyType == "Color3" then
label[name] = getColorFromString(value)
elseif propertyType == "Vector2" then
label[name] = getVector2FromString(value)
else
label[name] = value
end
ret = true
end
end
return ret
end
----- Set up default properties -----
for name, value in pairs(defaults) do
applyMarkup(name, value)
defaultProperties[propertyShortcuts[name] or name] = properties[propertyShortcuts[name] or name]
end
for name, value in pairs(startingProperties or {}) do
applyMarkup(name, value)
defaultProperties[propertyShortcuts[name] or name] = properties[propertyShortcuts[name] or name]
end
if prevTextObject then
properties = prevTextObject.OverflowPickupProperties
for name, value in pairs(properties) do
applyMarkup(name, value)
end
end
----- Get vertical size -----
local function getTextSize()
if properties.TextScaled == true then
local relativeHeight
if properties.TextScaleRelativeTo == "Screen" then
relativeHeight = layerCollector.AbsoluteSize.Y
elseif properties.TextScaleRelativeTo == "Frame" then
relativeHeight = frame.AbsoluteSize.Y
end
return math.min(properties.TextScale * relativeHeight, 100)
else
return properties.TextSize
end
end
----- Lines -----
local contentHeight = 0
local function newLine()
local lastLineFrame = lineFrames[#lineFrames]
if lastLineFrame then
contentHeight = contentHeight + lastLineFrame.Size.Y.Offset
if not allowOverflow and contentHeight + getTextSize() > frame.AbsoluteSize.Y then
overflown = true
return
end
end
local lineFrame = Instance.new("Frame")
lineFrame.Name = string.format("Line%03d", #lineFrames + 1)
lineFrame.Size = UDim2.new(0, 0, 0, 0)
lineFrame.BackgroundTransparency = 1
local textContainer = Instance.new("Frame", lineFrame)
textContainer.Name = "Container"
textContainer.Size = UDim2.new(0, 0, 0, 0)
textContainer.BackgroundTransparency = 1
setHorizontalAlignment(textContainer, properties.ContainerHorizontalAlignment)
lineFrame.Parent = frame
table.insert(lineFrames, lineFrame)
textFrames[#lineFrames] = {}
linePosition = 0
end
newLine()
----- Label printing -----
local function addFrameProperties(frame)
frameProperties[frame] = shallowCopy(properties)
frameProperties[frame].InitialSize = frame.Size
frameProperties[frame].InitialPosition = frame.Position
frameProperties[frame].InitialAnchorPoint = frame.AnchorPoint
end
function formatLabel(newLabel, labelHeight, labelWidth, endOfLineCallback)
local lineFrame = lineFrames[#lineFrames]
local verticalAlignment = tostring(properties.TextYAlignment)
if verticalAlignment == "Top" then
newLabel.Position = UDim2.new(0, linePosition, 0, 0)
newLabel.AnchorPoint = Vector2.new(0, 0)
elseif verticalAlignment == "Center" then
newLabel.Position = UDim2.new(0, linePosition, 0.5, 0)
newLabel.AnchorPoint = Vector2.new(0, 0.5)
elseif verticalAlignment == "Bottom" then
newLabel.Position = UDim2.new(0, linePosition, 1, 0)
newLabel.AnchorPoint = Vector2.new(0, 1)
end
linePosition = linePosition + labelWidth
if linePosition > frame.AbsoluteSize.X and not (linePosition == labelWidth) then
-- Newline, get rid of label and retry it on the next line
newLabel:Destroy()
local lastLabel = textFrames[#lineFrames][#textFrames[#lineFrames]]
if lastLabel:IsA("TextLabel") and lastLabel.Text == " " then -- get rid of trailing space
lineFrame.Container.Size = UDim2.new(0, linePosition - labelWidth - lastLabel.Size.X.Offset, 1, 0)
lastLabel:Destroy()
table.remove(textFrames[#lineFrames])
end
newLine()
endOfLineCallback()
else
-- Label is ok
newLabel.Size = UDim2.new(0, labelWidth, 0, labelHeight)
lineFrame.Container.Size = UDim2.new(0, linePosition, 1, 0)
lineFrame.Size = UDim2.new(1, 0, 0, math.max(lineFrame.Size.Y.Offset, labelHeight))
newLabel.Name = string.format("Group%03d", #textFrames[#lineFrames] + 1)
newLabel.Parent = lineFrame.Container
table.insert(textFrames[#lineFrames], newLabel)
addFrameProperties(newLabel)
properties.AnimateYield = 0
end
end
function printText(text)
if text == "\n" then
newLine()
return
elseif text == " " and linePosition == 0 then
return -- no leading spaces
end
local textSize = getTextSize()
local textWidth = textService:GetTextSize(text, textSize, textLabel.Font, Vector2.new(layerCollector.AbsoluteSize.X, textSize)).X
local newTextLabel = textLabel:Clone()
newTextLabel.TextScaled = false
newTextLabel.TextSize = textSize
newTextLabel.Text = text -- This text is never actually displayed. We just use it as a reference for knowing what the group string is.
newTextLabel.TextTransparency = 1
newTextLabel.TextStrokeTransparency = 1
newTextLabel.TextWrapped = false
-- Keep the real text in individual frames per character:
local charPos = 0
local i = 1
for first, last in utf8.graphemes(text) do
local character = string.sub(text, first, last)
local characterWidth = textService:GetTextSize(character, textSize, textLabel.Font, Vector2.new(layerCollector.AbsoluteSize.X, textSize)).X
local characterLabel = textLabel:Clone()
characterLabel.Text = character
characterLabel.TextScaled = false
characterLabel.TextSize = textSize
characterLabel.Position = UDim2.new(0, charPos, 0, 0)
characterLabel.Size = UDim2.new(0, characterWidth + 1, 0, textSize)
characterLabel.Name = string.format("Char%03d", i)
characterLabel.Parent = newTextLabel
characterLabel.Visible = false
addFrameProperties(characterLabel)
charPos = charPos + characterWidth
i = i + 1
end
formatLabel(newTextLabel, textSize, textWidth, function() if not overflown then printText(text) end end)
end
function printImage(imageId)
local imageHeight = getTextSize()
local imageWidth = imageHeight -- Would be nice if we could get aspect ratio of image to get width properly.
local newImageLabel = imageLabel:Clone()
if richText.ImageShortcuts[imageId] then
newImageLabel.Image = typeof(richText.ImageShortcuts[imageId]) == "number" and "rbxassetid://"..richText.ImageShortcuts[imageId] or richText.ImageShortcuts[imageId]
else
newImageLabel.Image = "rbxassetid://"..imageId
end
newImageLabel.Size = UDim2.new(0, imageHeight, 0, imageWidth)
newImageLabel.Visible = false
formatLabel(newImageLabel, imageHeight, imageWidth, function() if not overflown then printImage(imageId) end end)
end
function printSeries(labelSeries)
for _, t in pairs(labelSeries) do
local markupKey, markupValue = string.match(t, "<(.+)=(.+)>")
if markupKey and markupValue then
if not applyMarkup(markupKey, markupValue) then
warn("Could not apply markup: ", t)
end
else
printText(t)
end
end
end
----- Text traversal + parsing -----
local overflowText
local textPos = 1
local textLength = #text
local labelSeries = {}
if prevTextObject then
textPos = prevTextObject.OverflowPickupIndex
end
while textPos and textPos <= textLength do
local nextMarkupStart, nextMarkupEnd = string.find(text, "<.->", textPos)
local nextSpaceStart, nextSpaceEnd = string.find(text, "[ \t\n]", textPos)
local nextBreakStart, nextBreakEnd, breakIsWhitespace
if nextMarkupStart and nextMarkupEnd and (not nextSpaceStart or nextMarkupStart < nextSpaceStart) then
nextBreakStart, nextBreakEnd = nextMarkupStart, nextMarkupEnd
else
nextBreakStart, nextBreakEnd = nextSpaceStart or textLength + 1, nextSpaceEnd or textLength + 1
breakIsWhitespace = true
end
local nextWord = nextBreakStart > textPos and string.sub(text, textPos, nextBreakStart - 1) or nil
local nextBreak = nextBreakStart <= textLength and string.sub(text, nextBreakStart, nextBreakEnd) or nil
table.insert(labelSeries, nextWord)
if breakIsWhitespace then
printSeries(labelSeries)
if overflown then
break
end
printSeries({nextBreak})
if overflown then
textPos = nextBreakStart
break
end
labelSeries = {}
else
table.insert(labelSeries, nextBreak)
end
textPos = nextBreakEnd + 1
--textPos = utf8.offset(text, 2, nextBreakEnd)
end
if not overflown then
printSeries(labelSeries)
end
----- Alignment layout -----
local listLayout = Instance.new("UIListLayout")
listLayout.HorizontalAlignment = properties.ContainerHorizontalAlignment
listLayout.VerticalAlignment = properties.ContainerVerticalAlignment
listLayout.Parent = frame
----- Calculate content size -----
local contentHeight = 0
local contentLeft = frame.AbsoluteSize.X
local contentRight = 0
for _, lineFrame in pairs(lineFrames) do
contentHeight = contentHeight + lineFrame.Size.Y.Offset
local container = lineFrame.Container
local left, right
if container.AnchorPoint.X == 0 then
left = container.Position.X.Offset
right = container.Size.X.Offset
elseif container.AnchorPoint.X == 0.5 then
left = lineFrame.AbsoluteSize.X / 2 - container.Size.X.Offset / 2
right = lineFrame.AbsoluteSize.X / 2 + container.Size.X.Offset / 2
elseif container.AnchorPoint.X == 1 then
left = lineFrame.AbsoluteSize.X - container.Size.X.Offset
right = lineFrame.AbsoluteSize.X
end
contentLeft = math.min(contentLeft, left)
contentRight = math.max(contentRight, right)
end
----- Animation -----
animationCount = animationCount + 1
local animationDone = false
local allTextReached = false
local overrideYield = false
local animationRenderstepBinding = "TextAnimation"..animationCount
local animateQueue = {}
local function updateAnimations()
if allTextReached and #animateQueue == 0 or animationDone then
animationDone = true
runService:UnbindFromRenderStep(animationRenderstepBinding)
animateQueue = {}
return
end
local t = tick()
for i = #animateQueue, 1, -1 do
local set = animateQueue[i]
local properties = set.Settings
local animateStyle = animationStyles[properties.AnimateStyle]
if not animateStyle then
warn("No animation style found for: ", properties.AnimateStyle, ", defaulting to Appear")
animateStyle = animationStyles.Appear
end
local animateAlpha = math.min((t - set.Start) / properties.AnimateStyleTime, 1)
animateStyle(set.Char, animateAlpha, properties)
if animateAlpha >= 1 then
table.remove(animateQueue, i)
end
end
end
local function setFrameToDefault(frame)
frame.Position = frameProperties[frame].InitialPosition
frame.Size = frameProperties[frame].InitialSize
frame.AnchorPoint = frameProperties[frame].InitialAnchorPoint
for name, value in pairs(frameProperties[frame]) do
applyProperty(name, value, frame)
end
end
local function setGroupVisible(frame, visible)
frame.Visible = visible
for _, v in pairs(frame:GetChildren()) do
v.Visible = visible
if visible then
setFrameToDefault(v)
end
end
if visible and frame:IsA("ImageLabel") then
setFrameToDefault(frame)
end
end
local function animate(waitForAnimationToFinish)
animationDone = false
runService:BindToRenderStep(animationRenderstepBinding, Enum.RenderPriority.Last.Value, updateAnimations)
local stepGrouping
local stepTime
local stepFrequency
local numAnimated
-- Make everything invisible to start
for lineNum, list in pairs(textFrames) do
for _, frame in pairs(list) do
setGroupVisible(frame, false)
end
end
local function animateCharacter(char, properties)
table.insert(animateQueue, {Char = char, Settings = properties, Start = tick()})
end
local function yield()
if not overrideYield and numAnimated % stepFrequency == 0 and stepTime >= 0 then
local yieldTime = stepTime > 0 and stepTime or nil
wait(yieldTime)
end
end
for lineNum, list in pairs(textFrames) do
for _, frame in pairs(list) do
local properties = frameProperties[frame]
if not (properties.AnimateStepGrouping == stepGrouping) or not (properties.AnimateStepFrequency == stepFrequency) then
numAnimated = 0
end
stepGrouping = properties.AnimateStepGrouping
stepTime = properties.AnimateStepTime
stepFrequency = properties.AnimateStepFrequency
if properties.AnimateYield > 0 then
wait(properties.AnimateYield)
end
if stepGrouping == "Word" or stepGrouping == "All" then
--if not (frame:IsA("TextLabel") and (frame.Text == " ")) then
if frame:IsA("TextLabel") then
frame.Visible = true
for _, v in pairs(frame:GetChildren()) do
animateCharacter(v, frameProperties[v])
end
else
animateCharacter(frame, properties)
end
if stepGrouping == "Word" then
numAnimated = numAnimated + 1
yield()
end
--end
elseif stepGrouping == "Letter" then
if frame:IsA("TextLabel") --[[and not (frame.Text == " ") ]]then
frame.Visible = true
local text = frame.Text
local i = 1
while true do
local sound = script.NPCSound:Clone()
sound.Parent = game.Players.LocalPlayer.PlayerGui
sound:Play()
game:GetService("Debris"):AddItem(sound,.3)
local v = frame:FindFirstChild(string.format("Char%03d", i))
if not v then
break
end
animateCharacter(v, frameProperties[v])
numAnimated = numAnimated + 1
yield()
if animationDone then
return
end
i = i + 1
end
else
animateCharacter(frame, properties)
numAnimated = numAnimated + 1
yield()
end
else
warn("Invalid step grouping: ", stepGrouping)
end
if animationDone then
return
end
end
end
allTextReached = true
if waitForAnimationToFinish then
while #animateQueue > 0 do
runService.RenderStepped:Wait()
end
end
end
local textObject = {}
----- Overflowing -----
textObject.Overflown = overflown
textObject.OverflowPickupIndex = textPos
textObject.StartingProperties = startingProperties
textObject.OverflowPickupProperties = properties
textObject.Text = text
if prevTextObject then
prevTextObject.NextTextObject = textObject
end
-- to overflow: check if textObject.Overflown, then use richText:ContinueOverflow(newFrame, textObject) to continue to another frame.
----- Return object API -----
textObject.ContentSize = Vector2.new(contentRight - contentLeft, contentHeight)
function textObject:Animate(yield)
if yield then
animate()
else
coroutine.wrap(animate)()
end
if self.NextTextObject then
self.NextTextObject:Animate(yield)
end
end
function textObject:Show(finishAnimation)
if finishAnimation then
overrideYield = true
else
animationDone = true
for lineNum, list in pairs(textFrames) do
for _, frame in pairs(list) do
setGroupVisible(frame, true)
end
end
end
if self.NextTextObject then
self.NextTextObject:Show(finishAnimation)
end
end
function textObject:Hide()
animationDone = true
for lineNum, list in pairs(textFrames) do
for _, frame in pairs(list) do
setGroupVisible(frame, false)
end
end
if self.NextTextObject then
self.NextTextObject:Hide()
end
end
return textObject
end
function richText:ContinueOverflow(newFrame, prevTextObject)
return richText:New(newFrame, nil, nil, false, prevTextObject)
end
return richText
|
--Made by Stickmasterluke |
sp = script.Parent
speedboost = 19 --100% speed bonus
jump = 2.5
speedforsmoke = 10 --smoke apears when character running >= 10 studs/second.
local tooltag = script:WaitForChild("ToolTag",2)
if tooltag~=nil then
local tool=tooltag.Value
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16+16*speedboost
h.JumpPower=50+50*jump
local hrp = sp:FindFirstChild("HumanoidRootPart")
if hrp ~= nil then
smokepart=Instance.new("Part")
smokepart.FormFactor="Custom"
smokepart.Size=Vector3.new(0,0,0)
smokepart.TopSurface="Smooth"
smokepart.BottomSurface="Smooth"
smokepart.CanCollide=false
smokepart.Transparency=1
local weld=Instance.new("Weld")
weld.Name="SmokePartWeld"
weld.Part0 = hrp
weld.Part1=smokepart
weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
weld.Parent=smokepart
smokepart.Parent=sp
smoke=Instance.new("Smoke")
smoke.Enabled = hrp.Velocity.magnitude>speedforsmoke
smoke.RiseVelocity=2
smoke.Opacity=0
smoke.Size=.5
smoke.Parent=smokepart
h.Running:connect(function(speed)
if smoke and smoke~=nil then
smoke.Enabled=speed>speedforsmoke
end
end)
end
end
while tool~=nil and tool.Parent==sp and h~=nil do
sp.ChildRemoved:wait()
end
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16
h.JumpPower=50
end
end
if smokepart~=nil then
smokepart:Destroy()
end
script:Destroy()
|
--Gas.InputChanged:Connect(TouchThrottle) |
local function TouchBrake(input, GPE)
if input.UserInputState == Enum.UserInputState.Begin then
_InBrake = 1
else
_InBrake = 0
end
end
Brake.InputBegan:Connect(TouchBrake)
Brake.InputEnded:Connect(TouchBrake) |
-- Game services |
local Configurations = require(ServerStorage.Configurations)
local DisplayManager = require(script.Parent.DisplayManager)
|
-- walking |
local FOVChanges2 = {
FieldOfView = 70
}
local TweenInformation2 = TweenInfo.new(
1, --tween length
Enum.EasingStyle.Quint, --easing Style
Enum.EasingDirection.Out, --easing Direction
0, --repitition time
false, --reverse?
0 --delay
)
local tween2 = TweeningService:Create(camera,TweenInformation2,FOVChanges2)
|
--------------------) Settings |
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 20 -- cooldown for use of the tool again
BoneModelName = "X event" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage |
--// Firemode Settings |
CanSelectFire = true;
BurstEnabled = false;
SemiEnabled = false;
AutoEnabled = true;
BoltAction = false;
ExplosiveEnabled = true;
|
-- Mapping side handles to axes |
ArcHandles.SideToAxis = {
Top = 'Z',
Bottom = 'Z',
Left = 'Y',
Right = 'Y',
Front = 'X',
Back = 'X'
}
ArcHandles.AxisToSide = {
X = 'Front',
Y = 'Right',
Z = 'Top'
}
|
-- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")") |
idx = idx + 1
end
end
-- fallback to defaults
if (animTable[name].count <= 0) then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight |
--[=[
@within Shake
@prop RotationInfluence Vector3
This is similar to `Amplitude` but multiplies against each axis
of the resultant shake vector, and only affects the rotation vector.
Defaults to `Vector3.one`.
]=] | |
--[[Run]] |
--Print Version
local ver=require(car["A-Chassis Tune"].README)
print("//INSPARE: AC6 Loaded - Build "..ver)
--Runtime Loop
while wait() do
--Steering
Steering()
--Powertrain
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
--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 * 5250 / _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
|
--- Returns a new ArgumentContext, an object that handles parsing and validating arguments |
function Argument.new (command, argumentObject, value)
local self = {
Command = command; -- The command that owns this argument
Type = nil; -- The type definition
Name = argumentObject.Name; -- The name for this specific argument
Object = argumentObject; -- The raw ArgumentObject (definition)
Required = argumentObject.Default == nil and argumentObject.Optional ~= true; -- If the argument is required or not.
Executor = command.Executor; -- The player who is running the command
RawValue = value; -- The raw, unparsed value
RawSegments = {}; -- The raw, unparsed segments (if the raw value was comma-sep)
TransformedValues = {}; -- The transformed value (generated later)
Prefix = ""; -- The prefix for this command (%Team)
TextSegmentInProgress = ""; -- The text of the raw segment the user is currently typing.
RawSegmentsAreAutocomplete = false;
}
if type(argumentObject.Type) == "table" then
self.Type = argumentObject.Type
else
local parsedType, parsedRawValue, prefix = Util.ParsePrefixedUnionType(
command.Cmdr.Registry:GetTypeName(argumentObject.Type),
value
)
self.Type = command.Dispatcher.Registry:GetType(parsedType)
self.RawValue = parsedRawValue
self.Prefix = prefix
if self.Type == nil then
error(string.format("%s has an unregistered type %q", self.Name or "<none>", parsedType or "<none>"))
end
end
setmetatable(self, Argument)
self:Transform()
return self
end
function Argument:GetDefaultAutocomplete()
if self.Type.Autocomplete then
local strings, options = self.Type.Autocomplete(self:TransformSegment(""))
return strings, options or {}
end
return {}
end
|
--[[--------------------------------------------------------------------
-- Notes:
-- * an Instruction is a table with OP, A, B, C, Bx elements; this
-- makes the code easy to follow and should allow instruction handling
-- to work with doubles and ints
-- * WARNING luaP:Instruction outputs instructions encoded in little-
-- endian form and field size and positions are hard-coded
--
-- Not implemented:
-- *
--
-- Added:
-- * luaP:CREATE_Inst(c): create an inst from a number (for OP_SETLIST)
-- * luaP:Instruction(i): convert field elements to a 4-char string
-- * luaP:DecodeInst(x): convert 4-char string into field elements
--
-- Changed in 5.1.x:
-- * POS_OP added, instruction field positions changed
-- * some symbol names may have changed, e.g. LUAI_BITSINT
-- * new operators for RK indices: BITRK, ISK(x), INDEXK(r), RKASK(x)
-- * OP_MOD, OP_LEN is new
-- * OP_TEST is now OP_TESTSET, OP_TEST is new
-- * OP_FORLOOP, OP_TFORLOOP adjusted, OP_FORPREP is new
-- * OP_TFORPREP deleted
-- * OP_SETLIST and OP_SETLISTO merged and extended
-- * OP_VARARG is new
-- * many changes to implementation of OpMode data
----------------------------------------------------------------------]] |
local luaP = {}
|
--// Modules |
local L_120_ = require(L_22_:WaitForChild("Utilities"))
local L_121_ = require(L_22_:WaitForChild("Spring"))
local L_122_ = require(L_22_:WaitForChild("Plugins"))
local L_123_ = require(L_22_:WaitForChild("easing"))
local L_124_ = L_120_.Fade
local L_125_ = L_120_.SpawnCam
local L_126_ = L_120_.FixCam
local L_127_ = L_120_.tweenFoV
local L_128_ = L_120_.tweenCam
local L_129_ = L_120_.tweenRoll
local L_130_ = L_120_.TweenJoint
local L_131_ = L_120_.Weld
|
-- constants |
local GAME_VERSION = configuration.GAME_VERSION
local DEBUG_REPORTER = configuration.DEBUG_REPORTER
local REPORT_TO_PLAYFAB = configuration.REPORT_TO_PLAYFAB
local REPORT_TO_GOOGLE_ANALYTICS = configuration.REPORT_TO_GOOGLE_ANALYTICS
local PRINT_SUCCESSFUL_GOOGLE_ANALYTICS = configuration.PRINT_SUCCESSFUL_GOOGLE_ANALYTICS
local PRINT_SUCCESSFUL_PLAYFAB = configuration.PRINT_SUCCESSFUL_PLAYFAB
|
--[[
DO NOT DELETE THIS LOADER
IF YOU DO THE ADMIN WILL LOSE 78/100 OF ITS
FEAUTURES!
-]] | |
-- Decompiled with the Synapse X Luau decompiler. |
client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
GetEnv = nil;
gTable = nil;
return function(p1)
local l__PlayerGui__1 = service.PlayerGui;
local l__LocalPlayer__2 = service.Players.LocalPlayer;
local l__Parent__3 = script.Parent.Parent;
local l__Main__4 = l__Parent__3.Frame.Main;
local l__Timer__5 = l__Parent__3.Frame.Timer;
local v6 = p1.OnClick;
local v7 = p1.OnClose;
local v8 = p1.OnIgnore;
local l__Title__9 = p1.Title;
local v10 = p1.Message or (p1.Text or "");
local l__Time__11 = p1.Time;
if v6 and type(v6) == "string" then
v6 = client.Core.LoadCode(v6, GetEnv());
end;
if v7 and type(v7) == "string" then
v7 = client.Core.LoadCode(v7, GetEnv());
end;
if v8 and type(v8) == "string" then
v8 = client.Core.LoadCode(v8, GetEnv());
end;
local v12 = client.UI.Get("NotificationHolder", nil, true);
if not v12 then
local v13 = service.New("ScreenGui");
local v14 = client.UI.Register(v13);
local v15 = service.New("ScrollingFrame", v13);
client.UI.Prepare(v13);
v14.Name = "NotificationHolder";
v15.Name = "Frame";
v15.BackgroundTransparency = 1;
v15.Size = UDim2.new(0, 200, 0.5, 0);
v15.Position = UDim2.new(1, -210, 0.5, -10);
v15.CanvasSize = UDim2.new(0, 0, 0, 0);
v15.ChildAdded:Connect(function(p2)
if #v15:GetChildren() == 0 then
v15.Visible = false;
return;
end;
v15.Visible = true;
end);
v15.ChildRemoved:Connect(function(p3)
if #v15:GetChildren() == 0 then
v15.Visible = false;
return;
end;
v15.Visible = true;
end);
v12 = v14;
v14:Ready();
end;
l__Parent__3.Frame.Title.Text = l__Title__9;
l__Parent__3.Name = l__Title__9;
l__Main__4.Text = v10;
local u1 = nil;
local function u2(p4, p5)
local v16 = {};
for v17, v18 in pairs(p4:GetChildren()) do
table.insert(v16, 1, v18);
end;
for v19, v20 in pairs(v16) do
v20.Position = UDim2.new(0, 0, 1, -75 * (v19 + p5));
end;
p4.CanvasSize = UDim2.new(0, 0, 0, #p4:GetChildren() * 75);
local v21 = #p4:GetChildren() * 75 - p4.AbsoluteWindowSize.Y;
if v21 < 0 then
v21 = 0;
end;
p4.CanvasPosition = Vector2.new(0, v21);
end;
local l__Frame__3 = v12.Object.Frame;
l__Main__4.MouseButton1Click:Connect(function()
if l__Parent__3 and l__Parent__3.Parent then
if v6 then
u1 = v6();
end;
l__Parent__3:Destroy();
u2(l__Frame__3, 0);
end;
end);
local l__gTable__4 = p1.gTable;
l__Parent__3.Frame.Close.MouseButton1Click:Connect(function()
if l__Parent__3 and l__Parent__3.Parent then
if v7 then
u1 = v7();
end;
l__gTable__4:Destroy();
u2(l__Frame__3, 0);
end;
end);
u2(l__Frame__3, 1);
l__Parent__3.Parent = l__Frame__3;
l__Parent__3:TweenPosition(UDim2.new(0, 0, 1, -75), "Out", "Linear", 0.2);
spawn(function()
local v22 = Instance.new("Sound", service.LocalContainer());
if v10 == "Click here for commands." then
v22.SoundId = "rbxassetid://987728667";
elseif l__Title__9 == "Warning!" then
v22.SoundId = "rbxassetid://428495297";
else
v22.SoundId = "rbxassetid://2275705078";
end;
wait(0.1);
v22:Play();
wait(1);
v22:Destroy();
end);
if l__Time__11 then
l__Timer__5.Visible = true;
local u5 = l__Time__11;
spawn(function()
while true do
l__Timer__5.Text = u5;
wait(1);
u5 = u5 - 1;
if u5 <= 0 then
break;
end;
if not l__Parent__3 then
break;
end;
if not l__Parent__3.Parent then
break;
end;
end;
if l__Parent__3 and l__Parent__3.Parent then
if v8 then
u1 = v8();
end;
l__Parent__3:Destroy();
u2(l__Frame__3, 0);
end;
end);
end;
while true do
wait();
if u1 ~= nil then
break;
end;
if not l__Parent__3 then
break;
end;
if not l__Parent__3.Parent then
break;
end;
end;
return nil;
end;
|
-- functions |
local function HandleCharacter(character)
local player = Players:GetPlayerFromCharacter(character)
local playerData
if player then
playerData = PLAYER_DATA:WaitForChild(player.Name)
end
if character then
local humanoid = character.Humanoid
local armor = humanoid.Armor
local slots = humanoid.ArmorSlots
local lastSlots = slots.Value
armor.Changed:connect(function()
local activeSlots = math.ceil(armor.Value / SLOT_SIZE)
slots.Value = activeSlots
end)
slots.Changed:connect(function()
if slots.Value > lastSlots then
REMOTES.Effect:FireAllClients("Booster", character, "Armor")
elseif slots.Value < lastSlots then
REMOTES.Effect:FireAllClients("Shatter", character, "Armor")
end
lastSlots = slots.Value
-- remove old armor
character.Armor:ClearAllChildren()
if slots.Value > 0 then
local armor = CUSTOMIZATION.Armors.Default
if playerData then
if CUSTOMIZATION.Armors:FindFirstChild(playerData.Equipped.Armor.Value) then
armor = CUSTOMIZATION.Armors[playerData.Equipped.Armor.Value]
end
end
local armor = armor["Tier" .. tostring(slots.Value)]:Clone()
local primary = armor.PrimaryPart
local attach = character[primary.Name]
for _, v in pairs(armor:GetChildren()) do
if v:IsA("BasePart") and v ~= primary then
v.CanCollide = false
v.Massless = true
local offset = primary.CFrame:toObjectSpace(v.CFrame)
local weld = Instance.new("Weld")
weld.Part0 = attach
weld.Part1 = v
weld.C0 = offset
weld.Parent = v
v.Anchored = false
end
end
primary:Destroy()
armor.Parent = character.Armor
end
end)
end
end
local function HandlePlayer(player)
player.CharacterAdded:connect(HandleCharacter)
HandleCharacter(player.Character)
end
local function AddArmor(character, amount)
local armor = character.Humanoid.Armor
local slots = character.Humanoid.ArmorSlots
if armor.Value < MAX_SLOTS * SLOT_SIZE then
slots.Value = math.min(slots.Value + amount, MAX_SLOTS)
armor.Value = math.min(armor.Value + amount * SLOT_SIZE, MAX_SLOTS * SLOT_SIZE)
return true
end
return false
end
local function Boost(character, amount)
local humanoid = character.Humanoid
local armor = humanoid.Armor
local slots = humanoid.ArmorSlots
local maxArmor = slots.Value * SLOT_SIZE
armor.Value = math.min(armor.Value + amount * SLOT_SIZE, maxArmor)
end
|
--[[ 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(176, 222)
JumpButton.ImageRectSize = Vector2.new(174, 174)
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(0, 222)
MasterControl:SetIsJumping(true)
end)
OnInputEnded = function()
touchObject = nil
MasterControl:SetIsJumping(false)
JumpButton.ImageRectOffset = Vector2.new(176, 222)
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
|
------------------------------------------------------------------------
--
-- * used in luaK:goiftrue(), luaK:goiffalse()
------------------------------------------------------------------------ |
function luaK:jumponcond(fs, e, cond)
if e.k == "VRELOCABLE" then
local ie = self:getcode(fs, e)
if luaP:GET_OPCODE(ie) == "OP_NOT" then
fs.pc = fs.pc - 1 -- remove previous OP_NOT
return self:condjump(fs, "OP_TEST", luaP:GETARG_B(ie), 0, cond and 0 or 1)
end
-- else go through
end
self:discharge2anyreg(fs, e)
self:freeexp(fs, e)
return self:condjump(fs, "OP_TESTSET", luaP.NO_REG, e.info, cond and 1 or 0)
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 = false -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[[
Realistic Head Bobble Script
Put in StarterCharacterScripts
]] | |
-- Add a toolbar button named "Create Empty Script" |
local newScriptButton = toolbar:CreateButton("Create Empty Script", "Create an empty script", "rbxassetid://4458901886") |
--AfterHeal = Humanoid.Health + Heal |
BeamTween = TAnim(BeamTweenValue, {Value = 0.3}, 0.8, "Quad", "InOut", math.huge, true, 0)
Dead = false
Died = Humanoid.Died:Connect(function()
BeamTween:Cancel()
Dead = true
end)
Creator.Changed:Connect(function()
if not Creator or not Creator.Parent then
BeamTween:Cancel()
Dead = true
end
end)
CreatorHumanoid.Died:Connect(function()
BeamTween:Cancel()
Dead = true
end)
TAnim(HealSound, {Volume = 0.3}, 0.4, "Quart", "InOut", 0, false, 0)
for i = 1, 40 do
if Dead then
break
else
Humanoid.Health = Humanoid.Health + (Heal / 30)
end
SWait(0.1)
end
if Died then
Died:Disconnect()
end
HealParticle.Enabled = false
HealCross.Enabled = false
Del = TAnim(HealSound, {Volume = 0}, 0.4, "Quart", "InOut", 0, false, 0)
spawn(function()
Del.Completed:Wait()
HealSound:Stop()
end)
BeamTween:Cancel()
BeamTween = TAnim(BeamTweenValue, {Value = 1}, 0.5, "Quad", "InOut", 0, false, 0)
Debris:AddItem(TargetTorsoAtt, 5)
Debris:AddItem(HealBeam, 5)
Debris:AddItem(HealSound, 5)
SWait(5)
script:Destroy()
|
--Script |
feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
feedbackMain.InputBox.Input.Changed:Connect(function()
feedbackMain.CharactersLeft.Text = maxCharacters - #feedbackMain.InputBox.Input.Text
if maxCharacters - #feedbackMain.InputBox.Input.Text < 0 then
feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,50,50)
feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundButton
else
feedbackMain.CharactersLeft.TextColor3 = Color3.fromRGB(255,255,255)
feedbackMain.SendButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
end
end)
local db = false
feedbackMain.SendButton.MouseButton1Click:Connect(function()
if not db and maxCharacters - #feedbackMain.InputBox.Input.Text >= 0 then
db = true
local msg = feedbackMain.InputBox.Input.Text
if msg == "Type feedback/bug report here" then
db = false
return
end
feedbackMain.InputBox.Input.Text = "Sending Message..."
local response = game.ReplicatedStorage.FilteringFunction:InvokeServer(msg)
feedbackMain.InputBox.Input.Text = response
wait(5)
if feedbackMain.InputBox.Input.Text == response then
feedbackMain.InputBox.Input.Text = "Type feedback/bug report here"
end
db = false
end
end)
script.Parent.Button.MouseButton1Click:Connect(function()
open = not open
if open then
feedbackMain:TweenPosition(UDim2.new(1,-300,1,-300),"Out","Quint",0.3,true)
else
feedbackMain:TweenPosition(UDim2.new(1,100,1,-300),"Out","Quint",0.3,true)
end
end)
|
--[[Steering]] |
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
|
-- Get initial data for client |
getFloorMaterial()
getSoundProperties()
update()
|
--- Registers a command based purely on its definition.
-- Prefer using Registry:RegisterCommand for proper handling of server/client model. |
function Registry:RegisterCommandObject (commandObject, fromCmdr)
for key in pairs(commandObject) do
if self.CommandMethods[key] == nil then
error("Unknown key/method in command " .. (commandObject.Name or "unknown command") .. ": " .. key)
end
end
if commandObject.Args then
for i, arg in pairs(commandObject.Args) do
if type(arg) == "table" then
for key in pairs(arg) do
if self.CommandArgProps[key] == nil then
error(('Unknown property in command "%s" argument #%d: %s'):format(commandObject.Name or "unknown", i, key))
end
end
end
end
end
if commandObject.AutoExec and RunService:IsClient() then
table.insert(self.AutoExecBuffer, commandObject.AutoExec)
self:FlushAutoExecBufferDeferred()
end
-- Unregister the old command if it exists...
local oldCommand = self.Commands[commandObject.Name:lower()]
if oldCommand and oldCommand.Aliases then
for _, alias in pairs(oldCommand.Aliases) do
self.Commands[alias:lower()] = nil
end
elseif not oldCommand then
table.insert(self.CommandsArray, commandObject)
end
self.Commands[commandObject.Name:lower()] = commandObject
if commandObject.Aliases then
for _, alias in pairs(commandObject.Aliases) do
self.Commands[alias:lower()] = commandObject
end
end
end
|
--[=[
Requires all the modules that are children of the given parent. This is an easy
way to quickly load all services that might be in a folder.
```lua
Knit.AddServices(somewhere.Services)
```
]=] |
function KnitServer.AddServices(parent: Instance): {Service}
local addedServices = {}
for _,v in ipairs(parent:GetChildren()) do
if not v:IsA("ModuleScript") then continue end
table.insert(addedServices, require(v))
end
return addedServices
end
|
--[[
CameraShakePresets.Bump
CameraShakePresets.Explosion
CameraShakePresets.Earthquake
CameraShakePresets.BadTrip
CameraShakePresets.HandheldCamera
CameraShakePresets.Vibration
CameraShakePresets.RoughDriving
--]] |
local CameraShakeInstance = require(script.Parent.CameraShakeInstance)
local CameraShakePresets = {
-- A high-magnitude, short, yet smooth shake.
-- Should happen once.
Bump = function()
local c = CameraShakeInstance.new(2.5, 4, 0.1, 0.75)
c.PositionInfluence = Vector3.new(0.15, 0.15, 0.15)
c.RotationInfluence = Vector3.new(1, 1, 1)
return c
end;
-- An intense and rough shake.
-- Should happen once.
Explosion = function()
local c = CameraShakeInstance.new(5, 10, 0, 1.5)
c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
c.RotationInfluence = Vector3.new(4, 1, 1)
return c
end;
-- A continuous, rough shake
-- Sustained.
Earthquake = function()
local c = CameraShakeInstance.new(0.6, 3.5, 2, 10)
c.PositionInfluence = Vector3.new(0.25, 0.25, 0.25)
c.RotationInfluence = Vector3.new(1, 1, 4)
return c
end;
-- A bizarre shake with a very high magnitude and low roughness.
-- Sustained.
BadTrip = function()
local c = CameraShakeInstance.new(10, 0.15, 5, 10)
c.PositionInfluence = Vector3.new(0, 0, 0.15)
c.RotationInfluence = Vector3.new(2, 1, 4)
return c
end;
-- A subtle, slow shake.
-- Sustained.
HandheldCamera = function()
local c = CameraShakeInstance.new(.5, 1, 4, 4)
c.PositionInfluence = Vector3.new(2,0,0)
c.RotationInfluence = Vector3.new(1.25,0,0)
return c
end;
-- A very rough, yet low magnitude shake.
-- Sustained.
Vibration = function()
local c = CameraShakeInstance.new(0.4, 20, 2, 2)
c.PositionInfluence = Vector3.new(0, 0.15, 0)
c.RotationInfluence = Vector3.new(1.25, 0, 4)
return c
end;
-- A slightly rough, medium magnitude shake.
-- Sustained.
RoughDriving = function()
local c = CameraShakeInstance.new(1, 2, 1, 1)
c.PositionInfluence = Vector3.new(0, 0, 0)
c.RotationInfluence = Vector3.new(1, 1, 1)
return c
end;
}
return setmetatable({}, {
__index = function(t, i)
local f = CameraShakePresets[i]
if (type(f) == "function") then
return f()
end
error("No preset found with index \"" .. i .. "\"")
end;
})
|
----------do not edit anything below this line |
local function createMessageOnClient(msg)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = msg;
Font = Enum.Font.Arcade;
Color = sm;
FontSize = Enum.FontSize.Size18;
})
end
if welcomeMessageOn then
createMessageOnClient(welcomeMessage)
end
if displayJoinMessage then
createMessageOnClient(game:GetService("Players").LocalPlayer.Name..joinMessage)
game:GetService('Players').PlayerAdded:Connect(function(plr)
createMessageOnClient(plr.Name..joinMessage)
end)
end
if displayLeaveMessage then
game:GetService('Players').PlayerRemoving:Connect(function(plr)
createMessageOnClient(plr.Name..leftMessage)
end)
end
|
--Remove Existing Mass |
function DReduce(p)
for i,v in pairs(p:GetChildren())do
if v:IsA("BasePart") then
if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
v.CustomPhysicalProperties = PhysicalProperties.new(
0,
v.CustomPhysicalProperties.Friction,
v.CustomPhysicalProperties.Elasticity,
v.CustomPhysicalProperties.FrictionWeight,
v.CustomPhysicalProperties.ElasticityWeight
)
end
DReduce(v)
end
end
DReduce(bike)
|
-- Decompiled with the Synapse X Luau decompiler. |
local l__VRService__1 = game:GetService("VRService");
local l__UserInputService__2 = game:GetService("UserInputService");
local l__RunService__3 = game:GetService("RunService");
local l__PathfindingService__4 = game:GetService("PathfindingService");
local l__ContextActionService__5 = game:GetService("ContextActionService");
local l__StarterGui__6 = game:GetService("StarterGui");
local l__LocalPlayer__7 = game:GetService("Players").LocalPlayer;
local v8 = Vector3.new(0, 0, 0);
local v9 = Vector3.new(1, 0, 1);
local v10 = Instance.new("BindableEvent");
v10.Name = "MovementUpdate";
v10.Parent = script;
local u1 = nil;
coroutine.wrap(function()
local l__PathDisplay__11 = script.Parent:WaitForChild("PathDisplay");
if l__PathDisplay__11 then
u1 = require(l__PathDisplay__11);
end;
end)();
local v12 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v13 = setmetatable({}, v12);
v13.__index = v13;
function v13.new(p1)
local v14 = setmetatable(v12.new(), v13);
v14.CONTROL_ACTION_PRIORITY = p1;
v14.navigationRequestedConn = nil;
v14.heartbeatConn = nil;
v14.currentDestination = nil;
v14.currentPath = nil;
v14.currentPoints = nil;
v14.currentPointIdx = 0;
v14.expectedTimeToNextPoint = 0;
v14.timeReachedLastPoint = tick();
v14.moving = false;
v14.isJumpBound = false;
v14.moveLatch = false;
v14.userCFrameEnabledConn = nil;
return v14;
end;
function v13.SetLaserPointerMode(p2, p3)
pcall(function()
l__StarterGui__6:SetCore("VRLaserPointerMode", p3);
end);
end;
function v13.GetLocalHumanoid(p4)
local l__Character__15 = l__LocalPlayer__7.Character;
if not l__Character__15 then
return;
end;
for v16, v17 in pairs(l__Character__15:GetChildren()) do
if v17:IsA("Humanoid") then
return v17;
end;
end;
return nil;
end;
function v13.HasBothHandControllers(p5)
return l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) and l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand);
end;
function v13.HasAnyHandControllers(p6)
return l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) or l__VRService__1:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand);
end;
function v13.IsMobileVR(p7)
return l__UserInputService__2.TouchEnabled;
end;
function v13.HasGamepad(p8)
return l__UserInputService__2.GamepadEnabled;
end;
function v13.ShouldUseNavigationLaser(p9)
if p9:IsMobileVR() then
return true;
end;
if p9:HasBothHandControllers() then
return false;
end;
if p9:HasAnyHandControllers() then
return true;
end;
return not p9:HasGamepad();
end;
function v13.StartFollowingPath(p10, p11)
currentPath = p11;
currentPoints = currentPath:GetPointCoordinates();
currentPointIdx = 1;
moving = true;
timeReachedLastPoint = tick();
local v18 = p10:GetLocalHumanoid();
if v18 and v18.Torso and #currentPoints >= 1 then
expectedTimeToNextPoint = (currentPoints[1] - v18.Torso.Position).magnitude / v18.WalkSpeed;
end;
v10:Fire("targetPoint", p10.currentDestination);
end;
function v13.GoToPoint(p12, p13)
currentPath = true;
currentPoints = { p13 };
currentPointIdx = 1;
moving = true;
local v19 = p12:GetLocalHumanoid();
timeReachedLastPoint = tick();
expectedTimeToNextPoint = (v19.Torso.Position - p13).magnitude / v19.WalkSpeed;
v10:Fire("targetPoint", p13);
end;
function v13.StopFollowingPath(p14)
currentPath = nil;
currentPoints = nil;
currentPointIdx = 0;
moving = false;
p14.moveVector = v8;
end;
function v13.TryComputePath(p15, p16, p17)
local v20 = nil;
while not v20 and 0 < 5 do
local v21 = l__PathfindingService__4:ComputeSmoothPathAsync(p16, p17, 200);
if v21.Status == Enum.PathStatus.ClosestNoPath then
return nil;
end;
if v21.Status == Enum.PathStatus.ClosestOutOfRange then
return nil;
end;
if v21 and v21.Status == Enum.PathStatus.FailStartNotEmpty then
p16 = p16 + (p17 - p16).Unit;
v21 = nil;
end;
if v20 and v20.Status == Enum.PathStatus.FailFinishNotEmpty then
p17 = p17 + Vector3.new(0, 1, 0);
v20 = nil;
end;
end;
return v20;
end;
function v13.OnNavigationRequest(p18, p19, p20)
local l__Position__22 = p19.Position;
local l__currentDestination__23 = p18.currentDestination;
local l__x__24 = l__Position__22.x;
local v25 = false;
if l__x__24 == l__x__24 then
v25 = false;
if l__x__24 ~= (1 / 0) then
v25 = l__x__24 ~= (-1 / 0);
end;
end;
if v25 then
local l__y__26 = l__Position__22.y;
v25 = false;
if l__y__26 == l__y__26 then
v25 = false;
if l__y__26 ~= (1 / 0) then
v25 = l__y__26 ~= (-1 / 0);
end;
end;
if v25 then
local l__z__27 = l__Position__22.z;
v25 = false;
if l__z__27 == l__z__27 then
v25 = false;
if l__z__27 ~= (1 / 0) then
v25 = l__z__27 ~= (-1 / 0);
end;
end;
end;
end;
if not v25 then
return;
end;
p18.currentDestination = l__Position__22;
local v28 = p18:GetLocalHumanoid();
if not v28 or not v28.Torso then
return;
end;
local l__Position__29 = v28.Torso.Position;
if (p18.currentDestination - l__Position__29).magnitude < 12 then
p18:GoToPoint(p18.currentDestination);
return;
end;
if not l__currentDestination__23 or (p18.currentDestination - l__currentDestination__23).magnitude > 4 then
local v30 = p18:TryComputePath(l__Position__29, p18.currentDestination);
if v30 then
p18:StartFollowingPath(v30);
if u1 then
u1.setCurrentPoints(p18.currentPoints);
u1.renderPath();
return;
end;
else
p18:StopFollowingPath();
if u1 then
u1.clearRenderedPath();
return;
end;
end;
else
if moving then
p18.currentPoints[#currentPoints] = p18.currentDestination;
return;
end;
p18:GoToPoint(p18.currentDestination);
end;
end;
function v13.OnJumpAction(p21, p22, p23, p24)
if p23 == Enum.UserInputState.Begin then
p21.isJumping = true;
end;
return Enum.ContextActionResult.Sink;
end;
function v13.BindJumpAction(p25, p26)
if p26 then
if p25.isJumpBound then
return;
end;
else
if p25.isJumpBound then
p25.isJumpBound = false;
l__ContextActionService__5:UnbindAction("VRJumpAction");
end;
return;
end;
p25.isJumpBound = true;
l__ContextActionService__5:BindActionAtPriority("VRJumpAction", function()
return p25:OnJumpAction();
end, false, p25.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA);
end;
function v13.ControlCharacterGamepad(p27, p28, p29, p30)
if p30.KeyCode ~= Enum.KeyCode.Thumbstick1 then
return;
end;
if p29 == Enum.UserInputState.Cancel then
p27.moveVector = v8;
return;
end;
if p29 ~= Enum.UserInputState.End then
p27:StopFollowingPath();
if u1 then
u1.clearRenderedPath();
end;
if p27:ShouldUseNavigationLaser() then
p27:BindJumpAction(true);
p27:SetLaserPointerMode("Hidden");
end;
if p30.Position.magnitude > 0.22 then
p27.moveVector = Vector3.new(p30.Position.X, 0, -p30.Position.Y);
if p27.moveVector.magnitude > 0 then
p27.moveVector = p27.moveVector.unit * math.min(1, p30.Position.magnitude);
end;
p27.moveLatch = true;
end;
else
p27.moveVector = v8;
if p27:ShouldUseNavigationLaser() then
p27:BindJumpAction(false);
p27:SetLaserPointerMode("Navigation");
end;
if p27.moveLatch then
p27.moveLatch = false;
v10:Fire("offtrack");
end;
end;
return Enum.ContextActionResult.Sink;
end;
function v13.OnHeartbeat(p31, p32)
local v31 = p31.moveVector;
local v32 = p31:GetLocalHumanoid();
if not v32 or not v32.Torso then
return;
end;
if p31.moving and p31.currentPoints then
local l__Position__33 = v32.Torso.Position;
local v34 = (currentPoints[1] - l__Position__33) * v9;
local l__magnitude__35 = v34.magnitude;
local v36 = v34 / l__magnitude__35;
if l__magnitude__35 < 1 then
local v37 = 0;
local v38 = currentPoints[1];
for v39, v40 in pairs(currentPoints) do
if v39 ~= 1 then
v38 = v40;
v37 = v37 + (v40 - v38).magnitude / v32.WalkSpeed;
end;
end;
table.remove(currentPoints, 1);
currentPointIdx = currentPointIdx + 1;
if #currentPoints == 0 then
p31:StopFollowingPath();
if u1 then
u1.clearRenderedPath();
end;
return;
end;
if u1 then
u1.setCurrentPoints(currentPoints);
u1.renderPath();
end;
expectedTimeToNextPoint = (currentPoints[1] - l__Position__33).magnitude / v32.WalkSpeed;
timeReachedLastPoint = tick();
else
local v41 = { game.Players.LocalPlayer.Character, workspace.CurrentCamera };
local v42, v43, v44 = workspace:FindPartOnRayWithIgnoreList(Ray.new(l__Position__33 - Vector3.new(0, 1, 0), v36 * 3), v41);
if v42 then
local v45 = Vector3.new(0, 100, 0);
local v46, v47, v48 = workspace:FindPartOnRayWithIgnoreList(Ray.new(v43 + v36 * 0.5 + v45, -v45), v41);
local v49 = v47.Y - l__Position__33.Y;
if v49 < 6 and v49 > -2 then
v32.Jump = true;
end;
end;
if expectedTimeToNextPoint + 2 < tick() - timeReachedLastPoint then
p31:StopFollowingPath();
if u1 then
u1.clearRenderedPath();
end;
v10:Fire("offtrack");
end;
v31 = p31.moveVector:Lerp(v36, p32 * 10);
end;
end;
local l__x__50 = v31.x;
local v51 = false;
if l__x__50 == l__x__50 then
v51 = false;
if l__x__50 ~= (1 / 0) then
v51 = l__x__50 ~= (-1 / 0);
end;
end;
if v51 then
local l__y__52 = v31.y;
v51 = false;
if l__y__52 == l__y__52 then
v51 = false;
if l__y__52 ~= (1 / 0) then
v51 = l__y__52 ~= (-1 / 0);
end;
end;
if v51 then
local l__z__53 = v31.z;
v51 = false;
if l__z__53 == l__z__53 then
v51 = false;
if l__z__53 ~= (1 / 0) then
v51 = l__z__53 ~= (-1 / 0);
end;
end;
end;
end;
if v51 then
p31.moveVector = v31;
end;
end;
function v13.OnUserCFrameEnabled(p33)
if p33:ShouldUseNavigationLaser() then
p33:BindJumpAction(false);
p33:SetLaserPointerMode("Navigation");
return;
end;
p33:BindJumpAction(true);
p33:SetLaserPointerMode("Hidden");
end;
function v13.Enable(p34, p35)
p34.moveVector = v8;
p34.isJumping = false;
if p35 then
p34.navigationRequestedConn = l__VRService__1.NavigationRequested:Connect(function(p36, p37)
p34:OnNavigationRequest(p36, p37);
end);
p34.heartbeatConn = l__RunService__3.Heartbeat:Connect(function(p38)
p34:OnHeartbeat(p38);
end);
l__ContextActionService__5:BindAction("MoveThumbstick", function(p39, p40, p41)
return p34:ControlCharacterGamepad(p39, p40, p41);
end, false, p34.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1);
l__ContextActionService__5:BindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2);
p34.userCFrameEnabledConn = l__VRService__1.UserCFrameEnabled:Connect(function()
p34:OnUserCFrameEnabled();
end);
p34:OnUserCFrameEnabled();
l__VRService__1:SetTouchpadMode(Enum.VRTouchpad.Left, Enum.VRTouchpadMode.VirtualThumbstick);
l__VRService__1:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY);
p34.enabled = true;
return;
end;
p34:StopFollowingPath();
l__ContextActionService__5:UnbindAction("MoveThumbstick");
l__ContextActionService__5:UnbindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2);
p34:BindJumpAction(false);
p34:SetLaserPointerMode("Disabled");
if p34.navigationRequestedConn then
p34.navigationRequestedConn:Disconnect();
p34.navigationRequestedConn = nil;
end;
if p34.heartbeatConn then
p34.heartbeatConn:Disconnect();
p34.heartbeatConn = nil;
end;
if p34.userCFrameEnabledConn then
p34.userCFrameEnabledConn:Disconnect();
p34.userCFrameEnabledConn = nil;
end;
p34.enabled = false;
end;
return v13;
|
-- Global matchers object holds the list of available matchers and
-- the state, that can hold matcher specific values that change over time. |
local JEST_MATCHERS_OBJECT = Symbol.for_("$$jest-matchers-object")
|
-- Adjust the movement of the firefly, allowing them to roam around. |
local Fly = script.Parent
while true do -- Alter the flies movement direction every once a while to make it roam around
Fly.BodyVelocity.velocity = Vector3.new(math.random(-20,20)*0.1,math.random(-20,20)*0.1,math.random(-20,20)*0.1)
wait(math.random(10,25)*0.1)
end |
--BaseRay.Transparency = 1 |
BaseRayMesh = Instance.new("SpecialMesh")
BaseRayMesh.Name = "Mesh"
BaseRayMesh.MeshType = Enum.MeshType.Brick
BaseRayMesh.Scale = Vector3.new(0.2, 0.2, 1)
BaseRayMesh.Offset = Vector3.new(0, 0.2, 0)
BaseRayMesh.VertexColor = Vector3.new(1, 1, 1)
BaseRayMesh.Parent = BaseRay
ServerControl = (Remotes:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
ServerControl.Name = "ServerControl"
ServerControl.Parent = Remotes
ClientControl = (Remotes:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
ClientControl.Name = "ClientControl"
ClientControl.Parent = Remotes
Light.Enabled = false
Tool.Enabled = true
function RayTouched(Hit, Position)
if not Hit or not Hit.Parent then
return
end
local character = Hit.Parent
if character:IsA("Hat") then
character = character.Parent
end
if character == Character then
return
end
local humanoid = character:FindFirstChildOfClass('Humanoid')
if not humanoid or humanoid.Health == 0 then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and Functions.IsTeamMate(Player, player) then
return
end
local DeterminedDamage = math.random(Configuration.Damage.MinValue, Configuration.Damage.MaxValue)
Functions.UntagHumanoid(humanoid)
Functions.TagHumanoid(humanoid, Player)
humanoid:TakeDamage(DeterminedDamage)
end
function CheckIfAlive()
return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
if not CheckIfAlive() then
return
end
ToolEquipped = true
end
function Unequipped()
ToolEquipped = false
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
ServerControl.OnServerInvoke = (function(player, Mode, Value)
if player ~= Player or not ToolEquipped or not CheckIfAlive() or not Mode or not Value then
return
end
if Mode == "Fire" then
Sounds.Fire:Play()
elseif Mode == "RayHit" then
local RayHit = Value.Hit
local RayPosition = Value.Position
if RayHit and RayPosition then
RayTouched(RayHit, RayPosition)
end
if not FX.Enabled then
FX.Enabled = true
delay(0.1, function()
FX.Enabled = false
end)
end
elseif Mode == "CastLaser" then
local StartPosition = Value.StartPosition
local TargetPosition = Value.TargetPosition
local RayHit = Value.RayHit
if not StartPosition or not TargetPosition or not RayHit then
return
end
for i, v in pairs(Players:GetPlayers()) do
if v:IsA("Player") and v ~= Player then
local Backpack = v:FindFirstChild("Backpack")
if Backpack then
local LaserScript = CastLaser:Clone()
local StartPos = Instance.new("Vector3Value")
StartPos.Name = "StartPosition"
StartPos.Value = StartPosition
StartPos.Parent = LaserScript
local TargetPos = Instance.new("Vector3Value")
TargetPos.Name = "TargetPosition"
TargetPos.Value = TargetPosition
TargetPos.Parent = LaserScript
local RayHit = Instance.new("BoolValue")
RayHit.Name = "RayHit"
RayHit.Value = RayHit
RayHit.Parent = LaserScript
LaserScript.Disabled = false
Debris:AddItem(LaserScript, 1.5)
LaserScript.Parent = Backpack
end
end
end
end
end)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--// Holstering |
HolsteringEnabled = false;
HolsterPos = CFrame.new(0.140751064, 0, -0.616261482, -4.10752676e-08, -0.342020065, 0.939692616, -1.49501727e-08, 0.939692557, 0.342020094, -0.99999994, 0, -4.37113847e-08);
}
return Settings
|
-- Edit stuff here |
DATA_STORE = "TopCoins" --< Name of the Data store values will be saved in
SCORE_UPDATE = 30 --< How often you want the leaderboards to update in seconds (no less than 30)
PLAYER_UPDATE = 30 --< How often you want the player's current stat to save in seconds (no less than 30)
PLAYER_SAVE = "leaderstats" --< Do not change unless you are using something that is not leaderstats
NAME_OF_STAT = "Coins" --< Name of the stat you want to save (HAS to be inside 'leaderstats' or whatever PLAYER_SAVE is)
|
-- Tween |
local tween = game:GetService("TweenService")
local info = TweenInfo.new(
3,
Enum.EasingStyle.Linear,
Enum.EasingDirection.InOut,
0,
false,
0
)
local abrindo = {
CFrame = cf1.CFrame
}
local fechando = {
CFrame = doorpos
}
local create1 = tween:Create(portao,info,abrindo)
local create2 = tween:Create(portao,info,fechando)
|
--[[Steering]] |
function Steering()
--Mouse Steer
if _MSteer then
local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
local mdZone = _Tune.Peripherals.MSteerDZone/100
local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
if math.abs(mST)<=mdZone then
_GSteerT = 0
else
_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
end
end
--Interpolate Steering
if _GSteerC < _GSteerT then
if _GSteerC<0 then
_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.ReturnSpeed)
else
_GSteerC = math.min(_GSteerT,_GSteerC+_Tune.SteerSpeed)
end
else
if _GSteerC>0 then
_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.ReturnSpeed)
else
_GSteerC = math.max(_GSteerT,_GSteerC-_Tune.SteerSpeed)
end
end
--Steer Decay Multiplier
local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
--Apply Steering
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="F" then
v.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
elseif v.Name=="FL" then
if _GSteerC>= 0 then
v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
else
v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
end
elseif v.Name=="FR" then
if _GSteerC>= 0 then
v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerInner*sDecay),0)
else
v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(_GSteerC*_Tune.SteerOuter*sDecay),0)
end
end
end
end
|
--------------------------------------------------------------------------------------
--------------------[ PRE-CONNECTIONS ]-----------------------------------------------
-------------------------------------------------------------------------------------- |
RS:connect(function()
local Forward = (Keys["w"] or Keys[string.char(17)])
local Backward = (Keys["s"] or Keys[string.char(18)])
local Right = (Keys["d"] or Keys[string.char(19)])
local Left = (Keys["a"] or Keys[string.char(20)])
if (Forward or Backward or Right or Left) then
Walking, Idleing = true, false
elseif (not (Forward and Backward and Right and Left)) then
Walking, Idleing = false, true
end
end)
M2.KeyDown:connect(function(Key) Keys[Key] = true end)
M2.KeyUp:connect(function(Key) Keys[Key] = false end)
|
------------------------------------------------------------------ |
local AimingCursor = "http://www.roblox.com/asset/?id=107455536"
local LockedCursor = "http://www.roblox.com/asset/?id=107455986"
local TargetCursor = "http://www.roblox.com/asset/?id=107455960"
local NormalCursor = "http://www.roblox.com/asset/?id=116176885" |
--[[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 = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.92 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.6 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Made by Luckymaxer |
Seat = script.Parent
Model = Seat.Parent
Engine = Model:WaitForChild("Engine")
BeamPart = Model:WaitForChild("BeamPart")
Lights = Model:WaitForChild("Lights")
Seats = Model:WaitForChild("Seats")
Sounds = {
Flying = Engine:WaitForChild("UFO_Flying"),
Beam = Engine:WaitForChild("UFO_Beam"),
Idle = Engine:WaitForChild("UFO_Idle"),
TakingOff = Engine:WaitForChild("UFO_Taking_Off")
}
Players = game:GetService("Players")
Debris = game:GetService("Debris")
BeamSize = 50
CurrentBeamSize = 0
MaxVelocity = 40
MinVelocity = -40
MaxSideVelocity = 40
MinSideVelocity = -40
Acceleration = 2
Deceleration = 2
AutoDeceleration = 2
SideAcceleration = 2
SideDeceleration = 2
AutoSideDeceleration = 2
LiftOffSpeed = 5
LiftSpeed = 10
LowerSpeed = -10
Velocity = Vector3.new(0, 0, 0)
SideVelocity = 0
FlipForce = 1000000
InUse = false
PlayerUsing = nil
PlayerControlScript = nil
PlayerConnection = nil
BeamActive = false
TakingOff = false
LightsEnabled = false
Enabled = false
Controls = {
Forward = {Key = "W", Byte = 17, Mode = false},
Backward = {Key = "S", Byte = 18, Mode = false},
Left = {Key = "A", Byte = 20, Mode = false},
Right = {Key = "D", Byte = 19, Mode = false},
Up = {Key = "Q", Byte = 113, Mode = false},
Down = {Key = "E", Byte = 101, Mode = false},
}
ControlScript = script:WaitForChild("ControlScript")
Beam = Instance.new("Part")
Beam.Name = "Beam"
Beam.Transparency = 0.3
Beam.BrickColor = BrickColor.new("Lime green")
Beam.Material = Enum.Material.Plastic
Beam.Shape = Enum.PartType.Block
Beam.TopSurface = Enum.SurfaceType.Smooth
Beam.BottomSurface = Enum.SurfaceType.Smooth
Beam.FormFactor = Enum.FormFactor.Custom
Beam.Size = Vector3.new(BeamPart.Size.X, 0.2, BeamPart.Size.Z)
Beam.Anchored = false
Beam.CanCollide = false
BeamMesh = Instance.new("CylinderMesh")
BeamMesh.Parent = Beam
for i, v in pairs(Sounds) do
v:Stop()
end
RemoteConnection = script:FindFirstChild("RemoteConnection")
if not RemoteConnection then
RemoteConnection = Instance.new("RemoteFunction")
RemoteConnection.Name = "RemoteConnection"
RemoteConnection.Parent = script
end
BodyGyro = Engine:FindFirstChild("BodyGyro")
if not BodyGyro then
BodyGyro = Instance.new("BodyGyro")
BodyGyro.Parent = Engine
end
BodyGyro.maxTorque = Vector3.new(0, 0, 0)
BodyGyro.D = 7500
BodyGyro.P = 10000
BodyPosition = Engine:FindFirstChild("BodyPosition")
if not BodyPosition then
BodyPosition = Instance.new("BodyPosition")
BodyPosition.Parent = Engine
end
BodyPosition.maxForce = Vector3.new(0, 0, 0)
BodyPosition.D = 10000
BodyPosition.P = 50000
BodyVelocity = Engine:FindFirstChild("BodyVelocity")
if not BodyVelocity then
BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Parent = Engine
end
BodyVelocity.velocity = Vector3.new(0, 0, 0)
BodyVelocity.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.P = 10000
FlipGyro = BeamPart:FindFirstChild("FlipGyro")
if not FlipGyro then
FlipGyro = Instance.new("BodyGyro")
FlipGyro.Name = "FlipGyro"
FlipGyro.Parent = BeamPart
end
FlipGyro.maxTorque = Vector3.new(0, 0, 0)
FlipGyro.D = 500
FlipGyro.P = 3000
RiseVelocity = BeamPart:FindFirstChild("RiseVelocity")
if not RiseVelocity then
RiseVelocity = Instance.new("BodyVelocity")
RiseVelocity.Name = "RiseVelocity"
RiseVelocity.Parent = BeamPart
end
RiseVelocity.velocity = Vector3.new(0, 0, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.P = 10000
function RayCast(Position, Direction, MaxDistance, IgnoreList)
return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
end
function ToggleLights()
for i, v in pairs(Lights:GetChildren()) do
if v:IsA("BasePart") then
for ii, vv in pairs(v:GetChildren()) do
if vv:IsA("Light") then
vv.Enabled = LightsEnabled
end
end
end
end
end
ToggleLights()
function CheckTable(Table, Instance)
for i, v in pairs(Table) do
if v == Instance then
return true
end
end
return false
end
function RandomizeTable(Table)
local TableCopy = {}
for i = 1, #Table do
local Index = math.random(1, #Table)
table.insert(TableCopy, Table[Index])
table.remove(Table, Index)
end
return TableCopy
end
for i, v in pairs(Model:GetChildren()) do
if v:IsA("BasePart") and v.Name == "Beam" then
v:Destroy()
end
end
function GetPartsInBeam(beam)
local IgnoreObjects = {(((PlayerUsing and PlayerUsing.Character) and PlayerUsing.Character) or nil), Model}
local NegativePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
local PositivePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
local Parts = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region3.new(beam.Position - NegativePartRadius, beam.Position + PositivePartRadius), IgnoreObjects, 100)
local Humanoids = {}
local Torsos = {}
for i, v in pairs(Parts) do
if v and v.Parent then
local humanoid = v.Parent:FindFirstChild("Humanoid")
local torso = v.Parent:FindFirstChild("Torso")
local player = Players:GetPlayerFromCharacter(v.Parent)
if player and humanoid and humanoid.Health > 0 and torso and not CheckTable(Humanoids, humanoid) then
table.insert(Humanoids, humanoid)
table.insert(Torsos, {Humanoid = humanoid, Torso = torso})
end
end
end
return Torsos
end
RemoteConnection.OnServerInvoke = (function(Player, Script, Action, Value)
if Script and Script ~= PlayerControlScript then
Script.Disabled = true
Script:Destroy()
else
if Action == "KeyDown" then
if Value == "l" then
LightsEnabled = not LightsEnabled
ToggleLights()
elseif Value == "t" then
if TemporaryBeam and TemporaryBeam.Parent then
local Torsos = GetPartsInBeam(TemporaryBeam)
local TorsosUsed = {}
Torsos = RandomizeTable(Torsos)
for i, v in pairs(Seats:GetChildren()) do
if v:IsA("Seat") and not v:FindFirstChild("SeatWeld") then
for ii, vv in pairs(Torsos) do
if vv.Humanoid and vv.Humanoid.Parent and vv.Humanoid.Health > 0 and not vv.Humanoid.Sit and vv.Torso and vv.Torso.Parent and not CheckTable(TorsosUsed, vv.Torso) then
table.insert(TorsosUsed, vv.Torso)
vv.Torso.CFrame = v.CFrame
break
end
end
end
end
end
end
if not TakingOff then
for i, v in pairs(Controls) do
if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
v.Mode = true
end
end
if Controls.Up.Mode or Controls.Down.Mode then
RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
end
if Controls.Forward.Mode or Controls.Backward.Mode or Controls.Left.Mode or Controls.Right.Mode or Controls.Up.Mode or Controls.Down.Mode then
Sounds.Idle:Stop()
Sounds.Flying:Play()
end
end
elseif Action == "KeyUp" then
if not TakingOff then
for i, v in pairs(Controls) do
if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
v.Mode = false
end
end
if not Controls.Up.Mode and not Controls.Down.Mode then
BodyPosition.position = Engine.Position
BodyPosition.maxForce = Vector3.new(0, 100000000, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.velocity = Vector3.new(0, 0, 0)
end
if not Controls.Forward.Mode and not Controls.Backward.Mode and not Controls.Left.Mode and not Controls.Right.Mode and not Controls.Up.Mode and not Controls.Down.Mode then
Sounds.Flying:Stop()
Sounds.Idle:Play()
end
end
elseif Action == "Button1Down" then
if not BeamActive and not TakingOff then
BeamActive = true
if TemporaryBeam and TemporaryBeam.Parent then
TemporaryBeam:Destroy()
end
TemporaryBeam = Beam:Clone()
TemporaryBeam.Parent = Model
Spawn(function()
while TemporaryBeam and TemporaryBeam.Parent do
local Torsos = GetPartsInBeam(TemporaryBeam)
for i, v in pairs(Torsos) do
if v.Humanoid and v.Humanoid.Parent and v.Humanoid.Health > 0 and v.Torso and v.Torso.Parent and not v.Torso:FindFirstChild("UFOPullForce") and not v.Torso:FindFirstChild("UFOBalanceForce") then
local UFOPullForce = Instance.new("BodyVelocity")
UFOPullForce.Name = "UFOPullForce"
UFOPullForce.maxForce = Vector3.new(0, 1000000, 0)
UFOPullForce.velocity = CFrame.new(v.Torso.Position, BeamPart.Position).lookVector * 25
Debris:AddItem(UFOPullForce, 0.25)
UFOPullForce.Parent = v.Torso
local UFOBalanceForce = Instance.new("BodyGyro")
UFOBalanceForce.Name = "UFOBalanceForce"
UFOBalanceForce.maxTorque = Vector3.new(1000000, 0, 1000000)
Debris:AddItem(UFOBalanceForce, 0.25)
UFOBalanceForce.Parent = v.Torso
end
end
wait()
end
end)
local BeamWeld = Instance.new("Weld")
BeamWeld.Part0 = BeamPart
BeamWeld.Part1 = TemporaryBeam
Spawn(function()
Sounds.Beam:Play()
while Enabled and BeamActive and TemporaryBeam and TemporaryBeam.Parent do
local IgnoreTable = {Model}
for i, v in pairs(Players:GetChildren()) do
if v:IsA("Player") and v.Character then
table.insert(IgnoreTable, v.Character)
end
end
local BeamPartClone = BeamPart:Clone()
local BeamPartCloneY = BeamPartClone:Clone()
BeamPartCloneY.CFrame = BeamPartCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
BeamPartCloneY.CFrame = BeamPartCloneY.CFrame - BeamPartCloneY.CFrame.lookVector * ((BeamPart.Size.Y / 2))
local Hit, Position = RayCast(BeamPart.Position, BeamPartCloneY.CFrame.lookVector, BeamSize, IgnoreTable)
CurrentBeamSize = ((BeamPart.Position - Position).magnitude * 5)
TemporaryBeam.Mesh.Scale = Vector3.new(1, CurrentBeamSize, 1)
BeamWeld.Parent = TemporaryBeam
BeamWeld.C0 = CFrame.new(0, 0, 0) - Vector3.new(0, ((CurrentBeamSize / 2) + (BeamPart.Size.Y / 2)) / 5 , 0)
wait()
end
BeamActive = false
Sounds.Beam:Stop()
if TemporaryBeam and TemporaryBeam.Parent then
TemporaryBeam:Destroy()
end
end)
end
elseif Action == "Button1Up" then
BeamActive = false
end
end
end)
function ManageMotionStep(ForceLift, CoordinateFrame)
local CameraForwards = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 0, 1))
local CameraSideways = -CoordinateFrame:vectorToWorldSpace(Vector3.new(1, 0, 0))
local CameraRotation = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 1, 0))
CameraForwards = CameraForwards * Vector3.new(1, 0, 1)
CameraSideways = CameraSideways * Vector3.new(1, 0, 1)
if CameraForwards:Dot(CameraForwards) < 0.1 or CameraSideways:Dot(CameraSideways) < 0.1 then
return
end
CameraForwards = CameraForwards.unit
CameraSideways = CameraSideways.unit
if math.abs(Velocity.X) < 2 and math.abs(Velocity.Z) < 2 then
BodyVelocity.velocity = Vector3.new(0, 0, 0)
else
BodyVelocity.velocity = Velocity
end
BodyGyro.cframe = CFrame.new(0, 0, 0) * CFrame.Angles(Velocity:Dot(Vector3.new(0, 0, 1)) * (math.pi / 320), 0, math.pi - Velocity:Dot(Vector3.new(1, 0, 0)) * (math.pi / 320))
if Controls.Forward.Mode and (not Controls.Backward.Mode) and Velocity:Dot(CameraForwards) < MaxVelocity then
Velocity = Velocity + Acceleration * CameraForwards
elseif Controls.Backward.Mode and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > MinVelocity then
Velocity = Velocity - Deceleration * CameraForwards
elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > 0 then
Velocity = Velocity - AutoDeceleration * CameraForwards
elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) < 0 then
Velocity = Velocity + AutoDeceleration * CameraForwards
end
if Controls.Left.Mode and (not Controls.Right.Mode) and Velocity:Dot(CameraSideways) < MaxSideVelocity then
Velocity = Velocity + SideAcceleration * CameraSideways
elseif Controls.Right.Mode and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > MinSideVelocity then
Velocity = Velocity - SideDeceleration * CameraSideways
elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > 0 then
Velocity = Velocity - AutoSideDeceleration * CameraSideways
elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) < 0 then
Velocity = Velocity + AutoSideDeceleration * CameraSideways
end
if ForceLift then
RiseVelocity.velocity = Vector3.new(0, LiftOffSpeed, 0)
else
if Controls.Up.Mode and (not Controls.Down.Mode) then
RiseVelocity.velocity = Vector3.new(0, LiftSpeed, 0)
BodyPosition.maxForce = Vector3.new(0, 0, 0)
elseif Controls.Down.Mode and (not Controls.Up.Mode) then
RiseVelocity.velocity = Vector3.new(0, LowerSpeed, 0)
BodyPosition.maxForce = Vector3.new(0, 0, 0)
end
end
end
function MotionManager()
Spawn(function()
TakingOff = true
RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
local StartTime = tick()
Sounds.TakingOff:Play()
while Enabled and PlayerConnection and (tick() - StartTime) < 3 do
local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
ManageMotionStep(true, CoordinateFrame)
wait()
end
TakingOff = false
Sounds.TakingOff:Stop()
while PlayerConnection and (Enabled or Velocity:Dot(Velocity) > 0.5) do
local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
ManageMotionStep(false, CoordinateFrame)
wait()
end
end)
end
function LiftOff()
BodyGyro.maxTorque = Vector3.new(1000000, 1000000, 1000000)
BodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000)
Velocity = Vector3.new(0, 0, 0)
Enabled = true
MotionManager()
end
function Equipped(Player)
local Backpack = Player:FindFirstChild("Backpack")
if Backpack then
InUse = true
PlayerUsing = Player
PlayerControlScript = ControlScript:Clone()
local RemoteController = Instance.new("ObjectValue")
RemoteController.Name = "RemoteController"
RemoteController.Value = RemoteConnection
RemoteController.Parent = PlayerControlScript
local VehicleSeat = Instance.new("ObjectValue")
VehicleSeat.Name = "VehicleSeat"
VehicleSeat.Value = Seat
VehicleSeat.Parent = PlayerControlScript
PlayerConnection = Instance.new("RemoteFunction")
PlayerConnection.Name = "PlayerConnection"
PlayerConnection.Parent = PlayerControlScript
PlayerControlScript.Disabled = false
PlayerControlScript.Parent = Backpack
LiftOff()
end
end
function Unequipped()
if PlayerControlScript and PlayerControlScript.Parent then
PlayerControlScript:Destroy()
end
Enabled = false
PlayerControlScript = nil
PlayerUsing = nil
PlayerConnection = nil
BeamActive = false
TakingOff = false
InUse = false
BodyGyro.maxTorque = Vector3.new(0, 0, 0)
BodyPosition.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.velocity = Vector3.new(0, 0, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.velocity = Vector3.new(0, 0, 0)
for i, v in pairs(Controls) do
v.Mode = false
end
end
function Flip()
local EngineCloneY = Engine:Clone()
EngineCloneY.CFrame = EngineCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
if EngineCloneY.CFrame.lookVector.Y < 0.707 then
FlipGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), Vector3.new(0, 1, 0)) * CFrame.Angles((-math.pi / 2), 0, 0)
FlipGyro.maxTorque = Vector3.new(FlipForce, FlipForce, FlipForce)
wait(2)
FlipGyro.maxTorque = Vector3.new(0,0,0)
end
end
Seat.ChildAdded:connect(function(Child)
if Child:IsA("Weld") and Child.Name == "SeatWeld" then
if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
if Player then
Equipped(Player)
end
end
end
end)
Seat.ChildRemoved:connect(function(Child)
if Child:IsA("Weld") and Child.Name == "SeatWeld" then
if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
if Player and Player == PlayerUsing then
Unequipped(Player)
end
end
end
end)
Spawn(function()
while true do
Flip()
wait(5)
end
end)
|
-- #endif
--]] |
f.is_vararg = f.is_vararg + self.VARARG_ISVARARG
else
luaX:syntaxerror(ls, "<name> or "..self:LUA_QL("...").." expected")
end
until f.is_vararg ~= 0 or not self:testnext(ls, ",")
end--if
self:adjustlocalvars(ls, nparams)
-- NOTE: the following works only when HASARG_MASK is 2!
f.numparams = fs.nactvar - (f.is_vararg % self.HASARG_MASK)
luaK:reserveregs(fs, fs.nactvar) -- reserve register for parameters
end
|
--[=[
@within Touch
@prop TouchTapInWorld Signal<(position: Vector2, processed: boolean)>
@tag Event
Proxy for [UserInputService.TouchTapInWorld](https://developer.roblox.com/en-us/api-reference/event/UserInputService/TouchTapInWorld).
]=]
--[=[
@within Touch
@prop TouchPan Signal<(touchPositions: {Vector2}, totalTranslation: Vector2, velocity: Vector2, state: Enum.UserInputState, processed: boolean)>
@tag Event
Proxy for [UserInputService.TouchPan](https://developer.roblox.com/en-us/api-reference/event/UserInputService/TouchPan).
]=]
--[=[
@within Touch
@prop TouchPinch Signal<(touchPositions: {Vector2}, scale: number, velocity: Vector2, state: Enum.UserInputState, processed: boolean)>
@tag Event
Proxy for [UserInputService.TouchPinch](https://developer.roblox.com/en-us/api-reference/event/UserInputService/TouchPinch).
]=] | |
-- This script gets placed into StarterPlayerScripts where it will locally play the background music for each player. |
local plr = game.Players.LocalPlayer
local char
local torso
local container = game.ReplicatedStorage:WaitForChild("CinderingBGM")
local settings = require(container:WaitForChild("Settings"))
local musicfolder = container:WaitForChild("MusicFolder")
local globalfolder = musicfolder:WaitForChild("GlobalMusic")
local zonesfolder = musicfolder:WaitForChild("MusicZones")
local servercount = container:WaitForChild("ObjectCount").Value
function GetMatchingCount() --objects can take some time to actually replicate to the client. make sure that the client sees the correct # of objects in the music folder before initializing the rest of the script
local count = 0
local function recurse(instance)
for _,v in pairs(instance:GetChildren()) do
count = count + 1
recurse(v)
end
end
recurse(musicfolder)
if count == servercount then return true end
end
while not GetMatchingCount() do
wait(.5)
end
function IsCleanRotation(v3values) --check to see whether the rotation is at clean 90 degree increments so we can use the more simplistic calculations for it
for _,v in pairs(v3values) do
if not (v%90 <= 0.01 or v%90 >= 89.99) then --why not just check for (v%90 == 0)? because rotations can suffer from floating point inaccuracies
return false
end
end
return true
end
|
-------- OMG HAX |
r = game:service("RunService")
Tool = script.Parent
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = 2 -- things float at > 1
local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil
function recursiveGetLift(node)
local m = 0
local c = node:GetChildren()
for i=1,#c do
if c[i].className == "Part" then
if c[i].Name == "Handle" then
m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
else
m = m + (c[i]:GetMass() * equalizingForce * gravity)
end
end
m = m + recursiveGetLift(c[i])
end
return m
end
function onMassChanged(child, char)
print("Mass changed:" .. child.Name .. " " .. char.Name)
if (ghostEffect ~= nil) then
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
end
end
function UpdateGhostState(isUnequipping)
if isUnequipping == true then
ghostEffect:Remove()
ghostEffect = nil
massCon1:disconnect()
massCon2:disconnect()
else
if ghostEffect == nil then
local char = Tool.Parent
if char == nil then return end
ghostEffect = Instance.new("BodyForce")
ghostEffect.Name = "GravityCoilEffect"
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
ghostEffect.Parent = char.Head
ghostChar = char
massCon1 = char.ChildAdded:connect(function(child) onMassChanged(child, char) end)
massCon2 = char.ChildRemoved:connect(function(child) onMassChanged(child, char) end)
end
end
end
function onEquipped()
Tool.Handle.CoilSound:Play()
UpdateGhostState(false)
end
function onUnequipped()
UpdateGhostState(true)
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
|
-- Decompiled with the Synapse X Luau decompiler. |
local l__LocalPlayer__1 = game:GetService("Players").LocalPlayer;
local l__SoundService__1 = game:GetService("SoundService");
if l__LocalPlayer__1.Character then
l__SoundService__1:SetListener(Enum.ListenerType.ObjectPosition, (l__LocalPlayer__1.Character:WaitForChild("Head")));
end;
l__LocalPlayer__1.CharacterAdded:connect(function(p1)
l__SoundService__1:SetListener(Enum.ListenerType.ObjectPosition, (p1:WaitForChild("Head")));
end);
|
-- * Fires when the local player's MouseButton1 interacts with the
-- `ExitButton` GUI. Sets `Interacting` BoolValue to false.
--
-- Arguments: None
-- Return: None
-- * |
function hide()
MainFrame.Visible = false
InteractionButton.Visible = false
-- Unfreeze the player
humanoid.WalkSpeed = prevWalkSpeed or humanoid.WalkSpeed
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
end
function show()
MainFrame.Visible = true
InteractionButton.Visible = false
-- Freeze the player
prevWalkSpeed = humanoid.WalkSpeed
humanoid.WalkSpeed = 0
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
end |
--[[
Thumbs up;
Favorite;
Friend me;
Donation?
@CLIMAXIMUS
--]] | |
--[[
Creates a function that invokes a callback with correct error handling and
resolution mechanisms.
]] |
local function createAdvancer(traceback, callback, resolve, reject)
return function(...)
local ok, resultLength, result = runExecutor(traceback, callback, ...)
if ok then
resolve(unpack(result, 1, resultLength))
else
reject(result[1])
end
end
end
local function isEmpty(t)
return next(t) == nil
end
local Promise = {
Error = Error,
Status = makeEnum("Promise.Status", {"Started", "Resolved", "Rejected", "Cancelled"}),
_getTime = os.clock,
_timeEvent = game:GetService("RunService").Heartbeat,
_unhandledRejectionCallbacks = {},
}
Promise.prototype = {}
Promise.__index = Promise.prototype
|
--handler:FireServer("stopSound",Your sound here) |
wait()
handler:FireServer("playSound",bike.DriveSeat.Rev) |
--[[ todo: player animations when entering vehicle
--Get in a seat
local function enterStart()
--Wait until player lets go of button (causing them to get in) or seat out of range (nothing happens)
while EnterKeyDown and AdornedSeat do
wait()
end
if AdornedSeat then
--Tell server we are getting in seat
Remotes.GetInSeat:FireServer(AdornedSeat)
local n = 0
repeat
wait()
n = n + 1
until AdornedSeat == nil or n>20
EnterImageButton.Visible = true
local hum = getLocalHumanoid()
if hum then
if hum.Sit then
-- load animations only when player is in the vehicle
local hum = getLocalHumanoid()
if hum ~= currentHumanoid then -- load only when we have a new humanoid
currentHumanoid = hum
local anims = animationFolder:GetChildren()
for i = 1, #anims do
AnimationTracks[anims[i].Name] = hum:LoadAnimation(anims[i])
end
end
-- play seated animation
local seat = hum.SeatPart
local prefix = (seat.ClassName == "VehicleSeat" and "Driver" or "Passenger")
local preferredAnimation = AnimationTracks[prefix.."_Seated"]
if preferredAnimation then
preferredAnimation.Priority = Enum.AnimationPriority.Action
preferredAnimation:Play()
end
end
end
end
end
]] | --
|
--[[Susupension]] |
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 400 -- Spring Dampening
Tune.FSusStiffness = 17000 -- Spring Force
Tune.FSusLength = .8 -- Resting Suspension length (in studs)
Tune.FSusMaxExt = .15 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .05 -- Max Compression Travel (in studs)
Tune.FSusAngle = 75 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 6 -- Wishbone Length
Tune.FWsBoneAngle = 3 -- 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 = 400 -- Spring Dampening
Tune.RSusStiffness = 17000 -- Spring Force
Tune.RSusLength = .8 -- Resting Suspension length (in studs)
Tune.RSusMaxExt = .15 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .05 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- 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 = false -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Really red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 8 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[[
defib.OnServerEvent:Connect(function(player)
local Human = player.Character.Humanoid
local enabled = Human.Parent.Saude.Variaveis.Doer
local Sangrando = Human.Parent.Saude.Stances.Sangrando
local MLs = Human.Parent.Saude.Variaveis.MLs
local Caido = Human.Parent.Saude.Stances.Caido
local Ferido = Human.Parent.Saude.Stances.Ferido
local bbleeding = Human.Parent.Saude.Stances.bbleeding
local o2l = Human.Parent.Saude.Stances.o2
local isdead = Human.Parent.Saude.Stances.rodeath
local Bandagens = Human.Parent.Saude.Kit.defib
if enabled.Value == false then
if Bandagens.Value >= 1 and o2l.Value == true and isdead.Value == true then
enabled.Value = true
wait(4)
isdead.Value = false
Caido.Value = false
Human.Health = Human.Health + 100
wait(1)
enabled.Value = false
end
end
end)
]] | --
Splint.OnServerEvent:Connect(function(player)
local Human = player.Character.Humanoid
local enabled = Human.Parent.Saude.Variaveis.Doer
local Sangrando = Human.Parent.Saude.Stances.Sangrando
local MLs = Human.Parent.Saude.Variaveis.MLs
local Caido = Human.Parent.Saude.Stances.Caido
local Ferido = Human.Parent.Saude.Stances.Ferido
local Bandagens = Human.Parent.Saude.Kit.Splint
if enabled.Value == false and Caido.Value == false then
if Bandagens.Value >= 1 and Ferido.Value == true then
enabled.Value = true
wait(.3)
Ferido.Value = false
Bandagens.Value = Bandagens.Value - 1
wait(2)
enabled.Value = false
end
end
end)
PainKiller.OnServerEvent:Connect(function(player)
local Human = player.Character.Humanoid
local enabled = Human.Parent.Saude.Variaveis.Doer
local Sangrando = Human.Parent.Saude.Stances.Sangrando
local MLs = Human.Parent.Saude.Variaveis.MLs
local Dor = Human.Parent.Saude.Variaveis.Dor
local Caido = Human.Parent.Saude.Stances.Caido
local Ferido = Human.Parent.Saude.Stances.Ferido
local Bandagens = Human.Parent.Saude.Kit.Aspirina
if enabled.Value == false and Caido.Value == false then
if Bandagens.Value >= 1 and Dor.Value >= 1 then
enabled.Value = true
wait(.3)
Dor.Value = Dor.Value - math.random(60,75)
Bandagens.Value = Bandagens.Value - 1
wait(2)
enabled.Value = false
end
end
end)
Energetic.OnServerEvent:Connect(function(player)
local Human = player.Character.Humanoid
local enabled = Human.Parent.Saude.Variaveis.Doer
local Sangrando = Human.Parent.Saude.Stances.Sangrando
local MLs = Human.Parent.Saude.Variaveis.MLs
local Dor = Human.Parent.Saude.Variaveis.Dor
local Caido = Human.Parent.Saude.Stances.Caido
local Ferido = Human.Parent.Saude.Stances.Ferido
local Bandagens = Human.Parent.Saude.Kit.Energetico
--local Energia = Human.Parent.Saude.Variaveis.Energia
if enabled.Value == false and Caido.Value == false and Bandagens.Value >= 1 then
if Human.Health < Human.MaxHealth then
enabled.Value = true
wait(.3)
Human.Health = Human.Health + (Human.MaxHealth/3)
--Energia.Value = Energia.Value + (Energia.MaxValue/3)
Bandagens.Value = Bandagens.Value - 1
wait(2)
enabled.Value = false
end
end
end)
Tourniquet.OnServerEvent:Connect(function(player)
local Human = player.Character.Humanoid
local enabled = Human.Parent.Saude.Variaveis.Doer
local Sangrando = Human.Parent.Saude.Stances.Sangrando
local MLs = Human.Parent.Saude.Variaveis.MLs
local Dor = Human.Parent.Saude.Variaveis.Dor
local Caido = Human.Parent.Saude.Stances.Caido
local Ferido = Human.Parent.Saude.Stances.Ferido
local Bandagens = Human.Parent.Saude.Kit.Tourniquet
if Human.Parent.Saude.Stances.Tourniquet.Value == false then
if enabled.Value == false and Bandagens.Value > 0 then
enabled.Value = true
wait(.3)
Human.Parent.Saude.Stances.Tourniquet.Value = true
Bandagens.Value = Bandagens.Value - 1
wait(2)
enabled.Value = false
end
else
if enabled.Value == false then
enabled.Value = true
wait(.3)
Human.Parent.Saude.Stances.Tourniquet.Value = false
Bandagens.Value = Bandagens.Value + 1
wait(2)
enabled.Value = false
end
end
end)
|
--[[Steering]] |
Tune.SteerInner = 70 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 70 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .05 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
--[[
CameraModule - This ModuleScript implements a singleton class to manage the
selection, activation, and deactivation of the current camera controller,
character occlusion controller, and transparency controller. This script binds to
RenderStepped at Camera priority and calls the Update() methods on the active
controller instances.
The camera controller ModuleScripts implement classes which are instantiated and
activated as-needed, they are no longer all instantiated up front as they were in
the previous generation of PlayerScripts.
2018 PlayerScripts Update - AllYourBlox
--]] |
local CameraModule = {}
CameraModule.__index = CameraModule
|
-- Endgame gui |
local endgameGui = EndgameGui.new()
local endgameGuiFrame = endgameGui:createFrame(Endgame)
return nil
|
--///////////////////////// Constructors
--////////////////////////////////////// |
function module.new()
local obj = setmetatable({}, methods)
obj.GuiObject = nil
obj.GuiObjects = {}
obj.ChannelTabs = {}
obj.NumTabs = 0
obj.CurPageNum = 0
obj.ScrollChannelsFrameLock = false
obj.AnimParams = {}
obj:InitializeAnimParams()
ChatSettings.SettingsChanged:connect(function(setting, value)
if (setting == "ChatChannelsTabTextSize") then
obj:ResizeChannelTabText(value)
end
end)
return obj
end
return module
|
--[[
Returns true if value exists in array.
Functions.SearchArray(
array, <-- |REQ| Array to search through
search, <-- |REQ| Search value
)
--]] |
return function(array, search)
--- Scan array
for _, value in ipairs(array) do
if value == search then
--- Matching value!
return true
end
end
--- No matching value
return false
end
|
--only works for R6 |
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
player.Character.Animate.walk.WalkAnim.AnimationId = "http://www.roblox.com/asset/?id=6866085991" -- Insert your animation's ID here or leave this one, I don't really care--
end)
end)
|
--[[
Change log:
09/18
Fixed checkbox mouseover sprite
Encapsulated checkbox creation into separate method
Fixed another checkbox issue
09/15
Invalid input is ignored instead of setting to default of that data type
Consolidated control methods and simplified them
All input goes through ToValue method
Fixed position of BrickColor palette
Made DropDown appear above row if it would otherwise exceed the page height
Cleaned up stylesheets
09/14
Made properties window scroll when mouse wheel scrolled
Object/Instance and Color3 data types handled properly
Multiple BrickColor controls interfering with each other fixed
Added support for Content data type
--]] |
wait(0.2)
local print = function(s)
print(tostring(s))
end
|
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- |
function onRunning(speed)
if speed > 0.01 then
local scale = 16.0
playAnimation("walk", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Running"
else
if emoteNames[currentAnim] == nil then
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
local scale = 5.0
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed > 1.00 then
local scale = 10.0
playAnimation("swim", 0.4, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Swimming"
else
playAnimation("swimidle", 0.4, Humanoid)
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
-- Tool Animation handling
local tool = getTool()
if tool and (tool.RequiresHandle or tool:FindFirstChild("Handle")) then
local animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
--------------------------UTIL LIBRARY------------------------------- |
local Utility = {}
do
local Signal = {}
function Signal.Create()
local sig = {}
local mSignaler = Instance.new('BindableEvent')
local mArgData = nil
local mArgDataCount = nil
function sig:fire(...)
mArgData = {...}
mArgDataCount = select('#', ...)
mSignaler:Fire()
end
function sig:connect(f)
if not f then error("connect(nil)", 2) end
return mSignaler.Event:connect(function()
f(unpack(mArgData, 1, mArgDataCount))
end)
end
function sig:wait()
mSignaler.Event:wait()
assert(mArgData, "Missing arg data, likely due to :TweenSize/Position corrupting threadrefs.")
return unpack(mArgData, 1, mArgDataCount)
end
return sig
end
Utility.Signal = Signal
function Utility.Create(instanceType)
return function(data)
local obj = Instance.new(instanceType)
for k, v in pairs(data) do
if type(k) == 'number' then
v.Parent = obj
else
obj[k] = v
end
end
return obj
end
end
local function clamp(low, high, num)
return math.max(math.min(high, num), low)
end
Utility.Clamp = clamp
local function ViewSizeX()
local camera = workspace.CurrentCamera
local x = camera and camera.ViewportSize.X or 0
local y = camera and camera.ViewportSize.Y or 0
if x == 0 then
return 1024
else
if x > y then
return x
else
return y
end
end
end
Utility.ViewSizeX = ViewSizeX
local function ViewSizeY()
local camera = workspace.CurrentCamera
local x = camera and camera.ViewportSize.X or 0
local y = camera and camera.ViewportSize.Y or 0
if y == 0 then
return 768
else
if x > y then
return y
else
return x
end
end
end
Utility.ViewSizeY = ViewSizeY
local function AspectRatio()
return ViewSizeX() / ViewSizeY()
end
Utility.AspectRatio = AspectRatio
local function FindChacterAncestor(part)
if part then
local humanoid = part:FindFirstChild("Humanoid")
if humanoid then
return part, humanoid
else
return FindChacterAncestor(part.Parent)
end
end
end
Utility.FindChacterAncestor = FindChacterAncestor
local function GetUnitRay(x, y, viewWidth, viewHeight, camera)
return camera:ScreenPointToRay(x, y)
end
Utility.GetUnitRay = GetUnitRay
local RayCastIgnoreList = workspace.FindPartOnRayWithIgnoreList
local function Raycast(ray, ignoreNonCollidable, ignoreList)
local ignoreList = ignoreList or {}
local hitPart, hitPos = RayCastIgnoreList(workspace, ray, ignoreList)
if hitPart then
if ignoreNonCollidable and hitPart.CanCollide == false then
table.insert(ignoreList, hitPart)
return Raycast(ray, ignoreNonCollidable, ignoreList)
end
return hitPart, hitPos
end
return nil, nil
end
Utility.Raycast = Raycast
Utility.Round = function(num, roundToNearest)
roundToNearest = roundToNearest or 1
return math.floor((num + roundToNearest/2) / roundToNearest) * roundToNearest
end
local function AveragePoints(positions)
local avgPos = Vector2.new(0,0)
if #positions > 0 then
for i = 1, #positions do
avgPos = avgPos + positions[i]
end
avgPos = avgPos / #positions
end
return avgPos
end
Utility.AveragePoints = AveragePoints
local function FuzzyEquals(numa, numb)
return numa + 0.1 > numb and numa - 0.1 < numb
end
Utility.FuzzyEquals = FuzzyEquals
local LastInput = 0
UIS.InputBegan:connect(function(inputObject, wasSunk)
if not wasSunk then
if inputObject.UserInputType == Enum.UserInputType.Touch or
inputObject.UserInputType == Enum.UserInputType.MouseButton1 or
inputObject.UserInputType == Enum.UserInputType.MouseButton2 then
LastInput = tick()
end
end
end)
Utility.GetLastInput = function()
return LastInput
end
end
local humanoidCache = {}
local function findPlayerHumanoid(player)
local character = player and player.Character
if character then
local resultHumanoid = humanoidCache[player]
if resultHumanoid and resultHumanoid.Parent == character then
return resultHumanoid
else
humanoidCache[player] = nil -- Bust Old Cache
for _, child in pairs(character:GetChildren()) do
if child:IsA('Humanoid') then
humanoidCache[player] = child
return child
end
end
end
end
end
local function CFrameInterpolator(c0, c1) -- (CFrame from, CFrame to) -> (float theta, (float fraction -> CFrame between))
local fromAxisAngle = CFrame.fromAxisAngle
local components = CFrame.new().components
local inverse = CFrame.new().inverse
local v3 = Vector3.new
local acos = math.acos
local sqrt = math.sqrt
local invroot2 = 1 / math.sqrt(2)
-- The expanded matrix
local _, _, _, xx, yx, zx,
xy, yy, zy,
xz, yz, zz = components(inverse(c0)*c1)
-- The cos-theta of the axisAngles from
local cosTheta = (xx + yy + zz - 1)/2
-- Rotation axis
local rotationAxis = v3(yz-zy, zx-xz, xy-yx)
-- The position to tween through
local positionDelta = (c1.p - c0.p)
-- Theta
local theta;
-- Catch degenerate cases
if cosTheta >= 0.999 then
-- Case same rotation, just return an interpolator over the positions
return 0, function(t)
return c0 + positionDelta*t
end
elseif cosTheta <= -0.999 then
-- Case exactly opposite rotations, disambiguate
theta = math.pi
xx = (xx + 1) / 2
yy = (yy + 1) / 2
zz = (zz + 1) / 2
if xx > yy and xx > zz then
if xx < 0.001 then
rotationAxis = v3(0, invroot2, invroot2)
else
local x = sqrt(xx)
xy = (xy + yx) / 4
xz = (xz + zx) / 4
rotationAxis = v3(x, xy/x, xz/x)
end
elseif yy > zz then
if yy < 0.001 then
rotationAxis = v3(invroot2, 0, invroot2)
else
local y = sqrt(yy)
xy = (xy + yx) / 4
yz = (yz + zy) / 4
rotationAxis = v3(xy/y, y, yz/y)
end
else
if zz < 0.001 then
rotationAxis = v3(invroot2, invroot2, 0)
else
local z = sqrt(zz)
xz = (xz + zx) / 4
yz = (yz + zy) / 4
rotationAxis = v3(xz/z, yz/z, z)
end
end
else
-- Normal case, get theta from cosTheta
theta = acos(cosTheta)
end
-- Return the interpolator
return theta, function(t)
return c0*fromAxisAngle(rotationAxis, theta*t) + positionDelta*t
end
end |
-- In radians the minimum accuracy penalty |
local MinSpread = 0.01 |
--[[Manage Plugins]] |
script.Parent.Interface:WaitForChild("Bike").Value=bike
script.Parent.Interface:WaitForChild("Car").Value=bike
for i,v in pairs(script.Parent.Plugins:GetChildren()) do
for _,a in pairs(v:GetChildren()) do
if a:IsA("RemoteEvent") or a:IsA("RemoteFunction") then
a.Parent=bike
for _,b in pairs(a:GetChildren()) do
if b:IsA("Script") then b.Disabled=false end
end
end
end
v.Parent = script.Parent.Interface
end
script.Parent.Plugins:Destroy()
|
--[[
Hey, this script is all set up!
If you want you can modify it, if you know what your doing.
Contact me if you have any questions.
--qreet
UPDATE LOG
May 29|2018
--Added smoother loading
--Click noise
--]] | |
-- Functions |
players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local rootPart = character:WaitForChild("HumanoidRootPart")
local footstepsSound = Instance.new("Sound")
footstepsSound.Name = "Footsteps"
footstepsSound.RollOffMaxDistance = 22.5
footstepsSound.RollOffMode = Enum.RollOffMode.Linear
footstepsSound.PlayOnRemove = true
footstepsSound.Volume = 1.2
footstepsSound.Parent = rootPart
end)
end)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.