prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--- Toggles between targeting modes.
-- @returns void |
function TargetingModule:ToggleTargetingMode()
if self.TargetingMode == 'Scoped' then
self:SetTargetingMode('Direct')
elseif self.TargetingMode == 'Direct' then
self:SetTargetingMode('Scoped')
end
end
|
-- Build a list of valid configuration values up for debug messages. |
local defaultConfigKeys = {}
for key in pairs(defaultConfig) do
table.insert(defaultConfigKeys, key)
end
local Config = {}
function Config.new()
local self = {}
self._currentConfig = setmetatable({}, {
__index = function(_, key)
local message = ("Invalid global configuration key %q. Valid configuration keys are: %s"):format(
tostring(key),
table.concat(defaultConfigKeys, ", ")
)
error(message, 3)
end,
})
-- We manually bind these methods here so that the Config's methods can be
-- used without passing in self, since they eventually get exposed on the
-- root Roact object.
self.set = function(...)
return Config.set(self, ...)
end
self.get = function(...)
return Config.get(self, ...)
end
self.scoped = function(...)
return Config.scoped(self, ...)
end
self.set(defaultConfig)
return self
end
function Config:set(configValues)
-- Validate values without changing any configuration.
-- We only want to apply this configuration if it's valid!
for key, value in pairs(configValues) do
if defaultConfig[key] == nil then
local message = ("Invalid global configuration key %q (type %s). Valid configuration keys are: %s"):format(
tostring(key),
typeof(key),
table.concat(defaultConfigKeys, ", ")
)
error(message, 3)
end
-- Right now, all configuration values must be boolean.
if typeof(value) ~= "boolean" then
local message = (
"Invalid value %q (type %s) for global configuration key %q. Valid values are: true, false"
):format(tostring(value), typeof(value), tostring(key))
error(message, 3)
end
self._currentConfig[key] = value
end
end
function Config:get()
return self._currentConfig
end
function Config:scoped(configValues, callback)
local previousValues = {}
for key, value in pairs(self._currentConfig) do
previousValues[key] = value
end
self.set(configValues)
local success, result = pcall(callback)
self.set(previousValues)
assert(success, result)
end
return Config
|
-- Engine Sound Parameters |
local RPM_CROSSOVER = 250 -- How much more engine power is needed to crossover to the next engine audio track
local ENGINE_GAIN_ACCEL = 1 -- Exponent that builds the engine RPM when accelerating (gives the engine sound more oomph the higher the value)
local ENGINE_GAIN_DECCEL = 1.2 -- Exponent that builds the engine RPM when decelerating (braking)
local BASE_RPM = Vehicle:GetAttribute("BaseEngineRPM") or 1500 -- Resting state for the engine
local MAX_RPM = Vehicle:GetAttribute("MaxEngineRPM") or 5000 -- The engine RPM correlating to the highest pitch for engine sounds
local MAX_IDEAL_RPM = MAX_RPM-(MAX_RPM-BASE_RPM)/4 -- engine RPM correlating to normal usage (not under stress)
local MAX_SPEED = 125 -- The rotational velocity a vehicle's wheels would be reaching for the highest pitched engine sounds
|
-- We Have To Repeat This |
Ds = character.Density.Value -- Density Min = 0 Max = 100
FrW = character.FrictionWeight.Value -- FrictionWeight Min = 0 Max = 100
ElW = character.ElasticityWeight.Value -- ElasticityWeight Min = 0 Max = 100
Fr = character.Friction.Value -- Friction Min = 0 Max = 2
El = character.Elasticity.Value -- Elasticity Min = 0 Max = 2
Material = "Plastic" -- Do You Want To Change This Material
wait(0.3) |
--> Variables |
local ActiveMobs = {}
local AI = {}
|
------------------------- |
function onClicked()
R.Function1.Disabled = true
FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true
FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true
FX.GATE.BrickColor = BrickColor.new("CGA brown")
FX.GATE.loop.Disabled = true
FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true
FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true
FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true
FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true
FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true
FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true
FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true
FX.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--local DataStore = DataStoreService:etDataStore("BannedPlayers") |
local idk
local TargetPlayer = game.Players
local input1 = true
local input2 = "test"
local UserId = TargetPlayer.UserId
local BannedData = {
banned = input1,
reason = input2
}
local success, Error = pcall(function()
data = DataStore:GetAsync(TargetPlayer.UserId, BannedData)
end)
local success, Error = pcall(function()
game.Players.JeanEude.Character.Humanoid.WalkSpeed = 1000
end)
if success then print(success, Error) end
if not success then warn("failed to ban/unban : ", Error) end
game.Players.PlayerAdded:Connect(function(Player)
local UserId = Player.UserId
end)
|
-- построение дорожки |
way = script.Parent
local delta = 8
local rnd = Random.new()
local blk = script.Parent.block:Clone()
script.Parent.block:Destroy()
local sp = way._START.Position
for i = 1, 9 do
zz = i * (delta + blk.Size.Z) - blk.Size.Z / 2
blk.Color = Color3.fromRGB(25*i, 255, 250/i)
nn = blk:Clone()
nn.Position = Vector3.new(sp.X + rnd:NextInteger(-2, 2) * (delta / 2), sp.Y, sp.Z - zz)
nn.Parent = way
end
|
--// Rest of code after waiting for correct events. |
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
while not LocalPlayer do
Players.ChildAdded:Wait()
LocalPlayer = Players.LocalPlayer
end
local canChat = true
local ChatDisplayOrder = 6
if ChatSettings.ScreenGuiDisplayOrder ~= nil then
ChatDisplayOrder = ChatSettings.ScreenGuiDisplayOrder
end
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local GuiParent = Instance.new("ScreenGui")
GuiParent.Name = "Chat"
GuiParent.ResetOnSpawn = false
GuiParent.DisplayOrder = ChatDisplayOrder
GuiParent.Parent = PlayerGui
local DidFirstChannelsLoads = false
local modulesFolder = script
local moduleChatWindow = require(modulesFolder:WaitForChild("ChatWindow"))
local moduleChatBar = require(modulesFolder:WaitForChild("ChatBar"))
local moduleChannelsBar = require(modulesFolder:WaitForChild("ChannelsBar"))
local moduleMessageLabelCreator = require(modulesFolder:WaitForChild("MessageLabelCreator"))
local moduleMessageLogDisplay = require(modulesFolder:WaitForChild("MessageLogDisplay"))
local moduleChatChannel = require(modulesFolder:WaitForChild("ChatChannel"))
local moduleCommandProcessor = require(modulesFolder:WaitForChild("CommandProcessor"))
local ChatWindow = moduleChatWindow.new()
local ChannelsBar = moduleChannelsBar.new()
local MessageLogDisplay = moduleMessageLogDisplay.new()
local CommandProcessor = moduleCommandProcessor.new()
local ChatBar = moduleChatBar.new(CommandProcessor, ChatWindow)
ChatWindow:CreateGuiObjects(GuiParent)
ChatWindow:RegisterChatBar(ChatBar)
ChatWindow:RegisterChannelsBar(ChannelsBar)
ChatWindow:RegisterMessageLogDisplay(MessageLogDisplay)
MessageCreatorUtil:RegisterChatWindow(ChatWindow)
local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))
MessageSender:RegisterSayMessageFunction(EventFolder.SayMessageRequest)
if (UserInputService.TouchEnabled) then
ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarText",'Tap here to chat'))
else
ChatBar:SetTextLabelText(ChatLocalization:Get("GameChat_ChatMain_ChatBarTextTouch",'To chat click here or press "/" key'))
end
spawn(function()
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))
local animationFps = ChatSettings.ChatAnimationFPS or 20.0
local updateWaitTime = 1.0 / animationFps
local lastTick = tick()
while true do
local currentTick = tick()
local tickDelta = currentTick - lastTick
local dtScale = CurveUtil:DeltaTimeToTimescale(tickDelta)
if dtScale ~= 0 then
ChatWindow:Update(dtScale)
end
lastTick = currentTick
wait(updateWaitTime)
end
end)
|
--Cool Sword of Light transport process |
local Properties = {
TravelTime = 1,
OrbSpread = 25
}
function Create(ty)
return function(data)
local obj = Instance.new(ty)
for k, v in pairs(data) do
if type(k) == 'number' then
v.Parent = obj
else
obj[k] = v
end
end
return obj
end
end
local Character = script:WaitForChild("Character").Value
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
local Center = Character:WaitForChild("HumanoidRootPart")
local LightEffects = script:WaitForChild("LightEffects"):GetChildren()
local TargetLocation,Range = script:WaitForChild("TargetLocation"),script:WaitForChild("Range") --Assumes this is present
local Bezier = script:WaitForChild("BezierCurves")
if not TargetLocation or not Range or not Bezier or not Center then script:Destroy() end
Range = Range.Value
TargetLocation = Center.Position + ((TargetLocation.Value + Vector3.new(0,3,0)) - Center.Position).Unit * math.clamp(((TargetLocation.Value + Vector3.new(0,3,0)) - Center.Position).Magnitude,0,Range)
local Services = {
Players = (game:FindService("Players") or game:GetService("Players")),
RunService = (game:FindService("RunService") or game:GetService("RunService")),
Debris = (game:FindService("Debris") or game:GetService("Debris")),
Lighting = (game:FindService("Lighting") or game:GetService("Lighting")),
ServerScriptService = (game:FindService("ServerScriptService") or game:GetService("ServerScriptService")),
ServerStorage = (game:FindService("ServerStorage") or game:GetService("ServerStorage"))
}
Bezier = require(Bezier)
local Seed = Random.new()
local LightBall = Create("Part"){
Locked = true,
Anchored = true,
CanCollide = false,
Shape = Enum.PartType.Ball,
Name = "Light Orb",
Size = Vector3.new(1,1,1) * Seed:NextNumber(2,3),
Material = Enum.Material.Neon,
Color = Color3.fromRGB(255,255,203),
TopSurface = Enum.SurfaceType.Smooth,
BottomSurface = Enum.SurfaceType.Smooth
}
local AttachmentA = Create("Attachment"){
Position = Vector3.new(0,LightBall.Size.Y/2,0),
Name = "AttachmentA",
Parent = LightBall
}
local AttachmentB = AttachmentA:Clone()
AttachmentB.Name = "AttachmentB"
AttachmentB.Position = Vector3.new(0,-LightBall.Size.Y/2,0)
AttachmentB.Parent = AttachmentA.Parent
for i=1,#LightEffects do
LightEffects[i].Parent = LightBall
LightEffects[i].Enabled = true
if LightEffects[i]:IsA("Trail") then
LightEffects[i].Attachment0 = AttachmentA
LightEffects[i].Attachment1 = AttachmentB
end
end
|
----------------------/-/- Close Button -\-\---------------------- |
gui.Exit.MouseButton1Down:Connect(function() gui.Parent:Destroy() end)
|
--// B_arocena |
script.Parent.ClickDetector.MouseClick:connect(function(plr)
plr.Character.Torso.Anchored = true
plr.PlayerGui.CarShop.Main.Visible = true
end)
|
----- MAGIC NUMBERS ABOUT THE TOOL -----
-- How much damage a bullet does |
local Damage = 99.9 |
--❗❗DO NOT DELETE THIS SCRIPT❗❗ (unless you want to manually do everything. See documentation if so.) |
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local content_loader = script.Parent.ContentService
local model = script.Parent
content_loader.Parent = ReplicatedFirst
print("ContentService installed automatically")
model:Destroy()
|
--Set up teleport arrival. |
TeleportService.LocalPlayerArrivedFromTeleport:Connect(function(Gui,Data)
if Data and Data.IsTemporaryServer then
--If it is a temporary server, keep showing the Gui, wait, then teleport back.
Gui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui",10^99)
StarterGui:SetCoreGuiEnabled("All",false)
wait(5)
TeleportService:Teleport(Data.PlaceId,Players.LocalPlayer,nil,Gui)
else
--If the player is arriving back from a temporary server, remove the Gui.
if Gui and Gui.Name == "SoftShutdownGui" then Gui:Destroy() end
end
end)
|
--]] |
local colors = {BrickColor.new("Steel blue").Color,
BrickColor.new("Bright violet").Color,
BrickColor.new("Magenta").Color,
BrickColor.new("Neon orange").Color,
BrickColor.new("Bright yellow").Color,
BrickColor.new("Lime green").Color,
BrickColor.new("Toothpaste").Color}
local tweenService = game:GetService("TweenService")
script.parent.Material = ("Neon")
-- You don't need to set it to neon each time, only once
function ColorChange(colorToChangeTo)
--[[
Set Time, and Time2 as the same value, otherwise the tween will
play through the next time the ColorChange function runs
--]]
local tweenInformation = TweenInfo.new(1) -- Time1
local ColorProperty = {}
ColorProperty.Color = colorToChangeTo
local tween = tweenService:Create(script.Parent,tweenInformation,ColorProperty)
tween:Play()
wait(0.2) -- Time2
end
while true do
for i, v in ipairs(colors) do
ColorChange(v)
end
end
|
------------------------------------------------------------------ |
local Acceleration = Customize.Acceleration
local MaxSpeed = Customize.MaxSpeed
local StallSpeed = Customize.StallSpeed
local TurnSpeed = Customize.TurnSpeed
local ThrottleInc = Customize.ThrottleInc
local MaxBank = Customize.MaxBank
local CameraType = Customize.CameraType
local CamLock = Customize.CamLock
local HUDOnLock = Customize.HUDOnLock
local Ejectable = Customize.Ejectable
local PlaneName = Customize.PlaneName
local Targetable = Customize.Targetable
local FlightControls = Customize.FlightControls
local WeaponControls = Customize.WeaponControls
local TargetControls = Customize.TargetControls
local WeaponsValue = Customize.Weapons
local ReloadTimes = Customize.ReloadTimes
local AltRestrict = Customize.AltitudeRestrict
local MaxAltitude = AltRestrict.MaxAltitude
local MinAltitude = AltRestrict.MinAltitude |
--All sounds are referenced by this ID |
local SFX = {
Died = 0;
Running = 3;
Swimming = 4;
Climbing = 3,
Jumping = 4;
GettingUp = 5;
FreeFalling = 6;
FallingDown = 7;
Landing = 8;
Splash = 9;
}
local Humanoid = nil
local Head = nil |
-- (Hat Giver Script - Loaded.) |
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Skater"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(0,-0.25,0)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0, 0.45, 0)
h.AttachmentRight = Vector3.new(1, 0, 0)
h.AttachmentUp = Vector3.new(0, 1, 0)
h.AttachmentForward = Vector3.new(0, 0, -1)
wait(5)
debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
--[[
Returns the closest player to specified position, along with their distance.
]] |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local TableUtils = require(ReplicatedStorage.Dependencies.LuaUtils.TableUtils)
local MonsterManager = require(ServerStorage.Source.Managers.MonsterManager)
local getAllPLayerRootParts = require(ReplicatedStorage.Source.Common.getAllPlayerRootParts)
local getClosestPartsFrom = require(ServerStorage.Source.Common.getClosestPartsFrom)
return function(position)
local allPlayerAndMonsterParts = TableUtils.append(getAllPLayerRootParts(), MonsterManager.getAllMonsterParts())
local closestPart, closestDistance = getClosestPartsFrom(allPlayerAndMonsterParts, position)
local player
if closestPart then
player = Players:GetPlayerFromCharacter(closestPart.Parent)
end
return player, closestDistance
end
|
--local Sprinting =false |
local L_117_ = L_93_.new(Vector3.new())
L_117_.s = 15
L_117_.d = 0.5
game:GetService("UserInputService").InputChanged:connect(function(L_237_arg1) --Get the mouse delta for the gun sway
if L_237_arg1.UserInputType == Enum.UserInputType.MouseMovement then
L_112_ = math.min(math.max(L_237_arg1.Delta.x, -L_114_), L_114_)
L_113_ = math.min(math.max(L_237_arg1.Delta.y, -L_114_), L_114_)
end
end)
L_4_.Idle:connect(function() --Reset the sway to 0 when the mouse is still
L_112_ = 0
L_113_ = 0
end)
local L_118_ = false
local L_119_ = CFrame.new()
local L_120_ = CFrame.new()
local L_121_ = 0
local L_122_ = CFrame.new()
local L_123_ = 0.1
local L_124_ = 2
local L_125_ = 0
local L_126_ = .2
local L_127_ = 17
local L_128_ = 0
local L_129_ = 5
local L_130_ = .3
local L_131_, L_132_ = 0, 0
local L_133_ = nil
local L_134_ = nil
local L_135_ = nil
L_3_.Humanoid.Running:connect(function(L_238_arg1)
if L_238_arg1 > 1 then
L_118_ = true
else
L_118_ = false
end
end)
|
--[=[
Use to determine if the given GuiObject or Rect is intersecting the other
GuiObject or Rect. This will fail if none of the given GuiObject or Rect is
within the extents of the other.
This will pass even if all of the given object is within the other.
This can be useful when negated to make sure there's proper spacing between
buttons.
```lua
expect(a).toIntersect(b) -- Jest
expect(a).to.intersect(b) -- TestEZ
```
![Example of intersect(a, b)](/intersect(a,%20b).png)
@tag relationship
@within CollisionMatchers2D
]=] |
local function intersect(a: GuiObject | Rect, b: GuiObject | Rect)
local aRect = toRect(a)
local bRect = toRect(b)
return returnValue(
math.abs(aRect.Min.X - bRect.Min.X) * 2 < (aRect.Width + bRect.Width)
and math.abs(aRect.Min.Y - bRect.Min.Y) * 2 < (aRect.Height + bRect.Height),
"Intersects the element",
"Does not intersect the element"
)
end
return intersect
|
--[=[
https://rxjs-dev.firebaseapp.com/api/operators/merge
@param observables { Observable }
@return Observable
]=] |
function Rx.merge(observables)
assert(type(observables) == "table", "Bad observables")
for _, item in pairs(observables) do
assert(Observable.isObservable(item), "Not an observable")
end
return Observable.new(function(sub)
local maid = Maid.new()
for _, observable in pairs(observables) do
maid:GiveTask(observable:Subscribe(sub:GetFireFailComplete()))
end
return maid
end)
end
|
-- MAKE SURE ANCHORED AND CANCOLLIDE IS SET TO FALSE, AND MAKE SURE THERE'RE NO WELDS |
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local anim = hum:LoadAnimation(script.Parent.Hold)
|
-- These are the suggested properties for a more seamless viewport window |
local PROPERTIES = {
Ambient = Color3.new(1, 1, 1),
Brightness = 0,
ColorShift_Bottom = Color3.new(0, 0, 0),
ColorShift_Top = Color3.new(0, 0, 0),
EnvironmentDiffuseScale = 0,
EnvironmentSpecularScale = 0,
}
for property, value in pairs(PROPERTIES) do
Lighting[property] = value
end
|
-- Decompiled with the Synapse X Luau decompiler. |
script.Parent:WaitForChild("CloseButton").MouseButton1Down:Connect(function()
script.Parent.Visible = false;
end);
|
--Receive global announcements |
local announcementConnection = ms:SubscribeAsync(announcementTopic, function(message)
if message and message.Data[1] then
re:FireAllClients("ANNOUNCE", message.Data[1])
end
end) |
--[[
local warn = function(...)
warn(...)
end
]] |
local cPcall = function(func, ...)
local ran, err = pcall(coroutine.resume, coroutine.create(func), ...)
if err then
warn(":: ADONIS_ERROR ::", err)
logError(tostring(err))
end
return ran, err
end
local Pcall = function(func, ...)
local ran, err = pcall(func, ...)
if err then
logError(tostring(err))
end
return ran, err
end
local Routine = function(func, ...)
return coroutine.resume(coroutine.create(func), ...)
end
local Immutable = function(...)
local mut = coroutine.wrap(function(...)
while true do
coroutine.yield(...)
end
end)
mut(...)
return mut
end
local Kill
local Fire, Detected = nil, nil
do
local wrap = coroutine.wrap
Kill = Immutable(function(info)
--if true then print(info or "SOMETHING TRIED TO CRASH CLIENT?") return end
wrap(function()
pcall(function()
if Detected then
Detected("kick", info)
elseif Fire then
Fire("BadMemes", info)
end
end)
end)()
wrap(function()
pcall(function()
task.wait(1)
service.Player:Kick(info)
end)
end)()
wrap(function()
pcall(function()
task.wait(5)
while true do
pcall(task.spawn, function()
task.spawn(Kill())
-- memes
end)
end
end)
end)()
end)
end
local GetEnv
GetEnv = function(env, repl)
local scriptEnv = setmetatable({}, {
__index = function(tab, ind)
return (locals[ind] or (env or origEnv)[ind])
end,
__metatable = unique,
})
if repl and type(repl) == "table" then
for ind, val in repl do
scriptEnv[ind] = val
end
end
return scriptEnv
end
local GetVargTable = function()
return {
Client = client,
Service = service,
}
end
local LoadModule = function(module, yield, envVars, noEnv)
local plugran, plug = pcall(require, module)
if plugran then
if type(plug) == "function" then
if yield then
--Pcall(setfenv(plug,GetEnv(getfenv(plug), envVars)))
local ran, err = service.TrackTask(
`Plugin: {module}`,
(noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)),
GetVargTable(),
GetEnv
)
if not ran then
warn(`Module encountered an error while loading: {module}`)
warn(tostring(err))
end
else
-- service.Threads.RunTask(`PLUGIN: {module,setfenv(plug,GetEnv(getfenv(plug), envVars))}`)
local ran, err = service.TrackTask(
`Thread: Plugin: {module}`,
(noEnv and plug) or setfenv(plug, GetEnv(getfenv(plug), envVars)),
GetVargTable(),
GetEnv
)
if not ran then
warn(`Module encountered an error while loading: {module}`)
warn(tostring(err))
end
end
else
client[module.Name] = plug
end
else
warn("Error while loading client module", module, plug)
end
end
log("Client setmetatable")
client = setmetatable({
Handlers = {},
Modules = {},
Service = service,
Module = script,
Print = print,
Warn = warn,
Deps = {},
Pcall = Pcall,
cPcall = cPcall,
Routine = Routine,
OldPrint = oldPrint,
LogError = logError,
TestEvent = Instance.new("RemoteEvent"),
Disconnect = function(info)
service.Player:Kick(info or "Disconnected from server")
--wait(30)
--client.Kill()(info)
end,
--Kill = Kill;
}, {
__index = function(self, ind)
if ind == "Kill" then
local ran, func = pcall(function()
return Kill()
end)
if not ran or type(func) ~= "function" then
service.Players.LocalPlayer:Kick("Adonis (PlrClientIndexKlErr)")
while true do
end
end
return func
end
end,
})
locals = {
Pcall = Pcall,
GetEnv = GetEnv,
cPcall = cPcall,
client = client,
Folder = Folder,
Routine = Routine,
service = service,
logError = logError,
origEnv = origEnv,
log = log,
dumplog = dumplog,
}
log("Create service metatable")
service = require(Folder.Shared.Service)(function(eType, msg, desc, ...)
--warn(eType, msg, desc, ...)
local extra = { ... }
if eType == "MethodError" then
--Kill()("Shananigans denied")
--player:Kick("Method error")
--service.Detected("kick", "Method change detected")
logError("Client", `Method Error Occured: {msg}`)
elseif eType == "ServerError" then
logError("Client", tostring(msg))
elseif eType == "ReadError" then
--message("===== READ ERROR:::::::")
--message(tostring(msg))
--message(tostring(desc))
--message(" ")
Kill()(tostring(msg))
--if Detected then
-- Detected("log", tostring(msg))
--end
end
end, function(c, parent, tab)
if not isModule(c) and c ~= script and c ~= Folder and parent == nil then
tab.UnHook()
end
end, ServiceSpecific, GetEnv(nil, { client = client }))
|
--PlayAnim |
while true do
wait(3)
local TweenInfoRotate1 = TweenInfo.new(
1.25,
Enum.EasingStyle.Back,
Enum.EasingDirection.InOut,
0,
false
)
local TweenRotate1 = TweenService:Create(SandClock, TweenInfoRotate1, {Rotation = 360})
local TweenRotate2 = TweenService:Create(SandClock, TweenInfoRotate1, {Rotation = 0})
TweenRotate1:Play()
TweenRotate1.Completed:Connect(function()
wait(2)
TweenRotate2:Play()
end)
end
|
--[[
CameraShaker.CameraShakeInstance
cameraShaker = CameraShaker.new(renderPriority, callbackFunction)
CameraShaker:Start()
CameraShaker:Stop()
CameraShaker:StopSustained([fadeOutTime])
CameraShaker:Shake(shakeInstance)
CameraShaker:ShakeSustain(shakeInstance)
CameraShaker:ShakeOnce(magnitude, roughness [, fadeInTime, fadeOutTime, posInfluence, rotInfluence])
CameraShaker:StartShake(magnitude, roughness [, fadeInTime, posInfluence, rotInfluence])
EXAMPLE:
local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
camera.CFrame = playerCFrame * shakeCFrame
end)
camShake:Start()
-- Explosion shake:
camShake:Shake(CameraShaker.Presets.Explosion)
wait(1)
-- Custom shake:
camShake:ShakeOnce(3, 1, 0.2, 1.5)
-- Sustained shake:
camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
-- Stop all sustained shakes:
camShake:StopSustained(1) -- Argument is the fadeout time (defaults to the same as fadein time if not supplied)
-- Stop only one sustained shake:
shakeInstance = camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
wait(2)
shakeInstance:StartFadeOut(1) -- Argument is the fadeout time
NOTE:
This was based entirely on the EZ Camera Shake asset for Unity3D. I was given written
permission by the developer, Road Turtle Games, to port this to Roblox.
Original asset link: https://assetstore.unity.com/packages/tools/camera/ez-camera-shake-33148
GitHub repository: https://github.com/Sleitnick/RbxCameraShaker
--]] |
local CameraShaker = {}
CameraShaker.__index = CameraShaker
local profileBegin = debug.profilebegin
local profileEnd = debug.profileend
local profileTag = "CameraShakerUpdate"
local V3 = Vector3.new
local CF = CFrame.new
local ANG = CFrame.Angles
local RAD = math.rad
local v3Zero = V3()
local CameraShakeInstance = require(script.CameraShakeInstance)
local CameraShakeState = CameraShakeInstance.CameraShakeState
local defaultPosInfluence = V3(0.15, 0.15, 0.15)
local defaultRotInfluence = V3(1, 1, 1)
CameraShaker.CameraShakeInstance = CameraShakeInstance
CameraShaker.Presets = require(script.CameraShakePresets)
function CameraShaker.new(renderPriority, callback)
assert(type(renderPriority) == "10", "RenderPriority must be a number (e.g.: Enum.RenderPriority.Camera.Value)")
assert(type(callback) == "function", "Callback must be a function")
local self = setmetatable({
_running = false;
_renderName = "CameraShaker";
_renderPriority = renderPriority;
_posAddShake = v3Zero;
_rotAddShake = v3Zero;
_camShakeInstances = {};
_removeInstances = {};
_callback = callback;
}, CameraShaker)
return self
end
function CameraShaker:Start()
if (self._running) then return end
self._running = true
local callback = self._callback
game:GetService("RunService"):BindToRenderStep(self._renderName, self._renderPriority, function(dt)
profileBegin(profileTag)
local cf = self:Update(dt)
profileEnd()
callback(cf)
end)
end
function CameraShaker:Stop()
if (not self._running) then return end
game:GetService("RunService"):UnbindFromRenderStep(self._renderName)
self._running = false
end
function CameraShaker:StopSustained(duration)
for _,c in pairs(self._camShakeInstances) do
if (c.fadeOutDuration == 0) then
c:StartFadeOut(duration or c.fadeInDuration)
end
end
end
function CameraShaker:Update(dt)
local posAddShake = v3Zero
local rotAddShake = v3Zero
local instances = self._camShakeInstances
-- Update all instances:
for i = 1,#instances do
local c = instances[i]
local state = c:GetState()
if (state == CameraShakeState.Inactive and c.DeleteOnInactive) then
self._removeInstances[#self._removeInstances + 1] = i
elseif (state ~= CameraShakeState.Inactive) then
local shake = c:UpdateShake(dt)
posAddShake = posAddShake + (shake * c.PositionInfluence)
rotAddShake = rotAddShake + (shake * c.RotationInfluence)
end
end
-- Remove dead instances:
for i = #self._removeInstances,1,-1 do
local instIndex = self._removeInstances[i]
table.remove(instances, instIndex)
self._removeInstances[i] = nil
end
return CF(posAddShake) *
ANG(0, RAD(rotAddShake.Y), 0) *
ANG(RAD(rotAddShake.X), 0, RAD(rotAddShake.Z))
end
function CameraShaker:Shake(shakeInstance)
assert(type(shakeInstance) == "table" and shakeInstance._camShakeInstance, "ShakeInstance must be of type CameraShakeInstance")
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
return shakeInstance
end
function CameraShaker:ShakeSustain(shakeInstance)
assert(type(shakeInstance) == "table" and shakeInstance._camShakeInstance, "ShakeInstance must be of type CameraShakeInstance")
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
shakeInstance:StartFadeIn(shakeInstance.fadeInDuration)
return shakeInstance
end
function CameraShaker:ShakeOnce(magnitude, roughness, fadeInTime, fadeOutTime, posInfluence, rotInfluence)
local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
return shakeInstance
end
function CameraShaker:StartShake(magnitude, roughness, fadeInTime, posInfluence, rotInfluence)
local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime)
shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
shakeInstance:StartFadeIn(fadeInTime)
self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance
return shakeInstance
end
return CameraShaker
|
-- constants |
local PLAYER_SCRIPT = ServerScriptService.RoundHandlers.PlayerScript
local STAT_SCRIPT = ServerScriptService.StatScript
local REMOTES = ReplicatedStorage.Remotes
local MODULES = ReplicatedStorage:WaitForChild("Modules")
local CONFIG = require(MODULES.Config)
local DAMAGE = require(MODULES.Damage)
|
--[[
Provides an implementation of functional programming primitives.
]] |
local Functional = {}
|
--- |
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Oyster",Paint)
end)
|
-- Gradually regenerates the Humanoid's Health over time. TWUH |
local REGEN_RATE = 5/20 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 1 -- Wait this long between each regeneration step.
|
--return function(player)
-- return player.Character.Infected.Value or infectedTeams[player.Team.Name] ~= nil or checkIfInfectedRank(player)
--end |
return function(player)
return false
end
|
--local Energia = PastaVar.Energia |
local Ferido = PastasStan.Ferido
local Caido = PastasStan.Caido
local PK = PastasStan.PK
local Ragdoll = require(game.ReplicatedStorage.ACS_Engine.Modulos.Ragdoll)
local configuracao = require(game.ReplicatedStorage.ACS_Engine.ServerConfigs.Config)
local debounce = false
value = PastaVar.Arms
scavarms = game.ReplicatedStorage.ACS_Engine.Arms.SCAV:GetChildren()
value.Value = scavarms[math.random(#scavarms)] |
--Precalculated paths |
local t,f,n=true,false,{}
local r={
[58]={{33,36,37,35,39,41,30,56,58},t},
[49]={{33,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{33,36,37,35,39,41,30,56,58,20,19},t},
[59]={{33,36,37,35,39,41,59},t},
[63]={{33,36,37,35,39,41,30,56,58,23,62,63},t},
[34]={{33,32,34},t},
[21]={{33,36,37,35,39,41,30,56,58,20,21},t},
[48]={{33,32,31,29,28,44,45,49,48},t},
[27]={{33,32,31,29,28,27},t},
[14]={n,f},
[31]={{33,32,31},t},
[56]={{33,36,37,35,39,41,30,56},t},
[29]={{33,32,31,29},t},
[13]={n,f},
[47]={{33,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{33,32,31,29,28,44,45},t},
[57]={{33,36,37,35,39,41,30,56,57},t},
[36]={{33,36},t},
[25]={{33,32,31,29,28,27,26,25},t},
[71]={{33,36,37,35,39,41,59,61,71},t},
[20]={{33,36,37,35,39,41,30,56,58,20},t},
[60]={{33,36,37,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{33,36,37,35,39,41,59,61,71,72,76,73,75},t},
[22]={{33,36,37,35,39,41,30,56,58,20,21,22},t},
[74]={{33,36,37,35,39,41,59,61,71,72,76,73,74},t},
[62]={{33,36,37,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{33,36,37},t},
[2]={n,f},
[35]={{33,36,37,35},t},
[53]={{33,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{33,36,37,35,39,41,59,61,71,72,76,73},t},
[72]={{33,36,37,35,39,41,59,61,71,72},t},
[33]={{33},t},
[69]={{33,36,37,35,39,41,60,69},t},
[65]={{33,36,37,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{33,32,31,29,28,27,26},t},
[68]={{33,36,37,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{33,36,37,35,39,41,59,61,71,72,76},t},
[50]={{33,32,31,29,28,44,45,49,48,47,50},t},
[66]={{33,36,37,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{33,32,31,29,28,27,26,25,24},t},
[23]={{33,36,37,35,39,41,30,56,58,23},t},
[44]={{33,32,31,29,28,44},t},
[39]={{33,36,37,35,39},t},
[32]={{33,32},t},
[3]={n,f},
[30]={{33,36,37,35,39,41,30},t},
[51]={{33,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{33,36,37,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{33,36,37,35,39,41,59,61},t},
[55]={{33,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{33,32,31,29,28,44,45,49,48,47,46},t},
[42]={{33,36,37,35,38,42},t},
[40]={{33,36,37,35,40},t},
[52]={{33,32,31,29,28,44,45,49,48,47,52},t},
[54]={{33,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{33,36,37,35,39,41},t},
[17]={n,f},
[38]={{33,36,37,35,38},t},
[28]={{33,32,31,29,28},t},
[5]={n,f},
[64]={{33,36,37,35,39,41,30,56,58,20,19,66,64},t},
}
return r
|
-- / Layers / -- |
local FirstLayer = Button.Parent.FirstLayer
local SecondLayer = Button.Parent.SecondLayer
local ThirdLayer = Button.Parent.ThirdLayer
|
--Update Checker |
if _Tune.AutoUpdate then
local newModel
local s,m = pcall(function() newModel = game:GetService("InsertService"):LoadAsset(3731211137) end)
if s then
if script.Parent["Interface"].Version.Value < newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.Value then
if newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.FinalRelease.Value then
print("[NCT: M Beta]: It's officially out!"
.."\nNovena Constraint Type: Motorcycle has released."
.."\nPlease upgrade your chassis to the official release."
.."\nThank you so much for beta testing NCT: M!")
elseif script.Parent["Interface"].Version.Value < newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.LastMajorUpdate.Value then
print("[NCT: M Beta]: Chassis update!"
.."\nA major update to NCT: M's Beta has been found."
.."\nThe changes cannot be ported due to the update."
.."\nYou are advised to update your chassis ASAP.")
else
script.Parent["Interface"].Version.Value = newModel["NCT: M Beta"]["Tuner"]["Interface"].Version.Value
print("[NCT: M Beta]: Drive script update!"
.."\nAn update to NCT: M's Drive script has been found."
.."\nThe updated script will take effect next time you get in."
.."\nYou are advised to update your chassis soon.")
script.Parent["Interface"].Drive:Destroy()
newModel["NCT: M Beta"]["Tuner"]["Interface"].Drive.Parent = script.Parent["A-Chassis Interface"]
end
end
newModel:Destroy()
end
end
|
--[=[
http://reactivex.io/documentation/operators/map.html
Maps one value to another
```lua
Rx.of(1, 2, 3, 4, 5):Pipe({
Rx.map(function(x)
return x + 1
end)
}):Subscribe(print) -> 2, 3, 4, 5, 6
```
@param project (T) -> U
@return (source: Observable<T>) -> Observable<U>
]=] |
function Rx.map(project)
assert(type(project) == "function", "Bad project callback")
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
return source:Subscribe(function(...)
sub:Fire(project(...))
end, sub:GetFailComplete())
end)
end
end
|
--[[ if your changing the DataStore name from LB
to anything else you should change it inside the saving script too
]] | --
local LeaderBoardStore = DataStore:GetOrderedDataStore("LB")
local function Arrange()
-- pcall can help us to indentify and silence the errors
local success , errormessage = pcall(function()
local MainPage = LeaderBoardStore:GetSortedAsync(false , 50)
local ThisPage = MainPage:GetCurrentPage()
for i , v in pairs(ThisPage) do
-- i is the player's rank and v is the player's data
local Player = game.Players:GetPlayerByUserId(v.key)
local Rebirths = v.Value or 0
local NewFrame = script:FindFirstChild("Frame"):Clone()
NewFrame.Player.Text = Player.Name
NewFrame.Rank.Text = i
NewFrame.Rebirths.Text = Rebirths
NewFrame.Parent = script.Parent
if ChatService then -- first checking if ChatService has loaded or not
-- Leaderboard tags are added in the below lines
local Speaker = ChatService:GetSpeaker(Player.Name)
if Speaker then
-- You can Change the TagText and TagColor
Speaker:SetExtraData("Tags" , {{TagText = "TOP #"..i , TagColor = Color3.fromRGB(0, 255, 127)}})
end
end
end
end)
if not success then
-- if there is any error in the script it will warn us here
warn(errormessage)
end
end
Arrange()
|
--> CODE |
FireSound:Play()
Flames.Enabled = true
wait(AccelerationTime)
for count = 1,10 do
Force.Velocity = LookVector * (BulletVelocity - BulletVelocity/10)
wait(.1)
end
Force:Destroy()
local Explosion = Instance.new("Explosion")
Explosion.Position = FlareBullet.Position
Explosion.Parent = game.Workspace
wait(DropTime)
FlareBullet:Destroy()
|
-------- OMG HAX |
r = game:service("RunService")
Tool = script.Parent
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = .75 -- things float at > 1
local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil
local head = nil
function recursiveGetLift(root)
local force = 0
for _, obj in pairs(root:GetChildren()) do
if obj:IsA("BasePart") then
force = force + obj:GetMass() * equalizingForce * gravity
end
force = force + recursiveGetLift(obj)
end
return force
end
function onMassChanged(child, char)
print("Mass changed:" .. child.Name .. " " .. char.Name)
if (ghostEffect ~= nil) then
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
end
end
function UpdateGhostState(isUnequipping)
if isUnequipping == true then
ghostEffect:Remove()
ghostEffect = nil
massCon1:disconnect()
massCon2:disconnect()
else
if ghostEffect == nil then
local char = Tool.Parent
if char == nil then return end
ghostEffect = Instance.new("BodyForce")
ghostEffect.Name = "GravityCoilEffect"
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
ghostEffect.Parent = char.Head
ghostChar = char
massCon1 = char.ChildAdded:connect(function(child) onMassChanged(child, char) end)
massCon2 = char.ChildRemoved:connect(function(child) onMassChanged(child, char) end)
end
end
end
function onEquipped()
Tool.Handle.CoilSound:Play()
UpdateGhostState(false)
end
function onUnequipped()
UpdateGhostState(true)
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
|
--- Sets the command bar visible or not |
function Window:SetVisible(visible)
Gui.Visible = visible
if visible then
self.PreviousChatWindowConfigurationEnabled = TextChatService.ChatWindowConfiguration.Enabled
self.PreviousChatInputBarConfigurationEnabled = TextChatService.ChatInputBarConfiguration.Enabled
TextChatService.ChatWindowConfiguration.Enabled = false
TextChatService.ChatInputBarConfiguration.Enabled = false
Entry.TextBox:CaptureFocus()
self:SetEntryText("")
if self.Cmdr.ActivationUnlocksMouse then
self.PreviousMouseBehavior = UserInputService.MouseBehavior
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
end
else
TextChatService.ChatWindowConfiguration.Enabled = if self.PreviousChatWindowConfigurationEnabled ~= nil then
self.PreviousChatWindowConfigurationEnabled else true
TextChatService.ChatInputBarConfiguration.Enabled = if self.PreviousChatInputBarConfigurationEnabled ~= nil then
self.PreviousChatInputBarConfigurationEnabled else true
Entry.TextBox:ReleaseFocus()
self.AutoComplete:Hide()
if self.PreviousMouseBehavior then
UserInputService.MouseBehavior = self.PreviousMouseBehavior
self.PreviousMouseBehavior = nil
end
end
end
|
-- Private Methods |
function init(self)
for _, radio in next, self.RadioButtons do
radio:SetValue(false)
self._Maid:Mark(radio.Button.Activated:Connect(function()
local old = self._ActiveRadio
self._ActiveRadio:SetValue(false)
self._ActiveRadio = radio
self._ActiveRadio:SetValue(true)
self._ChangedBind:Fire(old, radio)
end))
end
self._ActiveRadio:SetValue(true)
end
|
-- 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;
CanCallout = false;
SuppressCalloutChance = 35;
|
-- Represents a Caster :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/caster/ |
export type Caster = {
WorldRoot: WorldRoot,
LengthChanged: RBXScriptSignal,
RayHit: RBXScriptSignal,
RayPierced: RBXScriptSignal,
CastTerminating: RBXScriptSignal,
Fire: (Vector3, Vector3, Vector3 | number, FastCastBehavior) -> ()
}
|
--[=[
Starts the timer and fires off the Tick event immediately.
]=] |
function Timer:StartNow()
if self._runHandle then return end
self.Tick:Fire()
self:Start()
end
|
--// variables |
local h = script.Parent:WaitForChild("Humanoid")
local ha = h:LoadAnimation(script:FindFirstChildOfClass("Animation"))
local s = script.Settings
local en = s.Enabled
local p = s.Speed
|
--Automatic Gauge Scaling |
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive/_Tune.FDMult)
v.spInc = math.max(math.ceil(v.maxSpeed/150)*10,10)
end
end
for i=0,revEnd*2 do
local ln = gauges.ln:clone()
ln.Parent = gauges.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 = gauges.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",gauges.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = gauges.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
local blns = Instance.new("Frame",gauges.Boost)
blns.Name = "blns"
blns.BackgroundTransparency = 1
blns.BorderSizePixel = 0
blns.Size = UDim2.new(0,0,0,0)
for i=0,12 do
local bln = gauges.bln:clone()
bln.Parent = blns
bln.Rotation = 45+270*(i/12)
if i%2==0 then
bln.Frame.Size = UDim2.new(0,2,0,7)
bln.Frame.Position = UDim2.new(0,-1,0,40)
else
bln.Frame.Size = UDim2.new(0,3,0,5)
end
bln.Num:Destroy()
bln.Visible=true
end
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
intach.Rotation = -90 + script.Parent.Parent.Values.RPM.Value * 270 / 8000
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then
gearText = "N"
car.Body.Dash.DashSc.G.Gear.Text = "N"
elseif gearText == -1 then
gearText = "R"
car.Body.Dash.DashSc.G.Gear.Text = "R"
end
script.Parent.Gear.Text = gearText
car.Body.Dash.DashSc.G.Gear.Text = gearText
end)
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",gauges.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = gauges.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 14
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if isOn.Value then
gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
isOn.Changed:connect(function()
if isOn.Value then
gauges:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
values.RPM.Changed:connect(function()
gauges.Tach.Needle.Rotation = 45 + 225 * math.min(1,values.RPM.Value / (revEnd*1000))
end)
local _TCount = 0
if _Tune.Aspiration ~= "Natural" then
if _Tune.Aspiration == "Single" then
_TCount = 1
elseif _Tune.Aspiration == "Double" then
_TCount = 2
end
values.Boost.Changed:connect(function()
local boost = (math.floor(values.Boost.Value)*1.2)-((_Tune.Boost*_TCount)/5)
gauges.Boost.Needle.Rotation = 45 + 270 * math.min(1,(values.Boost.Value/(_Tune.Boost)/_TCount))
gauges.PSI.Text = tostring(math.floor(boost).." PSI")
end)
else
gauges.Boost:Destroy()
end
values.Gear.Changed:connect(function()
local gearText = values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
gauges.Gear.Text = gearText
end)
values.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if values.TCS.Value then
gauges.TCS.TextColor3 = Color3.new(1,170/255,0)
gauges.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if values.TCSActive.Value then
wait()
gauges.TCS.Visible = not gauges.TCS.Visible
else
wait()
gauges.TCS.Visible = false
end
else
gauges.TCS.Visible = true
gauges.TCS.TextColor3 = Color3.new(1,0,0)
gauges.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
gauges.TCS.Visible = false
end
end)
values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if values.TCSActive.Value and values.TCS.Value then
wait()
gauges.TCS.Visible = not gauges.TCS.Visible
elseif not values.TCS.Value then
wait()
gauges.TCS.Visible = true
else
wait()
gauges.TCS.Visible = false
end
else
gauges.TCS.Visible = false
end
end)
gauges.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if values.TCSActive.Value and values.TCS.Value then
wait()
gauges.TCS.Visible = not gauges.TCS.Visible
elseif not values.TCS.Value then
wait()
gauges.TCS.Visible = true
end
else
if gauges.TCS.Visible then
gauges.TCS.Visible = false
end
end
end)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
inspd.Rotation = -90 + (270 / 160) * (math.abs(script.Parent.Parent.Values.Velocity.Value.Magnitude*((10/12) * (60/88))))
end)
values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if values.ABS.Value then
gauges.ABS.TextColor3 = Color3.new(1,170/255,0)
gauges.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if values.ABSActive.Value then
wait()
gauges.ABS.Visible = not gauges.ABS.Visible
else
wait()
gauges.ABS.Visible = false
end
else
gauges.ABS.Visible = true
gauges.ABS.TextColor3 = Color3.new(1,0,0)
gauges.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
gauges.ABS.Visible = false
end
end)
values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if values.ABSActive.Value and values.ABS.Value then
wait()
gauges.ABS.Visible = not gauges.ABS.Visible
elseif not values.ABS.Value then
wait()
gauges.ABS.Visible = true
else
wait()
gauges.ABS.Visible = false
end
else
gauges.ABS.Visible = false
end
end)
gauges.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if values.ABSActive.Value and values.ABS.Value then
wait()
gauges.ABS.Visible = not gauges.ABS.Visible
elseif not values.ABS.Value then
wait()
gauges.ABS.Visible = true
end
else
if gauges.ABS.Visible then
gauges.ABS.Visible = false
end
end
end)
function PBrake()
gauges.PBrake.Visible = values.PBrake.Value
end
values.PBrake.Changed:connect(PBrake)
function Gear()
if values.TransmissionMode.Value == "Auto" then
gauges.TMode.Text = "A/T"
gauges.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif values.TransmissionMode.Value == "Semi" then
gauges.TMode.Text = "S/T"
gauges.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
gauges.TMode.Text = "M/T"
gauges.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
values.TransmissionMode.Changed:connect(Gear)
values.Velocity.Changed:connect(function(property)
gauges.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
mouse.KeyDown:connect(function(key)
if key=="v" then
gauges.Visible=not gauges.Visible
end
end)
gauges.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(gauges.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
gauges.Speed.Text = math.floor(UNITS[currentUnits].scaling*values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
wait(.1)
Gear()
PBrake()
|
--[=[
@param ... any
Fires the signal at _all_ clients with any arguments.
:::note Outbound Middleware
All arguments pass through any outbound middleware (if any)
before being sent to the clients.
:::
]=] |
function RemoteSignal:FireAll(...: any)
self._re:FireAllClients(self:_processOutboundMiddleware(nil, ...))
end
|
--[[
lua-polynomials is a Lua module created by piqey
(John Kushmer) for finding the roots of second-,
third- and fourth- degree polynomials.
--]] | |
--Made by Luckymaxer |
Debris = game:GetService("Debris")
Camera = game:GetService("Workspace").CurrentCamera
Sounds = {
RayHit = script:WaitForChild("Hit")
}
BasePart = Instance.new("Part")
BasePart.Shape = Enum.PartType.Block
BasePart.Material = Enum.Material.Plastic
BasePart.TopSurface = Enum.SurfaceType.Smooth
BasePart.BottomSurface = Enum.SurfaceType.Smooth
BasePart.FormFactor = Enum.FormFactor.Custom
BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
BasePart.CanCollide = true
BasePart.Locked = true
BasePart.Anchored = false
BaseRay = BasePart:Clone()
BaseRay.Name = "Laser"
BaseRay.BrickColor = BrickColor.new("Bright yellow")
BaseRay.Material = Enum.Material.SmoothPlastic
BaseRay.Size = Vector3.new(0.2, 0.2, 0.2)
BaseRay.Anchored = true
BaseRay.CanCollide = false
BaseRayMesh = Instance.new("SpecialMesh")
BaseRayMesh.Name = "Mesh"
BaseRayMesh.MeshType = Enum.MeshType.Brick
BaseRayMesh.Scale = Vector3.new(0.2, 0.2, 1)
BaseRayMesh.Offset = Vector3.new(0, 0, 0)
BaseRayMesh.VertexColor = Vector3.new(1, 1, 1)
BaseRayMesh.Parent = BaseRay
function PlaySound(Position, Sound)
local SoundPart = BasePart:Clone()
SoundPart.Name = "ParticlePart"
SoundPart.Transparency = 1
SoundPart.Anchored = true
SoundPart.CanCollide = false
local SoundObject = Sound:Clone()
SoundObject.Parent = SoundPart
Debris:AddItem(SoundPart, 1.5)
SoundPart.Parent = game:GetService("Workspace")
SoundPart.CFrame = CFrame.new(Position)
SoundObject:Play()
end
function FireRay(StartPosition, TargetPosition, Hit)
local Vec = (TargetPosition - StartPosition)
local Distance = Vec.magnitude
local Direction = Vec.unit
local PX = (StartPosition + (0.0 * Distance) * Direction)
local PY = (StartPosition + (0.0 * Distance) * Direction)
local PZ = (StartPosition + (0.0 * Distance) * Direction)
local DX = (StartPosition - PX).magnitude
local DY = (PX - PY).magnitude
local DZ = (PY - PZ).magnitude
local Limit = 2
local AX = (PX + Vector3.new(math.random(math.max(-Limit, (-0.0 * DX)), math.min(Limit, (0.21 * DX))),math.random(math.max(-Limit, (-0.21 * DX)),math.min(Limit, (0.21 * DX))), math.random(math.max(-Limit, (-0.21 * DX)), math.min(Limit, (0.21 * DX)))))
local AY = (PY + Vector3.new(math.random(math.max(-Limit, (-0.0 * DY)), math.min(Limit, (0.21 * DY))),math.random(math.max(-Limit, (-0.21 * DY)),math.min(Limit, (0.21 * DY))), math.random(math.max(-Limit, (-0.21 * DY)), math.min(Limit, (0.21 * DY)))))
local AZ = (PZ + Vector3.new(math.random(math.max(-Limit, (-0.0 * DZ)), math.min(Limit, (0.21 * DZ))),math.random(math.max(-Limit, (-0.21 * DZ)),math.min(Limit, (0.21 * DZ))), math.random(math.max(-Limit, (-0.21 * DZ)), math.min(Limit, (0.21 * DZ)))))
local Rays = {
{Distance = (AX - StartPosition).magnitude, Direction = CFrame.new(StartPosition, AX)},
{Distance = (AY - AX).magnitude, Direction = CFrame.new(AX, AY)},
{Distance = (AZ - AY).magnitude, Direction = CFrame.new(AY, AZ)},
{Distance = (TargetPosition - AZ).magnitude, Direction = CFrame.new(AZ, TargetPosition)},
}
for i, v in pairs(Rays) do
local Ray = BaseRay:Clone()
Ray.BrickColor = BrickColor.new("Bright yellow")
Ray.Reflectance = 0.4
Ray.Transparency = 0.7 --1
local Mesh = Ray.Mesh
Mesh.Scale = (Vector3.new(0.15, 0.15, (v.Distance / 1)) * 5)
Ray.CFrame = (v.Direction * CFrame.new(0, 0, (-0.5 * v.Distance)))
Debris:AddItem(Ray, (0.1 / (#Rays - (i - 1))))
Ray.Parent = Camera
end
end
pcall(function()
local StartPosition = script:WaitForChild("StartPosition").Value
local TargetPosition = script:WaitForChild("TargetPosition").Value
local RayHit = script:WaitForChild("RayHit").Value
FireRay(StartPosition, TargetPosition)
if RayHit then
PlaySound(TargetPosition, Sounds.RayHit)
end
end)
Debris:AddItem(script, 1)
|
--- Scan for world FX modules |
for _, m in ipairs(script:GetChildren()) do
if m.ClassName == "ModuleScript" then
WorldFX[m.Name] = require(m)
end
end
|
-------------------------------------------------------------------------- |
local _WHEELTUNE = {
TireWearOn = true ,
--Friction and Wear
FWearSpeed = .6 , --Don't change this
FTargetFriction = .93 , -- .88 to .93
FMinFriction = 0.35 , --Don't change this
RWearSpeed = .6 , --Don't change this
RTargetFriction = .93 , -- .88 to .93
RMinFriction = 0.35 , --Don't change this
--Tire Slip
TCSOffRatio = 1 , --Don't change this
WheelLockRatio = 1/6 , --Don't change this
WheelspinRatio = 1/1.2 , --Don't change this
--Wheel Properties
FFrictionWeight = 0.6 , --Don't change this
RFrictionWeight = 0.6 , --Don't change this
FLgcyFrWeight = 0 , --Don't change this
RLgcyFrWeight = 0 , --Don't change this
FElasticity = 0 , --Don't change this
RElasticity = 0 , --Don't change this
FLgcyElasticity = 0 , --Don't change this
RLgcyElasticity = 0 , --Don't change this
FElastWeight = 1 , --Don't change this
RElastWeight = 1 , --Don't change this
FLgcyElWeight = 10 , --Don't change this
RLgcyElWeight = 10 , --Don't change this
--Wear Regen
RegenSpeed = 3.6 , --Don't change this
}
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 740 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 7000 -- Use sliders to manipulate values
Tune.Redline = 7500 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5000
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--------END AUDIENCE BACK RIGHT-------- |
game.Workspace.rightpalette.l11.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l12.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l21.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
game.Workspace.rightpalette.l22.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
wait(0.15)
|
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
---------------------------------------------------------------------------------------------------- |
,EnableHolster = false
,HolsterTo = 'Torso' -- Put the name of the body part you wanna holster to
,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
,RightArmPos = CFrame.new(-1, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Server
,LeftArmPos = CFrame.new(1,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0)) --server
,ServerGunPos = CFrame.new(-1, -1, 0) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))
,GunPos = CFrame.new(1, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
,RightPos = CFrame.new(-1, 0.15, -1.15) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Client
,LeftPos = CFrame.new(1,0.15,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0)) --Client
}
return Config
|
-- For Testing |
ClientSceneFramework.task = task
local hasBeenCalled = false
return function(stubs)
if hasBeenCalled then
error("Client Scene Framework has already been called")
return
end
-- Used for testing only
if stubs then
for i, v in pairs(stubs) do
ClientSceneFramework[i] = v
end
end
-- Anchor Client For Scene Transition: Anchors a client while they're transitioning so their velocity doesn't launch people
ClientSceneFramework.handleAnchorClientForSceneTransition =
ClientSceneFramework.AnchorClientForSceneTransitionModule
ClientSceneFramework.AnchorClientForSceneTransition.OnClientEvent:Connect(
ClientSceneFramework.handleAnchorClientForSceneTransition
)
-- Unload Scene Client Remote Event: removes their scene
ClientSceneFramework.handleUnloadSceneClientRemoteEvent = ClientSceneFramework.UnloadSceneClientRemoteEventModule(
ClientSceneFramework.DefaultUnloadScene
)
ClientSceneFramework.UnloadSceneClientRemoteEvent.OnClientEvent:Connect(
ClientSceneFramework.handleUnloadSceneClientRemoteEvent
)
-- Load Scene Remote Event: Loads a scene for the client and tells them they're ready to transition
ClientSceneFramework.handleLoadSceneRemoteEvent =
ClientSceneFramework.LoadSceneRemoteEventModule.LoadSceneRemoteEventFn
ClientSceneFramework.LoadSceneRemoteEvent.OnClientEvent:Connect(ClientSceneFramework.handleLoadSceneRemoteEvent)
-- Get Current Scene Environment: Returns the scene's client folder from workspace
ClientSceneFramework.handleGetCurrentSceneEnvironment = ClientSceneFramework.GetCurrentSceneEnvironmentModule
ClientSceneFramework.GetCurrentSceneEnvironment.OnInvoke = ClientSceneFramework.handleGetCurrentSceneEnvironment
ClientSceneFramework.InitModule()
hasBeenCalled = true
return ClientSceneFramework
end
|
--// Functions |
function MakeFakeArms()
Arms = Instance.new("Model")
Arms.Name = "Arms"
Arms.Parent = L_5_
local L_169_ = Instance.new("Humanoid")
L_169_.MaxHealth = 0
L_169_.Health = 0
L_169_.Name = ""
L_169_.Parent = Arms
if L_3_:FindFirstChild("Shirt") then
local L_174_ = L_3_:FindFirstChild("Shirt"):clone()
L_174_.Parent = Arms
end
local L_170_ = L_3_:FindFirstChild("Right Arm"):clone()
for L_175_forvar1, L_176_forvar2 in pairs(L_170_:GetChildren()) do
if L_176_forvar2:IsA('Motor6D') then
L_176_forvar2:Destroy()
end
end
L_170_.Name = "Right Arm"
L_170_.FormFactor = "Custom"
L_170_.Size = Vector3.new(0.8, 2.5, 0.8)
L_170_.Transparency = 0.0
local L_171_ = Instance.new("Motor6D")
L_171_.Part0 = L_170_
L_171_.Part1 = L_3_:FindFirstChild("Right Arm")
L_171_.C0 = CFrame.new()
L_171_.C1 = CFrame.new()
L_171_.Parent = L_170_
L_170_.Parent = Arms
local L_172_ = L_3_:FindFirstChild("Left Arm"):clone()
L_172_.Name = "Left Arm"
L_172_.FormFactor = "Custom"
L_172_.Size = Vector3.new(0.8, 2.5, 0.8)
L_172_.Transparency = 0.0
local L_173_ = Instance.new("Motor6D")
L_173_.Part0 = L_172_
L_173_.Part1 = L_3_:FindFirstChild("Left Arm")
L_173_.C0 = CFrame.new()
L_173_.C1 = CFrame.new()
L_173_.Parent = L_172_
L_172_.Parent = Arms
end
function RemoveArmModel()
if Arms then
Arms:Destroy()
Arms = nil
end
end
local L_132_
function CreateShell()
L_132_ = time()
local L_177_ = L_1_.Shell:clone()
if L_177_:FindFirstChild('Shell') then
L_177_.Shell:Destroy()
end
L_177_.CFrame = L_1_.Chamber.CFrame
L_177_.Velocity = L_1_.Chamber.CFrame.lookVector * 30 + Vector3.new(0, 4, 0)
--shell.RotVelocity = Vector3.new(-10,40,30)
L_177_.Parent = L_98_
L_177_.CanCollide = false
game:GetService("Debris"):addItem(L_177_, 1)
delay(0.5, function()
if L_19_:FindFirstChild('ShellCasing') then
local L_178_ = L_19_.ShellCasing:clone()
L_178_.Parent = L_2_.PlayerGui
L_178_:Play()
game:GetService('Debris'):AddItem(L_178_, L_178_.TimeLength)
end
end)
end
|
-- Return the mock or actual service depending on environment: |
if shouldUseMock then
warn(":: Adonis :: Using MockDataStoreService instead of DataStoreService")
return require(MockDataStoreServiceModule)
else
return game:GetService("DataStoreService")
end
|
-- Constructor |
local Camera = workspace.CurrentCamera
local Looping = false
local Speed = 6.2
local FreezeControls = true
|
--Precalculated paths |
local t,f,n=true,false,{}
local r={
[58]={{65,64,66,19,20,58},t},
[49]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{65,64,66,19},t},
[59]={{65,64,66,19,20,57,56,30,41,59},t},
[63]={{65,64,66,63},t},
[34]={{65,64,66,19,20,57,56,30,41,39,35,34},t},
[21]={{65,64,66,19,20,21},t},
[48]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31},t},
[56]={{65,64,66,19,20,57,56},t},
[29]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{65,64,66,19,20,57},t},
[36]={{65,64,66,19,20,57,56,30,41,39,35,37,36},t},
[25]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{65,64,66,19,20,57,56,30,41,59,61,71},t},
[20]={{65,64,66,19,20},t},
[60]={{65,64,66,19,20,57,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{65,64,66,19,20,57,56,30,41,59,61,71,72,76,73,75},t},
[22]={{65,64,66,19,20,21,22},t},
[74]={{65,64,66,19,20,57,56,30,41,59,61,71,72,76,73,74},t},
[62]={{65,64,66,63,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{65,64,66,19,20,57,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{65,64,66,19,20,57,56,30,41,39,35},t},
[53]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{65,64,66,19,20,57,56,30,41,59,61,71,72,76,73},t},
[72]={{65,64,66,19,20,57,56,30,41,59,61,71,72},t},
[33]={{65,64,66,19,20,57,56,30,41,39,35,37,36,33},t},
[69]={{65,64,66,19,20,57,56,30,41,60,69},t},
[65]={{65},t},
[26]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{65,64,67,68},t},
[76]={{65,64,66,19,20,57,56,30,41,59,61,71,72,76},t},
[50]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{65,64,66},t},
[10]={n,f},
[24]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{65,64,66,63,62,23},t},
[44]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{65,64,66,19,20,57,56,30,41,39},t},
[32]={{65,64,66,19,20,57,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{65,64,66,19,20,57,56,30},t},
[51]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{65,64,67},t},
[61]={{65,64,66,19,20,57,56,30,41,59,61},t},
[55]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{65,64,66,19,20,57,56,30,41,39,40,38,42},t},
[40]={{65,64,66,19,20,57,56,30,41,39,40},t},
[52]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{65,64,66,19,20,57,56,30,41},t},
[17]={n,f},
[38]={{65,64,66,19,20,57,56,30,41,39,40,38},t},
[28]={{65,64,66,19,20,57,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{65,64},t},
}
return r
|
--//1st//-- |
if th == 44 then
if script.Parent.Control.Gear.Value == 1 then
if GEAR.Value == 1 then
if Wrpm.Value*(Gear1/FinalDrive)*100 < Idle then
rpm.Value = Idle
else
rpm.Value = Wrpm.Value*(Gear1/FinalDrive)*100
end
if Wrpm.Value*(Gear1/FinalDrive)*100 >= RPMLimiter then
rwd.Torque = 0
else
if script.Parent.Control.Throttle.Computer.Value == 0 and script.Parent.CarSeat.CC.Value == false then
rwd.Torque = 0.2
else
if (((rpm.Value/10000)-((sconfig*rpm.Value)/10000)^4.8)*hp/(config*size)) < ((Gear1/FinalDrive)*(hp/650))*scale then
rwd.Torque = (((Gear1/FinalDrive)*(hp/650))*scale)*th.Value
else
rwd.Torque =
(((rpm.Value/10000)-((sconfig*rpm.Value)/10000)^4.8)*hp/(config*size))*th.Value
end
end
end
end
end |
--Configuration |
Toolname = "Rappel" --Name of your tool, make sure tool is in lighting
|
----------------- |
local runservice = game:GetService("RunService")
while runservice.Heartbeat:Wait() do
local distance = 1000 -- 사람 인식하는 최대 범위
local target
for i, v in pairs(game.Players:GetPlayers())do
if v.Character and v.Character:FindFirstChild("Humanoid")
and v.Character.Humanoid.Health > 0
and v.Character:FindFirstChild("HumanoidRootPart")then
local d = (rootpart.Position - v.Character.HumanoidRootPart.Position).magnitude
if distance > d then
distance = d
target = v.Character.HumanoidRootPart
end
end
end
for i, v in pairs(npc:GetChildren())do
if v:FindFirstChild("zombie") == nil and v:FindFirstChild("Humanoid")
and v.Humanoid.Health > 0
and v:FindFirstChild("HumanoidRootPart")then
local d = (rootpart.Position - v.HumanoidRootPart.Position).magnitude
if distance > d then
distance = d
target = v.HumanoidRootPart
end
end
end
if target then
humanoid:MoveTo(target.Position)
end
end
|
--Automatic Gauge Scaling |
if autoscaling then
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
for i,v in pairs(UNITS) do
v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
end
end
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 90 + 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 = 90 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = lns
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i,v in pairs(UNITS) do
local lnn = Instance.new("Frame",script.Parent.Speedo)
lnn.BackgroundTransparency = 1
lnn.BorderSizePixel = 0
lnn.Size = UDim2.new(0,0,0,0)
lnn.Name = v.units
if i~= 1 then lnn.Visible=false end
for i=0,v.maxSpeed,v.spInc do
local ln = script.Parent.ln:clone()
ln.Parent = lnn
ln.Rotation = 45 + 225*(i/v.maxSpeed)
ln.Num.Text = i
ln.Num.TextSize = 20
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
end
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
script.Parent.Parent.IsOn.Changed:connect(function()
if script.Parent.Parent.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 90 + 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 _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if _Tune.TCSEnabled then
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
else
if script.Parent.TCS.Visible then
script.Parent.TCS.Visible = false
end
end
end)
script.Parent.Parent.Values.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABS.Value then
script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.ABSActive.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = true
script.Parent.ABS.TextColor3 = Color3.new(1,0,0)
script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0)
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.Parent.Values.ABSActive.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
else
wait()
script.Parent.ABS.Visible = false
end
else
script.Parent.ABS.Visible = false
end
end)
script.Parent.ABS.Changed:connect(function()
if _Tune.ABSEnabled then
if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = not script.Parent.ABS.Visible
elseif not script.Parent.Parent.Values.ABS.Value then
wait()
script.Parent.ABS.Visible = true
end
else
if script.Parent.ABS.Visible then
script.Parent.ABS.Visible = false
end
end
end)
function PBrake()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end
script.Parent.Parent.Values.PBrake.Changed:connect(PBrake)
function Gear()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "A/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "S/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "M/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end
script.Parent.Parent.Values.TransmissionMode.Changed:connect(Gear)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
for i,v in pairs(script.Parent.Speedo:GetChildren()) do
v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude) .. " "..UNITS[currentUnits].units
end)
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "v" then
for index, child in ipairs(script.Parent.Parent:GetChildren()) do
if child.ClassName == "Frame" or child.ClassName == "ImageLabel" or child.ClassName == "TextButton" then
child.Visible = not child.Visible
end
end
end
end)
wait(.1)
Gear()
PBrake()
|
--[=[
Brios wrap a value (or tuple of values) and are used to convey the lifetime of that
object. The brio is better than a maid, by providing the following constraints:
- Can be in 2 states, dead or alive.
- While alive, can retrieve values.
- While dead, retrieving values is forbidden.
- Died will fire once upon death.
Brios encapsulate the "lifetime" of a valid resource. Unlike a maid, they
- Can only die once, ensuring duplicate calls never occur.
- Have less memory leaks. Memory leaks in maids can occur when use of the maid occurs
after the cleanup of the maid has occured, in certain race conditions.
- Cannot be reentered, i.e. cannot retrieve values after death.
:::info
Calling `brio:Destroy()` or `brio:Kill()` after death does nothing. Brios cannot
be resurrected.
:::
Brios are useful for downstream events where you want to emit a resource. Typically
brios should be killed when their source is killed. Brios are intended to be merged
with downstream brios so create a chain of reliable resources.
```lua
local brio = Brio.new("a", "b")
print(brio:GetValue()) --> a b
print(brio:IsDead()) --> false
brio:GetDiedSignal():Connect(function()
print("Hello from signal!")
end)
brio:ToMaid():GiveTask(function()
print("Hello from maid cleanup!")
end)
brio:Kill()
--> Hello from signal!
--> Hello from maid cleanup!
print(brio:IsDead()) --> true
print(brio:GetValue()) --> ERROR: Brio is dead
```
## Design philosophy
Brios are designed to solve this issue where we emit an object with a lifetime associated with it from an
Observable stream. This resource is only valid for some amount of time (for example, while the object is
in the Roblox data model).
In order to know how long we can keep this object/use it, we wrap the object with a Brio, which denotes
the lifetime of the object.
Modeling this with pure observables is very tricky because the subscriber will have to also monitor/emit
a similar object with less clear conventions. For example an observable that emits the object, and then nil on death.
@class Brio
]=] |
local require = require(script.Parent.loader).load(script)
local Maid = require("Maid")
local GoodSignal = require("GoodSignal")
local Brio = {}
Brio.ClassName = "Brio"
Brio.__index = Brio
|
--[[
Returns all touching parts. Best (and cheapest) solution.
Functions.GetTouchingParts(
part, <-- |REQ| Basepart
)
--]] |
return function(part)
--- Create touch event (otherwise GetTouchingParts fails to return anything)
local connection = part.Touched:Connect(function() end)
--- Yeet
local results = part:GetTouchingParts()
--- Cancel touch event
connection:Disconnect()
--
return results
end
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 592 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6500 -- 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)
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!! |
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.PinHeart -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--!strict |
local function FindPath<U>(parent: Instance, ...: string): U?
local currentInstance: any = parent
for _, pathSlice in { ... } do
currentInstance = currentInstance:FindFirstChild(pathSlice)
if not currentInstance then
return nil
end
end
return currentInstance
end
return FindPath
|
--- |
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Shamrock",Paint)
end)
|
-- script.Parent.Parent.Body.Lights.Runner.Material = "Neon" |
script.Parent.Parent.Body.Dash.Screen.G.Enabled = true
script.Parent.Parent.Body.Dash.Screen.G.Startup.Visible = true
script.Parent.Parent.Body.Dash.Screen.G.Caution.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Unit.Visible = true
script.Parent.Parent.Body.Dash.DashSc.G.Enabled = true
script.Parent.Parent.DriveSeat.SS3.DashInfoSpeed.Info.Value = true
script.Parent.Parent.DriveSeat.SS3.DashInfoSpeed.Speed.Value = false
script.Parent.Parent.DriveSeat.SS3.DashInfoSpeed.Version.Value = false
script.Parent.Parent.DriveSeat.SS3.DashInfoSpeed.MPG.Value = false
script.Parent.Parent.DriveSeat.SS3.Radios.FMOne.Value = true
script.Parent.Parent.DriveSeat.SS3.Radios.FMTwo.Value = false
script.Parent.Parent.DriveSeat.SS3.Radios.FMThree.Value = false
script.Parent.Parent.DriveSeat.SS3.Radios.FMFour.Value = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.SpeedStats.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.Info.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Modes.Stats.Visible = false
script.Parent.Parent.Body.Dash.DashSc.G.Frame.Position = UDim2.new(0, 0, 0, -5)
script.Parent.Parent.Body.Dash.DashSc.G.Select.Position = UDim2.new(0, 0, 0, -5)
script.Parent.Parent.Body.Dash.DashSc.G.Unit.Text = "Welcome"
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.9
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.8
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.7
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.6
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.5
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.4
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.3
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = 1.5
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = 1.5
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.Car.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.Speed.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.Info1.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.Gas.ImageTransparency = 0.7
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.2
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = 1
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = 1
script.Parent.Parent.Body.Dash.DashSc.G.Select:TweenPosition(UDim2.new(0, 0, 0, 20), "InOut", "Quint", 1, true)
script.Parent.Parent.Body.Dash.DashSc.G.Frame:TweenPosition(UDim2.new(0, 0, 0, 20), "InOut", "Quint", 1, true)
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.Car.ImageTransparency = 0.4
script.Parent.Parent.Body.Dash.DashSc.G.Speed.ImageTransparency = 0.4
script.Parent.Parent.Body.Dash.DashSc.G.Info1.ImageTransparency = 0.4
script.Parent.Parent.Body.Dash.DashSc.G.Gas.ImageTransparency = 0.4
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0.1
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = .5
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = .5
wait(0.2)
script.Parent.Parent.Body.Dash.DashSc.G.Car.ImageTransparency = 0
script.Parent.Parent.Body.Dash.DashSc.G.Speed.ImageTransparency = 0
script.Parent.Parent.Body.Dash.DashSc.G.Info1.ImageTransparency = 0
script.Parent.Parent.Body.Dash.DashSc.G.Gas.ImageTransparency = 0
script.Parent.Parent.Body.Dash.DashSc.G.ImageLabel.ImageTransparency = 0
script.Parent.Parent.Body.Dash.Spd.Interface.LightInfluence = 0
script.Parent.Parent.Body.Dash.Tac.Interface.LightInfluence = 0
wait(2.2)
script.Parent.Parent.Body.Dash.DashSc.G.Modes.SpeedStats.Position = UDim2.new(0, 0, 0, 0)
script.Parent.Parent.Body.Dash.DashSc.G.Modes.SpeedStats.Visible = true
script.Parent.Parent.Body.Dash.DashSc.G.Unit.Visible = false
script.Parent.Parent.Body.Dash.Screen.G.Startup.Visible = false
script.Parent.Parent.Body.Dash.Screen.G.Caution.Visible = true
wait(6)
script.Parent.Parent.Body.Dash.Screen.G.Caution.Visible = false |
--[[ The Module ]] | --
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local TouchJump = setmetatable({}, BaseCharacterController)
TouchJump.__index = TouchJump
function TouchJump.new()
local self = setmetatable(BaseCharacterController.new() :: any, TouchJump)
self.parentUIFrame = nil
self.jumpButton = nil
self.characterAddedConn = nil
self.humanoidStateEnabledChangedConn = nil
self.humanoidJumpPowerConn = nil
self.humanoidParentConn = nil
self.externallyEnabled = false
self.jumpPower = 0
self.jumpStateEnabled = true
self.isJumping = false
self.humanoid = nil -- saved reference because property change connections are made using it
return self
end
function TouchJump:EnableButton(enable)
if enable then
if not self.jumpButton then
self:Create()
end
local humanoid = Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
if humanoid and self.externallyEnabled then
if self.externallyEnabled then
self.jumpButton.Visible = true
end
end
else
self.jumpButton.Visible = false
self.isJumping = false
self.jumpButton.ImageRectOffset = Vector2.new(1, 146)
end
end
function TouchJump:UpdateEnabled()
self:EnableButton(true)
--[[if self.jumpPower > 0 and self.jumpStateEnabled then
self:EnableButton(true)
else
self:EnableButton(false)
end]]
end
function TouchJump:HumanoidChanged(prop)
local humanoid = Players.LocalPlayer.Character and Players.LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
if prop == "JumpPower" then
self.jumpPower = humanoid.JumpPower
self:UpdateEnabled()
elseif prop == "Parent" then
if not humanoid.Parent then
self.humanoidChangeConn:Disconnect()
end
end
end
end
function TouchJump:HumanoidStateEnabledChanged(state, isEnabled)
if state == Enum.HumanoidStateType.Jumping then
self.jumpStateEnabled = isEnabled
self:UpdateEnabled()
end
end
function TouchJump:CharacterAdded(char)
if self.humanoidChangeConn then
self.humanoidChangeConn:Disconnect()
self.humanoidChangeConn = nil
end
self.humanoid = char:FindFirstChildOfClass("Humanoid")
while not self.humanoid do
char.ChildAdded:wait()
self.humanoid = char:FindFirstChildOfClass("Humanoid")
end
self.humanoidJumpPowerConn = self.humanoid:GetPropertyChangedSignal("JumpPower"):Connect(function()
self.jumpPower = self.humanoid.JumpPower
self:UpdateEnabled()
end)
self.humanoidParentConn = self.humanoid:GetPropertyChangedSignal("Parent"):Connect(function()
if not self.humanoid.Parent then
self.humanoidJumpPowerConn:Disconnect()
self.humanoidJumpPowerConn = nil
self.humanoidParentConn:Disconnect()
self.humanoidParentConn = nil
end
end)
self.humanoidStateEnabledChangedConn = self.humanoid.StateEnabledChanged:Connect(function(state, enabled)
self:HumanoidStateEnabledChanged(state, enabled)
end)
self.jumpPower = self.humanoid.JumpPower
self.jumpStateEnabled = self.humanoid:GetStateEnabled(Enum.HumanoidStateType.Jumping)
self:UpdateEnabled()
end
function TouchJump:SetupCharacterAddedFunction()
self.characterAddedConn = Players.LocalPlayer.CharacterAdded:Connect(function(char)
self:CharacterAdded(char)
end)
if Players.LocalPlayer.Character then
self:CharacterAdded(Players.LocalPlayer.Character)
end
end
function TouchJump:Enable(enable, parentFrame)
if parentFrame then
self.parentUIFrame = parentFrame
end
self.externallyEnabled = enable
self:EnableButton(enable)
end
function TouchJump:Create()
if not self.parentUIFrame then
return
end
if self.jumpButton then
self.jumpButton:Destroy()
self.jumpButton = nil
end
local minAxis = math.min(self.parentUIFrame.AbsoluteSize.x, self.parentUIFrame.AbsoluteSize.y)
local isSmallScreen = minAxis <= 500
local jumpButtonSize = isSmallScreen and 70 or 120
self.jumpButton = Instance.new("ImageButton")
self.jumpButton.Name = "JumpButton"
self.jumpButton.Visible = false
self.jumpButton.BackgroundTransparency = 1
self.jumpButton.Image = TOUCH_CONTROL_SHEET
self.jumpButton.ImageRectOffset = Vector2.new(1, 146)
self.jumpButton.ImageRectSize = Vector2.new(144, 144)
self.jumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)
self.jumpButton.Position = isSmallScreen and UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize - 20) or
UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize * 1.75)
local touchObject: InputObject? = nil
self.jumpButton.InputBegan:connect(function(inputObject)
--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
or inputObject.UserInputState ~= Enum.UserInputState.Begin then
return
end
touchObject = inputObject
self.jumpButton.ImageRectOffset = Vector2.new(146, 146)
self.isJumping = true
game.ReplicatedStorage.Package.Remotes.Input:FireServer({
Key = Enum.KeyCode.Space;
Pressed = true;
})
end)
local OnInputEnded = function()
touchObject = nil
self.isJumping = false
self.jumpButton.ImageRectOffset = Vector2.new(1, 146)
game.ReplicatedStorage.Package.Remotes.Input:FireServer({
Key = Enum.KeyCode.Space;
Pressed = false;
})
end
self.jumpButton.InputEnded:connect(function(inputObject: InputObject)
if inputObject == touchObject then
OnInputEnded()
end
end)
GuiService.MenuOpened:connect(function()
if touchObject then
OnInputEnded()
end
end)
if not self.characterAddedConn then
self:SetupCharacterAddedFunction()
end
self.jumpButton.Parent = self.parentUIFrame
end
return TouchJump
|
--this script is made by Joriangames/Problox Studio Scripts. Watch my video to understand
--everything. Here is the link: https://www.youtube.com/watch?v=XVwYgTLlrkM&lc=UgwxXH2R5pq3cY565Xx4AaABAg
--Make sure that this script is a normal script in the TextButton! |
local frame = script.Parent.Parent.Frame
frame.Visible = false
script.Parent.MouseButton1Click:Connect(function()
if frame.Visible == false then
frame.Visible = true
else
frame.Visible = false
end
end)
|
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]") |
local anim = animTable[animName][idx].anim
-- load it to the humanoid; get AnimationTrack
toolAnimTrack = humanoid:LoadAnimation(anim)
-- play the animation
toolAnimTrack:Play(transitionTime)
toolAnimName = animName
toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
end
end
function stopToolAnimations()
local oldAnim = toolAnimName
if (currentToolAnimKeyframeHandler ~= nil) then
currentToolAnimKeyframeHandler:disconnect()
end
toolAnimName = ""
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
toolAnimTrack = nil
end
return oldAnim
end
|
--[[START]] |
script.Parent:WaitForChild("Car")
script.Parent:WaitForChild("IsOn")
script.Parent:WaitForChild("ControlsOpen")
script.Parent:WaitForChild("Values")
script.Parent:WaitForChild("CruiseControl")
wait()
|
--- Solve direction and length of the ray by comparing current and last frame's positions
-- @param point type |
function solver:Solve(point: {[string]: any}): (Vector3, Vector3)
--- Translate localized Vector3 positions to world space values
local originPart: BasePart = point.Instances[1]
local vector: Vector3 = point.Instances[2]
local pointToWorldSpace: Vector3 = originPart.Position + originPart.CFrame:VectorToWorldSpace(vector)
--- If LastPosition is nil (caused by if the hitbox was stopped previously), rewrite its value to the current point position
if not point.LastPosition then
point.LastPosition = pointToWorldSpace
end
local origin: Vector3 = point.LastPosition
local direction: Vector3 = pointToWorldSpace - (point.LastPosition or EMPTY_VECTOR)
point.WorldSpace = pointToWorldSpace
return origin, direction
end
function solver:UpdateToNextPosition(point: {[string]: any}): Vector3
return point.WorldSpace
end
function solver:Visualize(point: {[string]: any}): CFrame
return CFrame.lookAt(point.WorldSpace, point.LastPosition)
end
return solver
|
--[[Vehicle Weight]] |
--Determine Current Mass
local mass=0
function getMass(p)
for i,v in pairs(p:GetChildren())do
if v:IsA("BasePart") then
mass=mass+v:GetMass()
end
getMass(v)
end
end
getMass(car)
--Apply Vehicle Weight
if mass<_Tune.Weight*weightScaling then
--Calculate Weight Distribution
local centerF = Vector3.new()
local centerR = Vector3.new()
local countF = 0
local countR = 0
for i,v in pairs(Drive) do
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
centerF = centerF+v.CFrame.p
countF = countF+1
else
centerR = centerR+v.CFrame.p
countR = countR+1
end
end
centerF = centerF/countF
centerR = centerR/countR
local center = centerR:Lerp(centerF, _Tune.WeightDist/100)
--Create Weight Brick
local weightB = Instance.new("Part",car.Body)
weightB.Name = "#Weight"
weightB.Anchored = true
weightB.CanCollide = false
weightB.BrickColor = BrickColor.new("Really black")
weightB.TopSurface = Enum.SurfaceType.Smooth
weightB.BottomSurface = Enum.SurfaceType.Smooth
if _Tune.WBVisible then
weightB.Transparency = .75
else
weightB.Transparency = 1
end
weightB.Size = Vector3.new(_Tune.WeightBSize[1],_Tune.WeightBSize[2],_Tune.WeightBSize[3])
weightB.CustomPhysicalProperties = PhysicalProperties.new(((_Tune.Weight*weightScaling)-mass)/(weightB.Size.x*weightB.Size.y*weightB.Size.z),0,0,0,0)
weightB.CFrame=(car.Body.CarName.Value.VehicleSeat.CFrame-car.Body.CarName.Value.VehicleSeat.Position+center)*CFrame.new(0,_Tune.CGHeight,0)
else
--Existing Weight Is Too Massive
warn( "\n\t [AC".._BuildVersion.."]: Mass too high for specified weight."
.."\n\t Target Mass:\t"..(math.ceil(_Tune.Weight*weightScaling*100)/100)
.."\n\t Current Mass:\t"..(math.ceil(mass*100)/100)
.."\n\t Reduce part size or axle density to achieve desired weight.")
end
local flipG = Instance.new("BodyGyro",car.Body.CarName.Value.VehicleSeat)
flipG.Name = "Flip"
flipG.D = 0
flipG.MaxTorque = Vector3.new(0,0,0)
flipG.P = 0
|
-- When player joins, have them spawn at the lobby |
local function onPlayerJoin(player)
player.RespawnLocation = lobbySpawn
leaderboardManager.new(player)
end
game.Players.PlayerAdded:Connect(onPlayerJoin) |
-- Destroys this cache entirely. Use this when you don't need this cache object anymore. |
function PartCacheStatic:Dispose()
assert(getmetatable(self) == PartCacheStatic, ERR_NOT_INSTANCE:format("Dispose", "PartCache.new"))
for _, object in self.Open do
object:Destroy()
end
for _, object in self.InUse do
object:Destroy()
end
self.Template:Destroy()
self.Open = {}
self.InUse = {}
self.CurrentCacheParent = nil
self.GetPart = nil
self.ReturnPart = nil
self.SetCacheParent = nil
self.Expand = nil
self.Dispose = nil
end
return PartCacheStatic
|
--local pupil1 = script.Parent.BillboardGui.Pupils1
--local pupil2 = script.Parent.BillboardGui.Pupils2 |
while task.wait() do
game:GetService('TweenService'):Create(eye1,TweenInfo.new(3,Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0),{StudsOffset = Vector3.new(0, 1.8, 0)}):Play()
game:GetService('TweenService'):Create(eye2,TweenInfo.new(3,Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0),{StudsOffset = Vector3.new(0, 1.8, 0)}):Play()
task.wait(3)
game:GetService('TweenService'):Create(eye1,TweenInfo.new(3,Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0),{StudsOffset = Vector3.new(0, 2, 0)}):Play()
game:GetService('TweenService'):Create(eye2,TweenInfo.new(3,Enum.EasingStyle.Cubic,Enum.EasingDirection.InOut,0,false,0),{StudsOffset = Vector3.new(0, 2, 0)}):Play()
task.wait(3)
end
|
--Make Rig and choose any Rig
--Add Script and paste this into Script |
name="Humanoid"
robo=script.Parent:Clone()
while true do
wait(5)
if script.Parent.Humanoid.Health<1 then
robo=robo:Clone()
robo.Parent=script.Parent.Parent
robo:makeJoints()
script.Parent:remove()
end
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, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}
math.randomseed(tick())
function findExistingAnimationInSet(set, anim)
if set == nil or anim == nil then
return 0
end
for idx = 1, set.count, 1 do
if set[idx].anim.AnimationId == anim.AnimationId then
return idx
end
end
return 0
end
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
table.insert(animTable[name].connections, config.ChildAdded:connect(function(child) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].connections, config.ChildRemoved:connect(function(child) configureAnimationSet(name, fileList) end))
local idx = 0
for _, childPart in pairs(config:GetChildren()) do
if (childPart:IsA("Animation")) then
local newWeight = 1
local weightObject = childPart:FindFirstChild("Weight")
if (weightObject ~= nil) then
newWeight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
idx = animTable[name].count
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
animTable[name][idx].weight = newWeight
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
table.insert(animTable[name].connections, childPart.Changed:connect(function(property) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].connections, childPart.ChildAdded:connect(function(property) configureAnimationSet(name, fileList) end))
table.insert(animTable[name].connections, childPart.ChildRemoved:connect(function(property) configureAnimationSet(name, fileList) end))
local lv = childPart:GetAttribute("LinearVelocity")
if lv then
strafingLocomotionMap[name] = {lv=lv, speed = lv.Magnitude}
end
if name == "run" or name == "walk" then
if lv then
fallbackLocomotionMap[name] = strafingLocomotionMap[name]
else
local speed = name == "run" and RUN_SPEED or WALK_SPEED
fallbackLocomotionMap[name] = {lv=Vector2.new(0.0, speed), speed = speed}
locomotionMap = fallbackLocomotionMap
-- If you don't have a linear velocity with your run or walk, you can't blend/strafe
warn("Strafe blending disabled. No linear velocity information for "..'"'.."walk"..'"'.." and "..'"'.."run"..'"'..".")
end
end
end
end
end
-- fallback to defaults
if (animTable[name].count <= 0) then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
end
end
-- preload anims
for i, animType in pairs(animTable) do
for idx = 1, animType.count, 1 do
if PreloadedAnims[animType[idx].anim.AnimationId] == nil then
Humanoid:LoadAnimation(animType[idx].anim)
PreloadedAnims[animType[idx].anim.AnimationId] = true
end
end
end
end
|
-- ROBLOX TODO: ADO-1182 Add more plugins here as we translate them |
local PLUGINS = {
jestMockSerializer,
plugins.AsymmetricMatcher,
plugins.ReactElement,
plugins.ReactTestComponent,
-- ROBLOX deviation: Roblox Instance matchers
plugins.RobloxInstance,
}
local originalPLUGINS = Array.from(PLUGINS)
|
--local TwinService = game:GetService("TweenService")
--local AnimationHighLight = TweenInfo.new(3)
--local Info = {FillTransparency = 0}
--local Animka = TwinService:Create(HighLight, AnimationHighLight, Info )
--local HighLight = char:WaitForChild("PLayerHighLight")
--Animka:Play() | |
--[[
Performs a left-fold of the list with the given initial value and callback.
]] |
function Functional.Fold(list, initial, callback)
local accum = initial
for key = 1, #list do
accum = callback(accum, list[key], key)
end
return accum
end
|
--Graveyard---------------
--[[
--function PlayerStatManager:getTycoonPurchases(player)
-- local succes,data = pcall(function()
-- local playerUserId = "Player_" .. player.UserId
-- return sessionData[playerUserId]["TycoonPurchases"]
-- end)
-- if succes == false then
-- warn("ERROR---------PlayerStatManager:getTycoonPurchases----------->")
-- print(data)
-- return nil
-- else
-- return data
-- end
--end
local function setupPlayerData(player)
local playerMoney = serverStorage:WaitForChild("PlayerMoney")
local playerStats = playerMoney:FindFirstChild(player.Name)
--Sometimes people have duplicate tycoon add e.g in core handler script
--adds PlayerMoney to storage and number value with player name that holds the
--money value
if playerStats == nil then
local plrStats = Instance.new("NumberValue",playerMoney)
plrStats.Name = player.Name
local isOwner = Instance.new("ObjectValue",plrStats)
isOwner.Name = "OwnsTycoon"
end
local playerUserId = "Player_" .. player.UserId
local success,data = pcall(function()
return playerData:GetAsync(playerUserId)
end)
if success then
if data then
print("----------Money: ---------> "..data["Money"])
sessionData[playerUserId] = data
local playerMoneyChild = playerMoney:FindFirstChild(player.Name)
if playerMoneyChild then
playerMoneyChild.Value = playerMoneyChild.Value + data["Money"]
else
print("------------playerMoneyChild is nil")
end
else
print("No data----------------->")
wait()
local success,err = pcall(function()
if player:IsInGroup(groupId) then
local cashmoney = playerMoney:FindFirstChild(player.Name)
if cashmoney then
cashmoney.Value = cashmoney.Value + cashGivenAmount
end
end
end)
if success == false then
print(err)
end
sessionData[playerUserId] = {}
--Adding purchases names to player saves but false
for f = 1,#savedPurchasesNames,1 do
local name = savedPurchasesNames[f]
sessionData[playerUserId][name] = false
end
sessionData[playerUserId]["Money"] = cashGivenAmount
sessionData[playerUserId]["RebirthCount"] = 0
return
end
--Adding new version objects
for e = 1,#savedPurchasesNames,1 do
local name = savedPurchasesNames[e]
print("Name of object: ",name)
if sessionData[playerUserId][name] == nil then
print("Adding new version objects "..name)
sessionData[playerUserId][name] = false
end
end]
else
warn("Couldn't get data")
print(data)
end
end
]] | --
--Testing wait TODO remove
--TODO fix problem PurchaseHandlerNew add objects from purchases while it is being
--required below and the it doesn't add new version for player if he joins the first initiolization
--of the server
--wait(5)--delete later on --if must turn back on uncomment this
--Investigate
--local purchaseHandlerNew = waitForTycoonsPurchaseHandlerNew()
--local Objects = require(purchaseHandlerNew)
--print("Name of tycoon: ",tycoons[1].Name)
--local Objects = require(tycoons[1]:WaitForChild("PurchaseHandlerNew"))
--Adding new version objects |
--[[[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.V ,
--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.LeftShift ,
--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 ,
}
|
--// Special Variables |
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server;
local service = Vargs.Service;
local MaxLogs = 1000
local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings
local function Init()
Functions = server.Functions;
Admin = server.Admin;
Anti = server.Anti;
Core = server.Core;
HTTP = server.HTTP;
Logs = server.Logs;
Remote = server.Remote;
Process = server.Process;
Variables = server.Variables;
Settings = server.Settings;
MaxLogs = Settings.MaxLogs;
game:BindToClose(Logs.SaveCommandLogs);
Logs.Init = nil;
Logs:AddLog("Script", "Logging Module Initialized");
end;
server.Logs = {
Init = Init;
Chats = {};
Joins = {};
Leaves = {};
Script = {};
RemoteFires = {};
Commands = {};
Exploit = {};
Errors = {};
DateTime = {};
TempUpdaters = {};
OldCommandLogsLimit = 1000; --// Maximum number of command logs to save to the datastore (the higher the number, the longer the server will take to close)
TabToType = function(tab)
local indToName = {
Chats = "Chat";
Joins = "Join";
Leaves = "Leave";
Script = "Script";
RemoteFires = "RemoteFire";
Commands = "Command";
Exploit = "Exploit";
Errors = "Error";
DateTime = "DateTime";
}
for ind, t in server.Logs do
if t == tab then
return indToName[ind] or ind
end
end
end;
AddLog = function(tab, log, misc)
if misc then
tab = log
log = misc
end
if type(tab) == "string" then
tab = Logs[tab]
end
if type(log) == "string" then
log = {
Text = log;
Desc = log;
}
end
if not log.Time and not log.NoTime then
log.Time = os.time()
end
table.insert(tab, 1, log)
if #tab > tonumber(MaxLogs) then
table.remove(tab, #tab)
end
service.Events.LogAdded:Fire(server.Logs.TabToType(tab), log, tab)
end;
SaveCommandLogs = function()
--// Disable saving command logs in Studio; not required.
if service.RunService:IsStudio() or service.RunService:IsRunMode() then
return
end
warn("Saving command logs...")
if Settings.SaveCommandLogs ~= true or Settings.DataStoreEnabled ~= true then
warn("Skipped saving command logs.")
return
end
local logsToSave = Logs.Commands --{}
local maxLogs = Logs.OldCommandLogsLimit
--local numLogsToSave = 200; --// Save the last X logs from this server
--for i = #Logs.Commands, i = math.max(#Logs.Commands - numLogsToSave, 1), -1 do
-- table.insert(logsToSave, Logs.Commands[i]);
--end
Core.UpdateData("OldCommandLogs", function(oldLogs)
local temp = {}
for _, m in logsToSave do
local newTab = type(m) == "table" and service.CloneTable(m) or m
if type(m) == "table" and newTab.Player then
local p = newTab.Player
newTab.Player = {
Name = p.Name;
UserId = p.UserId;
}
end
table.insert(temp, newTab)--{Time = m.Time; Text = m.Text..": "..m.Desc; Desc = m.Desc})
end
if oldLogs then
for _, m in oldLogs do
table.insert(temp, m)
end
end
table.sort(temp, function(a, b)
if a.Time and b.Time and type(a.Time) == "number" and type(b.Time) == "number" then
return a.Time > b.Time
else
return false
end
end)
--// Trim logs, starting from the oldest
if #temp > maxLogs then
local diff = #temp - maxLogs
for i = 1, diff do
table.remove(temp, 1)
end
end
return temp
end)
warn("Command logs saved!")
end;
ListUpdaters = {
TempUpdate = function(plr, data)
local updateKey = data.UpdateKey
local updater = Logs.TempUpdaters[updateKey]
if updater then
return updater(data)
end
end;
};
};
Logs = Logs
end
|
-- Decompiled with the Synapse X Luau decompiler. |
local l__Players__1 = game:GetService("Players");
local l__CurrentCamera__1 = game.Workspace.CurrentCamera;
local l__math_rad__2 = math.rad;
local u3 = nil;
local l__math_tan__4 = math.tan;
local u5 = nil;
local function v2()
local l__ViewportSize__3 = l__CurrentCamera__1.ViewportSize;
u3 = 2 * l__math_tan__4(l__math_rad__2(l__CurrentCamera__1.FieldOfView) / 2);
u5 = l__ViewportSize__3.X / l__ViewportSize__3.Y * u3;
end;
l__CurrentCamera__1:GetPropertyChangedSignal("FieldOfView"):Connect(v2);
l__CurrentCamera__1:GetPropertyChangedSignal("ViewportSize"):Connect(v2);
v2();
local u6 = l__CurrentCamera__1.NearPlaneZ;
l__CurrentCamera__1:GetPropertyChangedSignal("NearPlaneZ"):Connect(function()
u6 = l__CurrentCamera__1.NearPlaneZ;
end);
local u7 = {};
local u8 = {};
local u9 = function()
local v4 = 1;
u7 = {};
for v5, v6 in pairs(u8) do
u7[v4] = v6;
v4 = v4 + 1;
end;
end;
local function v7(p1)
local function v8(p2)
u8[p1] = p2;
u9();
end;
p1.CharacterAdded:Connect(v8);
p1.CharacterRemoving:Connect(function()
u8[p1] = nil;
u9();
end);
if p1.Character then
v8(p1.Character);
end;
end;
l__Players__1.PlayerAdded:Connect(v7);
l__Players__1.PlayerRemoving:Connect(function(p3)
u8[p3] = nil;
u9();
end);
for v9, v10 in ipairs(l__Players__1:GetPlayers()) do
v7(v10);
end;
u9();
u8 = nil;
u9 = nil;
l__CurrentCamera__1:GetPropertyChangedSignal("CameraSubject"):Connect(function()
local l__CameraSubject__11 = l__CurrentCamera__1.CameraSubject;
if l__CameraSubject__11:IsA("Humanoid") then
u9 = l__CameraSubject__11.RootPart;
return;
end;
if l__CameraSubject__11:IsA("BasePart") then
u9 = l__CameraSubject__11;
return;
end;
u9 = nil;
end);
local function u10(p4)
return 1 - (1 - p4.Transparency) * (1 - p4.LocalTransparencyModifier);
end;
local l__Ray_new__11 = Ray.new;
local function u12(p5, p6)
for v12 = #p5, p6 + 1, -1 do
p5[v12] = nil;
end;
end;
local l__math_huge__13 = math.huge;
local function u14(p7)
local v13 = false;
if u10(p7) < 0.25 then
v13 = p7.CanCollide;
if v13 then
v13 = false;
if u8 ~= (p7:GetRootPart() and p7) then
v13 = not p7:IsA("TrussPart");
end;
end;
end;
return v13;
end;
local function u15(p8, p9, p10, p11)
debug.profilebegin("queryPoint");
p10 = p10 + u6;
local v14 = p8 + p9 * p10;
local v15 = l__math_huge__13;
local v16 = l__math_huge__13;
local v17 = p8;
local v18 = 0;
while true do
local v19, v20 = workspace:FindPartOnRayWithIgnoreList(l__Ray_new__11(v17, v14 - v17), u7, false, true);
v18 = v18 + 1;
if v19 then
local v21 = v18 >= 64;
if u14(v19) or v21 then
local v22 = { v19 };
local l__Magnitude__23 = (v20 - p8).Magnitude;
if workspace:FindPartOnRayWithWhitelist(l__Ray_new__11(v14, v20 - v14), v22, true) and not v21 then
local v24 = false;
if p11 then
v24 = workspace:FindPartOnRayWithWhitelist(l__Ray_new__11(p11, v14 - p11), v22, true) or workspace:FindPartOnRayWithWhitelist(l__Ray_new__11(v14, p11 - v14), v22, true);
end;
if v24 then
v16 = l__Magnitude__23;
elseif p10 < v15 then
v15 = l__Magnitude__23;
end;
else
v16 = l__Magnitude__23;
end;
end;
u7[#u7 + 1] = v19;
v17 = v20 - p9 * 0.001;
end;
if v16 < l__math_huge__13 then
break;
end;
if not v19 then
break;
end;
end;
u12(u7, #u7);
debug.profileend();
return v15 - u6, v16 - u6;
end;
local function u16(p12, p13)
local v25 = #u7;
while true do
local v26, v27 = workspace:FindPartOnRayWithIgnoreList(l__Ray_new__11(p12, p13), u7, false, true);
if v26 then
if v26.CanCollide then
u12(u7, v25);
return v27, true;
end;
u7[#u7 + 1] = v26;
end;
if not v26 then
break;
end;
end;
u12(u7, v25);
return p12 + p13, false;
end;
local l__math_min__17 = math.min;
local u18 = { Vector2.new(0.4, 0), Vector2.new(-0.4, 0), Vector2.new(0, -0.4), Vector2.new(0, 0.4), Vector2.new(0, 0.2) };
local function u19(p14, p15)
debug.profilebegin("queryViewport");
local l__p__28 = p14.p;
local l__rightVector__29 = p14.rightVector;
local l__upVector__30 = p14.upVector;
local v31 = -p14.lookVector;
local l__ViewportSize__32 = l__CurrentCamera__1.ViewportSize;
local v33 = l__math_huge__13;
local v34 = l__math_huge__13;
for v35 = 0, 1 do
local v36 = l__rightVector__29 * ((v35 - 0.5) * u5);
for v37 = 0, 1 do
local v38, v39 = u15(l__p__28 + u6 * (v36 + l__upVector__30 * ((v37 - 0.5) * u3)), v31, p15, l__CurrentCamera__1:ViewportPointToRay(l__ViewportSize__32.x * v35, l__ViewportSize__32.y * v37).Origin);
if v39 < v33 then
v33 = v39;
end;
if v38 < v34 then
v34 = v38;
end;
end;
end;
debug.profileend();
return v34, v33;
end;
local function u20(p16, p17, p18)
debug.profilebegin("testPromotion");
local l__p__40 = p16.p;
local l__rightVector__41 = p16.rightVector;
local l__upVector__42 = p16.upVector;
local v43 = -p16.lookVector;
debug.profilebegin("extrapolate");
for v44 = 0, l__math_min__17(1.25, p18.rotVelocity.magnitude + (u16(l__p__40, p18.posVelocity * 1.25) - l__p__40).Magnitude / p18.posVelocity.magnitude), 0.0625 do
local v45 = p18.extrapolate(v44);
if p17 <= u15(v45.p, -v45.lookVector, p17) then
return false;
end;
end;
debug.profileend();
debug.profilebegin("testOffsets");
for v46, v47 in ipairs(u18) do
local v48 = u16(l__p__40, l__rightVector__41 * v47.x + l__upVector__42 * v47.y);
if u15(v48, (l__p__40 + v43 * p17 - v48).Unit, p17) == l__math_huge__13 then
return false;
end;
end;
debug.profileend();
debug.profileend();
return true;
end;
return function(p19, p20, p21)
debug.profilebegin("popper");
u8 = u9 and u9:GetRootPart() or u9;
local v49 = p20;
local v50, v51 = u19(p19, p20);
if v51 < v49 then
v49 = v51;
end;
if v50 < v49 and u20(p19, p20, p21) then
v49 = v50;
end;
u8 = nil;
debug.profileend();
return v49;
end;
|
----------------------This is just an example----------------------------- |
end
local userInputService = game:GetService("UserInputService")
userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if gameProcessedEvent then return end
if input.KeyCode == Enum.KeyCode.One then
onKeyPressOne()
elseif input.KeyCode == Enum.KeyCode.Two then
onKeyPressTwo()
elseif input.KeyCode == Enum.KeyCode.G then
onKeyPressG()
end
end)
|
--[[
When the game is run, this script automatically places all of the model's contents into the correct locations and deletes any leftover clutter.
All you have to do is configure the music IDs and/or zones as described in the README - the rest will be automatically handled!
--]] |
local settings = require(script.Parent.Settings)
if settings.UseGlobalBackgroundMusic == false and settings.UseMusicZones == false then
error("Cindering's BGM error: You have disabled both Global Background Music and Music Zones. You must change at least one of these settings to 'true'.")
return
end
local name1 = "BGM"
local name2 = "none"
local container = Instance.new("Folder")
container.Name = "CinderingBGM"
script.Parent.Settings.Parent = container
script.LocalBackgroundMusic.Parent = game.StarterPlayer.StarterPlayerScripts
local music = Instance.new("Folder")
local zones = Instance.new("Folder",music)
zones.Name = "MusicZones"
local global = Instance.new("Folder",music)
global.Name = "GlobalMusic"
if settings.UseMusicZones == true then
local folder = script.Parent:FindFirstChild(name2) or game.ReplicatedStorage:FindFirstChild(name2) or workspace:FindFirstChild(name2) or game:FindFirstChild(name2,true) -- never know where someone might accidentally drag that folder...
if folder then
for _,model in pairs(folder:GetChildren()) do
if (model:IsA("Model") and model:FindFirstChild("Music")) then
model.Parent = zones
end
end
else
error("Cindering's BGM error: Your background music zones folder could not be found! You may have deleted/renamed the original folder. It should be named: "..name2)
return
end
end
if settings.UseGlobalBackgroundMusic == true then
local folder = script.Parent:FindFirstChild(name1) or game.ReplicatedStorage:FindFirstChild(name1) or workspace:FindFirstChild(name1) or game:FindFirstChild(name1,true)
if folder then
for _,v in pairs(folder:GetChildren()) do
if v:IsA("Sound") then
v.Parent = global
end
end
else
error("Cindering's BGM error: Your global background music folder could not be found! You may have deleted/renamed the original folder. It should be named: "..name1)
return
end
end
if settings.UseGlobalBackgroundMusic == true and #global:GetChildren() == 0 then
warn("Cindering's BGM warning: Your global background music folder is completely empty; no music will be played from there.")
end
if settings.UseMusicZones == true and #zones:GetChildren() == 0 then
warn("Cindering's BGM warning: Your background music zones folder is completely empty; no music will be played from there.")
end
music.Name = "MusicFolder"
music.Parent = container
local count = 0
function recurse(instance)
for _,v in pairs(instance:GetChildren()) do
count = count + 1
recurse(v)
end
end
recurse(music)
local val = Instance.new("IntValue",container)
val.Name = "ObjectCount"
val.Value = count
container.Parent = game.ReplicatedStorage
script.Parent:Destroy()
|
--Set up WeaponTypes lookup table |
do
local function onNewWeaponType(weaponTypeModule)
if not weaponTypeModule:IsA("ModuleScript") then
return
end
local weaponTypeName = weaponTypeModule.Name
xpcall(function()
coroutine.wrap(function()
local weaponType = require(weaponTypeModule)
assert(typeof(weaponType) == "table", string.format("WeaponType \"%s\" did not return a valid table", weaponTypeModule:GetFullName()))
WEAPON_TYPES_LOOKUP[weaponTypeName] = weaponType
end)()
end, function(errMsg)
warn(string.format("Error while loading %s: %s", weaponTypeModule:GetFullName(), errMsg))
warn(debug.traceback())
end)
end
for _, child in pairs(WeaponTypes:GetChildren()) do
onNewWeaponType(child)
end
WeaponTypes.ChildAdded:Connect(onNewWeaponType)
end
local WeaponsSystem = {}
WeaponsSystem.didSetup = false
WeaponsSystem.knownWeapons = {}
WeaponsSystem.connections = {}
WeaponsSystem.networkFolder = nil
WeaponsSystem.remoteEvents = {}
WeaponsSystem.remoteFunctions = {}
WeaponsSystem.currentWeapon = nil
WeaponsSystem.aimRayCallback = nil
WeaponsSystem.CurrentWeaponChanged = Instance.new("BindableEvent")
local NetworkingCallbacks = require(WeaponsSystemFolder:WaitForChild("NetworkingCallbacks"))
NetworkingCallbacks.WeaponsSystem = WeaponsSystem
local _damageCallback = nil
local _getTeamCallback = nil
function WeaponsSystem.setDamageCallback(cb)
_damageCallback = cb
end
function WeaponsSystem.setGetTeamCallback(cb)
_getTeamCallback = cb
end
function WeaponsSystem.setup()
if WeaponsSystem.didSetup then
warn("Warning: trying to run WeaponsSystem setup twice on the same module.")
return
end
print(script.Parent:GetFullName(), "is now active.")
WeaponsSystem.doingSetup = true
--Setup network routing
if IsServer then
local networkFolder = Instance.new("Folder")
networkFolder.Name = "Network"
for _, remoteEventName in pairs(REMOTE_EVENT_NAMES) do
local remoteEvent = Instance.new("RemoteEvent")
remoteEvent.Name = remoteEventName
remoteEvent.Parent = networkFolder
local callback = NetworkingCallbacks[remoteEventName]
if not callback then
--Connect a no-op function to ensure the queue doesn't pile up.
warn("There is no server callback implemented for the WeaponsSystem RemoteEvent \"%s\"!")
warn("A default no-op function will be implemented so that the queue cannot be abused.")
callback = function() end
end
WeaponsSystem.connections[remoteEventName .. "Remote"] = remoteEvent.OnServerEvent:Connect(function(...)
callback(...)
end)
WeaponsSystem.remoteEvents[remoteEventName] = remoteEvent
end
for _, remoteFuncName in pairs(REMOTE_FUNCTION_NAMES) do
local remoteFunc = Instance.new("RemoteEvent")
remoteFunc.Name = remoteFuncName
remoteFunc.Parent = networkFolder
local callback = NetworkingCallbacks[remoteFuncName]
if not callback then
--Connect a no-op function to ensure the queue doesn't pile up.
warn("There is no server callback implemented for the WeaponsSystem RemoteFunction \"%s\"!")
warn("A default no-op function will be implemented so that the queue cannot be abused.")
callback = function() end
end
remoteFunc.OnServerInvoke = function(...)
return callback(...)
end
WeaponsSystem.remoteFunctions[remoteFuncName] = remoteFunc
end
networkFolder.Parent = WeaponsSystemFolder
WeaponsSystem.networkFolder = networkFolder
else
WeaponsSystem.StarterGui = game:GetService("StarterGui")
WeaponsSystem.camera = ShoulderCamera.new(WeaponsSystem)
WeaponsSystem.gui = WeaponsGui.new(WeaponsSystem)
if ConfigurationValues.SprintEnabled.Value then
WeaponsSystem.camera:setSprintEnabled(ConfigurationValues.SprintEnabled.Value)
end
if ConfigurationValues.SlowZoomWalkEnabled.Value then
WeaponsSystem.camera:setSlowZoomWalkEnabled(ConfigurationValues.SlowZoomWalkEnabled.Value)
end
local networkFolder = WeaponsSystemFolder:WaitForChild("Network", math.huge)
for _, remoteEventName in pairs(REMOTE_EVENT_NAMES) do
coroutine.wrap(function()
local remoteEvent = networkFolder:WaitForChild(remoteEventName, math.huge)
local callback = NetworkingCallbacks[remoteEventName]
if callback then
WeaponsSystem.connections[remoteEventName .. "Remote"] = remoteEvent.OnClientEvent:Connect(function(...)
callback(...)
end)
end
WeaponsSystem.remoteEvents[remoteEventName] = remoteEvent
end)()
end
for _, remoteFuncName in pairs(REMOTE_FUNCTION_NAMES) do
coroutine.wrap(function()
local remoteFunc = networkFolder:WaitForChild(remoteFuncName, math.huge)
local callback = NetworkingCallbacks[remoteFuncName]
if callback then
remoteFunc.OnClientInvoke = function(...)
return callback(...)
end
end
WeaponsSystem.remoteFunctions[remoteFuncName] = remoteFunc
end)()
end
Players.LocalPlayer.CharacterAdded:Connect(WeaponsSystem.onCharacterAdded)
if Players.LocalPlayer.Character then
WeaponsSystem.onCharacterAdded(Players.LocalPlayer.Character)
end
WeaponsSystem.networkFolder = networkFolder
end
--Setup weapon tools and listening
WeaponsSystem.connections.weaponAdded = CollectionService:GetInstanceAddedSignal(WEAPON_TAG):Connect(WeaponsSystem.onWeaponAdded)
WeaponsSystem.connections.weaponRemoved = CollectionService:GetInstanceRemovedSignal(WEAPON_TAG):Connect(WeaponsSystem.onWeaponRemoved)
for _, instance in pairs(CollectionService:GetTagged(WEAPON_TAG)) do
WeaponsSystem.onWeaponAdded(instance)
end
WeaponsSystem.doingSetup = false
WeaponsSystem.didSetup = true
end
function WeaponsSystem.onCharacterAdded(character)
-- Make it so players unequip weapons while seated, then reequip weapons when they become unseated
local humanoid = character:WaitForChild("Humanoid")
WeaponsSystem.connections.seated = humanoid.Seated:Connect(function(isSeated)
if isSeated then
WeaponsSystem.seatedWeapon = character:FindFirstChildOfClass("Tool")
humanoid:UnequipTools()
WeaponsSystem.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
else
WeaponsSystem.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
humanoid:EquipTool(WeaponsSystem.seatedWeapon)
end
end)
end
function WeaponsSystem.shutdown()
if not WeaponsSystem.didSetup then
return
end
for _, weapon in pairs(WeaponsSystem.knownWeapons) do
weapon:onDestroyed()
end
WeaponsSystem.knownWeapons = {}
if IsServer and WeaponsSystem.networkFolder then
WeaponsSystem.networkFolder:Destroy()
end
WeaponsSystem.networkFolder = nil
WeaponsSystem.remoteEvents = {}
WeaponsSystem.remoteFunctions = {}
for _, connection in pairs(WeaponsSystem.connections) do
if typeof(connection) == "RBXScriptConnection" then
connection:Disconnect()
end
end
WeaponsSystem.connections = {}
end
function WeaponsSystem.getWeaponTypeFromTags(instance)
for _, tag in pairs(CollectionService:GetTags(instance)) do
local weaponTypeFound = WEAPON_TYPES_LOOKUP[tag]
if weaponTypeFound then
return weaponTypeFound
end
end
return nil
end
function WeaponsSystem.createWeaponForInstance(weaponInstance)
coroutine.wrap(function()
local weaponType = WeaponsSystem.getWeaponTypeFromTags(weaponInstance)
if not weaponType then
local weaponTypeObj = weaponInstance:WaitForChild("WeaponType")
if weaponTypeObj and weaponTypeObj:IsA("StringValue") then
local weaponTypeName = weaponTypeObj.Value
local weaponTypeFound = WEAPON_TYPES_LOOKUP[weaponTypeName]
if not weaponTypeFound then
warn(string.format("Cannot find the weapon type \"%s\" for the instance %s!", weaponTypeName, weaponInstance:GetFullName()))
return
end
weaponType = weaponTypeFound
else
warn("Could not find a WeaponType tag or StringValue for the instance ", weaponInstance:GetFullName())
return
end
end
-- Since we might have yielded while trying to get the WeaponType, we need to make sure not to continue
-- making a new weapon if something else beat this iteration.
if WeaponsSystem.getWeaponForInstance(weaponInstance) then
warn("Already got ", weaponInstance:GetFullName())
warn(debug.traceback())
return
end
-- We should be pretty sure we got a valid weaponType by now
assert(weaponType, "Got invalid weaponType")
local weapon = weaponType.new(WeaponsSystem, weaponInstance)
WeaponsSystem.knownWeapons[weaponInstance] = weapon
end)()
end
function WeaponsSystem.getWeaponForInstance(weaponInstance)
if not typeof(weaponInstance) == "Instance" then
warn("WeaponsSystem.getWeaponForInstance(weaponInstance): 'weaponInstance' was not an instance.")
return nil
end
return WeaponsSystem.knownWeapons[weaponInstance]
end
|
--------RIGHT DOOR -------- |
game.Workspace.doorright.l41.BrickColor = BrickColor.new(1013)
game.Workspace.doorright.l53.BrickColor = BrickColor.new(106)
game.Workspace.doorright.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value) |
-- Variables for the zombie, its humanoid, and destination |
local humanoid = workspace.AI
local destination = workspace.destination
local agentParams = {
AgentRadius = 10,
AgentHeight = 0.01,
AgentCanJump = false
}
|
-- 3D TextGen |
This = script.Parent
Btn = This.Parent
Lift = Btn.Parent.Parent.Parent
Config = require(Lift.CustomLabel)
Characters = require(script.Characters)
CustomLabel = Config["CUSTOMFLOORLABEL"][tonumber(Btn.Name)]
function ChangeFloor(SF)
if string.len(SF) == 1 then
SetLabel(1,SF,-0.04)
SetLabel(2,"NIL",0)
else
SetLabel(1,SF:sub(1,1),0)
SetLabel(2,SF:sub(2,2),0)
end
end
function SetLabel(ID,CHAR,OFFSET)
if This:FindFirstChild("L"..ID) and Characters[CHAR] ~= nil then
This["L"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0)
for i,l in pairs(Characters[CHAR]) do
This["L"..ID].Mesh.MeshId = "rbxassetid://"..l
end
This["L"..ID].Mesh.Scale = Vector3.new(0.005, 0.007, 0.019)
end
end
if CustomLabel then
ChangeFloor(CustomLabel)
else
ChangeFloor(Btn.Name)
end
script:Destroy()
|
-- Written by GFink.
-- This script can be placed anywhere. |
local y=workspace:GetDescendants()
local r
for s=1,#y do
if y[s].Name=="Doomspires" then
local sa=y[s]:GetChildren()
local m=Instance.new("Model")
m.Name="Backup"
m.Parent=game.ServerStorage
for i=1,#sa do
if sa[i].Name~="GameValues" then
if not sa[i]:IsA("Script") then
sa[i]:Clone().Parent=m
end
end
end
script.Signal.Changed:connect(function(Property)
if Property==true then
print("Regenerating")
local ab=y[s]:GetChildren()
for cd=1,#ab do
if not ab[cd]:IsA("Script") then
ab[cd]:Destroy()
end
end
script.GameControlScriptLocation.Value.Disabled=true
local z=game.ServerStorage:WaitForChild("Backup",1):GetChildren()
for f=1,#z do
z[f]:Clone().Parent=y[s]
end
script.GameControlScriptLocation.Value.Disabled=false
script.Signal.Value=false
y[s]:MakeJoints()
local t=game.Teams:GetChildren()
for d=1,#t do
if t[d].Name~="Spectators" then
t[d].AutoAssignable=true
end
end
script.GameControlScriptLocation.Value.ShuffleTeams:Invoke()
script.GameControlScriptLocation.Value.BalanceTeams:Invoke()
wait(1)
local p=game.Players:GetDescendants()
for q=1,#p do
if p[q].Parent then
if p[q].Parent.Name=="leaderstats" then
p[q].Value=0
end
end
if p[q]:IsA("Player") then
game:GetService("ReplicatedStorage").ChangeTeamEvent:FireClient(p[q],p[q].TeamColor) -- i could use fireallclients but then i couldnt select the teamcolor property
p[q]:LoadCharacter()
p[q]:WaitForChild("AntiTeamKill",5).Value=true
elseif p[q]:IsA("TextButton") then -- only works in experimental mode
if p[q].Name=="Button" then
p[q].Visible=false
end
end
end
elseif Property==false then
return
end
end)
end
end
|
-- Decompiled with the Synapse X Luau decompiler. |
local l__Players__1 = game:GetService("Players");
local v2 = require(script.Parent:WaitForChild("BaseCharacterController"));
local v3 = setmetatable({}, v2);
v3.__index = v3;
function v3.new()
local v4 = setmetatable(v2.new(), v3);
v4.isFollowStick = false;
v4.thumbstickFrame = nil;
v4.moveTouchObject = nil;
v4.onTouchMovedConn = nil;
v4.onTouchEndedConn = nil;
v4.screenPos = nil;
v4.stickImage = nil;
v4.thumbstickSize = nil;
return v4;
end;
local u1 = Vector3.new(0, 0, 0);
function v3.Enable(p1, p2, p3)
if p2 == nil then
return false;
end;
if p2 then
local v5 = true;
else
v5 = false;
end;
p2 = v5;
if p1.enabled == p2 then
return true;
end;
p1.moveVector = u1;
p1.isJumping = false;
if p2 then
if not p1.thumbstickFrame then
p1:Create(p3);
end;
p1.thumbstickFrame.Visible = true;
else
p1.thumbstickFrame.Visible = false;
p1:OnInputEnded();
end;
p1.enabled = p2;
end;
function v3.OnInputEnded(p4)
p4.thumbstickFrame.Position = p4.screenPos;
p4.stickImage.Position = UDim2.new(0, p4.thumbstickFrame.Size.X.Offset / 2 - p4.thumbstickSize / 4, 0, p4.thumbstickFrame.Size.Y.Offset / 2 - p4.thumbstickSize / 4);
p4.moveVector = u1;
p4.isJumping = false;
p4.thumbstickFrame.Position = p4.screenPos;
p4.moveTouchObject = nil;
end;
local l__UserInputService__2 = game:GetService("UserInputService");
local l__GuiService__3 = game:GetService("GuiService");
function v3.Create(p5, p6)
if p5.thumbstickFrame then
p5.thumbstickFrame:Destroy();
p5.thumbstickFrame = nil;
if p5.onTouchMovedConn then
p5.onTouchMovedConn:Disconnect();
p5.onTouchMovedConn = nil;
end;
if p5.onTouchEndedConn then
p5.onTouchEndedConn:Disconnect();
p5.onTouchEndedConn = nil;
end;
end;
local v6 = math.min(p6.AbsoluteSize.x, p6.AbsoluteSize.y) <= 500;
if v6 then
local v7 = 70;
else
v7 = 120;
end;
p5.thumbstickSize = v7;
p5.screenPos = v6 and UDim2.new(0, p5.thumbstickSize / 2 - 10, 1, -p5.thumbstickSize - 20) or UDim2.new(0, p5.thumbstickSize / 2, 1, -p5.thumbstickSize * 1.75);
p5.thumbstickFrame = Instance.new("Frame");
p5.thumbstickFrame.Name = "ThumbstickFrame";
p5.thumbstickFrame.Active = true;
p5.thumbstickFrame.Visible = false;
p5.thumbstickFrame.Size = UDim2.new(0, p5.thumbstickSize, 0, p5.thumbstickSize);
p5.thumbstickFrame.Position = p5.screenPos;
p5.thumbstickFrame.BackgroundTransparency = 1;
local v8 = Instance.new("ImageLabel");
v8.Name = "OuterImage";
v8.Image = "rbxasset://textures/ui/TouchControlsSheet.png";
v8.ImageRectOffset = Vector2.new();
v8.ImageRectSize = Vector2.new(220, 220);
v8.BackgroundTransparency = 1;
v8.Size = UDim2.new(0, p5.thumbstickSize, 0, p5.thumbstickSize);
v8.Position = UDim2.new(0, 0, 0, 0);
v8.Parent = p5.thumbstickFrame;
p5.stickImage = Instance.new("ImageLabel");
p5.stickImage.Name = "StickImage";
p5.stickImage.Image = "rbxasset://textures/ui/TouchControlsSheet.png";
p5.stickImage.ImageRectOffset = Vector2.new(220, 0);
p5.stickImage.ImageRectSize = Vector2.new(111, 111);
p5.stickImage.BackgroundTransparency = 1;
p5.stickImage.Size = UDim2.new(0, p5.thumbstickSize / 2, 0, p5.thumbstickSize / 2);
p5.stickImage.Position = UDim2.new(0, p5.thumbstickSize / 2 - p5.thumbstickSize / 4, 0, p5.thumbstickSize / 2 - p5.thumbstickSize / 4);
p5.stickImage.ZIndex = 2;
p5.stickImage.Parent = p5.thumbstickFrame;
local u4 = nil;
p5.thumbstickFrame.InputBegan:Connect(function(p7)
if not (not p5.moveTouchObject) or p7.UserInputType ~= Enum.UserInputType.Touch or p7.UserInputState ~= Enum.UserInputState.Begin then
return;
end;
p5.moveTouchObject = p7;
p5.thumbstickFrame.Position = UDim2.new(0, p7.Position.x - p5.thumbstickFrame.Size.X.Offset / 2, 0, p7.Position.y - p5.thumbstickFrame.Size.Y.Offset / 2);
u4 = Vector2.new(p5.thumbstickFrame.AbsolutePosition.x + p5.thumbstickFrame.AbsoluteSize.x / 2, p5.thumbstickFrame.AbsolutePosition.y + p5.thumbstickFrame.AbsoluteSize.y / 2);
local v9 = Vector2.new(p7.Position.x - u4.x, p7.Position.y - u4.y);
end);
local function u5(p8)
local v10 = Vector2.new(p8.x - u4.x, p8.y - u4.y);
local l__magnitude__11 = v10.magnitude;
local v12 = p5.thumbstickFrame.AbsoluteSize.x / 2;
if p5.isFollowStick and v12 < l__magnitude__11 then
local v13 = v10.unit * v12;
p5.thumbstickFrame.Position = UDim2.new(0, p8.x - p5.thumbstickFrame.AbsoluteSize.x / 2 - v13.x, 0, p8.y - p5.thumbstickFrame.AbsoluteSize.y / 2 - v13.y);
else
v10 = v10.unit * math.min(l__magnitude__11, v12);
end;
p5.stickImage.Position = UDim2.new(0, v10.x + p5.stickImage.AbsoluteSize.x / 2, 0, v10.y + p5.stickImage.AbsoluteSize.y / 2);
end;
p5.onTouchMovedConn = l__UserInputService__2.TouchMoved:Connect(function(p9, p10)
if p9 == p5.moveTouchObject then
u4 = Vector2.new(p5.thumbstickFrame.AbsolutePosition.x + p5.thumbstickFrame.AbsoluteSize.x / 2, p5.thumbstickFrame.AbsolutePosition.y + p5.thumbstickFrame.AbsoluteSize.y / 2);
local v14 = Vector2.new(p9.Position.x - u4.x, p9.Position.y - u4.y) / (p5.thumbstickSize / 2);
local l__magnitude__15 = v14.magnitude;
if l__magnitude__15 < 0.05 then
local v16 = Vector3.new();
else
local v17 = v14.unit * ((l__magnitude__15 - 0.05) / 0.95);
v16 = Vector3.new(v17.x, 0, v17.y);
end;
p5.moveVector = v16;
u5(p9.Position);
end;
end);
p5.onTouchEndedConn = l__UserInputService__2.TouchEnded:Connect(function(p11, p12)
if p11 == p5.moveTouchObject then
p5:OnInputEnded();
end;
end);
l__GuiService__3.MenuOpened:Connect(function()
if p5.moveTouchObject then
p5:OnInputEnded();
end;
end);
p5.thumbstickFrame.Parent = p6;
end;
return v3;
|