prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--Left lean |
XR15RightLegLeftLean = 0
YR15RightLegLeftLean = -.2
ZR15RightLegLeftLean = .3
R15RightKneeLeftLean = -.3
XR15RightArmLeftLean = .5
YR15RightArmLeftLean = -.3
ZR15RightArmLeftLean = .2
R15RightElbowLeftLean = .2
XR15LeftLegLeftLean = .5
YR15LeftLegLeftLean = .35
ZR15LeftLegLeftLean = .55
R15LeftKneeLeftLean = -.1
XR15LeftArmLeftLean = -.5
YR15LeftArmLeftLean = -.5
ZR15LeftArmLeftLean = -.72
R15LeftElbowLeftLean = -1.2
XR15LowerTorsoLeftLean = .3
YR15LowerTorsoLeftLean = -.3
ZR15LowerTorsoLeftLean = 0.1
ZR15UpperTorsoLeftLean = .2
|
-- Module Scripts |
local ModuleScripts = ServerScriptService:FindFirstChild("ModuleScripts")
local RaceModules = ModuleScripts:FindFirstChild("RaceModules")
local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local GameSettings = require(RaceModules:FindFirstChild("GameSettings"))
local LeaderboardManager = require(RaceModules:FindFirstChild("LeaderboardManager"))
local RaceManager = require(ReplicatedModuleScripts:FindFirstChild("RaceManager"))
local PlayerConverter = require(ReplicatedModuleScripts:FindFirstChild("PlayerConverter"))
|
--[[
]] |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Marketplace = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local AvatarEditor = ReplicatedStorage.AvatarEditor
local Spring = require(AvatarEditor.Shared.Util.Spring)
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Promise = require(AvatarEditor.Shared.Util.Promise)
local GuiLib = require(AvatarEditor.Client.GuiLib.LazyLoader)
local GetProductInfo = require(AvatarEditor.Shared.GetProductInfo)
local Theme = require(AvatarEditor.Client.Theme)
local player = Players.LocalPlayer
local Class = {}
Class.__index = Class
function Class.new(frame)
local self = setmetatable({}, Class)
self.Frame = frame
self.PurchaseFrame = self.Frame.Frame
self.CreateFrame = self.Frame.CreateOutfit
self.ConfirmFrame = self.Frame.Confirm
self.Maid = Maid.new()
self.Listeners = Maid.new()
for i, v in ipairs(frame:GetChildren()) do
if not v:IsA("Frame") then
continue
end
self.Maid:GiveTask(Theme:Bind(v, "BackgroundColor3", "Primary"))
self.Maid:GiveTask(Theme:Bind(v.Buttons.Button1, "BackgroundColor3", "Cancel"))
self.Maid:GiveTask(Theme:Bind(v.Buttons.Button1, "TextColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(v.Buttons.Button2, "BackgroundColor3", "Confirm"))
self.Maid:GiveTask(Theme:Bind(v.Buttons.Button2, "TextColor3", "Text"))
end
self.Maid:GiveTask(Theme:Bind(self.ConfirmFrame.Body.MessageLabel, "TextColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.ConfirmFrame.Body.TextLabel, "TextColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.ConfirmFrame.Body.TextLabel.Line, "BackgroundColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.CreateFrame.Body.TextLabel, "TextColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.CreateFrame.Body.TextLabel.Line, "BackgroundColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.CreateFrame.Body.Info.Search, "BackgroundColor3", "TabButton"))
self.Maid:GiveTask(Theme:Bind(self.CreateFrame.Body.Info.Search.TextBox, "PlaceholderColor3", "PlaceholderText"))
self.Maid:GiveTask(Theme:Bind(self.CreateFrame.Body.Info.Search.TextBox, "TextColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.PurchaseFrame.Body.ProductInfo.ItemPreviewImage.ItemPreviewImageContainer, "BackgroundColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.PurchaseFrame.Body.ProductInfo.ProductDescription.ProductDescriptionText, "TextColor3", "Text"))
self.Maid:GiveTask(Theme:Bind(self.PurchaseFrame.Body.AdditionalDetails, "TextColor3", "Text"))
self.TweenSpring = Spring.new(1)
self.TweenSpring.Damper = 1
self.TweenSpring.Speed = 20
for i, v in ipairs(frame:GetChildren()) do
if v:IsA("Frame") then
v.Visible = false
end
end
return self
end
function Class:OnRenderStep(delta)
local frame = self.Frame
local tweenSpring = self.TweenSpring
tweenSpring:TimeSkip(delta)
local pos = tweenSpring.Position
frame.BackgroundTransparency = 0.4 + pos * 0.6
frame.Visible = frame.BackgroundTransparency < 0.98
end
function Class:PromptPurchase(assetId)
local maid = self.Listeners
local frame = self.PurchaseFrame
local overlayButtons = frame.Buttons
local productInfoFrame = frame.Body.ProductInfo
local descriptionLabel = productInfoFrame.ProductDescription.ProductDescriptionText
local previewImage = productInfoFrame.ItemPreviewImage.ItemPreviewImageContainer.ItemImage
self:_setup(frame)
descriptionLabel.Text = ""
previewImage.Image = ""
overlayButtons.Button2.Text = "???"
local productInfoPromise = GetProductInfo(assetId)
productInfoPromise:andThen(function(productInfo)
descriptionLabel.Text = productInfo.Name
previewImage.Image = "rbxthumb://type=Asset&id=" .. productInfo.AssetId .. "&w=150&h=150"
if productInfo.IsPublicDomain then
overlayButtons.Button2.Text = "Free"
elseif productInfo.IsForSale then
overlayButtons.Button2.Text = productInfo.PriceInRobux .. " Robux"
else
overlayButtons.Button2.Text = "Offsale"
end
maid:GiveTask(overlayButtons.Button2.Activated:Connect(function(inputObject)
Marketplace:PromptPurchase(player, assetId)
maid:DoCleaning()
end))
end)
:catch(warn)
maid:GiveTask(function()
productInfoPromise:cancel()
descriptionLabel.Text = ""
previewImage.Image = ""
overlayButtons.Button2.Text = "???"
end)
end
function Class:PromptCostume(callback)
local maid = self.Listeners
local frame = self.CreateFrame
local overlayButtons = frame.Buttons
local textBox = frame.Body.Info.Search.TextBox
self:_setup(frame)
frame.Body.Info.TextLabel.Visible = false -- TODO error messages?
local mask = GuiLib.Classes.TextMask.new(textBox)
maid:GiveTask(mask)
mask:SetMaskType("Alphanumberic")
mask:SetMaxLength(20)
local function onFocusLost()
if textBox.Text ~= "" then
callback(textBox.Text)
maid:DoCleaning()
end
end
maid:GiveTask(mask.Frame.FocusLost:Connect(function(enterPressed, inputThatCausedFocusLoss)
if not enterPressed then
return
end
onFocusLost()
end))
maid:GiveTask(overlayButtons.Button2.Activated:Connect(function(inputObject)
onFocusLost()
end))
maid:GiveTask(function()
textBox.Text = ""
end)
textBox:CaptureFocus()
end
function Class:PromptConfirm(configTable, callback)
local maid = self.Listeners
local frame = self.ConfirmFrame
local overlayButtons = frame.Buttons
frame.Body.TextLabel.Text = configTable.Title or "Confirm"
frame.Body.MessageLabel.Text = configTable.Text or "Are you sure you want to do this action?"
maid:GiveTask(overlayButtons.Button2.Activated:Connect(function(inputObject)
callback()
maid:DoCleaning()
end))
self:_setup(frame)
end
function Class:_setup(frame)
local maid = self.Listeners
local tweenSpring = self.TweenSpring
local overlayButtons = frame.Buttons
maid:GiveTask(overlayButtons.Button1.Activated:Connect(function(inputObject)
maid:DoCleaning()
end))
maid:GiveTask(frame.Parent.Activated:Connect(function(inputObject)
maid:DoCleaning()
end))
maid:GiveTask(function()
frame.Visible = false
tweenSpring.Target = 1
end)
frame.Visible = true
tweenSpring.Target = 0
end
function Class:Destroy()
self.Maid:DoCleaning()
self.Maid = nil
self.Listeners:DoCleaning()
self.Listeners = nil
self.Frame = nil
self.PurchaseFrame = nil
self.CreateFrame = nil
self.ConfirmFrame = nil
self.TweenSpring = nil
setmetatable(self, nil)
end
return Class
|
--// Delcarables |
local newRope = nil
local newDir = nil
local new = nil
local newAtt0 = nil
local newAtt1 = nil
local isHeld = false
local active = false
local TS = game:GetService("TweenService")
|
-- declarations |
local toolAnim = "None"
local toolAnimTime = 0
local jumpAnimTime = 0
local jumpAnimDuration = 0.3
local toolTransitionTime = 0.1
local fallTransitionTime = 0.3
local jumpMaxLimbVelocity = 0.75
|
-- model by CatLeoYT XD -- |
local Tool = script.Parent
local speedforsmoke = 10
local CoilSound = Tool.Handle:WaitForChild("CoilSound")
function MakeSmoke(HRP, Human)
smoke=Instance.new("Smoke")
smoke.Enabled=HRP.Velocity.magnitude>speedforsmoke
smoke.RiseVelocity=2
smoke.Opacity=.25
smoke.Size=.5
smoke.Parent=HRP
Human.Running:connect(function(speed)
if smoke and smoke~=nil then
smoke.Enabled=speed>speedforsmoke
end
end)
end
Tool.Equipped:connect(function()
local Handle = Tool:WaitForChild("Handle")
local HRP = Tool.Parent:FindFirstChild("HumanoidRootPart")
local Human = Tool.Parent:FindFirstChild("Humanoid")
CoilSound:Play()
Human.WalkSpeed = Human.WalkSpeed * Tool.SpeedBoostScript.SpeedMultiplier.Value
MakeSmoke(HRP, Human)
end)
Tool.Unequipped:connect(function()
local plrChar = Tool.Parent.Parent.Character
local HRP = plrChar.HumanoidRootPart
if HRP:FindFirstChild("Smoke") then
HRP.Smoke:Destroy()
end
plrChar.Humanoid.WalkSpeed = plrChar.Humanoid.WalkSpeed / Tool.SpeedBoostScript.SpeedMultiplier.Value
end)
|
--Wheelie tune |
local WheelieD = 5
local WheelieTq = 90
local WheelieP = 10
local WheelieMultiplier = 1.5
local WheelieDivider = 1
|
--Tune |
OverheatSpeed = .2 --How fast the car will overheat
CoolingEfficiency = .05 --How fast the car will cool down
RunningTemp = 85 --In degrees
Fan = true --Cooling fan
FanTemp = 100 --At what temperature the cooling fan will activate
FanTempAlpha = 90 --At what temperature the cooling fan will deactivate
FanSpeed = .03 --How fast the car will cool down
FanVolume = .2 --Sound volume
BlowupTemp = 130 --At what temperature the engine will blow up
GUI = true --GUI temperature gauge
|
--Suspension Hinges |
bike.RearSection.RearSwingArmHinge.Size = Vector3.new(_Tune.HingeSize,_Tune.HingeSize,_Tune.HingeSize)
bike.RearSection.RearSwingArmHinge.CustomPhysicalProperties = PhysicalProperties.new(_Tune.HingeDensity,0,0,100,100)
if _Tune.RBricksVisible or _Tune.Debug then bike.RearSection.RearSwingArmHinge.Transparency = .75 else bike.RearSection.RearSwingArmHinge.Transparency = 1 end
local rshinge = bike.RearSection.RearSwingArmHinge:Clone()
rshinge.Parent = bike.Body
rshinge.Name = "SwingArmHinge"
local rshingea = Instance.new("Attachment", rshinge)
local rshingeb = Instance.new("Attachment", bike.RearSection.RearSwingArmHinge)
local rshingec = Instance.new("HingeConstraint", rshinge)
rshingec.Attachment0 = rshingea
rshingec.Attachment1 = rshingeb
|
--------| Reference |-------- |
local isClient = game:GetService("RunService"):IsClient()
|
--// Char Parts |
local Humanoid = Personagem:WaitForChild('Humanoid')
local Head = Personagem:WaitForChild('Head')
local Torso = Personagem:WaitForChild('Torso')
local HumanoidRootPart = Personagem:WaitForChild('HumanoidRootPart')
local RootJoint = HumanoidRootPart:WaitForChild('RootJoint')
local Neck = Torso:WaitForChild('Neck')
local Right_Shoulder = Torso:WaitForChild('Right Shoulder')
local Left_Shoulder = Torso:WaitForChild('Left Shoulder')
local Right_Hip = Torso:WaitForChild('Right Hip')
local Left_Hip = Torso:WaitForChild('Left Hip')
local Connections = {}
local Debris = game:GetService("Debris")
local Ignore_Model = ACS_Storage:FindFirstChild("Server")
local BulletModel = ACS_Storage:FindFirstChild("Client")
local IgnoreList = {"Ignorable","Glass"}
local Ray_Ignore = {Character, Ignore_Model, Camera, BulletModel, IgnoreList}
Camera.CameraType = Enum.CameraType.Custom
Camera.CameraSubject = Humanoid
|
-- all the tweens currently being updated |
local allTweens: Set<Tween> = {}
setmetatable(allTweens, WEAK_KEYS_METATABLE)
|
-- Spawn a new firefly from the center when one flew too far |
local Model = script.Parent
local Fly = Model.FireFly:Clone() -- Clone a fly from the start
Model.ChildRemoved:connect(function() -- When a fly got removed when he flew too far, paste a clone to spawn a new one
if Model:FindFirstChild("Center") then
local newFly = Fly:Clone()
newFly.Position = Model.Center.CenterPart.Position
newFly.Parent = Model
end
end) |
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 140 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6980 -- Use sliders to manipulate values
Tune.Redline = 8000 -- 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)
|
-- Updates that occur in the render phase are not officially supported. But when
-- they do occur, we defer them to a subsequent render by picking a lane that's
-- not currently rendering. We treat them the same as if they came from an
-- interleaved event. Remove this flag once we have migrated to the
-- new behavior. |
exports.deferRenderPhaseUpdateToNextBatch = false
|
--[[**
ensures value is a number where min <= value <= max
@param min The minimum to use
@param max The maximum to use
@returns A function that will return true iff the condition is passed
**--]] |
function t.numberConstrained(min, max)
assert(t.number(min) and t.number(max))
local minCheck = t.numberMin(min)
local maxCheck = t.numberMax(max)
return function(value)
local minSuccess, minErrMsg = minCheck(value)
if not minSuccess then
return false, minErrMsg or ""
end
local maxSuccess, maxErrMsg = maxCheck(value)
if not maxSuccess then
return false, maxErrMsg or ""
end
return true
end
end
|
--Loop For Making Rays For The Bullet's Trajectory |
for i = 1, 30 do
local thisOffset = offset + Vector3.new(0, yOffset*(i-1), 0)
local travelRay = Ray.new(point1,thisOffset)
local hit, position = workspace:FindPartOnRay(travelRay, parts.Parent)
local distance = (position - point1).magnitude
round.Size = Vector3.new(.6, distance, .6)
round.CFrame = CFrame.new(position, point1)
* CFrame.new(0, 0, -distance/2)
* CFrame.Angles(math.rad(90),0,0)
round.Parent = workspace
point1 = point1 + thisOffset
if hit then
round:remove()
local e = Instance.new("Explosion")
e.BlastRadius = 5
e.BlastPressure = 0
e.Position = position
e.Parent = workspace
e.DestroyJointRadiusPercent = 0
if hit and hit.Parent then
if hit.Parent:FindFirstChild("Humanoid") then
return hit.Parent.Humanoid
elseif hit.Parent.Parent:FindFirstChild("Humanoid") then
return hit.Parent.Parent.Humanoid
elseif (hit.Parent.Name == "Hull") or (hit.Parent.Name == "Turret") or (hit.Parent.Name == "Gun") or (hit.Parent.Name == "Parts") then
print("You Have Damaged a Vehicle")
local HitSound = hit.Parent:findFirstChild("Pen"):Clone()
HitSound.Parent = hit
HitSound:Play()
hit.Parent.Parent:findFirstChild("Damage").Value = hit.Parent.Parent:findFirstChild("Damage").Value - dealingdamage
if hit.Parent.Parent:findFirstChild("Damage").Value<1 and hit.Parent.Parent:findFirstChild("Destroyed").Value == false then
local DestroyScript = hit.Parent.Parent:findFirstChild("DestroyScript"):clone()
DestroyScript.Parent = hit.Parent.Parent
DestroyScript.Disabled = false
print("Vehicle Disabled")
end
elseif hit.Name == "Left Arm" or hit.Name == "Left Leg" or hit.Name == "Right Arm" or hit.Name == "Right Leg" or hit.Name == "Torso" or hit.Name == "HumanoidRootPart" then
hit.Parent:findFirstChild("Humanoid").Health = hit.Parent:findFirstChild("Humanoid").Health - dealingdamage
print("Direct Hit a Player lmao")
elseif hit.Parent.Name == "Face" then
hit.Parent.Parent:findFirstChild("Humanoid").Health = hit.Parent.Parent:findFirstChild("Humanoid").Health - dealingdamage
print("Direct Hit a Morph of a Player lmao")
elseif (hit.Parent.Name == "Full") or (hit.Parent.Name == "Damage") then
hit.Parent.Parent:FindFirstChild("Stats").Health.Value = hit.Parent.Parent:FindFirstChild("Stats").Health.Value - 1
end
end
local players = game.Players:getChildren()
for i = 1, #players do
-- if players[i].TeamColor ~= script.Parent.Parent.Tank.Value then --if he's not an ally
character = players[i].Character
torso = character:findFirstChild'Torso'
if character and torso then
torsoPos = torso.Position
origPos = round.Position
local ray = Ray.new(origPos, torsoPos-origPos)
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignoreList)
if hit then
if hit.Parent == character then
human = hit.Parent:findFirstChild("Humanoid")
human2 = hit.Parent.Parent:findFirstChild("Humanoid")
if human then
distance = (position-origPos).magnitude |
--[=[
@return boolean
@param opt Option
Metamethod to check equality between two options. Returns `true` if both
options hold the same value _or_ both options are None.
```lua
local o1 = Option.Some(32)
local o2 = Option.Some(32)
local o3 = Option.Some(64)
local o4 = Option.None
local o5 = Option.None
print(o1 == o2) --> true
print(o1 == o3) --> false
print(o1 == o4) --> false
print(o4 == o5) --> true
```
]=] |
function Option:__eq(opt)
if Option.Is(opt) then
if self:IsSome() and opt:IsSome() then
return (self:Unwrap() == opt:Unwrap())
elseif self:IsNone() and opt:IsNone() then
return true
end
end
return false
end
|
--[[
Package link auto-generated by Rotriever
]] |
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["JestTestResult"]["JestTestResult"])
export type AggregatedResult = Package.AggregatedResult
export type AssertionLocation = Package.AssertionLocation
export type AssertionResult = Package.AssertionResult
export type FailedAssertion = Package.FailedAssertion
export type FormattedTestResults = Package.FormattedTestResults
export type Milliseconds = Package.Milliseconds
export type RuntimeTransformResult = Package.RuntimeTransformResult
export type SerializableError = Package.SerializableError
export type Snapshot = Package.Snapshot
export type SnapshotSummary = Package.SnapshotSummary
export type Status = Package.Status
export type Suite = Package.Suite
export type Test = Package.Test
export type TestEvents = Package.TestEvents
export type TestFileEvent = Package.TestFileEvent
export type TestResult = Package.TestResult
export type TestResultsProcessor = Package.TestResultsProcessor
export type TestCaseResult = Package.TestCaseResult
export type V8CoverageResult = Package.V8CoverageResult
return Package
|
--[[Transmission]] |
Tune.TransModes = {"Auto"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- ROBLOX deviation: skipped
-- Expect.extractExpectedAssertionsErrors = extractExpectedAssertionsErrors | |
--[[[Default Controls]] |
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = Enum.KeyCode.R ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
--------------------------------------------------- |
function module:CreateRanks()
coroutine.wrap(function()
local ranksInfo = main.signals.RetrieveRanksInfo:InvokeServer()
local permRanksInfo = ranksInfo.PermRanks
local ranksToSort = ranksInfo.Ranks
local permissions = ranksInfo.Permissions
--Organise ranks
local rankPositions = {}
local ranks = {}
for i, rankDetails in pairs(ranksToSort) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
table.insert(ranks, 1, {rankId, rankName, {}})
end
for i,v in pairs(ranks) do
rankPositions[v[1]] = i
end
for pName, pDetails in pairs(permissions) do
--Owner
if pName == "owner" and rankPositions[8] then
local ownerRankDetail = ranks[rankPositions[8]]
table.insert(ownerRankDetail[3], {main.ownerName, "Owner", main:GetModule("cf"):GetUserImage(main.ownerId)})
--SpecificUsers and PermRanks
elseif pName == "specificusers" then
for plrName, rankId in pairs(pDetails) do
if #plrName > 1 then
local rankDetail = ranks[rankPositions[rankId]]
local boxInfo = {plrName, "Specific User", main:GetModule("cf"):GetUserImage(main:GetModule("cf"):GetUserId(plrName))}
table.insert(rankDetail[3], boxInfo)
end
end
for i, record in pairs(permRanksInfo) do
if not record.RemoveRank then
local rankDetail = ranks[rankPositions[record.Rank]]
if rankDetail then
local boxInfo = {main:GetModule("cf"):GetName(record.UserId), "PermRank", main:GetModule("cf"):GetUserImage(record.UserId), record}
table.insert(rankDetail[3], boxInfo)
end
end
end
elseif pName == "gamepasses" then
--Gamepasses
for gamepassId, gamepassInfo in pairs(pDetails) do
if not main:GetModule("cf"):FindValue(main.products, gamepassId) then
local rankDetail = ranks[rankPositions[gamepassInfo.Rank]]
if rankDetail then
local boxInfo = {gamepassInfo.Name, "Gamepass", gamepassInfo.IconImageAssetId, tonumber(gamepassId), gamepassInfo.PriceInRobux}
table.insert(rankDetail[3], boxInfo)
end
end
end
elseif pName == "assets" then
--Assets
for assetId, assetInfo in pairs(pDetails) do
local rankDetail = ranks[rankPositions[assetInfo.Rank]]
if rankDetail then
local boxInfo = {assetInfo.Name, "Asset", main:GetModule("cf"):GetAssetImage(assetId), tonumber(assetId), assetInfo.PriceInRobux}
table.insert(rankDetail[3], boxInfo)
end
end
elseif pName == "groups" then
--Groups
for groupId, groupInfo in pairs(pDetails) do
for roleName, roleInfo in pairs(groupInfo.Roles) do
if roleInfo.Rank then
local rankDetail = ranks[rankPositions[roleInfo.Rank]]
if rankDetail then
local boxInfo = {groupInfo.Name.." | "..roleName, "Group", groupInfo.EmblemUrl, tonumber(groupId)}
table.insert(rankDetail[3], boxInfo)
end
end
end
end
elseif otherPermissions[pName] then
--Other
local info = otherPermissions[pName]
local rank = permissions[info[1]]
if rank > 0 then
local rankDetail = ranks[rankPositions[rank]]
if rankDetail then
local boxInfo = {info[2], info[3], string.upper(string.sub(info[1], 1, 1))}
table.insert(rankDetail[3], boxInfo)
end
end
end
end
--Can view PermRank menu
local canModifyPermRanks = false
if main.pdata.Rank >= (main.commandRanks.permrank or 4) then
canModifyPermRanks = true
end
--Clear labels
main:GetModule("cf"):ClearPage(pages.ranks)
--Setup labels
local labelCount = 0
for i,v in pairs(ranks) do
local rankId = v[1]
local rankName = v[2]
local boxes = v[3]
--
labelCount = labelCount + 1
local rankTitle = templates.rankTitle:Clone()
rankTitle.Name = "Label".. labelCount
rankTitle.RankIdFrame.TextLabel.Text = rankId
rankTitle.RankName.Text = rankName
rankTitle.Visible = true
rankTitle.Parent = pages.ranks
--
for _, boxInfo in pairs(boxes) do
labelCount = labelCount + 1
local boxTitle = boxInfo[1]
local boxDesc = boxInfo[2]
local boxImage = boxInfo[3]
local rankItem = templates.rankItem:Clone()
rankItem.Name = "Label".. labelCount
rankItem.ItemTitle.Text = boxTitle
rankItem.ItemDesc.Text = boxDesc
if #tostring(boxImage) == 1 then
rankItem.ItemIcon.Text = boxImage
rankItem.ItemIcon.Visible = true
rankItem.ItemImage.Visible = false
else
if tonumber(boxImage) then
boxImage = "rbxassetid://"..boxImage
end
rankItem.ItemImage.Image = tostring(boxImage)
end
local xScale = 0.7
rankItem.Unlock.Visible = false
rankItem.ViewMore.Visible = false
if boxDesc == "Gamepass" or boxDesc == "Asset" then
local productId = boxInfo[4]
local productPrice = boxInfo[5]
rankItem.ItemImage.BackgroundTransparency = 1
rankItem.Unlock.Visible = true
rankItem.Unlock.MouseButton1Down:Connect(function()
buyFrame.ProductName.Text = boxTitle
buyFrame.ProductImage.Image = boxImage
buyFrame.PurchaseToUnlock.TextLabel.Text = rankName
buyFrame.InGame.TextLabel.Text = main.gameName
buyFrame.MainButton.Price.Text = (productPrice or 0).." "
buyFrame.MainButton.ProductId.Value = productId
buyFrame.MainButton.ProductType.Value = boxDesc
main:GetModule("cf"):ShowWarning("BuyFrame")
end)
xScale = 0.4
elseif boxDesc == "PermRank" then
local record = boxInfo[4]
if canModifyPermRanks then
local viewMore = rankItem.ViewMore
viewMore.Visible = true
viewMore.MouseButton1Down:Connect(function()
main:GetModule("cf"):ShowPermRankedUser{boxTitle, record.UserId, record.RankedBy}
end)
end
xScale = 0.6
else
xScale = 0.7
end
rankItem.ItemTitle.Size = UDim2.new(xScale, 0, rankItem.ItemTitle.Size.Y.Scale, 0)
rankItem.ItemDesc.Size = UDim2.new(xScale, 0, rankItem.ItemDesc.Size.Y.Scale, 0)
rankItem.Visible = true
rankItem.Parent = pages.ranks
end
end
--Canvas Size
if labelCount >= 2 then
for i = 1,2 do
local firstLabel = pages.ranks["Label1"]
local finalLabel = pages.ranks["Label".. labelCount]
pages.ranks.CanvasSize = UDim2.new(0, 0, 0, (finalLabel.AbsolutePosition.Y + finalLabel.AbsoluteSize.Y - firstLabel.AbsolutePosition.Y))
end
end
end)()
end
|
-- requiredArguments is a set of keys that must be mapped to non-nil values in arguments
-- optionalArguments is a mapping of optional keys in arguments to their default values |
return function(arguments, requiredArguments, optionalArguments)
for key, _ in pairs(requiredArguments) do
if arguments[key] == nil then
error("Did not provide required argument " .. key)
end
end
if optionalArguments then
for key, defaultValue in pairs(optionalArguments) do
if arguments[key] == nil then
arguments[key] = defaultValue
end
end
end
for key in pairs(arguments) do
if requiredArguments[key] == nil and ((not optionalArguments) or optionalArguments[key] == nil) then
error("Provided invalid argument " .. key)
end
end
end
|
--Wheels Array |
local fDensity = _Tune.FWheelDensity
local rDensity = _Tune.RWheelDensity
local fFwght = _WHEELTUNE.FFrictionWeight
local rFwght = _WHEELTUNE.RFrictionWeight
local fElast = _WHEELTUNE.FElasticity
local rElast = _WHEELTUNE.RElasticity
local fEwght = _WHEELTUNE.FElastWeight
local rEwght = _WHEELTUNE.RElastWeight
if not workspace:PGSIsEnabled() then
fDensity = _Tune.FWLgcyDensity
rDensity = _Tune.RWLgcyDensity
fFwght = _WHEELTUNE.FLgcyFrWeight
rFwght = _WHEELTUNE.FLgcyFrWeight
fElast = _WHEELTUNE.FLgcyElasticity
rElast = _WHEELTUNE.RLgcyElasticity
fEwght = _WHEELTUNE.FLgcyElWeight
rEwght = _WHEELTUNE.RLgcyElWeight
end
local Wheels = {}
for i,v in pairs(car.Wheels:GetChildren()) do
local w = {}
w.wheel = v
local ca
w.x = 0
if v.Name == "FL" or v.Name == "FR" or v.Name == "F" then
ca = (12-math.abs(_Tune.FCamber))/15
w.x = fDensity
w.BaseHeat = _WHEELTUNE.FTargetFriction-_WHEELTUNE.FMinFriction
w.WearSpeed = _WHEELTUNE.FWearSpeed
w.fWeight = fFwght
w.elast = fElast
w.eWeight = fEwght
else
ca = (12-math.abs(_Tune.RCamber))/15
w.x = rDensity
w.BaseHeat = _WHEELTUNE.RTargetFriction-_WHEELTUNE.RMinFriction
w.WearSpeed = _WHEELTUNE.RWearSpeed
w.fWeight = rFwght
w.elast = rElast
w.eWeight = rEwght
end
--if car:FindFirstChild("WearData")~=nil then
-- w.Heat = math.min(w.BaseHeat,car.WearData[v.Name].Value+(((tick()-car.WearData.STime.Value)*_WHEELTUNE.RegenSpeed*15/10000)))
--else
w.Heat = w.BaseHeat
--end
w.stress = 0
table.insert(Wheels,w)
end
|
--[=[
Detects if a table is empty.
```lua
local Empty = {}
local NotEmpty = { "Stuff" }
print(TableKit.IsEmpty(Empty), TableKit.IsEmpty(NotEmpty)) -- prints true, false
```
@within TableKit
@param mysteryTable table
@return boolean
]=] |
function TableKit.IsEmpty(mysteryTable: { [unknown]: unknown }): boolean
return next(mysteryTable) == nil
end
return table.freeze(TableKit)
|
---------------------------------------------- |
local debris = game:GetService("Debris")
while vehicle:FindFirstChild("StamperFloor") or vehicle:FindFirstChild("StamperFloor2") do vehicle.ChildRemoved:wait() end
local vehicleSize = vehicle:GetModelSize().magnitude
|
--[=[
@within TableUtil
@function Sync
@param srcTbl table -- Source table
@param templateTbl table -- Template table
@return table
Synchronizes the `srcTbl` based on the `templateTbl`. This will make
sure that `srcTbl` has all of the same keys as `templateTbl`, including
removing keys in `srcTbl` that are not present in `templateTbl`. This
is a _deep_ operation, so any nested tables will be synchronized as
well.
```lua
local template = {kills = 0, deaths = 0, xp = 0}
local data = {kills = 10, experience = 12}
data = TableUtil.Sync(data, template)
print(data) --> {kills = 10, deaths = 0, xp = 0}
```
:::caution Data Loss Warning
This is a two-way sync, so the source table will have data
_removed_ that isn't found in the template table. This can
be problematic if used for player data, where there might
be dynamic data added that isn't in the template.
For player data, use `TableUtil.Reconcile` instead.
]=] |
local function Sync(srcTbl: Table, templateTbl: Table): Table
assert(type(srcTbl) == "table", "First argument must be a table")
assert(type(templateTbl) == "table", "Second argument must be a table")
local tbl = Copy(srcTbl)
-- If 'tbl' has something 'templateTbl' doesn't, then remove it from 'tbl'
-- If 'tbl' has something of a different type than 'templateTbl', copy from 'templateTbl'
-- If 'templateTbl' has something 'tbl' doesn't, then add it to 'tbl'
for k,v in pairs(tbl) do
local vTemplate = templateTbl[k]
-- Remove keys not within template:
if vTemplate == nil then
tbl[k] = nil
-- Synchronize data types:
elseif type(v) ~= type(vTemplate) then
if type(vTemplate) == "table" then
tbl[k] = Copy(vTemplate, true)
else
tbl[k] = vTemplate
end
-- Synchronize sub-tables:
elseif type(v) == "table" then
tbl[k] = Sync(v, vTemplate)
end
end
-- Add any missing keys:
for k,vTemplate in pairs(templateTbl) do
local v = tbl[k]
if v == nil then
if type(vTemplate) == "table" then
tbl[k] = Copy(vTemplate, true)
else
tbl[k] = vTemplate
end
end
end
return tbl
end
|
-- ====================
-- MISCELLANEOUS
-- Etc. settings for the gun
-- ==================== |
Knockback = 0; --Setting above 0 will enabling the gun to push enemy back. NOTE: If "ExplosiveEnabled" is enabled, this setting is not work
Lifesteal = 0; --In percent - Setting above 0 will allow user to steal enemy's health by dealing a damage to them.
FlamingBullet = false; --Enable the bullet to set enemy on fire. Its DPS and Duration can be edited inside "IgniteScript"
DualEnabled = false; --Enable the user to hold two guns instead one. In order to make this setting work, you must clone its Handle and name it to "Handle2". Enabling this setting will override Idle Animation ID.
Piercing = 0; --Setting above 0 will enabling the gun to penetrate up to XX victim(s). Cannot penetrate wall. NOTE: It doesn't work with "ExplosiveEnabled"
|
-- Activate it on start. |
if ( script.Activate.Value ) then
activate();
end
|
-- scripting level 1000000: go
-- if you type 2 dashes like this "--" you can create a comment
-- comments aren't executed, so you can type stuff like this! | |
-- Unequip logic here |
function OnUnequipped()
Handle.UnequipSound:Play()
Handle.EquipSound:Stop()
Handle.EquipSound2:Stop()
LeftButtonDown = false
flare.MuzzleFlash.Enabled = false
Reloading = false
MyCharacter = nil
MyHumanoid = nil
MyTorso = nil
MyPlayer = nil
MyMouse = nil
if OnFireConnection then
OnFireConnection:disconnect()
end
if OnReloadConnection then
OnReloadConnection:disconnect()
end
if FlashHolder then
FlashHolder = nil
end
if WeaponGui then
WeaponGui.Parent = nil
WeaponGui = nil
end
if Tip then
Tip.Parent = nil
Tip = nil
end
if RecoilTrack then
RecoilTrack:Stop()
end
if ReloadTrack then
ReloadTrack:Stop()
end
end
local function SetReticleColor(color)
if WeaponGui and WeaponGui:FindFirstChild('Crosshair') then
for _, line in pairs(WeaponGui.Crosshair:GetChildren()) do
if line:IsA('Frame') then
line.BorderColor3 = color
end
end
end
end
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
while true do
wait(0.033)
if WeaponGui and WeaponGui:FindFirstChild('Crosshair') and MyMouse then
WeaponGui.Crosshair.Position = UDim2.new(0, MyMouse.X, 0, MyMouse.Y)
SetReticleColor(NeutralReticleColor)
local target = MyMouse.Target
if target and target.Parent then
local player = PlayersService:GetPlayerFromCharacter(target.Parent)
if player then
if MyPlayer.Neutral or player.TeamColor ~= MyPlayer.TeamColor then
SetReticleColor(EnemyReticleColor)
else
SetReticleColor(FriendlyReticleColor)
end
end
end
end
if Spread and not IsShooting then
local currTime = time()
if currTime - LastSpreadUpdate > FireRate * 2 then
LastSpreadUpdate = currTime
Spread = math.max(MinSpread, Spread - AimInaccuracyStepAmount)
UpdateCrosshair(Spread, MyMouse)
end
end
end
|
-- white and black
--Play_Video_Event.Event:Connect(function()
-- print("playing video soon")
-- wait(1)
-- game.Workspace.Sound:Play()
-- local frames = 0
-- local chunks = 0
-- for _,v in pairs(Loaded_Vid) do
-- chunks += 1
-- local chunk = tostring(chunks)
-- local pixel = 0
-- for f = 1 , chunk_size do
-- frames += 1
-- local collums = 0
-- local frame = tostring(frames)
-- local current_frame = v[chunk][frame]
-- for i = 1 , x_res do
-- collums += 1
-- local collum = tostring(collums) -- number to string
-- for c in string.gmatch(current_frame[collum], "(%w)") do -- 'w' represents the individual letter returned
-- pixel += 1
-- if pixel == 6913 then
-- pixel = 1
-- end
-- if c == "0" then
-- VideoScreen[collum][pixel].Color = black_color
-- else
-- VideoScreen[collum][pixel].Color = white_color
-- end
-- end
-- end
-- RunService.Heartbeat:Wait()
-- RunService.Heartbeat:Wait()
-- RunService.Heartbeat:Wait()
-- RunService.Heartbeat:Wait()
-- end
-- end
--end) |
Play_Video_Event.OnClientEvent:Connect(function()
print("playing video soon")
wait(1)
game.Workspace.Sound:Play()
local frames = 0
local chunks = 0
for _,v in pairs(Loaded_Vid) do
chunks += 1
local chunk = tostring(chunks)
for f = 1 , chunk_size do
frames += 1
local pixel = 0
local collums = 0
local frame = tostring(frames)
local current_frame = v[chunk][frame]
for i = 1 , x_res do
collums += 1
local collum = tostring(collums) -- number to string
local r = 0
local g = 0
local b = 0
local instrunction = false
local current = 0
if current_frame[collum] ~= nil then
for c in string.gmatch(current_frame[collum], ".") do -- 'w' represents the individual letter returned
current += 1
if instrunction == true then
if current == 1 then
-- do nothing as it started the instruction
elseif current == 2 then
g = Hex_Dictionary[c]
current = 0
instrunction = false
pixel += g
end
elseif c == "x" then
current = 0
pixel += 1
elseif c == "*" then
instrunction = true
else
if current == 1 then
r = Hex_Baked_Dictionary[c]
-- checks if the frame must be skipped
elseif current == 2 then
g = Hex_Baked_Dictionary[c]
else
b = Hex_Baked_Dictionary[c]
current = 0
pixel += 1
local color = Color3.fromRGB(r,g,b)
VideoScreen[collum][pixel].Color = color
end
end
end
end
--RunService.Heartbeat:Wait()
end
RunService.Heartbeat:Wait()
RunService.Heartbeat:Wait()
RunService.Heartbeat:Wait()
RunService.Heartbeat:Wait()
end
end
end)
|
-- Initialization |
local lastActivePath = {}
if game.Workspace:FindFirstChild("BasePlate") then
game.Workspace.BasePlate:Destroy()
end
local tracksModel = Instance.new("Model")
tracksModel.Name = "Tracks"
tracksModel.Parent = game.Workspace
function packagePathModels()
local pathPackager = require(script.PathPackager)
while true do
local pathBase = game.Workspace:FindFirstChild("PathBase", true)
if pathBase then
pathPackager:PackageRoom(pathBase)
else
break
end
end
end
coroutine.wrap(function() packagePathModels() end)()
|
-- Customized explosive effect that doesn't affect teammates and only breaks joints on dead parts |
local TaggedHumanoids = {}
local function OnExplosionHit(hitPart, hitDistance, blastCenter)
if hitPart and hitDistance then
local character, humanoid = FindCharacterAncestor(hitPart.Parent)
if character then
local myPlayer = CreatorTag.Value
if myPlayer and not myPlayer.Neutral then -- Ignore friendlies caught in the blast
local player = PlayersService:GetPlayerFromCharacter(character)
if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
return
end
end
end
if humanoid and humanoid.Health > 0 then -- Humanoids are tagged and damaged
if not IsInTable(TaggedHumanoids,humanoid) then
print("Tagged")
table.insert(TaggedHumanoids,humanoid)
ApplyTags(humanoid)
humanoid:TakeDamage(BLAST_DAMAGE)
end
else -- Loose parts and dead parts are blasted
if hitPart.Name ~= 'Handle' then
hitPart:BreakJoints()
local blastForce = Instance.new('BodyForce', hitPart) --NOTE: We will multiply by mass so bigger parts get blasted more
blastForce.Force = (hitPart.Position - blastCenter).unit * BLAST_FORCE * hitPart:GetMass()
DebrisService:AddItem(blastForce, 0.1)
end
end
end
end
local function OnTouched(otherPart)
if Rocket and otherPart then
-- Fly through anything in the ignore list
if IGNORE_LIST[string.lower(otherPart.Name)] then
return
end
local myPlayer = CreatorTag.Value
if myPlayer then
-- Fly through the creator
if myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
return
end
-- Fly through friendlies
if not myPlayer.Neutral then
local character = FindCharacterAncestor(otherPart.Parent)
local player = PlayersService:GetPlayerFromCharacter(character)
if player and player ~= myPlayer and player.TeamColor == Rocket.BrickColor then
return
end
end
end
-- Fly through terrain water
if otherPart == workspace.Terrain then
--NOTE: If the rocket is large, then the simplifications made here will cause it to fly through terrain in some cases
local frontOfRocket = Rocket.Position + (Rocket.CFrame.lookVector * (Rocket.Size.Z / 2))
local cellLocation = workspace.Terrain:WorldToCellPreferSolid(frontOfRocket)
local cellMaterial = workspace.Terrain:GetCell(cellLocation.X, cellLocation.Y, cellLocation.Z)
if cellMaterial == Enum.CellMaterial.Water or cellMaterial == Enum.CellMaterial.Empty then
return
end
end
-- Create the explosion
local explosion = Instance.new('Explosion')
explosion.BlastPressure = 0 -- Completely safe explosion
explosion.BlastRadius = BLAST_RADIUS
explosion.ExplosionType = Enum.ExplosionType.NoCraters
explosion.Position = Rocket.Position
explosion.Parent = workspace
-- Connect custom logic for the explosion
explosion.Hit:Connect(function(hitPart, hitDistance) OnExplosionHit(hitPart, hitDistance, explosion.Position) end)
-- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket
script.Parent = explosion
CreatorTag.Parent = script
Rocket:Destroy()
end
end
|
---[[ Chat Behaviour Settings ]] |
module.WindowDraggable = false
module.WindowResizable = false
module.ShowChannelsBar = false
module.GamepadNavigationEnabled = false
module.AllowMeCommand = false -- Me Command will only be effective when this set to true
module.ShowUserOwnFilteredMessage = true --Show a user the filtered version of their message rather than the original. |
--local part,pos,norm,mat = workspace:FindPartOnRay(ray,banto)
--banto:MoveTo(Vector3.new(banto.PrimaryPart.Position.X,pos.Y+2.25,banto.PrimaryPart.Position.Z))
--bp.Position = Vector3.new(bp.Position.X,pos.Y+2.25,bp.Position.Z) |
until (banto.PrimaryPart.Position-goal).magnitude < 10 or tick()-start >10
walk:Stop()
bp.Parent = nil
wait(math.random(3,8))
end
|
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote |
local emoteNames = { wave = false, point = false, dance1 = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
function configureAnimationSet(name, fileList)
if (animTable[name] ~= nil) then
for _, connection in pairs(animTable[name].connections) do
connection:disconnect()
end
end
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
animTable[name].connections = {}
-- check for config values
local config = script:FindFirstChild(name)
if (config ~= nil) then |
--Used to visualize waypoints |
local visualWaypoint = Instance.new("Part")
visualWaypoint.Size = Vector3.new(0.3, 0.3, 0.3)
visualWaypoint.Anchored = true
visualWaypoint.CanCollide = false
visualWaypoint.Material = Enum.Material.Neon
visualWaypoint.Shape = Enum.PartType.Ball
|
-- Device check |
local IS_CONSOLE = GuiService:IsTenFootInterface()
local IS_MOBILE = UserInputService.TouchEnabled and not UserInputService.MouseEnabled and not IS_CONSOLE
|
-- This is the same as Icon.new(), except it adds additional behaviour for certain specified names designed to mimic core icons, such as 'Chat' |
function Icon.mimic(coreIconToMimic)
local iconName = coreIconToMimic.."Mimic"
local icon = IconController.getIcon(iconName)
if icon then
return icon
end
icon = Icon.new()
icon:setName(iconName)
if coreIconToMimic == "Chat" then
icon:setOrder(-1)
icon:setImage("rbxasset://textures/ui/TopBar/chatOff.png", "deselected")
icon:setImage("rbxasset://textures/ui/TopBar/chatOn.png", "selected")
icon:setImageYScale(0.625)
-- Since roblox's core gui api sucks melons I reverted to listening for signals within the chat modules
-- unfortunately however they've just gone and removed *these* signals therefore
-- this mimic chat and similar features are now impossible to recreate accurately, so I'm disabling for now
-- ill go ahead and post a feature request; fingers crossed we get something by the next decade
--[[
-- Setup maid and cleanup actioon
local maid = icon._maid
icon._fakeChatMaid = maid:give(Maid.new())
maid.chatMimicCleanup = function()
starterGui:SetCoreGuiEnabled("Chat", icon.enabled)
end
-- Tap into chat module
local chatMainModule = localPlayer.PlayerScripts:WaitForChild("ChatScript").ChatMain
local ChatMain = require(chatMainModule)
local function displayChatBar(visibility)
icon.ignoreVisibilityStateChange = true
ChatMain.CoreGuiEnabled:fire(visibility)
ChatMain.IsCoreGuiEnabled = false
ChatMain:SetVisible(visibility)
icon.ignoreVisibilityStateChange = nil
end
local function setIconEnabled(visibility)
icon.ignoreVisibilityStateChange = true
ChatMain.CoreGuiEnabled:fire(visibility)
icon:setEnabled(visibility)
starterGui:SetCoreGuiEnabled("Chat", false)
icon:deselect()
icon.updated:Fire()
icon.ignoreVisibilityStateChange = nil
end
-- Open chat via Slash key
icon._fakeChatMaid:give(userInputService.InputEnded:Connect(function(inputObject, gameProcessedEvent)
if gameProcessedEvent then
return "Another menu has priority"
elseif not(inputObject.KeyCode == Enum.KeyCode.Slash or inputObject.KeyCode == Enum.SpecialKey.ChatHotkey) then
return "No relavent key pressed"
elseif ChatMain.IsFocused() then
return "Chat bar already open"
elseif not icon.enabled then
return "Icon disabled"
end
ChatMain:FocusChatBar(true)
icon:select()
end))
-- ChatActive
icon._fakeChatMaid:give(ChatMain.VisibilityStateChanged:Connect(function(visibility)
if not icon.ignoreVisibilityStateChange then
if visibility == true then
icon:select()
else
icon:deselect()
end
end
end))
-- Keep when other icons selected
icon.deselectWhenOtherIconSelected = false
-- Mimic chat notifications
icon._fakeChatMaid:give(ChatMain.MessagesChanged:connect(function()
if ChatMain:GetVisibility() == true then
return "ChatWindow was open"
end
icon:notify(icon.selected)
end))
-- Mimic visibility when StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, state) is called
coroutine.wrap(function()
runService.Heartbeat:Wait()
icon._fakeChatMaid:give(ChatMain.CoreGuiEnabled:connect(function(newState)
if icon.ignoreVisibilityStateChange then
return "ignoreVisibilityStateChange enabled"
end
local topbarEnabled = starterGui:GetCore("TopbarEnabled")
if topbarEnabled ~= IconController.previousTopbarEnabled then
return "SetCore was called instead of SetCoreGuiEnabled"
end
if not icon.enabled and userInputService:IsKeyDown(Enum.KeyCode.LeftShift) and userInputService:IsKeyDown(Enum.KeyCode.P) then
icon:setEnabled(true)
else
setIconEnabled(newState)
end
end))
end)()
icon.deselected:Connect(function()
displayChatBar(false)
end)
icon.selected:Connect(function()
displayChatBar(true)
end)
setIconEnabled(starterGui:GetCoreGuiEnabled("Chat"))
--]]
end
return icon
end
|
-- Listen for the part being touched |
part.Touched:Connect(onTouched)
|
------------------------------------------CONFIGURABLE VARIABLES]]------------------------------------------------------------------------------ |
music.Parent = script.Parent -- This is where the sound will be placed. If you want the sound to be heard everywhere, don't change it or put it into Workspace. |
--// Use the below table to set command permissions; Commented commands are included for example purposes |
settings.Permissions = {
-- "ff:HeadAdmins"; --// Changes :ff to HeadAdmins and higher (HeadAdmins = Level 300 by default)
-- "kill:300"; --// Changes :kill to level 300 and higher (Level 300 = HeadAdmins by default)
-- "ban:200,300" --// Makes it so :ban is only usable by levels 200 and 300 specifically (nothing higher or lower or in between)
}; -- Format: {"Command:NewLevel"; "Command:Customrank1,Customrank2,Customrank3";}
|
-- Determine whether we're in tool or plugin mode |
ToolMode = (Tool.Parent:IsA 'Plugin') and 'Plugin' or 'Tool'
|
-- this script removes its parent from the workspace after 24 seconds |
local Debris = game:GetService("Debris")
Debris:AddItem(script.Parent,24)
|
--// Firemode Settings |
CanSelectFire = false;
BurstEnabled = false;
SemiEnabled = true;
AutoEnabled = false;
BoltAction = false;
ExplosiveEnabled = false;
|
--[[WARNING!!! MAKE SURE THIS MODULE IS IN SERVER STORAGE OR SERVER SCRIPT SERVICE]] | |
-- Function to bind to touch moved if player is on mobile |
local function mobileFrame(touch, processed)
-- Check to see if the touch was on a UI element. If so, we don't want to update anything
if not processed then
-- Calculate touch position in world space. Uses Stravant's ScreenSpace Module script
-- to create a ray from the camera.
local test = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1)
local nearPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y, 1))
nearPos = game.Workspace.CurrentCamera.CoordinateFrame.p - nearPos
local farPos = screenSpace.ScreenToWorld(touch.Position.X, touch.Position.Y,50)
farPos = game.Workspace.CurrentCamera.CoordinateFrame:vectorToWorldSpace(farPos) * -1
if farPos.magnitude > 900 then
farPos = farPos.unit * 900
end
local ray = Ray.new(nearPos, farPos)
local part, pos = game.Workspace:FindPartOnRay(ray, player.Character)
-- if a position was found on the ray then update the character's rotation
if pos then
frame(pos)
end
end
end
local oldIcon = nil |
--[=[
Executes code at a specific point in Roblox's engine
@class onSteppedFrame
]=] |
local RunService = game:GetService("RunService")
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 231 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 5000 -- Use sliders to manipulate values
Tune.Redline = 7000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5600
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 2 -- 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 = 468 -- Clutch engagement threshold (higher = faster response)
|
--[[
Intended for use in tests.
Similar to await(), but instead of yielding if the promise is unresolved,
_unwrap will throw. This indicates an assumption that a promise has
resolved.
]] |
function Promise.prototype:_unwrap()
if self._status == Promise.Status.Started then
error("Promise has not resolved or rejected.", 2)
end
local success = self._status == Promise.Status.Resolved
return success, unpack(self._values, 1, self._valuesLength)
end
function Promise.prototype:_resolve(...)
if self._status ~= Promise.Status.Started then
if Promise.is((...)) then
(...):_consumerCancelled(self)
end
return
end
-- If the resolved value was a Promise, we chain onto it!
if Promise.is((...)) then
-- Without this warning, arguments sometimes mysteriously disappear
if select("#", ...) > 1 then
local message = string.format(
"When returning a Promise from andThen, extra arguments are " .. "discarded! See:\n\n%s",
self._source
)
warn(message)
end
local chainedPromise = ...
local promise = chainedPromise:andThen(function(...)
self:_resolve(...)
end, function(...)
local maybeRuntimeError = chainedPromise._values[1]
-- Backwards compatibility < v2
if chainedPromise._error then
maybeRuntimeError = Error.new({
error = chainedPromise._error,
kind = Error.Kind.ExecutionError,
context = "[No stack trace available as this Promise originated from an older version of the Promise library (< v2)]",
})
end
if Error.isKind(maybeRuntimeError, Error.Kind.ExecutionError) then
return self:_reject(maybeRuntimeError:extend({
error = "This Promise was chained to a Promise that errored.",
trace = "",
context = string.format(
"The Promise at:\n\n%s\n...Rejected because it was chained to the following Promise, which encountered an error:\n",
self._source
),
}))
end
self:_reject(...)
end)
if promise._status == Promise.Status.Cancelled then
self:cancel()
elseif promise._status == Promise.Status.Started then
-- Adopt ourselves into promise for cancellation propagation.
self._parent = promise
promise._consumers[self] = true
end
return
end
self._status = Promise.Status.Resolved
self._valuesLength, self._values = pack(...)
-- We assume that these callbacks will not throw errors.
for _, callback in ipairs(self._queuedResolve) do
coroutine.wrap(callback)(...)
end
self:_finalize()
end
function Promise.prototype:_reject(...)
if self._status ~= Promise.Status.Started then
return
end
self._status = Promise.Status.Rejected
self._valuesLength, self._values = pack(...)
-- If there are any rejection handlers, call those!
if not isEmpty(self._queuedReject) then
-- We assume that these callbacks will not throw errors.
for _, callback in ipairs(self._queuedReject) do
coroutine.wrap(callback)(...)
end
else
-- At this point, no one was able to observe the error.
-- An error handler might still be attached if the error occurred
-- synchronously. We'll wait one tick, and if there are still no
-- observers, then we should put a message in the console.
local err = tostring((...))
coroutine.wrap(function()
Promise._timeEvent:Wait()
-- Someone observed the error, hooray!
if not self._unhandledRejection then
return
end
-- Build a reasonable message
local message = string.format("Unhandled Promise rejection:\n\n%s\n\n%s", err, self._source)
for _, callback in ipairs(Promise._unhandledRejectionCallbacks) do
task.spawn(callback, self, unpack(self._values, 1, self._valuesLength))
end
if Promise.TEST then
-- Don't spam output when we're running tests.
return
end
warn(message)
end)()
end
self:_finalize()
end
|
-- Overrides Keyboard:UpdateJump() because jump is handled in OnRenderStepped |
function ClickToMove:UpdateJump()
if FFlagUserClickToMoveFollowPathRefactor then
-- Nothing to do (handled in OnRenderStepped)
else
self.isJumping = self.jumpRequested
end
end
|
--[[ SERVICES ]] |
local PlayersService = game:GetService('Players')
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ChatService = game:GetService("Chat")
local TextService = game:GetService("TextService") |
--[[[Default Controls]] |
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.World0 ,
ToggleABS = Enum.KeyCode.World0 ,
ToggleTransMode = Enum.KeyCode.World0 ,
ToggleMouseDrive = Enum.KeyCode.World0 ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
-- @Description Return a copy of the table without any keys.
-- @Arg1 Table |
function Basic.TableToArray(Tbl)
local Array = {}
for _,v in pairs(Tbl) do
table.insert(Array, v)
end
return Array
end
|
-- Changes made from EchoReaper's version: |
-- GetCurrentFPS() method removed
-- FPS is only tracked when the 'Loop' function is running for performance reasons
-- Styled code in consistency with the rest of the AeroGameFramework codebase
|
-----------------
--| Variables |--
----------------- |
local PlayersService = game:GetService('Players')
local Camera = nil
local CameraSubjectChangeConn = nil
local SubjectPart = nil
local PlayerCharacters = {} -- For ignoring in raycasts
local VehicleParts = {} -- Also just for ignoring
local LastPopAmount = 0
local LastZoomLevel = 0
local PopperEnabled = false
local CFrame_new = CFrame.new
|
-- Set the "AngularVelocity" property on all of the CylindricalConstraint motors |
local function setMotorVelocity(vel)
motorFL.AngularVelocity = vel
motorBL.AngularVelocity = vel
-- Motors on the right side are facing the opposite direction, so negative velocity must be used
motorFR.AngularVelocity = -vel
motorBR.AngularVelocity = -vel
end
|
-- Convenient syntax for creating a tree of instanes |
local function create(className)
return function(props)
local inst = Instance.new(className)
local parent = props.Parent
props.Parent = nil
for name, val in pairs(props) do
if type(name) == "string" then
inst[name] = val
else
val.Parent = inst
end
end
-- Only set parent after all other properties are initialized
inst.Parent = parent
return inst
end
end
local initialized = false
local uiRoot
local toast
local toastIcon
local toastUpperText
local toastLowerText
local function initializeUI()
assert(not initialized)
uiRoot = create("ScreenGui"){
Name = "RbxCameraUI",
AutoLocalize = false,
Enabled = true,
DisplayOrder = -1, -- Appears behind default developer UI
IgnoreGuiInset = false,
ResetOnSpawn = false,
ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
create("ImageLabel"){
Name = "Toast",
Visible = false,
AnchorPoint = Vector2.new(0.5, 0),
BackgroundTransparency = 1,
BorderSizePixel = 0,
Position = UDim2.new(0.5, 0, 0, 8),
Size = TOAST_CLOSED_SIZE,
Image = "rbxasset://textures/ui/Camera/CameraToast9Slice.png",
ImageColor3 = TOAST_BACKGROUND_COLOR,
ImageRectSize = Vector2.new(6, 6),
ImageTransparency = 1,
ScaleType = Enum.ScaleType.Slice,
SliceCenter = Rect.new(3, 3, 3, 3),
ClipsDescendants = true,
create("Frame"){
Name = "IconBuffer",
BackgroundTransparency = 1,
BorderSizePixel = 0,
Position = UDim2.new(0, 0, 0, 0),
Size = UDim2.new(0, 80, 1, 0),
create("ImageLabel"){
Name = "Icon",
AnchorPoint = Vector2.new(0.5, 0.5),
BackgroundTransparency = 1,
Position = UDim2.new(0.5, 0, 0.5, 0),
Size = UDim2.new(0, 48, 0, 48),
ZIndex = 2,
Image = "rbxasset://textures/ui/Camera/CameraToastIcon.png",
ImageColor3 = TOAST_FOREGROUND_COLOR,
ImageTransparency = 1,
}
},
create("Frame"){
Name = "TextBuffer",
BackgroundTransparency = 1,
BorderSizePixel = 0,
Position = UDim2.new(0, 80, 0, 0),
Size = UDim2.new(1, -80, 1, 0),
ClipsDescendants = true,
create("TextLabel"){
Name = "Upper",
AnchorPoint = Vector2.new(0, 1),
BackgroundTransparency = 1,
Position = UDim2.new(0, 0, 0.5, 0),
Size = UDim2.new(1, 0, 0, 19),
Font = Enum.Font.GothamSemibold,
Text = "Camera control enabled",
TextColor3 = TOAST_FOREGROUND_COLOR,
TextTransparency = 1,
TextSize = 19,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Center,
},
create("TextLabel"){
Name = "Lower",
AnchorPoint = Vector2.new(0, 0),
BackgroundTransparency = 1,
Position = UDim2.new(0, 0, 0.5, 3),
Size = UDim2.new(1, 0, 0, 15),
Font = Enum.Font.Gotham,
Text = "Right mouse button to toggle",
TextColor3 = TOAST_FOREGROUND_COLOR,
TextTransparency = 1,
TextSize = 15,
TextXAlignment = Enum.TextXAlignment.Left,
TextYAlignment = Enum.TextYAlignment.Center,
},
},
},
Parent = PlayerGui,
}
toast = uiRoot.Toast
toastIcon = toast.IconBuffer.Icon
toastUpperText = toast.TextBuffer.Upper
toastLowerText = toast.TextBuffer.Lower
initialized = true
end
local CameraUI = {}
do
-- Instantaneously disable the toast or enable for opening later on. Used when switching camera modes.
function CameraUI.setCameraModeToastEnabled(enabled)
if not enabled and not initialized then
return
end
if not initialized then
initializeUI()
end
toast.Visible = enabled
if not enabled then
CameraUI.setCameraModeToastOpen(false)
end
end
local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
-- Tween the toast in or out. Toast must be enabled with setCameraModeToastEnabled.
function CameraUI.setCameraModeToastOpen(open)
assert(initialized)
TweenService:Create(toast, tweenInfo, {
Size = open and TOAST_OPEN_SIZE or TOAST_CLOSED_SIZE,
ImageTransparency = open and TOAST_BACKGROUND_TRANS or 1,
}):Play()
TweenService:Create(toastIcon, tweenInfo, {
ImageTransparency = open and TOAST_FOREGROUND_TRANS or 1,
}):Play()
TweenService:Create(toastUpperText, tweenInfo, {
TextTransparency = open and TOAST_FOREGROUND_TRANS or 1,
}):Play()
TweenService:Create(toastLowerText, tweenInfo, {
TextTransparency = open and TOAST_FOREGROUND_TRANS or 1,
}):Play()
end
end
return CameraUI
|
-- Show the help text for joining and leaving channels. This is not useful unless custom channels have been added.
-- So it is turned off by default. |
module.ShowJoinAndLeaveHelpText = false
|
--[[Remove Character Weight]] |
--Get Seats
local Seats = {}
function getSeats(p)
for i,v in pairs(p:GetChildren()) do
if v:IsA("VehicleSeat") or v:IsA("Seat") then
local seat = {}
seat.Seat = v
seat.Parts = {}
table.insert(Seats,seat)
end
getSeats(v)
end
end
getSeats(car)
--Store Physical Properties/Remove Mass Function
function getPProperties(mod,t)
for i,v in pairs(mod:GetChildren()) do
if v:IsA("BasePart") then
if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
table.insert(t,{v,v.CustomPhysicalProperties})
v.CustomPhysicalProperties = PhysicalProperties.new(
0,
v.CustomPhysicalProperties.Friction,
v.CustomPhysicalProperties.Elasticity,
v.CustomPhysicalProperties.FrictionWeight,
v.CustomPhysicalProperties.ElasticityWeight
)
end
getPProperties(v,t)
end
end
--Apply Seat Handler
for i,v in pairs(Seats) do
--Sit Handler
v.Seat.ChildAdded:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") and child.Part1~=nil and child.Part1.Parent ~= workspace and not child.Part1.Parent:IsDescendantOf(car) then
v.Parts = {}
getPProperties(child.Part1.Parent,v.Parts)
end
end)
--Leave Handler
v.Seat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" and child:IsA("Weld") then
for i,v in pairs(v.Parts) do
if v[1]~=nil and v[2]~=nil and v[1]:IsDescendantOf(workspace) then
v[1].CustomPhysicalProperties = v[2]
end
end
v.Parts = {}
end
end)
end
|
--made by Bertox
--lul |
local ts = game:GetService("TweenService")
local fadeDRL = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local fadeDRL2 = TweenInfo.new(4, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local goal = {}
local goal2 = {}
local F = {}
local car = script.Parent.Parent.Parent.Parent
script.Parent.Parent.Parent.Parent.Electrics.Changed:connect(function()
if script.Parent.Parent.Parent.Parent.Electrics.Value == true then
drlFade(true)
else
drlFade(false)
end
end)
function drlFade(bool)
if bool then
goal2.Transparency = 0.8
local a = ts:Create(car.Body.DRLs.DRL1, fadeDRL, goal2)
a:Play()
else
goal2.Transparency = 1
local a = ts:Create(car.Body.DRLs.DRL1, fadeDRL, goal2)
a:Play()
end
end
F.drlFade = function(bool)
drlFade(bool)
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]] |
script.Parent:WaitForChild("Speedo")
script.Parent:WaitForChild("Tach")
script.Parent:WaitForChild("ln")
script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")
local car = script.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false
local _Tune = require(car["A-Chassis Tune"])
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
local revEnd = math.ceil(_lRPM/1000)
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
local maxSpeed = math.ceil(wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
local spInc = math.max(math.ceil(maxSpeed/200)*20,20)
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_pRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Speedo
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i=0,maxSpeed,spInc do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Speedo
ln.Rotation = 45 + 225*(i/maxSpeed)
ln.Num.Text = i
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
script.Parent.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
end)
script.Parent.Parent.Values.PBrake.Changed:connect(function()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end)
script.Parent.Parent.Values.TransmissionMode.Changed:connect(function()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "Strada"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "Sport"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "Corsa"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,script.Parent.Parent.Values.Velocity.Value.Magnitude/maxSpeed)
script.Parent.Speed.Text = math.floor(script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " SPS"
end)
|
-- |
end
else
print("sh")
end
else
print("arms")
end
end
function Key(key)
if key then
key = string.lower(key)
if (key=="c") then
if on == 1 then
on = 0
elseif on == 0 then
on = 1
end
Crouch(on)
end
end
end
function Equip(mouse)
mouse.KeyDown:connect(Key)
end
script.Parent.Equipped:connect(Equip)
|
---------------------------
--[[
--Main anchor point is the DriveSeat <car.DriveSeat>
Usage:
MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only
ModelWeld(Model,MainPart)
Example:
MakeWeld(car.DriveSeat,misc.PassengerSeat)
MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
ModelWeld(car.DriveSeat,misc.Door)
]] | |
--// Converts DateTime to ISO8601 timestamp |
local function format(num, digits)
return string.format("%0" .. digits .. "i", num)
end
local function parseDateTime()
local osDate = os.date("!*t")
local year, mon, day = osDate["year"], osDate["month"], osDate["day"]
local hour, min, sec = osDate["hour"], osDate["min"], osDate["sec"]
return year .. "-" .. format(mon, 2) .. "-" .. format(day, 2) .. "T" .. format(hour, 2) .. ":" .. format(min, 2) .. ":" .. format(sec, 2) .. "Z"
end
return parseDateTime(DateTime)
|
-- Get references to the DockShelf and its children |
local fldr = script.Parent.Parent.SelEmoji
local btn = script.Parent
local function toggleWindow()
if fldr.Visible then
-- Close the window by tweening back to the button position and size
fldr:TweenSizeAndPosition(
UDim2.new(0, 0, 0, 0),
UDim2.new(0.822,0,0.874,0),
'Out',
'Quad',
0.2,
false,
function()
fldr.Visible = false
end
)
else
-- Set the initial position of the window to be relative to the button
local startPos = UDim2.new(0.822,0,0.874,0)
fldr.Position = startPos
-- Set the initial size of the window to be zero
fldr.Size = UDim2.new(0, 0, 0, 0)
-- Show the window and tween its position and size from the button position and size to its original position and size
fldr.Visible = true
fldr:TweenSizeAndPosition(
UDim2.new(0.864, 0, 0.48, 0),
UDim2.new(0.065,0, 0.259, 0),
'Out',
'Quad',
0.2
)
end
end
|
--[=[
Impulses the spring, increasing velocity by the amount given. This is useful to make something shake,
like a Mac password box failing.
@param velocity T -- The velocity to impulse with
@return ()
]=] |
function SpringObject:Impulse(velocity)
self._currentSpring:Impulse(SpringUtils.toLinearIfNeeded(velocity))
self.Changed:Fire()
end
|
-- print("CurrentAnim ", currentAnim, " ", frameName) |
if (frameName == "End") then
if currentAnim == "walk" then
runAnimTrack.TimePosition = 0.0
currentAnimTrack.TimePosition = 0.0
else
-- print("Keyframe : ".. frameName)
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Humanoid)
setAnimationSpeed(animSpeed)
end
end
end
function rollAnimation(animName)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
return idx
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
|
-- Called when character is added |
function BaseOcclusion:CharacterAdded(char, player)
end
|
---- ARITHMETIC ---- |
function ActiveCastStatic:AddVelocity(velocity: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddVelocity", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
self:SetVelocity(self:GetVelocity() + velocity)
end
function ActiveCastStatic:AddAcceleration(acceleration: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddAcceleration", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
self:SetAcceleration(self:GetAcceleration() + acceleration)
end
function ActiveCastStatic:AddPosition(position: Vector3)
assert(getmetatable(self) == ActiveCastStatic, ERR_NOT_INSTANCE:format("AddPosition", "ActiveCast.new(...)"))
assert(self.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
self:SetPosition(self:GetPosition() + position)
end
|
-- Running -- |
local function Run(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
Running = true
humanoid.WalkSpeed = 30
while Running and Stamina2.MinValue > 0 do
Stamina2.MinValue -= 2
wait(.01)
end
if Stamina2.MinValue <= 20 then
humanoid.WalkSpeed = 16
end
end
end
UIS.InputBegan:Connect(Run)
|
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {};
local v2 = require(game.ReplicatedStorage.Modules.Lightning);
local v3 = require(game.ReplicatedStorage.Modules.Xeno);
local v4 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function v1.RunStompFx(p1, p2, p3, p4)
local v7 = l__ReplicatedStorage__1.KillFX[p1].Stomp:Clone();
v7.Parent = p2.Parent.UpperTorso and p2;
v7:Play();
game.Debris:AddItem(v7, 4);
local v8 = l__ReplicatedStorage__1.KillFX[p1].FX:Clone();
v8.Parent = workspace.Ignored.Animations;
v8.PrimaryPart.CFrame = CFrame.new(p2.Position);
v8.PrimaryPart.Sound:Play();
game.Debris:AddItem(v8, 6);
if p3 and p3:FindFirstChild("Information") then
for v9, v10 in pairs(v7:GetDescendants()) do
if v10:IsA("BasePart") or v10:IsA("MeshPart") then
v10.Color = p3:FindFirstChild("Information").RayColor.Value;
end;
end;
end;
for v11, v12 in pairs(v8:GetChildren()) do
local v13 = 1200;
if math.random(1, 2) == 2 then
v13 = -1200;
end;
game:GetService("TweenService"):Create(v12, TweenInfo.new(4), {
Transparency = 1,
Position = p2.Position + Vector3.new(0, 2, 0),
Size = v12.Size + Vector3.new(200, 200, 200),
Orientation = v12.Orientation + Vector3.new(0, 0, v13)
}):Play();
end;
return nil;
end;
return v1;
|
--[[ INSTRUCTIONS
- Place in the model
- Make sure model is anchored
- That's it. It will weld the model and all children.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
]] | |
-- Function to simulate day-night cycle |
local function dayNightCycle()
while true do
wait(dayDuration) -- Wait for the specified day duration
-- Daytime award
awardPointsToPlayers()
wait(dayDuration / 2) -- Half of the day for nighttime
-- Nighttime award
awardPointsToPlayers()
end
end
|
--[[
Dax,
See the MeleeScript.
]] |
local canmelee = true;
local tool = script.Parent;
function onKeyDown(key)
key:lower();
if key == "v" then
if canmelee == false then
return;
end
tool.Melee:play()
canmelee = false;
local rgrip = tool.Parent["Right Arm"].RightGrip;
script.melee.Value = true;
for i = 1,6 do
rgrip.C1 = rgrip.C1 * CFrame.fromEulerAnglesXYZ(-0.55,0,0);
wait();
end
wait(0.25);
for i = 1, 6 do
rgrip.C1 = rgrip.C1 * CFrame.fromEulerAnglesXYZ(0.55,0,0);
wait();
end
script.melee.Value = false;
wait(0.5);
canmelee = true;
end
end
function onSelect(mouse)
mouse.KeyDown:connect(onKeyDown);
end
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
if not humanoid then return end
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid ~= hum and hum ~= nil and game.Players:playerFromCharacter(humanoid.Parent) and game.Players:playerFromCharacter(humanoid.Parent).TeamColor~=cc then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(35)
wait(1)
untagHumanoid(humanoid)
end
end
tool.Equipped:connect(onSelect);
|
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {};
v1.__index = v1;
function v1.new()
local v2 = setmetatable({}, v1);
v2.cameras = require(script:WaitForChild("CameraModule"));
v2.controls = require(script:WaitForChild("ControlModule"));
return v2;
end;
function v1.GetCameras(p1)
return p1.cameras;
end;
function v1.GetControls(p2)
return p2.controls;
end;
return v1.new();
|
-- Customization |
AntiTK = false; -- Set to false to allow TK and damaging of NPC, true for no TK. (To damage NPC, this needs to be false)
MouseSense = 0.5;
CanAim = true; -- Allows player to aim
CanBolt = true; -- When shooting, if this is enabled, the bolt will move (SCAR-L, ACR, AK Series)
LaserAttached = true;
LightAttached = true;
TracerEnabled = true;
SprintSpeed = 21;
|
--[[**
ensures value is a number where min < value
@param min The minimum to use
@returns A function that will return true iff the condition is passed
**--]] |
function t.numberMinExclusive(min)
return function(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if min < value then
return true
else
return false, string.format("number > %d expected, got %d", min, value)
end
end
end
|
--[[ By: Brutez. ]] | --
local JeffTheKillerScript=script;
repeat Wait(0)until JeffTheKillerScript and JeffTheKillerScript.Parent and JeffTheKillerScript.Parent.ClassName=="Model"and JeffTheKillerScript.Parent:FindFirstChild("Head")and JeffTheKillerScript.Parent:FindFirstChild("HumanoidRootPart");
local JeffTheKiller=JeffTheKillerScript.Parent;
function raycast(Spos,vec,currentdist)
local hit2,pos2=game.Workspace:FindPartOnRay(Ray.new(Spos+(vec*.05),vec*currentdist),JeffTheKiller);
if hit2~=nil and pos2 then
if hit2.Name=="Handle" and not hit2.CanCollide or string.sub(hit2.Name,1,6)=="Effect"and not hit2.CanCollide then
local currentdist=currentdist-(pos2-Spos).magnitude;
return raycast(pos2,vec,currentdist);
end;
end;
return hit2,pos2;
end;
function RayCast(Position,Direction,MaxDistance,IgnoreList)
return Game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position,Direction.unit*(MaxDistance or 999.999)),IgnoreList);
end; |
-- Connect to the current and all future cameras |
workspace.Changed:connect(OnWorkspaceChanged)
OnWorkspaceChanged('CurrentCamera')
|
-- Roblox character sound script |
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local SOUND_DATA = {
Climbing = {
SoundId = "",
Looped = true,
},
Died = {
SoundId = "",
},
FreeFalling = {
SoundId = "",
Looped = true,
},
GettingUp = {
SoundId = "",
},
Jumping = {
SoundId = "",
},
Landing = {
SoundId = "",
},
Running = {
SoundId = "",
Looped = true,
Pitch = 1.85,
},
Splash = {
SoundId = "rbxasset://sounds/impact_water.mp3",
},
Swimming = {
SoundId = "rbxasset://sounds/action_swim.mp3",
Looped = true,
Pitch = 1.6,
},
}
-- wait for the first of the passed signals to fire
local function waitForFirst(...)
local shunt = Instance.new("BindableEvent")
local slots = {...}
local function fire(...)
for i = 1, #slots do
slots[i]:Disconnect()
end
return shunt:Fire(...)
end
for i = 1, #slots do
slots[i] = slots[i]:Connect(fire)
end
return shunt.Event:Wait()
end
|
-- body.HB.BrickColor = bool and BrickColor.new("Pearl") or BrickColor.new("Black")
-- body.HB.Material = bool and "Neon" or "SmoothPlastic
-- body.L2.Light.Enabled = bool --if you want That Bright Lights. |
elseif lights == 'HB' then
body.HB.Material = bool and "Neon" or "SmoothPlastic"
body.HB.Light.Enabled = bool
end
end
local b = ''
function Toggle(dir, tog)
if dir == 'Left' then
body.LeftIn.Material = tog and "Neon" or "Neon"
body.LeftIn.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
body.RLeft.Material = tog and "Neon" or "SmoothPlastic"
body.RLeft.BrickColor = tog and BrickColor.new("Really red") or BrickColor.new("Maroon")
car.Misc.FL.Mirror.Ind.Material = tog and "Neon" or "SmoothPlastic"
car.Misc.FL.Mirror.Ind.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
car.DriveSeat.LI.Value = tog
elseif dir == 'Right' then
body.RightIn.Material = tog and "Neon" or "Neon"
body.RightIn.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
body.RRight.Material = tog and "Neon" or "SmoothPlastic"
body.RRight.BrickColor = tog and BrickColor.new("Really red") or BrickColor.new("Maroon")
body.RRight2.Material = tog and "Neon" or "SmoothPlastic"
body.RRight2.BrickColor = tog and BrickColor.new("Really red") or BrickColor.new("Pearl")
car.Misc.FR.Mirror.Ind.Material = tog and "Neon" or "SmoothPlastic"
car.Misc.FR.Mirror.Ind.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
car.DriveSeat.RI.Value = tog
elseif dir == 'Hazards' then
body.LeftIn.Material = tog and "Neon" or "Neon"
body.LeftIn.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
car.Misc.FL.Mirror.Ind.Material = tog and "Neon" or "SmoothPlastic"
car.Misc.FL.Mirror.Ind.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
car.Misc.FR.Mirror.Ind.Material = tog and "Neon" or "SmoothPlastic"
car.Misc.FR.Mirror.Ind.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
body.RLeft.Material = tog and "Neon" or "SmoothPlastic"
body.RLeft.BrickColor = tog and BrickColor.new("Really red") or BrickColor.new("Maroon")
body.RightIn.Material = tog and "Neon" or "Neon"
body.RightIn.BrickColor = tog and BrickColor.new("Deep orange") or BrickColor.new("Pearl")
body.RRight.Material = tog and "Neon" or "SmoothPlastic"
body.RRight.BrickColor = tog and BrickColor.new("Really red") or BrickColor.new("Maroon")
car.DriveSeat.LI.Value = tog
car.DriveSeat.RI.Value = tog
end
end
function blink(typ)
b = typ
if blinking == true then
blinking = false
else
blinking = true
while blinking do
Toggle(typ, true)
script.Parent:FireClient(player, 'blink', .9, true)
wait(1/3)
Toggle(typ, false)
script.Parent:FireClient(player, 'blink', 0.8, true)
wait(1/3)
end
Toggle('Hazards', false)
script.Parent:FireClient(player, 'blink', .9, false)
end
end
script.Parent.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") and BlinkersEnabled then
if blinking == true and b == 'Hazards' then
return
else
blinking = false
end
end
end)
F.blinkers = function(dir)
blink(dir)
end
F.rv = function(bool)
tk.RV.Material = bool and "Neon" or "SmoothPlastic"
end
F.flash = function()
Toggle('Hazards', true)
wait(1/3)
Toggle('Hazards', false)
end
script.Parent.OnServerEvent:connect(function(pl,Fnc,...)
player = pl
F[Fnc](...)
end)
|
--[[[Default Controls]] |
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
-- запоминаем заготовку |
local sample = script.Parent.Lift:Clone() -- берём заготовку
local rand = Random.new() -- инициализация рандома
script.Parent.Lift:Destroy() -- удаляем исходник
for i = -7, 7 do
local pos = CFrame.new(0,0, 10.5*i + 10 + script.Parent.Parent.BasePart.Position.Z)
local tmp=sample:Clone()
tmp.Part.Speed.Value=rand:NextInteger(1,8)
tmp.Part.Moving.Disabled=false
tmp:SetPrimaryPartCFrame(pos)
tmp.Parent = script.Parent
end
|
-- Concatenate these two tables, return result. |
function CommonUtil.TableConcat(t1,t2)
for i=1,#t2 do
t1[#t1+1] = t2[i]
end
return t1
end
|
--[[**
ensures Roblox Vector2int16 type
@param value The value to check against
@returns True iff the condition is satisfied, false otherwise
**--]] |
t.Vector2int16 = t.typeof("Vector2int16")
|
--- Sets the text in the command bar text box, and captures focus |
function Window:SetEntryText(text)
Entry.TextBox.Text = text
if self:IsVisible() then
Entry.TextBox:CaptureFocus()
Entry.TextBox.CursorPosition = #text + 1
Window:UpdateWindowHeight()
end
end
|
--[[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 = 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.FAntiRoll = 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
|
---------------------------
--[[
--Main anchor point is the DriveSeat <car.DriveSeat>
Usage:
MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld" **Applies to Motor welds only
ModelWeld(Model,MainPart)
Example:
MakeWeld(car.DriveSeat,misc.PassengerSeat)
MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here | |
-- Import into an entire datastore type: |
local function importDataStoresFromTable(origin, destination, warnFunc, methodName, prefix, isOrdered)
for name, scopes in pairs(origin) do
if type(name) ~= "string" then
warnFunc(("%s: ignored %s > %q (name is not a string, but a %s)")
:format(methodName, prefix, tostring(name), typeof(name)))
elseif type(scopes) ~= "table" then
warnFunc(("%s: ignored %s > %q (scope list is not a table, but a %s)")
:format(methodName, prefix, name, typeof(scopes)))
elseif #name == 0 then
warnFunc(("%s: ignored %s > %q (name is an empty string)")
:format(methodName, prefix, name))
elseif #name > Constants.MAX_LENGTH_NAME then
warnFunc(("%s: ignored %s > %q (name exceeds %d character limit)")
:format(methodName, prefix, name, Constants.MAX_LENGTH_NAME))
else
for scope, data in pairs(scopes) do
if type(scope) ~= "string" then
warnFunc(("%s: ignored %s > %q > %q (scope is not a string, but a %s)")
:format(methodName, prefix, name, tostring(scope), typeof(scope)))
elseif type(data) ~= "table" then
warnFunc(("%s: ignored %s > %q > %q (data list is not a table, but a %s)")
:format(methodName, prefix, name, scope, typeof(data)))
elseif #scope == 0 then
warnFunc(("%s: ignored %s > %q > %q (scope is an empty string)")
:format(methodName, prefix, name, scope))
elseif #scope > Constants.MAX_LENGTH_SCOPE then
warnFunc(("%s: ignored %s > %q > %q (scope exceeds %d character limit)")
:format(methodName, prefix, name, scope, Constants.MAX_LENGTH_SCOPE))
else
if not destination[name] then
destination[name] = {}
end
if not destination[name][scope] then
destination[name][scope] = {}
end
Utils.importPairsFromTable(
data,
destination[name][scope],
Interfaces[destination[name][scope]],
warnFunc,
methodName,
("%s > %q > %q"):format(prefix, name, scope),
isOrdered
)
end
end
end
end
end
function MockDataStoreManager.ImportFromJSON(json, verbose)
local content
if type(json) == "string" then
local parsed, value = pcall(function() return HttpService:JSONDecode(json) end)
if not parsed then
error("bad argument #1 to 'ImportFromJSON' (string is not valid json)", 2)
end
content = value
elseif type(json) == "table" then
content = Utils.deepcopy(json)
else
error(("bad argument #1 to 'ImportFromJSON' (string or table expected, got %s)"):format(typeof(json)), 2)
end
local warnFunc = warn -- assume verbose as default
if verbose == false then -- intentional formatting
warnFunc = function() end
end
if type(content.GlobalDataStore) == "table" then
Utils.importPairsFromTable(
content.GlobalDataStore,
Data.GlobalDataStore,
Interfaces[Data.GlobalDataStore],
warnFunc,
"ImportFromJSON",
"GlobalDataStore",
false
)
end
if type(content.DataStore) == "table" then
importDataStoresFromTable(
content.DataStore,
Data.DataStore,
warnFunc,
"ImportFromJSON",
"DataStore",
false
)
end
if type(content.OrderedDataStore) == "table" then
importDataStoresFromTable(
content.OrderedDataStore,
Data.OrderedDataStore,
warnFunc,
"ImportFromJSON",
"OrderedDataStore",
true
)
end
end
return MockDataStoreManager
|
-- Player specific convenience variables |
local MyPlayer = nil
local MyCharacter = nil
local MyHumanoid = nil
local MyTorso = nil
local MyMouse = nil
local RecoilAnim
local RecoilTrack = nil
local IconURL = Tool.TextureId -- URL to the weapon icon asset
local DebrisService = game:GetService('Debris')
local PlayersService = game:GetService('Players')
local FireSound
local OnFireConnection = nil
local OnReloadConnection = nil
local DecreasedAimLastShot = false
local LastSpreadUpdate = time()
|
-- tween the sound to the speed |
local tween = game:GetService("TweenService"):Create(waterSound,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In),{["Volume"] = math.clamp(speed/maxSpeed,0,1)}) -- end of tweencreate
tween:Play()
end
|
-- VIP SERVER OWNER |
VipServerOwner = "NonAdmin";
|
-- Simple raycast alias |
local function Cast(origin, direction, ignoreDescendantsInstance, ignoreWater)
local castRay = Ray.new(origin, direction)
return Workspace:FindPartOnRay(castRay, ignoreDescendantsInstance, false, ignoreWater)
end
|
------//Aim Animations |
self.RightAim = CFrame.new(-.575, 0.1, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0));
self.LeftAim = CFrame.new(1.4,0.25,-1.45) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-25));
|
--[[Steering]] |
Tune.SteerInner = 26 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 25 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .06 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 330 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
--Handlebars hinge |
bike.FrontSection.TripleTreeHinge.Size = Vector3.new(_Tune.HingeSize,_Tune.HingeSize,_Tune.HingeSize)
bike.FrontSection.TripleTreeHinge.CustomPhysicalProperties = PhysicalProperties.new(_Tune.HingeDensity,0,0,100,100)
if _Tune.HingesVisible or _Tune.Debug then bike.FrontSection.TripleTreeHinge.Transparency = .75 else bike.FrontSection.TripleTreeHinge.Transparency = 1 end
local shinge = bike.FrontSection.TripleTreeHinge:Clone()
shinge.Parent = bike.Body
shinge.Name = "SteeringHinge"
local shingea = Instance.new("Attachment", shinge)
local shingeb = Instance.new("Attachment", bike.FrontSection.TripleTreeHinge)
local shingec = Instance.new("HingeConstraint", shinge)
shingec.Attachment0 = shingea
shingec.Attachment1 = shingeb
shingec.LimitsEnabled = true
shingec.UpperAngle = _Tune.SteerAngle
shingec.LowerAngle = -_Tune.SteerAngle
shingec.ActuatorType = "None"
|
--[[
Invisicam - Occlusion module that makes objects occluding character view semi-transparent
2018 Camera Update - AllYourBlox
--]] |