prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[
-- product
["AssetId"] = 0,
["AssetTypeId"] = 0,
["Created"] = "2023-05-17T18:00:11.7196645Z",
["Creator"] = ▶ {...},
["Description"] = "example description",
["DisplayDescription"] = "example description",
["DisplayIconImageAssetId"] = 0,
["DisplayName"] = "developer product test",
["IconImageAssetId"] = 0,
["IsForSale"] = true,
["IsLimited"] = false,
["IsLimitedUnique"] = false,
["IsNew"] = true,
["IsPublicDomain"] = false,
["MinimumMembershipLevel"] = 0,
["Name"] = "developer product test",
["PriceInRobux"] = 1000000000,
["ProductId"] = 1543290027,
["ProductType"] = "Developer Product",
["TargetId"] = 23596539,
["Updated"] = "2023-05-17T18:00:42.4963917Z"
--badge
{
["Description"] = "",
["IconImageId"] = 11132927395,
["IsEnabled"] = false,
["Name"] = "Example Badge"
}
--BadgeService:GetBadgeInfoAsync()
--BadgeService:AwardBadge()
--BadgeService:UserHasBadgeAsync()
]]
|
function module.AwardBadge(userId: number, badgeId: number): boolean?
local func = Functions.badges[badgeId]
if not func or BadgeService:UserHasBadgeAsync(userId, badgeId) then return end
local success, result = pcall(func, userId)
assert(success, `AwardBadge error: {result}`)
if result then
BadgeService:AwardBadge(userId, badgeId)
end
return true
end
|
--- Returns a table containing the parsed values for all of the arguments.
|
function Command:GatherArgumentValues ()
local values = {}
for i = 1, #self.ArgumentDefinitions do
local arg = self.Arguments[i]
if arg then
values[i] = arg:GetValue()
elseif type(self.ArgumentDefinitions[i]) == "table" then
values[i] = self.ArgumentDefinitions[i].Default
end
end
return values, #self.ArgumentDefinitions
end
|
-- ROBLOX MOVED: expect/utils.lua
-- ROBLOX TODO: (LUAU) Add seenReferences type annotation once Luau can
-- recognize that the seenReferences or {} is sufficient to make seenReferences
-- non-nil
|
local function getObjectSubset(object: any, subset: any, seenReferences_: { [Object]: boolean }?): any
local seenReferences = if seenReferences_ then seenReferences_ else {}
if Array.isArray(object) then
if Array.isArray(subset) and #subset == #object then
-- The return correct subclass of subset
local subsetMap = {}
for i, sub in ipairs(subset) do
table.insert(subsetMap, getObjectSubset(object[i], sub))
end
return subsetMap
end
elseif getType(object) == "DateTime" then
return object
elseif isObject(object) and isObject(subset) then
if equals(object, subset, { iterableEquality, subsetEquality }) then
return subset
end
local trimmed: any = {}
seenReferences[object] = trimmed
for i, key in
ipairs(Array.filter(Object.keys(object), function(key)
return hasPropertyInObject(subset, key)
end))
do
if seenReferences[object[key]] ~= nil then
trimmed[key] = seenReferences[object[key]]
else
trimmed[key] = getObjectSubset(object[key], subset[key], seenReferences)
end
end
if #Object.keys(trimmed) > 0 then
return trimmed
end
end
return object
end
return {
-- jasmineUtils.lua
equals = equals,
isA = isA,
isAsymmetric = isAsymmetric,
-- utils.lua
getObjectSubset = getObjectSubset,
iterableEquality = iterableEquality,
subsetEquality = subsetEquality,
isObjectWithKeys = isObjectWithKeys,
hasPropertyInObject = hasPropertyInObject,
}
|
--[[
Represents the state relevant while executing a test plan.
Used by TestRunner to produce a TestResults object.
Uses the same tree building structure as TestPlanBuilder; TestSession keeps
track of a stack of nodes that represent the current path through the tree.
]]
|
local TestEnum = require(script.Parent.TestEnum)
local TestResults = require(script.Parent.TestResults)
local Context = require(script.Parent.Context)
local TestSession = {}
TestSession.__index = TestSession
|
--[[ SERVICES ]]
|
--
local TeleportService = game:GetService("TeleportService")
local Players = game:GetService("Players")
|
--[[Susupension]]
|
Tune.SusEnabled = False -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusDamping = 500 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .1 -- Max Compression Travel (in studs)
Tune.FSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.RAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .1 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Bright red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--[=[
Requires all the modules that are descendants of the given parent.
]=]
|
function KnitClient.AddControllersDeep(parent: Instance): { Controller }
local addedControllers = {}
for _, v in parent:GetDescendants() do
if not v:IsA("ModuleScript") then
continue
end
table.insert(addedControllers, require(v))
end
return addedControllers
end
|
--Raycasting Function
|
local raycast = function(character, rayOrigin, rayDirection)
local params = RaycastParams.new()
params.FilterDescendantsInstances = {character, bloodCache}
params.FilterType = Enum.RaycastFilterType.Blacklist
params.IgnoreWater = true
local raycastResult = workspace:Raycast(rayOrigin, rayDirection, params)
if raycastResult then
return raycastResult
end
end
|
-- Table used to hold Observer objects in memory.
|
local strongRefs: Set<Types.Observer> = {}
|
-- Give to player if player spawned or joined if used rake theme is true
|
function AddGui(Player)
local GuiClone = script:FindFirstChildOfClass("ScreenGui"):Clone()
if not Player.Character then
Player.CharacterAdded:wait()
end
if Player:findFirstChild("PlayerGui"):FindFirstChild(GuiClone.Name) then
Player:findFirstChild("PlayerGui"):FindFirstChild(GuiClone.Name):Destroy()
end
GuiClone.MainRakeTheme.Disabled = false
GuiClone.Parent = Player:findFirstChild("PlayerGui")
end
function isplr(child)
if game.Players:findFirstChild(child.Name) or child.Name == "The_Rake" then
for _,v in next, game.Players:GetPlayers() do
AddGui(v)
end
end
end
game.Players.PlayerAdded:Connect(isplr)
game.Workspace.ChildAdded:connect(isplr)
wait(1)
for _,v in next, game.Players:GetPlayers() do
AddGui(v)
end
|
-- Constants
|
local Remote_Events = ReplicateStorage.RemoteEvents
local RE_Character_Appearance_Loaded = Remote_Events.CharacterAppearanceLoaded
|
-- map a value from one range to another
|
local function map(x, inMin, inMax, outMin, outMax)
return (x - inMin)*(outMax - outMin)/(inMax - inMin) + outMin
end
local function playSound(sound)
sound.TimePosition = 0
sound.Playing = true
end
local function stopSound(sound)
sound.Playing = false
sound.TimePosition = 0
end
local function shallowCopy(t)
local out = {}
for k, v in pairs(t) do
out[k] = v
end
return out
end
local function initializeSoundSystem(player, humanoid, rootPart)
local sounds = {}
-- initialize sounds
for name, props in pairs(SOUND_DATA) do
local sound = Instance.new("Sound")
sound.Name = name
-- set default values
sound.Archivable = false
sound.EmitterSize = 5
sound.MaxDistance = 150
sound.Volume = 0.65
for propName, propValue in pairs(props) do
sound[propName] = propValue
end
sound.Parent = rootPart
sounds[name] = sound
end
local playingLoopedSounds = {}
local function stopPlayingLoopedSounds(except)
for sound in pairs(shallowCopy(playingLoopedSounds)) do
if sound ~= except then
sound.Playing = false
playingLoopedSounds[sound] = nil
end
end
end
-- state transition callbacks
local stateTransitions = {
[Enum.HumanoidStateType.FallingDown] = function()
stopPlayingLoopedSounds()
end,
[Enum.HumanoidStateType.GettingUp] = function()
stopPlayingLoopedSounds()
playSound(sounds.GettingUp)
end,
[Enum.HumanoidStateType.Jumping] = function()
stopPlayingLoopedSounds()
playSound(sounds.Jumping)
end,
[Enum.HumanoidStateType.Swimming] = function()
local verticalSpeed = math.abs(rootPart.Velocity.Y)
if verticalSpeed > 0.1 then
sounds.Splash.Volume = math.clamp(map(verticalSpeed, 100, 350, 0.28, 1), 0, 1)
playSound(sounds.Splash)
end
stopPlayingLoopedSounds(sounds.Swimming)
sounds.Swimming.Playing = true
playingLoopedSounds[sounds.Swimming] = true
end,
[Enum.HumanoidStateType.Freefall] = function()
sounds.FreeFalling.Volume = 0
stopPlayingLoopedSounds(sounds.FreeFalling)
playingLoopedSounds[sounds.FreeFalling] = true
end,
[Enum.HumanoidStateType.Landed] = function()
stopPlayingLoopedSounds()
local verticalSpeed = math.abs(rootPart.Velocity.Y)
if verticalSpeed > 75 then
sounds.Landing.Volume = math.clamp(map(verticalSpeed, 50, 100, 0, 1), 0, 1)
playSound(sounds.Landing)
end
end,
[Enum.HumanoidStateType.Running] = function()
stopPlayingLoopedSounds(sounds.Running)
sounds.Running.Playing = true
playingLoopedSounds[sounds.Running] = true
end,
[Enum.HumanoidStateType.Climbing] = function()
local sound = sounds.Climbing
if math.abs(rootPart.Velocity.Y) > 0.1 then
sound.Playing = true
stopPlayingLoopedSounds(sound)
else
stopPlayingLoopedSounds()
end
playingLoopedSounds[sound] = true
end,
[Enum.HumanoidStateType.Seated] = function()
stopPlayingLoopedSounds()
end,
[Enum.HumanoidStateType.Dead] = function()
stopPlayingLoopedSounds()
playSound(sounds.Died)
end,
}
-- updaters for looped sounds
local loopedSoundUpdaters = {
[sounds.Climbing] = function(dt, sound, vel)
sound.Playing = vel.Magnitude > 0.1
end,
[sounds.FreeFalling] = function(dt, sound, vel)
if vel.Magnitude > 75 then
sound.Volume = math.clamp(sound.Volume + 0.9*dt, 0, 1)
else
sound.Volume = 0
end
end,
[sounds.Running] = function(dt, sound, vel)
sound.Playing = vel.Magnitude > 0.5 and humanoid.MoveDirection.Magnitude > 0.5
end,
}
-- state substitutions to avoid duplicating entries in the state table
local stateRemap = {
[Enum.HumanoidStateType.RunningNoPhysics] = Enum.HumanoidStateType.Running,
}
local activeState = stateRemap[humanoid:GetState()] or humanoid:GetState()
local activeConnections = {}
local stateChangedConn = humanoid.StateChanged:Connect(function(_, state)
state = stateRemap[state] or state
if state ~= activeState then
local transitionFunc = stateTransitions[state]
if transitionFunc then
transitionFunc()
end
activeState = state
end
end)
local customStateChangedConn = SetState.Event:Connect(function(state)
state = stateRemap[state] or state
if state ~= activeState then
local transitionFunc = stateTransitions[state]
if transitionFunc then
transitionFunc()
end
activeState = state
end
end)
local steppedConn = RunService.Stepped:Connect(function(_, worldDt)
-- update looped sounds on stepped
for sound in pairs(playingLoopedSounds) do
local updater = loopedSoundUpdaters[sound]
if updater then
updater(worldDt, sound, rootPart.Velocity)
end
end
end)
local humanoidAncestryChangedConn
local rootPartAncestryChangedConn
local characterAddedConn
local function terminate()
stateChangedConn:Disconnect()
customStateChangedConn:Disconnect()
steppedConn:Disconnect()
humanoidAncestryChangedConn:Disconnect()
rootPartAncestryChangedConn:Disconnect()
characterAddedConn:Disconnect()
end
humanoidAncestryChangedConn = humanoid.AncestryChanged:Connect(function(_, parent)
if not parent then
terminate()
end
end)
rootPartAncestryChangedConn = rootPart.AncestryChanged:Connect(function(_, parent)
if not parent then
terminate()
end
end)
characterAddedConn = player.CharacterAdded:Connect(terminate)
end
local function playerAdded(player)
local function characterAdded(character)
-- Avoiding memory leaks in the face of Character/Humanoid/RootPart lifetime has a few complications:
-- * character deparenting is a Remove instead of a Destroy, so signals are not cleaned up automatically.
-- ** must use a waitForFirst on everything and listen for hierarchy changes.
-- * the character might not be in the dm by the time CharacterAdded fires
-- ** constantly check consistency with player.Character and abort if CharacterAdded is fired again
-- * Humanoid may not exist immediately, and by the time it's inserted the character might be deparented.
-- * RootPart probably won't exist immediately.
-- ** by the time RootPart is inserted and Humanoid.RootPart is set, the character or the humanoid might be deparented.
if not character.Parent then
waitForFirst(character.AncestryChanged, player.CharacterAdded)
end
if player.Character ~= character or not character.Parent then
return
end
local humanoid = character:FindFirstChildOfClass("Humanoid")
while character:IsDescendantOf(game) and not humanoid do
waitForFirst(character.ChildAdded, character.AncestryChanged, player.CharacterAdded)
humanoid = character:FindFirstChildOfClass("Humanoid")
end
if player.Character ~= character or not character:IsDescendantOf(game) then
return
end
-- must rely on HumanoidRootPart naming because Humanoid.RootPart does not fire changed signals
local rootPart = character:FindFirstChild("HumanoidRootPart")
while character:IsDescendantOf(game) and not rootPart do
waitForFirst(character.ChildAdded, character.AncestryChanged, humanoid.AncestryChanged, player.CharacterAdded)
rootPart = character:FindFirstChild("HumanoidRootPart")
end
if rootPart and humanoid:IsDescendantOf(game) and character:IsDescendantOf(game) and player.Character == character then
initializeSoundSystem(player, humanoid, rootPart)
end
end
if player.Character then
characterAdded(player.Character)
end
player.CharacterAdded:Connect(characterAdded)
end
Players.PlayerAdded:Connect(playerAdded)
for _, player in ipairs(Players:GetPlayers()) do
playerAdded(player)
end
|
-- Modules
|
local ModuleScripts = ReplicatedStorage:WaitForChild("ModuleScripts")
local GameSettings = require(ModuleScripts:WaitForChild("GameSettings"))
|
-- Initialize
|
sound:Play()
image.ImageTransparency = 0
cam.CameraType = Enum.CameraType.Fixed
cam.FieldOfView = 10
wait(1)
image.ImageTransparency = 1
background.BackgroundTransparency = 0
cam.CameraType = Enum.CameraType.Custom
cam.CameraSubject = player.Character.Humanoid
cam.FieldOfView = 70
game:GetService("SoundService"):SetListener(Enum.ListenerType.CFrame,CFrame.new(0,99999999,0))
sound:Stop()
player.CharacterAdded:Connect(function()
game:GetService("SoundService"):SetListener(Enum.ListenerType.Camera)
end)
|
-- We use the built-in PathfindingService. See https://wiki.roblox.com/index.php?title=API:Class/PathfindingService
|
local PathfindingService = game:GetService("PathfindingService")
local DEBUG = false
local Pathfinder = {}
Pathfinder.__index = Pathfinder
function Pathfinder.new(RootPart)
assert(RootPart and RootPart:IsA("BasePart"), "Pathfinder.new(RootPart) requires a valid BasePart!")
local Data = {
CurrentPath = nil,
RootPart = RootPart,
Target = nil,
_DrawnPath = nil
}
return setmetatable(Data, Pathfinder)
end
|
--[=[
@within TableUtil
@function DecodeJSON
@param value any
@return string
Proxy for [`HttpService:JSONDecode`](https://developer.roblox.com/en-us/api-reference/function/HttpService/JSONDecode).
]=]
|
local function DecodeJSON(str: string): any
return HttpService:JSONDecode(str)
end
TableUtil.Copy = Copy
TableUtil.Sync = Sync
TableUtil.Reconcile = Reconcile
TableUtil.SwapRemove = SwapRemove
TableUtil.SwapRemoveFirstValue = SwapRemoveFirstValue
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.Assign = Assign
TableUtil.Extend = Extend
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.Sample = Sample
TableUtil.Flat = Flat
TableUtil.FlatMap = FlatMap
TableUtil.Keys = Keys
TableUtil.Find = Find
TableUtil.Every = Every
TableUtil.Some = Some
TableUtil.Truncate = Truncate
TableUtil.Zip = Zip
TableUtil.Lock = Lock
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON
return TableUtil
|
--[[
Knit.CreateController(controller): Controller
Knit.AddControllers(folder): Controller[]
Knit.AddControllersDeep(folder): Controller[]
Knit.GetService(serviceName): Service
Knit.GetController(controllerName): Controller
Knit.Start(): Promise<void>
Knit.OnStart(): Promise<void>
--]]
|
local KnitClient = {}
KnitClient.Version = script.Parent.Version.Value
KnitClient.Player = game:GetService("Players").LocalPlayer
KnitClient.Controllers = {}
KnitClient.Util = script.Parent.Util
local Promise = require(KnitClient.Util.Promise)
local Thread = require(KnitClient.Util.Thread)
local Loader = require(KnitClient.Util.Loader)
local Ser = require(KnitClient.Util.Ser)
local ClientRemoteSignal = require(KnitClient.Util.Remote.ClientRemoteSignal)
local ClientRemoteProperty = require(KnitClient.Util.Remote.ClientRemoteProperty)
local TableUtil = require(KnitClient.Util.TableUtil)
local services = {}
local servicesFolder = script.Parent:WaitForChild("Services")
local started = false
local startedComplete = false
local onStartedComplete = Instance.new("BindableEvent")
local function BuildService(serviceName, folder)
local service = {}
if (folder:FindFirstChild("RF")) then
for _,rf in ipairs(folder.RF:GetChildren()) do
if (rf:IsA("RemoteFunction")) then
service[rf.Name] = function(self, ...)
return Ser.DeserializeArgsAndUnpack(rf:InvokeServer(Ser.SerializeArgsAndUnpack(...)))
end
service[rf.Name .. "Promise"] = function(self, ...)
local args = Ser.SerializeArgs(...)
return Promise.new(function(resolve)
resolve(Ser.DeserializeArgsAndUnpack(rf:InvokeServer(table.unpack(args, 1, args.n))))
end)
end
end
end
end
if (folder:FindFirstChild("RE")) then
for _,re in ipairs(folder.RE:GetChildren()) do
if (re:IsA("RemoteEvent")) then
service[re.Name] = ClientRemoteSignal.new(re)
end
end
end
if (folder:FindFirstChild("RP")) then
for _,rp in ipairs(folder.RP:GetChildren()) do
if (rp:IsA("ValueBase") or rp:IsA("RemoteEvent")) then
service[rp.Name] = ClientRemoteProperty.new(rp)
end
end
end
services[serviceName] = service
return service
end
function KnitClient.CreateController(controller)
assert(type(controller) == "table", "Controller must be a table; got " .. type(controller))
assert(type(controller.Name) == "string", "Controller.Name must be a string; got " .. type(controller.Name))
assert(#controller.Name > 0, "Controller.Name must be a non-empty string")
assert(KnitClient.Controllers[controller.Name] == nil, "Service \"" .. controller.Name .. "\" already exists")
controller = TableUtil.Assign(controller, {
_knit_is_controller = true;
})
KnitClient.Controllers[controller.Name] = controller
return controller
end
function KnitClient.AddControllers(folder)
return Loader.LoadChildren(folder)
end
function KnitClient.AddControllersDeep(folder)
return Loader.LoadDescendants(folder)
end
function KnitClient.GetService(serviceName)
assert(type(serviceName) == "string", "ServiceName must be a string; got " .. type(serviceName))
local folder = servicesFolder:FindFirstChild(serviceName)
assert(folder ~= nil, "Could not find service \"" .. serviceName .. "\"")
return services[serviceName] or BuildService(serviceName, folder)
end
function KnitClient.GetController(controllerName)
return KnitClient.Controllers[controllerName]
end
function KnitClient.Start()
if (started) then
return Promise.Reject("Knit already started")
end
started = true
local controllers = KnitClient.Controllers
return Promise.new(function(resolve)
-- Init:
local promisesStartControllers = {}
for _,controller in pairs(controllers) do
if (type(controller.KnitInit) == "function") then
table.insert(promisesStartControllers, Promise.new(function(r)
controller:KnitInit()
r()
end))
end
end
resolve(Promise.All(promisesStartControllers))
end):Then(function()
-- Start:
for _,controller in pairs(controllers) do
if (type(controller.KnitStart) == "function") then
Thread.SpawnNow(controller.KnitStart, controller)
end
end
startedComplete = true
onStartedComplete:Fire()
Thread.Spawn(function()
onStartedComplete:Destroy()
end)
end)
end
function KnitClient.OnStart()
if (startedComplete) then
return Promise.Resolve()
else
return Promise.FromEvent(onStartedComplete.Event)
end
end
return KnitClient
|
-- Get references to the Dock frame and its children
|
local dock = script.Parent.Parent.AdmDockShelf
local click = script.Click
local buttons = {}
for _, child in ipairs(dock:GetChildren()) do
if child:IsA("ImageButton") then
table.insert(buttons, child)
end
end
|
--[[ @brief Returns the number of entries in a given table.
--]]
|
function module.CountMapEntries(t)
local n = 0;
for i in pairs(t) do
n = n + 1;
end
return n;
end
module.newLayeredTable = require(script.LayeredTable).new;
module.newReadOnlyWrapper = require(script.ReadOnlyWrapper).new;
function module.AddTableToTable(t1, t2)
local output = {};
for i, v in pairs(t1) do
output[i] = v + t2[i];
end
return output;
end
function module.AddNumberToTable(n, t)
local output = {};
for i, v in pairs(t) do
output[i] = v + n;
end
return output;
end
function module.Add(...)
local AddQueue = {...};
--Peel off the last two elements and add them.
for i = #AddQueue - 1, 1, -1 do
local a = AddQueue[i + 1];
local b = AddQueue[i];
if type(a) == 'table' then
if type(b) == 'table' then
AddQueue[i] = module.AddTableToTable(a, b);
else
AddQueue[i] = module.AddNumberToTable(b, a);
end
else
if type(b) == 'table' then
AddQueue[i] = module.AddNumberToTable(a, b);
else
AddQueue[i] = a * b;
end
end
end
return AddQueue[1];
end
function module.MultiplyTableByTable(t1, t2)
local output = {};
for i = 1, #t1 do
output[i] = t1[i] * t2[i];
end
return output;
end
function module.MultiplyNumberByTable(n, t)
local output = {};
for i = 1, #t do
output[i] = t[i] * n;
end
return output;
end
function module.Multiply(t1, t2)
if type(t1) == 'table' then
if type(t2) == 'number' then
return module.MultiplyNumberByTable(t2, t1);
elseif type(t2) == 'table' then
return module.MultiplyTableByTable(t1, t2);
else
Utils.Log.AssertNonNilAndType("argument 2", "table or number", t2);
end
elseif type(t1) == 'number' then
if type(t2) == 'table' then
return module.MultiplyNumberByTable(t1, t2);
else
Utils.Log.AssertNonNilAndType("argument 2", "table", t2);
end
end
end
local function rawRange(start, stop, step)
local output = {};
if step > 0 then
local i = start;
while i < stop do
output[#output + 1] = i;
i = i + step;
end
elseif step < 0 then
local i = start;
while i > stop do
output[#output + 1] = i;
i = i + step;
end
end
return output;
end
function module.Range(start, stop, step)
if start and stop and step then
return rawRange(start, stop, step);
elseif start and stop then
return rawRange(start, stop, 1);
elseif start then
return rawRange(0, start, 1);
else
return {};
end
end
function module.RangeInclusive(start, stop, step)
return module.Range(start, stop + step/2, step);
end
|
--Di base
|
script.Parent.Enabled = false
function Punto()
script.Parent.Enabled = true
task.wait(0.1)
script.Parent.Enabled = false
end
function Linea()
script.Parent.Enabled = true
task.wait(0.3)
script.Parent.Enabled = false
end
while true do
Punto()
task.wait(0.5)
Punto()
task.wait(0.5)
Punto()
task.wait(0.5)
Linea()
task.wait(0.5)
Linea()
task.wait(0.5)
Linea()
task.wait(0.5)
Punto()
task.wait(0.5)
Punto()
task.wait(0.5)
Punto()
task.wait(5)
end
|
--[[Chassis Assembly]]
|
--Create Steering Axle
local arm=Instance.new("Part",v)
arm.Name="Arm"
arm.Anchored=true
arm.CanCollide=false
arm.FormFactor=Enum.FormFactor.Custom
arm.Size=Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
arm.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,100,100)
arm.TopSurface=Enum.SurfaceType.Smooth
arm.BottomSurface=Enum.SurfaceType.Smooth
arm.Transparency=1
--Create Wheel Spindle
local base=arm:Clone()
base.Parent=v
base.Name="Base"
base.CFrame=base.CFrame*CFrame.new(0,_Tune.AxleSize,0)
base.BottomSurface=Enum.SurfaceType.Hinge
--Create Steering Anchor
local axle=arm:Clone()
axle.Parent=v
axle.Name="Axle"
axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle.BackSurface=Enum.SurfaceType.Hinge
if v.Name=="F" or v.Name=="R" then
local axle2=arm:Clone()
axle2.Parent=v
axle2.Name="Axle"
axle2.CFrame=CFrame.new(v.Position+((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle2.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle2.BackSurface=Enum.SurfaceType.Hinge
MakeWeld(arm,axle2)
end
local drive=arm:Clone()
drive.Parent=v
drive.CFrame=v.CFrame
drive.Name="Drive"
drive.CanCollide=false
MakeWeld(drive,arm)
--Create Suspension
if PGS_ON and _Tune.SusEnabled then
local sa=arm:Clone()
sa.Parent=v
sa.Name="#SA"
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
local aOff = _Tune.FAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-fDistX,-fDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
else
local aOff = _Tune.RAnchorOffset
sa.CFrame=v.CFrame*CFrame.new(_Tune.AxleSize/2,-rDistX,-rDistY)*CFrame.new(aOff[3],aOff[1],-aOff[2])*CFrame.Angles(-math.pi/2,-math.pi/2,0)
end
local sb=sa:Clone()
sb.Parent=v
sb.Name="#SB"
sb.CFrame=sa.CFrame*CFrame.new(0,0,_Tune.AxleSize)
sb.FrontSurface=Enum.SurfaceType.Hinge
local g = Instance.new("BodyGyro",sb)
g.Name = "Stabilizer"
g.MaxTorque = Vector3.new(0,0,1)
g.P = 0
local sf1 = Instance.new("Attachment",sa)
sf1.Name = "SAtt"
local sf2 = sf1:Clone()
sf2.Parent = sb
if v.Name == "FL" or v.Name == "FR" or v.Name == "F" then
sf1.Position = Vector3.new(fDistX-fSLX,-fDistY+fSLY,_Tune.AxleSize/2)
sf2.Position = Vector3.new(fDistX,-fDistY,-_Tune.AxleSize/2)
elseif v.Name == "RL" or v.Name=="RR" or v.Name == "R" then
sf1.Position = Vector3.new(rDistX-rSLX,-rDistY+rSLY,_Tune.AxleSize/2)
sf2.Position = Vector3.new(rDistX,-rDistY,-_Tune.AxleSize/2)
end
sb:MakeJoints()
local sp = Instance.new("SpringConstraint",v)
sp.Name = "Spring"
sp.Attachment0 = sf1
sp.Attachment1 = sf2
sp.LimitsEnabled = true
sp.Visible=_Tune.SusVisible
sp.Radius=_Tune.SusRadius
sp.Thickness=_Tune.SusThickness
sp.Color=BrickColor.new(_Tune.SusColor)
sp.Coils=_Tune.SusCoilCount
if v.Name == "FL" or v.Name=="FR" or v.Name =="F" then
g.D = _Tune.FAntiRoll
sp.Damping = _Tune.FSusDamping
sp.Stiffness = _Tune.FSusStiffness
sp.FreeLength = _Tune.FSusLength+_Tune.FPreCompress
sp.MaxLength = _Tune.FSusLength+_Tune.FExtensionLim
sp.MinLength = _Tune.FSusLength-_Tune.FCompressLim
else
g.D = _Tune.RAntiRoll
sp.Damping = _Tune.RSusDamping
sp.Stiffness = _Tune.RSusStiffness
sp.FreeLength = _Tune.RSusLength+_Tune.RPreCompress
sp.MaxLength = _Tune.RSusLength+_Tune.RExtensionLim
sp.MinLength = _Tune.RSusLength-_Tune.RCompressLim
end
MakeWeld(car.DriveSeat,sa)
MakeWeld(sb,base)
else
MakeWeld(car.DriveSeat,base)
end
--Lock Rear Steering Axle
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then MakeWeld(base,axle) end
--Weld Assembly
if v.Parent.Name == "RL" or v.Parent.Name == "RR" or v.Name=="R" then MakeWeld(car.DriveSeat,arm) end
MakeWeld(arm,axle)
arm:MakeJoints()
axle:MakeJoints()
--Weld Wheel Parts
if v:FindFirstChild("Parts")~=nil then
ModelWeld(v.Parts,v)
end
--Add Steering Gyro
if v:FindFirstChild("Steer") then
v:FindFirstChild("Steer"):Destroy()
end
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
local steer=Instance.new("BodyGyro",arm)
steer.Name="Steer"
steer.P=_Tune.SteerP
steer.D=_Tune.SteerD
steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
end
--Add Stabilization Gyro
local gyro=Instance.new("BodyGyro",v)
gyro.Name="Stabilizer"
gyro.MaxTorque=Vector3.new(1,0,1)
gyro.P=0
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
gyro.D=_Tune.FGyroDamp
else
gyro.D=_Tune.RGyroDamp
end
--Add Rotational BodyMover
local AA=Instance.new("Attachment",v) AA.Name="AA"
AA.Orientation=Vector3.new(0,0,90)
local AB=Instance.new("Attachment",drive) AB.Name="AB"
AB.Orientation=Vector3.new(0,0,90)
local AV=Instance.new("HingeConstraint",v)
AV.Name="#AV"
AV.Attachment0=AA
AV.Attachment1=AB
AV.ActuatorType="Motor"
end
|
--now, get to playing the music
|
local FadeoutTime = settings.MusicFadeoutTime
function PlaySound(sounddata)
if sounddata == nil then return end
local sound = Instance.new("Sound")
sound.Looped = true
sound.SoundId = sounddata.SoundId
sound.Volume = musicon and sounddata.Volume or 0
local v = Instance.new("NumberValue",sound)
v.Name = "OriginalVolume"
v.Value = sounddata.Volume
sound.Pitch = sounddata.Pitch
sound.Name = "BGM"
sound.Parent = script
sound:Play()
end
function FadeOutSound(sound)
local basevol = sound.Volume
local count = math.ceil(30*FadeoutTime)
if count < 1 then
count = 1
end
for i=1,count do
if sound then
sound.Volume = sound.Volume - (basevol / count)
wait(1/30)
end
end
if sound then
sound:Stop()
sound:Destroy()
end
end
if settings.UseGlobalBackgroundMusic == true and settings.UseMusicZones == false then
if #music[globali] == 1 then --global BGM with just 1 song? ez pz
PlaySound(music[1][1])
return
elseif #music[globali] == 0 then --there's no music to play...?
return
end
end
local recentindices = {} --keeps track of recently selected indicies, so as not to play repeat music tracks
math.randomseed(tick())
local currentzone
local zoneplayingmusic
function CheckIfRecent(i)
for _,v in pairs(recentindices) do
if v == i then
return true
end
end
return false
end
function SelectRandomMusic(musiclist) --select a random number, excluding ones that were already used recently
if musiclist == nil or #musiclist == 0 then return end
local possiblenumbers = {}
local selectedindex
for i=1,#musiclist do
if not CheckIfRecent(i) then
table.insert(possiblenumbers,i)
end
end
local selectedindex = possiblenumbers[math.random(1,#possiblenumbers)]
table.insert(recentindices,selectedindex)
if #recentindices > math.ceil(#musiclist / 2) then
table.remove(recentindices,1)
end
return musiclist[selectedindex]
end
function IsInZone(zonedata)
if torso and torso.Parent ~= nil then
local p = torso.Position
for _,data in pairs(zonedata["Parts"]) do
if data["Coordinates"] then
local t = data["Coordinates"]
if (p.x > t.lx and p.x < t.mx and p.y > t.ly and p.y < t.my and p.z > t.lz and p.z < t.mz) then --is the character within all the coordinates of the zone?
return true
end
elseif data["Part"] then --complex part? create a clone of the part and check if it's touching the character's torso
local part = data["Part"]:clone()
part.Anchored = true
part.Parent = workspace.CurrentCamera or workspace
part.CanCollide = true
local touching = part:GetTouchingParts()
part:Destroy()
for _,v in pairs(touching) do
if v == torso then
return true
end
end
end
end
return false
end
end
function CalculateCurrentZone()
local priority = -math.huge
local oldzone = currentzone
local selectedzone
if currentzone then
if IsInZone(currentzone) then
selectedzone = currentzone
priority = currentzone["Priority"]
end
end
for _,zone in pairs(zones) do
if zone["Priority"] > priority and IsInZone(zone) then
priority = zone["Priority"]
selectedzone = zone
end
end
currentzone = selectedzone
if currentzone ~= oldzone and (currentzone ~= nil or settings.UseGlobalBackgroundMusic == true) then
recentindices = {}
end
return currentzone,oldzone
end
function RunCycle() --the main cycle which will continuously run, checking which zones (if any) the character is in and playing new music when necessary
local bgm = script:FindFirstChild("BGM")
if settings.UseMusicZones == true then
local zone,oldzone = CalculateCurrentZone()
if zone ~= oldzone and zone ~= zoneplayingmusic and bgm then
if (zone == nil and (settings.UseGlobalBackgroundMusic == true or settings.MusicOnlyPlaysWithinZones == true)) or zone ~= nil then
FadeOutSound(bgm)
return
end
elseif zone and bgm == nil then
PlaySound(SelectRandomMusic(zone["Music"]))
zoneplayingmusic = zone
return
elseif zone == nil and oldzone and settings.MusicOnlyPlaysWithinZones == false and settings.UseGlobalBackgroundMusic == false and bgm == nil then
PlaySound(SelectRandomMusic(oldzone["Music"]))
zoneplayingmusic = oldzone
return
elseif zoneplayingmusic and settings.MusicOnlyPlaysWithinZones == false and settings.UseGlobalBackgroundMusic == false and bgm == nil then
PlaySound(SelectRandomMusic(zoneplayingmusic["Music"]))
return
elseif settings.UseGlobalBackgroundMusic == true and bgm == nil then
PlaySound(SelectRandomMusic(music[globali]))
zoneplayingmusic = nil
return
end
elseif bgm == nil and settings.UseGlobalBackgroundMusic == true then
PlaySound(SelectRandomMusic(music[globali]))
return
end
if bgm and (settings.UseGlobalBackgroundMusic == true and zoneplayingmusic == nil and #music[globali] > 1) or (zoneplayingmusic and #zoneplayingmusic["Music"] > 1) then
local length = bgm.TimeLength
local pos = bgm.TimePosition
if length ~= 0 and length - pos < FadeoutTime + .5 then
FadeOutSound(bgm)
end
end
end
while wait(.5) do
RunCycle()
end
|
-- LOCAL
|
local starterGui = game:GetService("StarterGui")
local guiService = game:GetService("GuiService")
local hapticService = game:GetService("HapticService")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local IconController = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(script.Parent.Signal)
local TopbarPlusGui = require(script.Parent.TopbarPlusGui)
local topbarIcons = {}
local fakeChatName = "_FakeChat"
local forceTopbarDisabled = false
local menuOpen
local topbarUpdating = false
local STUPID_CONTROLLER_OFFSET = 32
|
-- Servic
|
local rp = game:GetService("ReplicatedStorage")
|
-- public constructors
|
function vec.new(t)
return setmetatable(t, vec_mt);
end
|
--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.CatFood
|
--[[
This script arrange the model to somewhere so you don't need to do it yourself.
Delete this script if you want to do it yourself.
]]
|
local model = script.Parent
local char = model:WaitForChild("The Doombringer")
local stuff = model:WaitForChild("Stuffs")
char.Parent = workspace
stuff.Parent = game:GetService("ReplicatedStorage")
model:Destroy()
|
--// Modules
|
local L_78_ = require(L_19_:WaitForChild("Utilities"))
local L_79_ = require(L_19_:WaitForChild("Spring"))
local L_80_ = require(L_19_:WaitForChild("Plugins"))
local L_81_ = require(L_19_:WaitForChild("easing"))
local L_82_ = L_78_.Fade
local L_83_ = L_78_.SpawnCam
local L_84_ = L_78_.FixCam
local L_85_ = L_78_.tweenFoV
local L_86_ = L_78_.tweenCam
local L_87_ = L_78_.tweenRoll
local L_88_ = L_78_.TweenJoint
local L_89_ = L_78_.Weld
|
--Sound variables
|
local runningSound = myHead.Running
local jumpingSound = myHead.Jumping
local hurtSound = myHead.Hurt
local diedSound = myHead.Died
myHuman:SetStateEnabled(Enum.HumanoidStateType.Flying,false)
myHuman:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
myHuman:SetStateEnabled(Enum.HumanoidStateType.Physics,false)
myHuman:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
myHuman:SetStateEnabled(Enum.HumanoidStateType.RunningNoPhysics,false)
myHuman:SetStateEnabled(Enum.HumanoidStateType.StrafingNoPhysics,false)
myHuman:SetStateEnabled(Enum.HumanoidStateType.Swimming,false)
local rotAttach1 = Instance.new("Attachment")
rotAttach1.Parent = workspace.Terrain
myHuman.Running:Connect(function(speed)
if speed>0 then
runningSound:Play()
else
runningSound:Stop()
end
end)
myHuman.Jumping:Connect(function()
jumpingSound:Play()
end)
if marine.Settings.PlayDeathAnimation.Value == true then
myHuman.BreakJointsOnDeath = false
end
myHuman.Died:Connect(function()
diedSound:Play()
actions.yieldM4()
actions.updateFace("Dead")
if marine.Settings.PlayDeathAnimation.Value == true then
myHuman.BreakJointsOnDeath = false
marine.HumanoidRootPart.Anchored = true
DeathAnimation:Play()
DeathAnimation.Stopped:Wait()
end
for i,v in ipairs(marine:GetDescendants()) do
if v:IsA("BallSocketConstraint") then
v.Enabled = true
elseif v:IsA("BasePart") and v.Name ~= "myHumanoidRootPart" then
v.CanCollide = false
elseif v:IsA("Motor6D") then
v:Destroy()
end
end
if marine.Settings.Respawn.Value then
wait(marine.Settings.RespawnDelay.Value)
clone.Parent = marine.Parent
ArmorDurability = MaxArmorDurability
end
for i,v in ipairs(marine:GetDescendants()) do
if v:IsA("BasePart") or v:IsA("Decal") then
game:GetService("TweenService"):Create(v,TweenInfo.new(0.2),{Transparency = 1}):Play()
end
end
rotAttach1:Destroy()
wait(0.2)
marine:Destroy()
end)
local soundSpeeds = {0.9,0.95,1,1.05,1.1}
myHuman.HealthChanged:Connect(function(health)
if ArmorDurability > 0 then
local damageTaken = oldHealth - health
if (ArmorDurability - damageTaken) <= 0 then
ArmorDurability = 0
marine.Torso.ArmorBroken:Play()
local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local Properties1 = {BackgroundTransparency = 1}
local Properties2 = {ImageTransparency = 1}
ArmorFill.Size = UDim2.new(0, 0, 1, 0)
for i,v in pairs(ArmorGUI:GetDescendants()) do
if v:IsA("Frame") then
local Tween = TweenService:Create(v,Info,Properties1)
Tween:Play()
elseif v:IsA("ImageLabel") then
local Tween = TweenService:Create(v,Info,Properties2)
Tween:Play()
end
end
else
ArmorDurability -= damageTaken
ArmorFill.Size = UDim2.new((ArmorDurability / MaxArmorDurability) * 1, 0, 1, 0)
myHuman.Health = oldHealth
end
end
if health < oldHealth and hurtSound.IsPlaying == false then
status:set("tookDamage",true)
if math.random(3) == 1 then
hurtSound.PlaybackSpeed = soundSpeeds[math.random(#soundSpeeds)]
hurtSound:Play()
end
core.spawn(function()
actions.updateFace("Hurt")
wait(1)
if myHead:FindFirstChild("faceHurt") then
actions.updateFace(status:get("mood"),true)
end
end)
end
oldHealth = myHuman.Health
if myHuman.Health <= 0 then
local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local Properties1 = {BackgroundTransparency = 1}
local Properties2 = {ImageTransparency = 1}
HealthFill.Size = UDim2.new(0, 0, 1, 0)
for i,v in pairs(HealthGUI:GetDescendants()) do
if v:IsA("Frame") then
local Tween = TweenService:Create(v,Info,Properties1)
Tween:Play()
elseif v:IsA("ImageLabel") then
local Tween = TweenService:Create(v,Info,Properties2)
Tween:Play()
end
end
else
HealthFill.Size = UDim2.new((myHuman.Health / myHuman.MaxHealth) * 1, 0, 1, 0)
if myHuman.Health < 45 then
for i,v in pairs(HealthFrame:GetChildren()) do
if v.Name == "Borders" then
v.BackgroundColor3 = Color3.fromRGB(189, 63, 63)
end
end
HealthBar.BorderColor3 = Color3.fromRGB(189, 63, 63)
HealthFill.BackgroundColor3 = Color3.fromRGB(189, 63, 63)
HealthShading.BackgroundColor3 = Color3.fromRGB(194, 87, 87)
HealthFrame.ImageLabel.ImageColor3 = Color3.fromRGB(189, 63, 63)
else
for i,v in pairs(HealthFrame:GetChildren()) do
if v.Name == "Borders" then
v.BackgroundColor3 = Color3.fromRGB(0, 189, 0)
end
end
HealthBar.BorderColor3 = Color3.fromRGB(0, 189, 0)
HealthFill.BackgroundColor3 = Color3.fromRGB(0, 189, 0)
HealthShading.BackgroundColor3 = Color3.fromRGB(115, 189, 102)
HealthFrame.ImageLabel.ImageColor3 = Color3.fromRGB(0, 189, 0)
end
end
end)
|
--[[Script Functions]]
|
--
function CastLightRay(startPos,endPos,color,segLength,segSpeed,parts,effectfunc)
local part, nend = game.Workspace:FindPartOnRay( Ray.new(startPos,(endPos-startPos).unit*999.999),Tool.Parent)
if nend then endPos = nend end
if part and part.Parent then
if part.Parent:FindFirstChild('Humanoid') and part.Parent ~=Tool.Parent then
effectfunc(part.Parent.Humanoid,(endPos-startPos).unit)
elseif part.Parent.Parent and part.Parent.Parent:FindFirstChild('Humanoid') and part.Parent.Parent~=Tool.Parent then
effectfunc(part.Parent.Parent.Humanoid,(endPos-startPos).unit)
end
end
local numSegments = math.floor(math.min((startPos-endPos).magnitude/segLength,50))
local initNumParts = #parts
for i=numSegments,initNumParts,1 do
if parts[i] then
parts[i]:Destroy()
parts[i]=nil
end
end
for i=1,numSegments,1 do
if not parts[i] then
parts[i] = Instance.new('Part')
parts[i].Parent = Tool
parts[i].Anchored = true
parts[i].FormFactor = 'Custom'
parts[i].Size = Vector3.new(0,0,segLength)
parts[i].CanCollide = false
local tlight = Instance.new('PointLight')
tlight.Name = 'Light'
tlight.Parent = parts[i]
end
parts[i].BrickColor = color
parts[i]:WaitForChild('Light').Color = color.Color
parts[i].Light.Range =((math.sin(tick()*3)+1)*1)+5
parts[i].Light.Brightness =((math.sin(tick()*3)+1)*1)+1
parts[i].CFrame = CFrame.new(((i-.4)*(endPos-startPos).unit*segLength)+startPos,endPos)
end
return parts
end
|
--Runtime Loop
|
while wait() do
RegenSpeed = car.DriveSeat.Speed.Value
FWearSpeed = car.DriveSeat.TireStats.Fwear.Value
FTargetFriction = car.DriveSeat.TireStats.Ffriction.Value
RWearSpeed = car.DriveSeat.TireStats.Rwear.Value
RTargetFriction = car.DriveSeat.TireStats.Rfriction.Value
for i,v in pairs(Wheels) do
--Vars
local speed = car.DriveSeat.Velocity.Magnitude
local wheel = v.wheel.RotVelocity.Magnitude
local z = 0
local deg = 0.000126
--Tire Wear
local cspeed = (speed/1.298)*(2.6/v.wheel.Size.Y)
local wdif = math.abs(wheel-cspeed)
if _WHEELTUNE.TireWearOn then
if speed < 4 then
--Wear Regen
v.Heat = math.min(v.Heat + car.DriveSeat.Speed.Value/10000,v.BaseHeat)
else
--Tire Wear
if wdif > 1 then
v.Heat = v.Heat - wdif*deg*v.WearSpeed/28
elseif v.Heat >= v.BaseHeat then
v.Heat = v.BaseHeat
end
end
end
--Apply Friction
if v.wheel.Name == "FL" or v.wheel.Name == "FR" or v.wheel.Name == "F" then
z = _WHEELTUNE.FMinFriction+v.Heat
deg = ((deg - 0.0001188*cValues.Brake.Value)*(1-math.abs(cValues.SteerC.Value))) + 0.00000126*math.abs(cValues.SteerC.Value)
else
z = _WHEELTUNE.RMinFriction+v.Heat
end
--Tire Slip
if math.ceil((wheel/0.774/speed)*100) < 8 then
--Lock Slip
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelLockRatio,v.elast,v.fWeight,v.eWeight)
v.Heat = math.max(v.Heat,0)
elseif (_Tune.TCSEnabled and cValues.TCS.Value == false and math.ceil((wheel/0.774/speed)*100) > 80) then
--TCS Off
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.TCSOffRatio,v.elast,v.fWeight,v.eWeight)
v.Heat = math.max(v.Heat,0)
elseif math.ceil((wheel/0.774/speed)*100) > 130 then
--Wheelspin
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelspinRatio,v.elast,v.fWeight,v.eWeight)
v.Heat = math.max(v.Heat,0)
else
--No Slip
v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z,v.elast,v.fWeight,v.eWeight)
v.Heat = math.min(v.Heat,v.BaseHeat)
end
--Update UI
local vstress = math.abs(((((wdif+cspeed)/0.774)*0.774)-cspeed)/15)
if vstress > 0.05 and vstress > v.stress then
v.stress = math.min(v.stress + 0.03,1)
else
v.stress = math.max(v.stress - 0.03,vstress)
end
local UI = script.Parent.Tires[v.wheel.Name]
UI.First.Second.Image.ImageColor3 = Color3.new(math.min((v.stress*2),1), 1-v.stress, 0)
UI.First.Position = UDim2.new(0,0,1-v.Heat/v.BaseHeat,0)
UI.First.Second.Position = UDim2.new(0,0,v.Heat/v.BaseHeat,0)
end
end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function MaterialTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
end;
function MaterialTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
|
--
-- Adapted from
-- Tweener's easing functions (Penner's Easing Equations)
-- and http://code.google.com/p/tweener/ (jstweener javascript version)
--
-- Adapted for usage of Roblox CFrame objects
--
| |
--OnGround/Close to Ground Flying
|
if isAEngine.Position.Y >= 13 and isAEngine.Position.Y <= 555 then
script.Parent.IsRotated.Disabled = false
else
script.Parent.IsRotated.Disabled = true
script.Parent.WCR.Drift_Data.Enabled = false
script.Parent.WCL.Drift_Data.Enabled = false
end
end
|
--[[
A number of utilities in aid of navigating the DataModel quicker than normal.
]]
|
local DataModelUtils = {}
|
--Playing Animation--
|
if enabled.Value == true then
humanim:Play()
humanim.Looped = loop.Value
humanim:AdjustSpeed(sp.Value)
end
|
---------------
--| Utility |--
---------------
|
local math_min = math.min
local math_max = math.max
local math_cos = math.cos
local math_sin = math.sin
local math_pi = math.pi
local Vector3_new = Vector3.new
local ZERO_VECTOR3 = Vector3_new(0,0,0)
local function AssertTypes(param, ...)
local allowedTypes = {}
local typeString = ''
for _, typeName in pairs({...}) do
allowedTypes[typeName] = true
typeString = typeString .. (typeString == '' and '' or ' or ') .. typeName
end
local theType = type(param)
assert(allowedTypes[theType], typeString .. " type expected, got: " .. theType)
end
|
-------------------------------------------------------------------------
|
local function CheckAlive()
local humanoid = findPlayerHumanoid(Player)
return humanoid ~= nil and humanoid.Health > 0
end
local function GetEquippedTool(character: Model?)
if character ~= nil then
for _, child in pairs(character:GetChildren()) do
if child:IsA('Tool') then
return child
end
end
end
end
local ExistingPather = nil
local ExistingIndicator = nil
local PathCompleteListener = nil
local PathFailedListener = nil
local function CleanupPath()
if ExistingPather then
ExistingPather:Cancel()
ExistingPather = nil
end
if PathCompleteListener then
PathCompleteListener:Disconnect()
PathCompleteListener = nil
end
if PathFailedListener then
PathFailedListener:Disconnect()
PathFailedListener = nil
end
if ExistingIndicator then
ExistingIndicator:Destroy()
end
end
local function HandleMoveTo(thisPather, hitPt, hitChar, character, overrideShowPath)
if ExistingPather then
CleanupPath()
end
ExistingPather = thisPather
thisPather:Start(overrideShowPath)
PathCompleteListener = thisPather.Finished.Event:Connect(function()
CleanupPath()
if hitChar then
local currentWeapon = GetEquippedTool(character)
if currentWeapon then
currentWeapon:Activate()
end
end
end)
PathFailedListener = thisPather.PathFailed.Event:Connect(function()
CleanupPath()
if overrideShowPath == nil or overrideShowPath then
local shouldPlayFailureAnim = PlayFailureAnimation and not (ExistingPather and ExistingPather:IsActive())
if shouldPlayFailureAnim then
ClickToMoveDisplay.PlayFailureAnimation()
end
ClickToMoveDisplay.DisplayFailureWaypoint(hitPt)
end
end)
end
local function ShowPathFailedFeedback(hitPt)
if ExistingPather and ExistingPather:IsActive() then
ExistingPather:Cancel()
end
if PlayFailureAnimation then
ClickToMoveDisplay.PlayFailureAnimation()
end
ClickToMoveDisplay.DisplayFailureWaypoint(hitPt)
end
function OnTap(tapPositions: {Vector3}, goToPoint: Vector3?, wasTouchTap: boolean?)
-- Good to remember if this is the latest tap event
local camera = Workspace.CurrentCamera
local character = Player.Character
if not CheckAlive() then return end
-- This is a path tap position
if #tapPositions == 1 or goToPoint then
if camera then
local unitRay = camera:ScreenPointToRay(tapPositions[1].x, tapPositions[1].y)
local ray = Ray.new(unitRay.Origin, unitRay.Direction*1000)
local myHumanoid = findPlayerHumanoid(Player)
local hitPart, hitPt, hitNormal = Utility.Raycast(ray, true, getIgnoreList())
local hitChar, hitHumanoid = Utility.FindCharacterAncestor(hitPart)
if wasTouchTap and hitHumanoid and StarterGui:GetCore("AvatarContextMenuEnabled") then
local clickedPlayer = Players:GetPlayerFromCharacter(hitHumanoid.Parent)
if clickedPlayer then
CleanupPath()
return
end
end
if goToPoint then
hitPt = goToPoint
hitChar = nil
end
if hitPt and character then
-- Clean up current path
CleanupPath()
local thisPather = Pather(hitPt, hitNormal)
if thisPather:IsValidPath() then
HandleMoveTo(thisPather, hitPt, hitChar, character)
else
-- Clean up
thisPather:Cleanup()
-- Feedback here for when we don't have a good path
ShowPathFailedFeedback(hitPt)
end
end
end
elseif #tapPositions >= 2 then
if camera then
-- Do shoot
local currentWeapon = GetEquippedTool(character)
if currentWeapon then
currentWeapon:Activate()
end
end
end
end
local function DisconnectEvent(event)
if event then
event:Disconnect()
end
end
|
-- Smart Circle mode needs the intersection of 2 rays that are known to be in the same plane
-- because they are generated from cross products with a common vector. This function is computing
-- that intersection, but it's actually the general solution for the point halfway between where
-- two skew lines come nearest to each other, which is more forgiving.
|
local function RayIntersection(p0, v0, p1, v1)
local v2 = v0:Cross(v1)
local d1 = p1.x - p0.x
local d2 = p1.y - p0.y
local d3 = p1.z - p0.z
local denom = Det3x3(v0.x,-v1.x,v2.x,v0.y,-v1.y,v2.y,v0.z,-v1.z,v2.z)
if (denom == 0) then
return ZERO_VECTOR3 -- No solution (rays are parallel)
end
local t0 = Det3x3(d1,-v1.x,v2.x,d2,-v1.y,v2.y,d3,-v1.z,v2.z) / denom
local t1 = Det3x3(v0.x,d1,v2.x,v0.y,d2,v2.y,v0.z,d3,v2.z) / denom
local s0 = p0 + t0 * v0
local s1 = p1 + t1 * v1
local s = s0 + 0.5 * ( s1 - s0 )
-- 0.25 studs is a threshold for deciding if the rays are
-- close enough to be considered intersecting, found through testing
if (s1-s0).Magnitude < 0.25 then
return s
else
return ZERO_VECTOR3
end
end
|
--This is a a script for JayKay, Hi JAYKAY LOL, ok this is the script to add cash onkill, the Leaderboard comes with the zombie so dont worry
--Thats all bye!
|
local Humanoid = script.Parent.Zombie
function PwntX_X()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local Leaderstats = tag.Value:findFirstChild("leaderstats")
if Leaderstats ~= nil then
Leaderstats.Cash.Value = Leaderstats.Cash.Value + 5 -- This gives you 5 cash onkill.
Leaderstats.Spree.Value = Leaderstats.Spree.Value + 1 -- This changes the spree up by one, if you die, it goes back to Zero
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)
|
-- connect events
|
Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)
Humanoid.Swimming:connect(onSwimming)
|
--!nonstrict
--------------------------------------------------------------------------------
-- Popper.lua
-- Prevents your camera from clipping through walls.
--------------------------------------------------------------------------------
|
local Players = game:GetService("Players")
local camera = game.Workspace.CurrentCamera
local min = math.min
local tan = math.tan
local rad = math.rad
local inf = math.huge
local ray = Ray.new
local function getTotalTransparency(part)
return 1 - (1 - part.Transparency)*(1 - part.LocalTransparencyModifier)
end
local function eraseFromEnd(t, toSize)
for i = #t, toSize + 1, -1 do
t[i] = nil
end
end
local nearPlaneZ, projX, projY do
local function updateProjection()
local fov = rad(camera.FieldOfView)
local view = camera.ViewportSize
local ar = view.X/view.Y
projY = 2*tan(fov/2)
projX = ar*projY
end
camera:GetPropertyChangedSignal("FieldOfView"):Connect(updateProjection)
camera:GetPropertyChangedSignal("ViewportSize"):Connect(updateProjection)
updateProjection()
nearPlaneZ = camera.NearPlaneZ
camera:GetPropertyChangedSignal("NearPlaneZ"):Connect(function()
nearPlaneZ = camera.NearPlaneZ
end)
end
local blacklist = {} do
local charMap = {}
local function refreshIgnoreList()
local n = 1
blacklist = {}
for _, character in pairs(charMap) do
blacklist[n] = character
n = n + 1
end
end
local function playerAdded(player)
local function characterAdded(character)
charMap[player] = character
refreshIgnoreList()
end
local function characterRemoving()
charMap[player] = nil
refreshIgnoreList()
end
player.CharacterAdded:Connect(characterAdded)
player.CharacterRemoving:Connect(characterRemoving)
if player.Character then
characterAdded(player.Character)
end
end
local function playerRemoving(player)
charMap[player] = nil
refreshIgnoreList()
end
Players.PlayerAdded:Connect(playerAdded)
Players.PlayerRemoving:Connect(playerRemoving)
for _, player in ipairs(Players:GetPlayers()) do
playerAdded(player)
end
refreshIgnoreList()
end
|
-- Gui
|
local DisplayGui = script:WaitForChild("DisplayGui")
local ColorGui = script:WaitForChild("ColorGui")
local NewDisplayGui = nil
local NewColorGui = nil
function UndoSettings(Folder)
for _,v in pairs(Folder:GetChildren()) do
if v:IsA("NumberValue") or v:IsA("IntValue") then
v.Value = 0
elseif v:IsA("ObjectValue") and v.Name ~= "SpawnedSegway" then
v.Value = nil
end
end
end
function RemoveSegway()
-- Remove segway
DestroySegway:FireServer(Character,SpawnedSegway)
-- Reset camera
Camera.CameraType = "Custom"
-- Show tool
ConfigTool:FireServer(0,Tool,false,nil)
-- Undo tags anyway
HasSpawnedSegway.Value = false
-- UnPlatformStand player
ConfigHumanoid:FireServer(Humanoid,false,false,true)
-- If player has the segway controller script, we'll reset its settings
if PlayerGui:FindFirstChild("GuiControls") then -- Remove mobile gui
PlayerGui:FindFirstChild("GuiControls").Parent = script
end
UserInputService.ModalEnabled = false
UndoSettings(ToolStatus)
end
|
----------------
|
Speed = 16 -- This is the character's speed! 16 is normal walkspeed.
|
-- Roblox services
|
local ContentProvider = game:GetService("ContentProvider")
local TweenService = game:GetService("TweenService")
local SoundService = game:GetService("SoundService")
|
--local function OnChanged(property)
-- if property == 'Enabled' then
-- UpdateIcon()
-- end
--end
| |
--body.Touched:Connect(BodyTouched)
|
proximit.Triggered:Connect(function (player)
if BodyTouched(player) then
proximit.Enabled = false
CoolDown(1)
end
end)
seat:GetPropertyChangedSignal("Occupant"):Connect(OccupantChanged)
|
--
|
function module:GetBowSkin(Skin)
local inv = game.ReplicatedStorage.Inventory.Bows
for i,v in pairs(inv.Common:GetChildren()) do
if v.Name == Skin then
return v.Value
else
for i,v in pairs(inv.Rare:GetChildren()) do
if v.Name == Skin then
return v.Value
else
for i,v in pairs(inv.Epic:GetChildren()) do
if v.Name == Skin then
return v.Value
else
for i,v in pairs(inv.Legendary:GetChildren()) do
if v.Name == Skin then
return v.Value
else
print("Couldn't find the skin info")
return nil
end
end
end
end
end
end
end
end
end
|
--s.Pitch = 0.7
--[[for x = 1, 50 do
s.Pitch = s.Pitch + 0.20 1.900
s:play()
wait(0.001)
end]]
--[[Chopper level 5=1.2, Chopper level 4=1.04]]
|
s2.Volume=1
s.Volume=0
while s.Pitch<0.65 do
s.Pitch=s.Pitch+0.009
s:Play()
if s.Pitch>1 then
s.Pitch=1
end
wait(-9)
end
while s.Pitch<0.97 do
s.Pitch=s.Pitch+0.003
s:Play()
if s.Pitch>1 then
s.Pitch=1
end
wait(-9)
end
while true do
for x = 1, 500 do
s:play()
wait(-9)
end
end
|
--Paper
|
script.Parent.Paper.Parent = game.ReplicatedStorage
wait()
script.Parent:Destroy()
|
--while wait(1) do
-- for _, spawner in pairs(ACS_Workspace.WeaponSpawners:GetChildren()) do
-- spawner.Transparency = 1
-- spawner.Size = Vector3.new(0.2,0.2,0.2)
-- spawner.CanCollide = false
| |
-- local height = part.Size.Y
-- local cframe = part.CFrame
-- part.Size = Vector3.new(hit.Size.X,sizeincrement+math.random()*sizeincrement/2,hit.Size.Z)
-- part.CFrame = cf*CFrame.new(0,part.Size.y/2-height/2,0)
-- part.Transparency = (maximumheight-sizeincrement*2-part.Size.Y)/_G.snowMaximumHeight
-- part.CanCollide = false
|
end
end)
|
-- ROBLOX TODO: ADO-1633 fix Jest Types imports
-- local Config = require(Packages.JestTypes).Config
|
type ConfigPath = string
type ConfigSnapshotUpdateState = string
local PrettyFormat = require(Packages.PrettyFormat)
local PrettyFormat_ = require(CurrentModule.PrettyFormat)
|
--[[**
ensures value is a number where min < value < max
@param min The minimum to use
@param max The maximum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberConstrainedExclusive(min, max)
assert(t.number(min) and t.number(max))
local minCheck = t.numberMinExclusive(min)
local maxCheck = t.numberMaxExclusive(max)
return function(value)
local minSuccess, minErrMsg = minCheck(value)
if not minSuccess then
return false, minErrMsg or ""
end
local maxSuccess, maxErrMsg = maxCheck(value)
if not maxSuccess then
return false, maxErrMsg or ""
end
return true
end
end
|
-- In radian the maximum accuracy penalty
|
local MaxSpread = 0.0
|
--////////////////////////////// Methods
--//////////////////////////////////////
|
local methods = {}
methods.__index = methods
function methods:Destroy()
self.Destroyed = true
end
function methods:SetActive(active)
if active == self.Active then
return
end
if active == false then
self.MessageLogDisplay:Clear()
else
self.MessageLogDisplay:SetCurrentChannelName(self.Name)
for i = 1, #self.MessageLog do
self.MessageLogDisplay:AddMessage(self.MessageLog[i])
end
end
self.Active = active
end
function methods:UpdateMessageFiltered(messageData)
local searchIndex = 1
local searchTable = self.MessageLog
local messageObj = nil
while (#searchTable >= searchIndex) do
local obj = searchTable[searchIndex]
if (obj.ID == messageData.ID) then
messageObj = obj
break
end
searchIndex = searchIndex + 1
end
if messageObj then
messageObj.Message = messageData.Message
messageObj.IsFiltered = true
if self.Active then
if UserFlagRemoveMessageFromMessageLog then
if messageObj.Message == "" then
table.remove(self.MessageLog, searchIndex)
end
end
self.MessageLogDisplay:UpdateMessageFiltered(messageObj)
end
else
-- We have not seen this filtered message before, but we should still add it to our log.
self:AddMessageToChannelByTimeStamp(messageData)
end
end
function methods:AddMessageToChannel(messageData)
table.insert(self.MessageLog, messageData)
if self.Active then
self.MessageLogDisplay:AddMessage(messageData)
end
if #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel then
self:RemoveLastMessageFromChannel()
end
end
function methods:InternalAddMessageAtTimeStamp(messageData)
for i = 1, #self.MessageLog do
if messageData.Time < self.MessageLog[i].Time then
table.insert(self.MessageLog, i, messageData)
return
end
end
table.insert(self.MessageLog, messageData)
end
function methods:AddMessagesToChannelByTimeStamp(messageLog, startIndex)
for i = startIndex, #messageLog do
self:InternalAddMessageAtTimeStamp(messageLog[i])
end
while #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel do
table.remove(self.MessageLog, 1)
end
if self.Active then
self.MessageLogDisplay:Clear()
for i = 1, #self.MessageLog do
self.MessageLogDisplay:AddMessage(self.MessageLog[i])
end
end
end
function methods:AddMessageToChannelByTimeStamp(messageData)
if #self.MessageLog >= 1 then
-- These are the fast cases to evalutate.
if self.MessageLog[1].Time > messageData.Time then
return
elseif messageData.Time >= self.MessageLog[#self.MessageLog].Time then
self:AddMessageToChannel(messageData)
return
end
for i = 1, #self.MessageLog do
if messageData.Time < self.MessageLog[i].Time then
table.insert(self.MessageLog, i, messageData)
if #self.MessageLog > ChatSettings.MessageHistoryLengthPerChannel then
self:RemoveLastMessageFromChannel()
end
if self.Active then
self.MessageLogDisplay:AddMessageAtIndex(messageData, i)
end
return
end
end
else
self:AddMessageToChannel(messageData)
end
end
function methods:RemoveLastMessageFromChannel()
table.remove(self.MessageLog, 1)
if self.Active then
self.MessageLogDisplay:RemoveLastMessage()
end
end
function methods:ClearMessageLog()
self.MessageLog = {}
if self.Active then
self.MessageLogDisplay:Clear()
end
end
function methods:RegisterChannelTab(tab)
self.ChannelTab = tab
end
|
--local Energia = PastaVar.Energia
|
local Ferido = PastasStan.Ferido
local Caido = PastasStan.Caido
local ouch = Caido
local rodeath = PastasStan.rodeath
local cpr = PastasStan.cpr
local balloonbleed = PastasStan.balloonbleed
local clamped = PastasStan.clamped
local repaired = PastasStan.repaired
local o2 = PastasStan.o2
local dead = PastasStan.dead
local life = PastasStan.life
local surg2 = PastasStan.surg2
local cutopen = PastasStan.cutopen
local Ragdoll = require(game.ReplicatedStorage.ACS_Engine.Modulos.Ragdoll)
local configuracao = require(game.ReplicatedStorage.ACS_Engine.ServerConfigs.Config)
local debounce = false
life.Value = true
cutopen.Value = false
clamped.Value = false
|
--Rear Suspension
|
Tune.RSusStiffness = 20000 -- Spring Force
Tune.RSusDamping = 400 -- Spring Dampening
Tune.RAntiRoll = 400 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2.1 -- Resting Suspension length (in studs)
Tune.RPreCompress = .1 -- Pre-compression adds resting length force
Tune.RExtensionLim = .4 -- Max Extension Travel (in studs)
Tune.RCompressLim = .2 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
|
--// Tables
|
local L_92_ = {
"285421759";
"151130102";
"151130171";
"285421804";
"287769483";
"287769415";
"285421687";
"287769261";
"287772525";
"287772445";
"287772351";
"285421819";
"287772163";
}
local L_93_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace)
L_93_.Name = "BulletModel: " .. L_2_.Name
local L_94_
local L_95_ = L_24_.Ammo
local L_96_ = L_24_.StoredAmmo * L_24_.MagCount
local L_97_ = L_24_.ExplosiveAmmo
IgnoreList = {
L_3_,
L_93_,
L_5_
}
|
--Functions
|
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
--Varibles
local head = char.Head
local newtext = nametag:Clone() --Cloning the text.
local uppertext = newtext.UpperText
local lowertext = newtext.LowerText
local humanoid = char.Humanoid
humanoid.DisplayDistanceType = "None"
--Main Text
newtext.Parent = head
newtext.Adornee = head
uppertext.Text = player.Name
--"If" Statements
--You can add as many of these as you wish, just change it to the player's name.
if player.Name == "---" then
lowertext.Text = "---" --This is that the text will say.
lowertext.TextColor3 = Color3.fromRGB(255, 0, 255)
end
end)
end)
|
--Tone1Switch
|
Ton1Swch.Changed:Connect(function()
if Ton1Swch.Value == true then
Ton1Swch.Parent.P1.Transparency = 1
Ton1Swch.Parent.P2.Transparency = 0
ClickSound:Play()
Tone1Val.Test.Value = true
else
Ton1Swch.Parent.P1.Transparency = 0
Ton1Swch.Parent.P2.Transparency = 1
ClickSound:Play()
Tone1Val.Test.Value = false
end
end)
|
--[[local clonename = script.Parent.PlrName.Value:Clone()
script.Parent.PlrName.Value.Archivable = false
clonename:SetPrimaryPartCFrame(CFrame.new())
clonename.Parent = workspace
clonename.HumanoidRootPart.Orientation = Vector3.new(0, -180, 0);
for fart, fart2 in pairs(clonename:GetChildren()) do
if fart2:IsA("Accessory") or fart2:IsA("BasePart") then
if not (not getplrname.find(fart2.Name, "Arm")) or not (not getplrname.find(fart2.Name, "Leg")) or fart2.Name == "Torso" then
fart2:ClearAllChildren()
fart2.Transparency = 1;
end
else
fart2:Destroy();
end
end
for imtired, imtired2 in pairs(clonename:GetChildren()) do
if imtired2.Name == "StarterCharacter" then
imtired2:Destroy();
end
end
clonename.Parent = script.Parent.Viewport
local monkey = Instance.new("Camera")
monkey.CameraType = Enum.CameraType.Scriptable
monkey.CFrame = clonename.Head.CFrame:ToWorldSpace(CFrame.new(0, 0, -4.5))
monkey.CFrame = CFrame.new(monkey.CFrame.p, clonename.Head.Position)
monkey.CameraSubject = clonename.Head
monkey.CameraType = Enum.CameraType.Fixed
monkey.DiagonalFieldOfView = 85
monkey.Parent = Viewport
Viewport.CurrentCamera = monkey]]
|
--
end
|
--------------------------PC AUTO JUMPER-------------------------------
|
local function GetCharacter()
return Player and Player.Character
end
local function GetTorso()
local humanoid = findPlayerHumanoid(Player)
return humanoid and humanoid.Torso
end
local function IsPartAHumanoid(part)
return part and part.Parent and (part.Parent:FindFirstChild('Humanoid') ~= nil)
end
local function doAutoJump()
local character = GetCharacter()
if (character == nil) then
return;
end
local humanoid = findPlayerHumanoid(Player)
if (humanoid == nil) then
return;
end
local rayLength = 1.5;
-- This is how high a ROBLOXian jumps from the mid point of his torso
local jumpHeight = 7.0;
local torso = GetTorso()
if (torso == nil) then
return;
end
local torsoCFrame = torso.CFrame;
local torsoLookVector = torsoCFrame.lookVector;
local torsoPos = torsoCFrame.p;
local torsoRay = Ray.new(torsoPos + Vector3.new(0, -torso.Size.Y/2, 0), torsoLookVector * rayLength);
local jumpRay = Ray.new(torsoPos + Vector3.new(0, jumpHeight - torso.Size.Y, 0), torsoLookVector * rayLength);
local hitPart, _ = RayCastIgnoreList(workspace, torsoRay, {character}, false)
local jumpHitPart, _ = RayCastIgnoreList(workspace, jumpRay, {character}, false)
if (hitPart and jumpHitPart == nil and hitPart.CanCollide == true) then
-- NOTE: this follow line is not in the C++ impl, but an improvement in Click to Move
if not IsPartAHumanoid(hitPart) then
humanoid.Jump = true;
end
end
end
local NO_JUMP_STATES =
{
[Enum.HumanoidStateType.FallingDown] = false;
[Enum.HumanoidStateType.Flying] = false;
[Enum.HumanoidStateType.Freefall] = false;
[Enum.HumanoidStateType.GettingUp] = false;
[Enum.HumanoidStateType.Ragdoll] = false;
[Enum.HumanoidStateType.Running] = false;
[Enum.HumanoidStateType.Seated] = false;
[Enum.HumanoidStateType.Swimming] = false;
-- Special case to detect if we are on a ladder
[Enum.HumanoidStateType.Climbing] = false;
}
local function enableAutoJump()
local humanoid = findPlayerHumanoid(Player)
local currentState = humanoid and humanoid:GetState()
if currentState then
return NO_JUMP_STATES[currentState] == nil
end
return false
end
local function getAutoJump()
return true
end
local function vec3IsZero(vec3)
return vec3.magnitude < 0.05
end
|
--[[Transmission]]
|
--
Tune.Clutch = true -- Implements a realistic clutch.
Tune.TransModes = {"Manual","DCT","Auto"} --[[
[Modes]
"Manual" ; Traditional clutch operated manual transmission
"DCT" ; Dual clutch transmission, where clutch is operated automatically
"Auto" ; Automatic transmission that shifts for you
>Include within brackets
eg: {"Manual"} or {"DCT", "Manual"}
>First mode is default mode ]]
--[[Transmission]]
Tune.ClutchType = "Clutch" --[[
[Types]
"Clutch" : Standard clutch, recommended
"TorqueConverter" : Torque converter, keeps RPM up
"CVT" : CVT, found in scooters
]]
Tune.ClutchMode = "Speed" --[[
[Modes]
"Speed" : Speed controls clutch engagement
"RPM" : Speed and RPM control clutch engagement ]]
--Transmission Settings
Tune.Stall = true -- Stalling, enables the bike to stall. An ignition plugin would be necessary. Disables if Tune.Clutch is false.
Tune.ClutchEngage = 25 -- How fast engagement is (0 = instant, 99 = super slow)
--Torque Converter:
Tune.TQLock = false -- Torque converter starts locking at a certain RPM (see below if set to true)
--Torque Converter and CVT:
Tune.RPMEngage = 5300 -- Keeps RPMs to this level until passed
--Clutch:
Tune.SpeedEngage = 15 -- Speed the clutch fully engages at (Based on SPS)
--Clutch: "RPM" mode
Tune.ClutchRPMMult = 1.0 -- Clutch RPM multiplier, recommended to leave at 1.0
--Manual: Quick Shifter
Tune.QuickShifter = true -- To quickshift, cut off the throttle to upshift, and apply throttle to downshift, all without clutch.
Tune.QuickShiftTime = 0.25 -- Determines how much time you have to quick shift up or down before you need to use the clutch.
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoShiftType = "DCT" --[[
[Types]
"Rev" : Clutch engages fully once RPM reached
"DCT" : Clutch engages after a set time has passed ]]
Tune.AutoUpThresh = 200 -- Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 -- Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Automatic: Revmatching
Tune.ShiftThrot = 100 -- Throttle level when shifting down to revmatch, 0 - 100%
--Automatic: DCT
Tune.ShiftUpTime = 0.25 -- Time required to shift into next gear, from a lower gear to a higher one.
Tune.ShiftDnTime = 0.125 -- Time required to shift into next gear, from a higher gear to a lower one.
Tune.FinalDrive = (38/16)*1.6 -- (Final * Primary) -- Gearing determines top speed and wheel torque
-- for the final is recommended to divide the size of the rear sprocket to the one of the front sprocket
-- and multiply it to the primary drive ratio, if data is missing, you can also just use a single number
Tune.NeutralRev = true -- Enables you to back up manually in neutral
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 32/14 , -- Neutral and 1st gear are required
--[[ 2 ]] 32/18 ,
--[[ 3 ]] 33/22 ,
--[[ 4 ]] 32/24 ,
--[[ 5 ]] 34/28 ,
--[[ 6 ]] 33/29 ,
}
Tune.Limiter = false -- Enables a speed limiter
Tune.SpeedLimit = 300 -- At what speed (SPS) the limiter engages
|
--Dupes a part from the template.
|
local function MakeFromTemplate(template: BasePart, currentCacheParent: Instance)
local part: BasePart = template:Clone()
-- ^ Ignore W000 type mismatch between Instance and BasePart. False alert.
part.CFrame = CF_REALLY_FAR_AWAY
part.Anchored = true
part.Parent = currentCacheParent
return part
end
function PartCacheStatic.new(template: BasePart, numPrecreatedParts: number?, currentCacheParent: Instance?): PartCache
local newNumPrecreatedParts: number = numPrecreatedParts or 5
local newCurrentCacheParent: Instance = currentCacheParent or workspace
--PrecreatedParts value.
--Same thing. Ensure it's a number, ensure it's not negative, warn if it's really huge or 0.
assert(numPrecreatedParts > 0, "PrecreatedParts can not be negative!")
assertwarn(numPrecreatedParts ~= 0, "PrecreatedParts is 0! This may have adverse effects when initially using the cache.")
assertwarn(template.Archivable, "The template's Archivable property has been set to false, which prevents it from being cloned. It will temporarily be set to true.")
local oldArchivable = template.Archivable
template.Archivable = true
local newTemplate: BasePart = template:Clone()
-- ^ Ignore W000 type mismatch between Instance and BasePart. False alert.
template.Archivable = oldArchivable
template = newTemplate
local object: PartCache = {
Open = {},
InUse = {},
CurrentCacheParent = newCurrentCacheParent,
Template = template,
ExpansionSize = 10
}
setmetatable(object, PartCacheStatic)
-- Below: Ignore type mismatch nil | number and the nil | Instance mismatch on the table.insert line.
for _ = 1, newNumPrecreatedParts do
table.insert(object.Open, MakeFromTemplate(template, object.CurrentCacheParent))
end
object.Template.Parent = nil
return object
-- ^ Ignore mismatch here too
end
|
-- ROBLOX deviation END
|
local BufferedConsoleModule = require(CurrentModule.BufferedConsole)
exports.BufferedConsole = BufferedConsoleModule.default
export type BufferedConsole = BufferedConsoleModule.BufferedConsole
local CustomConsoleModule = require(CurrentModule.CustomConsole)
exports.CustomConsole = CustomConsoleModule.default
export type CustomConsole = CustomConsoleModule.CustomConsole
exports.NullConsole = require(CurrentModule.NullConsole).default
exports.getConsoleOutput = require(CurrentModule.getConsoleOutput).default
local typesModule = require(CurrentModule.types)
export type ConsoleBuffer = typesModule.ConsoleBuffer
export type LogMessage = typesModule.LogMessage
export type LogType = typesModule.LogType
export type LogEntry = typesModule.LogEntry
export type InspectOptions = typesModule.InspectOptions
return exports
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 10
local slash_damage = 12
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = 1
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
attack()
wait(1)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--[=[
@class EnumList
Defines a new Enum.
]=]
|
local EnumList = {}
|
--// Hash: 747c39bd00358b94599020af4dfde2375d20b56fce538fa04c22e2c14ba9503bd8f22b9b1544a90709932a0bd6eb8a80
-- Decompiled with the Synapse X Luau decompiler.
|
return function(p1)
return p1:sub(#p1 - ((p1:reverse():find("%u") or #p1 + 1) - 1)):gsub("%d+$", "");
end;
|
-- / Remote Events / --
|
local ToolEvent = game.ReplicatedStorage:WaitForChild("ToolEvent")
|
-- emitter block around camera used when outside
|
local Emitter do
Emitter = Instance.new("Part")
Emitter.Transparency = 1
Emitter.Anchored = true
Emitter.CanCollide = false
Emitter.Locked = false
Emitter.Archivable = false
Emitter.TopSurface = Enum.SurfaceType.Smooth
Emitter.BottomSurface = Enum.SurfaceType.Smooth
Emitter.Name = "__RainEmitter"
Emitter.Size = MIN_SIZE
Emitter.Archivable = false
local straight = Instance.new("ParticleEmitter")
straight.Name = "RainStraight"
straight.LightEmission = RAIN_DEFAULT_LIGHTEMISSION
straight.LightInfluence = RAIN_DEFAULT_LIGHTINFLUENCE
straight.Size = RAIN_STRAIGHT_SIZE
straight.Texture = RAIN_STRAIGHT_ASSET
straight.LockedToPart = true
straight.Enabled = false
straight.Lifetime = RAIN_STRAIGHT_LIFETIME
straight.Rate = RAIN_STRAIGHT_MAX_RATE
straight.Speed = NumberRange.new(RAIN_STRAIGHT_MAX_SPEED)
straight.EmissionDirection = Enum.NormalId.Bottom
straight.Parent = Emitter
local topdown = Instance.new("ParticleEmitter")
topdown.Name = "RainTopDown"
topdown.LightEmission = RAIN_DEFAULT_LIGHTEMISSION
topdown.LightInfluence = RAIN_DEFAULT_LIGHTINFLUENCE
topdown.Size = RAIN_TOPDOWN_SIZE
topdown.Texture = RAIN_TOPDOWN_ASSET
topdown.LockedToPart = true
topdown.Enabled = false
topdown.Rotation = RAIN_TOPDOWN_ROTATION
topdown.Lifetime = RAIN_TOPDOWN_LIFETIME
topdown.Rate = RAIN_TOPDOWN_MAX_RATE
topdown.Speed = NumberRange.new(RAIN_TOPDOWN_MAX_SPEED)
topdown.EmissionDirection = Enum.NormalId.Bottom
topdown.Parent = Emitter
end
local splashAttachments, rainAttachments do
splashAttachments = {}
rainAttachments = {}
for i = 1, RAIN_SPLASH_NUM do
-- splashes on ground
local splashAttachment = Instance.new("Attachment")
splashAttachment.Name = "__RainSplashAttachment"
local splash = Instance.new("ParticleEmitter")
splash.LightEmission = RAIN_DEFAULT_LIGHTEMISSION
splash.LightInfluence = RAIN_DEFAULT_LIGHTINFLUENCE
splash.Size = RAIN_SPLASH_SIZE
splash.Texture = RAIN_SPLASH_ASSET
splash.Rotation = RAIN_SPLASH_ROTATION
splash.Lifetime = RAIN_SPLASH_LIFETIME
splash.Transparency = NumberSequence.new {
NSK010;
NumberSequenceKeypoint.new(RAIN_TRANSPARENCY_T1, RAIN_SPLASH_ALPHA_LOW, 0);
NumberSequenceKeypoint.new(RAIN_TRANSPARENCY_T2, RAIN_SPLASH_ALPHA_LOW, 0);
NSK110;
}
splash.Enabled = false
splash.Rate = 0
splash.Speed = NumberRange.new(0)
splash.Name = "RainSplash"
splash.Parent = splashAttachment
splashAttachment.Archivable = false
table.insert(splashAttachments, splashAttachment)
-- occluded rain particle generation
local rainAttachment = Instance.new("Attachment")
rainAttachment.Name = "__RainOccludedAttachment"
local straightOccluded = Emitter.RainStraight:Clone()
straightOccluded.Speed = NumberRange.new(RAIN_OCCLUDED_MINSPEED, RAIN_OCCLUDED_MAXSPEED)
straightOccluded.SpreadAngle = RAIN_OCCLUDED_SPREAD
straightOccluded.LockedToPart = false
straightOccluded.Enabled = false
straightOccluded.Parent = rainAttachment
local topdownOccluded = Emitter.RainTopDown:Clone()
topdownOccluded.Speed = NumberRange.new(RAIN_OCCLUDED_MINSPEED, RAIN_OCCLUDED_MAXSPEED)
topdownOccluded.SpreadAngle = RAIN_OCCLUDED_SPREAD
topdownOccluded.LockedToPart = false
topdownOccluded.Enabled = false
topdownOccluded.Parent = rainAttachment
rainAttachment.Archivable = false
table.insert(rainAttachments, rainAttachment)
end
end
|
--[[Steering]]
|
Tune.SteerInner = 36 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 37 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .03 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .05 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
--[=[
@within TableUtil
@function Assign
@param target table
@param ... table
@return table
Copies all values of the given tables into the `target` table.
```lua
local t = {A = 10}
local t2 = {B = 20}
local t3 = {C = 30, D = 40}
local newT = TableUtil.Assign(t, t2, t3)
print(newT) --> {A = 10, B = 20, C = 30, D = 40}
```
]=]
|
local function Assign(target: Table, ...: Table): Table
local tbl = table.clone(target)
for _,src in ipairs({...}) do
for k,v in pairs(src) do
tbl[k] = v
end
end
return tbl
end
|
--[[
Singleton Manager that holds Room components
]]
|
local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")
local TableUtils = require(ReplicatedStorage.Dependencies.LuaUtils.TableUtils)
local Constants = require(ReplicatedStorage.Source.Common.Constants)
local Registry = require(ReplicatedStorage.Dependencies.GameUtils.Components.Registry)
local Room = require(ServerStorage.Source.Components.Room)
local statusValuesFolder = workspace.Statuses
local roomsSecure = statusValuesFolder.RoomsSecure
local roomsBreached = statusValuesFolder.RoomsBreached
local RoomManager = {}
local rooms = Registry.new(Room)
|
--[[
Function called when the client is notified of a player state update.
]]
|
function UIController.onClientStateUpdated(currentState, previousState)
UIController.setView(currentState, previousState)
end
|
--Exported
|
function module.new(sourceInstance, data, duration)
local record = RecurseAdd(sourceInstance, data)
local self = setmetatable(
{
record = RecurseAdd(sourceInstance, data),
state = 0,
duration = duration
}, module)
return self
end
function RemoveTween(tweenRecord, instance)
local sourceInstance = tweenRecord.sourceInstance
if (instance) then
sourceInstance = instance
end
for key,value in pairs(tweenRecord.pairs) do
sourceInstance[key] = value.src
end
for key,value in pairs(tweenRecord.children) do
local child = tweenRecord.sourceInstance
if (child) then
RemoveTween(value, child)
end
end
end
function module:RemoveTween()
RemoveTween(self.record)
end
function SetTween(tweenRecord, frac)
for key,value in pairs(tweenRecord.pairs) do
tweenRecord.sourceInstance[key] = value.func(value.src,value.dst, frac)
end
for key,value in pairs(tweenRecord.children) do
local child = tweenRecord.sourceInstance
if (child) then
SetTween(value, frac)
end
end
end
function module:SetTween(frac)
frac = math.clamp(frac,0,1)
SetTween(self.record, frac)
end
function module:RunTween(deltaTime, grow)
local oldFrac = self.state
if (grow == true) then
self.state += deltaTime / self.duration
else
self.state -= deltaTime / self.duration
end
self.state = math.clamp(self.state,0,1)
if (oldFrac ~= self.state) then
self:SetTween(self.state)
end
end
return module
|
----- cold tap handler -----
|
coldTap.Interactive.ClickDetector.MouseClick:Connect(function()
if coldOn.Value == false then
coldOn.Value = true
faucet.ParticleEmitter.Enabled = true
waterSound:Play()
coldTap:SetPrimaryPartCFrame(coldTap.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(-85), 0))
else
coldOn.Value = false
if hotOn.Value == false then
faucet.ParticleEmitter.Enabled = false
waterSound:Stop()
end
coldTap:SetPrimaryPartCFrame(coldTap.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(85), 0))
end
end)
|
---- Create motors
|
local freezerMotor = Instance.new("Motor")
freezerMotor.Name = "FreezerMotor"
freezerMotor.Parent = fridge.LeftWall
freezerMotor.Part0 = fridge.LeftWall
freezerMotor.Part1 = fridge.FreezerDoor
freezerMotor.C0 = CFrame.new(0,fridge.LeftWall.Size.Y/2-fridge.FreezerDoor.Size.Y/2,
-fridge.LeftWall.Size.Z/2-fridge.FreezerDoor.Size.Z/2) * CFrame.Angles(-math.pi/2,0,0)
freezerMotor.C1 = CFrame.new(-fridge.FreezerDoor.Size.X/2+fridge.LeftWall.Size.X/2,0,0) * CFrame.Angles(3*math.pi/2,0,0)
freezerMotor.MaxVelocity = .1
local doorMotor = Instance.new("Motor")
doorMotor.Name = "DoorMotor"
doorMotor.Parent = fridge.LeftWall
doorMotor.Part0 = fridge.LeftWall
doorMotor.Part1 = fridge.Door
doorMotor.C0 = CFrame.new(0,-fridge.LeftWall.Size.Y/2+fridge.Door.Size.Y/2,-fridge.LeftWall.Size.Z/2-fridge.Door.Size.Z/2) * CFrame.Angles(-math.pi/2,0,0)
doorMotor.C1 = CFrame.new(-fridge.Door.Size.X/2+fridge.LeftWall.Size.X/2,0,0) * CFrame.Angles(3*math.pi/2,0,0)
doorMotor.MaxVelocity = .1
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 0
local slash_damage = 0
local lunge_damage = 0
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
if (hit.Parent == nil) then return end -- happens when bullet hits sword
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
local force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,0,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(0,0,0)
Tool.GripRight = Vector3.new(0,0,0)
Tool.GripUp = Vector3.new(0,0,0)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,0)
Tool.GripRight = Vector3.new(0,0,0)
Tool.GripUp = Vector3.new(0,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
-- You may turn both of these on at once. In that case, zone-specific music will play in the appropriate zones, and global background music will play whenever you're not within any zone.
|
settings.DisplayMuteButton = false -- If set to true, there will be a button in the bottom-right corner of the screen allowing players to mute the background music.
settings.MusicFadeoutTime = .5 -- How long music takes to fade out, in seconds.
settings.MusicOnlyPlaysWithinZones = false -- (This setting only applies when UseGlobalBackgroundMusic is set to false) If a player walks into an area that's not covered by any music zone, what should happen? If true, music will stop playing. If false, the music from the previous zone will continue to play.
return settings
|
--whitelisted
|
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
print(Player.TeamColor)
if Player.TeamColor == BrickColor.new("Fawn brown") then
Character.Humanoid.MaxHealth = 200
Character.Humanoid.Health = 200
end
end)
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
print(Player.TeamColor)
if Player.TeamColor == BrickColor.new("Deep blue") then
Character.Humanoid.MaxHealth = 200
Character.Humanoid.Health = 200
end
end)
end)
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
print(Player.TeamColor)
if Player.TeamColor == BrickColor.new("Really black") then
Character.Humanoid.MaxHealth = 200
Character.Humanoid.Health = 200
end
end)
end)
|
-- Unequip logic here
|
function OnUnequipped()
LeftButtonDown = false
Reloading = false
MyCharacter = nil
MyHumanoid = nil
MyTorso = nil
MyPlayer = nil
MyMouse = nil
if OnFireConnection then
OnFireConnection:disconnect()
end
if OnReloadConnection then
OnReloadConnection:disconnect()
end
if FlashHolder then
FlashHolder = nil
end
if WeaponGui then
WeaponGui.Parent = nil
WeaponGui = nil
end
if EquipTrack then
EquipTrack:Stop()
end
if PumpTrack then
PumpTrack:Stop()
end
end
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
function GUIParticles.New(gui, particle)
--- Check if gui argument is a GUI instance or UDIM2 position
local isGeneratedGui = not pcall(function() local x = gui.Parent end)
--- Generate GUI holder if it is a UDIM2 position
if isGeneratedGui then
local fakeGuiHolder = Instance.new("ScreenGui")
fakeGuiHolder.Parent = _L.Player.Get("PlayerGui")
local fakeGui = Instance.new("Frame")
fakeGui.BackgroundTransparency = 1
fakeGui.Size = UDim2.new(0, 1, 0, 1)
fakeGui.Position = gui
fakeGui.AnchorPoint = Vector2.new(0.5, 0.5)
fakeGui.Parent = fakeGuiHolder
gui = fakeGui
end
--- Setup particle folder if it doesn't already exist
if particleFolder == nil then
particleFolder = Instance.new("Folder")
particleFolder.Name = "GUI Particles"
particleFolder.Parent = game.Workspace.CurrentCamera
end
--- Create particle's part holder
local particlePart = Instance.new("Part")
particlePart.Transparency = 1
particlePart.Material = Enum.Material.SmoothPlastic
particlePart.CanCollide = false
particlePart.Anchored = true
particlePart.Size = Vector3.new(0, 0, 0)
particlePart.Name = particle.Name
particlePart.Parent = particleFolder
--- Create attachment for particles (avoid spread)
local attachment = Instance.new("Attachment")
attachment.Parent = particlePart
--- Add in particles
particle = particle:Clone()
particle.ZOffset = particle.ZOffset + displayZ * 0.645 --- Hack of the century
particle.Parent = attachment
--- Math
local function Update()
local camera = game.Workspace.CurrentCamera
local cameraSize = camera.ViewportSize
local sizeX, sizeY = gui.AbsoluteSize.X, gui.AbsoluteSize.Y
local posX, posY = gui.AbsolutePosition.X + (sizeX / 2), gui.AbsolutePosition.Y + (sizeY / 2)
--[[local sizeInStudsTop = camera:ScreenPointToRay(gui.AbsolutePosition.X, gui.AbsolutePosition.Y, displayZ).Origin
local sizeInStudsBottom = camera:ScreenPointToRay(gui.AbsolutePosition.X+sizeX, gui.AbsolutePosition.Y+sizeY, displayZ).Origin
particlePart.Size = Vector3.new(math.abs(sizeInStudsBottom.X-sizeInStudsTop.X), math.abs(sizeInStudsBottom.Y-sizeInStudsTop.Y), 0.05) ]]
local positionInStuds = camera:ScreenPointToRay(posX, posY, displayZ).Origin
particlePart.CFrame = CFrame.new(positionInStuds) * CFrame.Angles(camera.CFrame:toEulerAnglesXYZ())
end
--- Main
coroutine.wrap(function()
--- Update
while (gui and particleFolder and particle and particlePart and particle.Parent) do
Update()
_L.Services.RunService.RenderStepped:wait()
end
--- Destroy
if gui.Parent and isGeneratedGui then gui.Parent:Destroy() end
if particle then particle:Destroy() end
if particlePart then particlePart:Destroy() end
end)()
--
return particle
end
|
--------END AUDIENCE BACK RIGHT--------
|
end
wait(0.15)
if game.Workspace.DoorFlashing.Value == true then
|
--use this to determine if you want this human to be harmed or not, returns boolean
|
function checkTeams(otherHuman)
return not (sameTeam(otherHuman) and not FriendlyFire)
end
function getKnife()
local knife = Handle:clone()
knife.Transparency = 0
knife.Hit.Pitch = math.random(90, 110)/100
local lift = Instance.new("BodyForce")
lift.force = Vector3.new(0, 196.2, 0) * knife:GetMass() * 0.8
lift.Parent = knife
local proj = Tool.Projectile:Clone()
proj.Disabled = false
proj.Parent = knife
return knife
end
function equippedLoop()
local client = game.StarterPlayer.StarterCharacterScripts.CombatClient
client.Disabled = true
while Equipped do
local dt = Heartbeat:wait()
if AttackPower < 1 then
AttackPower = AttackPower + dt * AttackRecharge
if AttackPower > 1 then
AttackPower = 1
end
end
Handle.Transparency = 1 - AttackPower
end
end
function onLeftDown(mousePos)
local knife = getKnife()
knife.CFrame = CFrame.new(Handle.Position, mousePos)
knife.Velocity = knife.CFrame.lookVector * AttackSpeed * AttackPower
local damage = AttackDamage * AttackPower
local touched
touched = knife.Touched:connect(function(part)
if part:IsDescendantOf(Tool.Parent) then return end
if contains(Knives, part) then return end
if part.Parent and part.Parent:FindFirstChild("Humanoid") then
local human = part.Parent.Humanoid
if checkTeams(human) then
tagHuman(human)
human:TakeDamage(damage)
knife.Hit:Play()
end
end
knife.Projectile:Destroy()
local w = Instance.new("Weld")
w.Part0 = part
w.Part1 = knife
w.C0 = part.CFrame:toObjectSpace(knife.CFrame)
w.Parent = w.Part0
end)
table.insert(Knives, knife)
knife.Parent = workspace
game:GetService("Debris"):AddItem(knife, 3.5)
delay(2, function()
knife.Transparency = 1
end)
Remote:FireClient(getPlayer(), "PlayAnimation", "Throw")
Handle.Throw.Pitch = 0.8 + 0.4 * AttackPower
Handle.Throw:Play()
AttackPower = 0
wait(10)
end
function onRemote(player, func, ...)
if player ~= getPlayer() then return end
if func == "LeftDown" then
onLeftDown(...)
end
end
function onEquip()
local client = game.StarterPlayer.StarterCharacterScripts.CombatClient
client.Disabled = true
Equipped = true
equippedLoop()
end
function onUnequip()
local client = game.StarterPlayer.StarterCharacterScripts.CombatClient
client.Enabled = true
Equipped = false
end
Remote.OnServerEvent:connect(onRemote)
Tool.Equipped:connect(onEquip)
Tool.Unequipped:connect(onUnequip)
|
---------------------------------------------------------------------------------------------l}o
------------------------------Blox370's Script-----------------------------------l}o
---------------------------------------------------------------------------------------------l}o
|
function onPlayerRespawned(newPlayer)
local Team = game.Players:findFirstChild(newPlayer.Name)
if Team ~= nil then
local TeamColor = Team.TeamColor
local c = game.Lighting.Hats:GetChildren()
local p = newPlayer.Character:GetChildren()
for i = 1, #c do
local a = Instance.new("Hat")
if c[i].Name == "Torso" then
a.AttachmentPos = Vector3.new(0, 8, 0)
end
local clone = c[i]:clone()
wait(1)
clone.Parent = a--Delete team color and the -- next to newplayer and the spaces to make the armor spawn the color of the Players Torso
clone.BrickColor = TeamColor --newPlayer.Character.Torso.BrickColor
clone.Name = "Handle"
a.Parent = newPlayer.Character
end
wait(6)
for i = 1, #p do
print(p[i].Name)
if p[i]:FindFirstChild("Handle") ~= nil then
p[i]:remove()
print("removed")
end
end
end
end
function onPlayerEntered(newPlayer)
newPlayer.Changed:connect(function(property)
if (property == "Character") then
onPlayerRespawned(newPlayer)
end
end)
end
game.Players.ChildAdded:connect(onPlayerEntered)
|
----------------------------------
------------FUNCTIONS-------------
----------------------------------
|
function UnDigify(digit)
if digit < 1 or digit > 61 then
return ""
elseif digit == 1 then
return "1"
elseif digit == 2 then
return "!"
elseif digit == 3 then
return "2"
elseif digit == 4 then
return "@"
elseif digit == 5 then
return "3"
elseif digit == 6 then
return "4"
elseif digit == 7 then
return "$"
elseif digit == 8 then
return "5"
elseif digit == 9 then
return "%"
elseif digit == 10 then
return "6"
elseif digit == 11 then
return "^"
elseif digit == 12 then
return "7"
elseif digit == 13 then
return "8"
elseif digit == 14 then
return "*"
elseif digit == 15 then
return "9"
elseif digit == 16 then
return "("
elseif digit == 17 then
return "0"
elseif digit == 18 then
return "q"
elseif digit == 19 then
return "Q"
elseif digit == 20 then
return "w"
elseif digit == 21 then
return "W"
elseif digit == 22 then
return "e"
elseif digit == 23 then
return "E"
elseif digit == 24 then
return "r"
elseif digit == 25 then
return "t"
elseif digit == 26 then
return "T"
elseif digit == 27 then
return "y"
elseif digit == 28 then
return "Y"
elseif digit == 29 then
return "u"
elseif digit == 30 then
return "i"
elseif digit == 31 then
return "I"
elseif digit == 32 then
return "o"
elseif digit == 33 then
return "O"
elseif digit == 34 then
return "p"
elseif digit == 35 then
return "P"
elseif digit == 36 then
return "a"
elseif digit == 37 then
return "s"
elseif digit == 38 then
return "S"
elseif digit == 39 then
return "d"
elseif digit == 40 then
return "D"
elseif digit == 41 then
return "f"
elseif digit == 42 then
return "g"
elseif digit == 43 then
return "G"
elseif digit == 44 then
return "h"
elseif digit == 45 then
return "H"
elseif digit == 46 then
return "j"
elseif digit == 47 then
return "J"
elseif digit == 48 then
return "k"
elseif digit == 49 then
return "l"
elseif digit == 50 then
return "L"
elseif digit == 51 then
return "z"
elseif digit == 52 then
return "Z"
elseif digit == 53 then
return "x"
elseif digit == 54 then
return "c"
elseif digit == 55 then
return "C"
elseif digit == 56 then
return "v"
elseif digit == 57 then
return "V"
elseif digit == 58 then
return "b"
elseif digit == 59 then
return "B"
elseif digit == 60 then
return "n"
elseif digit == 61 then
return "m"
else
return "?"
end
end
function IsBlack(note)
if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then
return true
end
end
local TweenService = game:GetService("TweenService")
function TWEEN(key,t,light)
local Goal = {}
Goal.Transparency = 0
local TwInfo = TweenInfo.new(t,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,4,true)
local twn = TweenService:Create(key, TwInfo, Goal)
twn:Play()
light.Color = key.Color
twn.Completed:wait()
light:Destroy()
return
end
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local OriginalStar = Piano.Case.ShootingStarModel
local star = OriginalStar:Clone()
star.Parent = Piano.Keys[octave]
star.Name = note2
star.Transparency = 1
star.Position = OriginalStar.Position + Vector3.new(0,math.random(-10,10),math.random(-10,10))
star.Anchored = false
local key = star
local light = Instance.new("PointLight",key)
light.Brightness = 3
light.Range = 5
local y = math.random(200,270)
star.Velocity = Vector3.new(600,y,0)
star.Material = "Neon"
wait(.2)
TWEEN(star,.3,light)
star.Anchored = true
wait(.2)
star:Destroy()
key.CanCollide = false
return
end
|
-- ping loop
|
while true do
for _, player in pairs(Players:GetPlayers()) do
spawn(function()
if player and player.Parent == Players then
if not pings[player] then
pings[player] = {
Pings = {};
Average = 0;
}
end
local start = tick()
pcall(function()
REMOTES.Ping:InvokeClient(player)
end)
local elapsed = tick() - start
if pings[player] then
table.insert(pings[player].Pings, elapsed)
if #pings[player].Pings > 5 then
table.remove(pings[player].Pings, 1)
end
local average = 0
for _, ping in pairs(pings[player].Pings) do
average = average + ping
end
pings[player].Average = average / #pings[player].Pings
end
end
end)
end
wait(1)
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = true
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=0
local trm=0
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0
script:WaitForChild("Rev")
script.Parent.Values.Gear.Changed:connect(function()
mult=1
if script.Parent.Values.RPM.Value>5000 then
shift=.2
end
end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
throt = math.max(.2,throt-.2)
trmmult = math.max(0,trmmult-.05)
trmon = 1
else
throt = math.min(.5,throt+.1)
trmmult = 1
trmon = 0
end
shift = math.min(1,shift+.2)
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
redline=1
else
redline=1
end
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
local Volume = (.35*throt*shift*redline)+(trm*trmon*trmmult*(3-throt)*math.sin(tick()*50))
local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
if FE then
handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
else
car.DriveSeat.Rev.Volume = Volume
car.DriveSeat.Rev.Pitch = Pitch
end
end
|
--F.updateSound = function(Sound, Pitch, Volume)
-- if Sound then
-- if Pitch then
-- Sound.Pitch = Pitch
-- end
-- if Volume then
-- Sound.Volume = Volume
-- end
-- end
--end
|
F.lock = function(x)
if x then
for i,v in pairs(script.Parent.Parent.Misc:GetDescendants()) do
if v:IsA("Motor") then
if v.Parent.Parent.Name == "Mirror" then
v.DesiredAngle = 0
else
end
end
end
carSeat.Lock:Play()
else
carSeat.Unlock:Play()
wait(.4)
carSeat.Unlock:Play()
end
for i,v in pairs(script.Parent.Parent.Misc:GetDescendants()) do
if v:IsA("ClickDetector") then
v.MaxActivationDistance = x and 0 or 12
end
end
end
local on = 0
F.rs = function(y)
local tune = require(carSeat.Parent:FindFirstChild("A-Chassis Tune"))
carSeat.IsOn.Value = y
if y then
carSeat.Startup:Play()
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*tune.IdleRPM/tune.Redline)*on^2
else car.DriveSeat.Rev.Pitch = 0
carSeat.Startup:Stop()
end
end
F.user = function()
carSeat.Parent:Destroy()
end
F.tk = function(b)
carSeat.Parent.Misc.TK.SS.Motor.DesiredAngle = b and 1.5 or 0
end
script.Parent.OnServerEvent:connect(function(Player, Func, ...)
if F[Func] then
F[Func](...)
end
end)
|
--returns the wielding player of this tool
|
function getPlayer()
local char = Tool.Parent
return game:GetService("Players"):GetPlayerFromCharacter(Character)
end
function Toss(direction)
local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
local spawnPos = Character.Head.Position
spawnPos = spawnPos + (direction * 5)
local Object = Tool.Handle:Clone()
Object.Burn.Attachment.Debris.Enabled = true
Object.ThinkFast:Destroy()
Object.Parent = workspace
Object.Swing.Pitch = Random.new():NextInteger(90, 110)/100
Object.Swing:Play()
Object.CanCollide = true
Object.CFrame = Tool.Handle.CFrame
Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
Object.Trail.Enabled = true
local rand = 11.25
Object.RotVelocity = Vector3.new(Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand),Random.new():NextNumber(-rand,rand))
Object:SetNetworkOwner(getPlayer())
local ScriptClone = DamageScript:Clone()
ScriptClone.Parent = Object
ScriptClone.Disabled = false
local tag = Instance.new("ObjectValue")
tag.Value = getPlayer()
tag.Name = "creator"
tag.Parent = Object
end
PowerRemote.OnServerEvent:Connect(function(player, Power)
local holder = getPlayer()
if holder ~= player then return end
AttackVelocity = Power
end)
TossRemote.OnServerEvent:Connect(function(player, mousePosition)
local holder = getPlayer()
if holder ~= player then return end
if Cooldown.Value == true then return end
Cooldown.Value = true
if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
TossRemote:FireClient(getPlayer(), "PlayAnimation", "Animation")
end
local targetPos = mousePosition.p
local lookAt = (targetPos - Character.Head.Position).unit
local SecretRNG = Random.new():NextInteger(1,10) --Change RNG value here
if SecretRNG == 1 then
local ChucklenutsSound = Tool.Handle.ThinkFast:Play()
end
Toss(lookAt)
task.wait(5)
Cooldown.Value = false
end)
Tool.Equipped:Connect(function()
Character = Tool.Parent
Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)
Tool.Unequipped:Connect(function()
Character = nil
Humanoid = nil
end)
|
--Set up gui - has its own class
|
local VehicleGui = require(script.Parent:WaitForChild("LocalVehicleGui")).new(Car)
VehicleGui:Enable()
VehicleGui:EnableDriverControls()
VehicleGui:EnableSpeedo()
local Keymap = require(ScriptsFolder.Keymap)
local LocalVehicleSeating = require(ScriptsFolder.LocalVehicleSeating)
|
--[[
A component that establishes a connection to a Roblox event when it is rendered.
]]
|
local Roact = require(script.Parent.Parent.Parent.Packages.Roact)
local ExternalEventConnection = Roact.Component:extend("ExternalEventConnection")
function ExternalEventConnection:init()
self.connection = nil
end
|
-- Do not modify anything below here! --
|
coroutine.wrap(function()
EB_touchingHumanoid = nil
if script.Parent:IsA("BasePart") then
script.Parent.Touched:Connect(function(EB_part)
EB_touchingPart = EB_part
local player = EB_part.Parent:FindFirstChild("Humanoid")
if player then
EB_touchingHumanoid = EB_part.Parent
if EB_touchingHumanoid then
if EB_touchingHumanoid:FindFirstChild("Humanoid") then
EB_touchingHumanoid.Humanoid.Health -= tonumber((tonumber(25)))
end
end
end
end)
end
end)()
|
--[[
Adds specified character to character collision group
]]
|
function CollisionGroupsController.addCharacter(character)
for _, child in pairs(character:GetChildren()) do
if child:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(child, Constants.CollisionGroup.Player)
end
end
end
|
--[[
Clones a table giving it a unique memory address. Doesn't support mixed tables and userdata.
Functions.CloneTable(
table, <-- |REQ| Table/dictionary
)
--]]
|
local deepcopy
function deepcopy(t, root, omit)
local clone = {}
for key, value in pairs(t) do
if t == root and key == omit then
print"omit"
continue
end
if type(key) == "table" then
clone[key] = deepcopy(value, root, omit)
else
clone[key] = value
end
end
return clone
end
return function(tbl, omit)
return deepcopy(tbl, tbl, omit)
end
|
-- Libraries
|
local Roact = require(Vendor:WaitForChild('Roact'))
local Maid = require(Libraries:WaitForChild('Maid'))
local fastSpawn = require(Libraries:WaitForChild('fastSpawn'))
|
--%%Functions%%--
|
script.Parent.AutoSensor.Touched:connect(whileTouching)
script.Parent.AutoSensor.TouchEnded:connect(letGo)
|
--- Player left
|
game.Players.PlayerRemoving:Connect(function(player)
--- Remove from cache
RemovePlayer(player)
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Parent__1 = script.Parent;
local v2 = require(l__Parent__1:WaitForChild("MessageLabelCreator"));
local v3 = require(l__Parent__1:WaitForChild("CurveUtil"));
local v4 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"));
local v5 = false;
local v6, v7 = pcall(function()
return settings():IsUserFeatureEnabled("UserFixChatMessageLogPerformance");
end);
if v6 then
v5 = v7;
end;
local v8 = {};
v8.__index = v8;
local u1 = {
ScrollBarThickness = 4
};
function v8.Destroy(p1)
p1.GuiObject:Destroy();
p1.Destroyed = true;
end;
function v8.SetActive(p2, p3)
p2.GuiObject.Visible = p3;
end;
function v8.UpdateMessageFiltered(p4, p5)
local v9 = nil;
local v10 = 1;
local l__MessageObjectLog__11 = p4.MessageObjectLog;
while v10 <= #l__MessageObjectLog__11 do
local v12 = l__MessageObjectLog__11[v10];
if v12.ID == p5.ID then
v9 = v12;
break;
end;
v10 = v10 + 1;
end;
if v9 then
local v13 = p4:IsScrolledDown();
v9.UpdateTextFunction(p5);
if not v5 then
p4:ReorderAllMessages();
return;
end;
else
return;
end;
p4:PositionMessageLabelInWindow(v9, v13);
end;
local u2 = v2.new();
function v8.AddMessage(p6, p7)
p6:WaitUntilParentedCorrectly();
local v14 = u2:CreateMessageLabel(p7, p6.CurrentChannelName);
if v14 == nil then
return;
end;
table.insert(p6.MessageObjectLog, v14);
p6:PositionMessageLabelInWindow(v14);
end;
function v8.AddMessageAtIndex(p8, p9, p10)
local v15 = u2:CreateMessageLabel(p9, p8.CurrentChannelName);
if v15 == nil then
return;
end;
table.insert(p8.MessageObjectLog, p10, v15);
local v16 = p8:IsScrolledDown();
p8:ReorderAllMessages();
if v16 then
p8.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p8.Scroller.CanvasSize.Y.Offset - p8.Scroller.AbsoluteSize.Y));
end;
end;
function v8.RemoveLastMessage(p11)
p11:WaitUntilParentedCorrectly();
local v17 = p11.MessageObjectLog[1];
local v18 = UDim2.new(0, 0, 0, v17.BaseFrame.AbsoluteSize.Y);
v17:Destroy();
table.remove(p11.MessageObjectLog, 1);
if not v5 then
for v19, v20 in pairs(p11.MessageObjectLog) do
v20.BaseFrame.Position = v20.BaseFrame.Position - v18;
end;
p11.Scroller.CanvasSize = p11.Scroller.CanvasSize - v18;
end;
end;
function v8.IsScrolledDown(p12)
local v21 = nil;
local v22 = nil;
local v23 = nil;
v21 = p12.Scroller.CanvasSize.Y.Offset;
v22 = p12.Scroller.AbsoluteWindowSize.Y;
v23 = p12.Scroller.CanvasPosition.Y;
if v5 then
local v24 = true;
if not (v21 < v22) then
v24 = v22 - 5 <= v21 + v23;
end;
return v24;
end;
local v25 = true;
if not (v21 < v22) then
v25 = v21 - v23 <= v22 + 5;
end;
return v25;
end;
function v8.PositionMessageLabelInWindow(p13, p14, p15)
p13:WaitUntilParentedCorrectly();
local l__BaseFrame__26 = p14.BaseFrame;
if v5 then
if p15 == nil then
p15 = p13:IsScrolledDown();
end;
l__BaseFrame__26.LayoutOrder = p14.ID;
else
l__BaseFrame__26.Parent = p13.Scroller;
l__BaseFrame__26.Position = UDim2.new(0, 0, 0, p13.Scroller.CanvasSize.Y.Offset);
end;
l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(p13.Scroller.AbsoluteSize.X));
if v5 then
l__BaseFrame__26.Parent = p13.Scroller;
end;
if p14.BaseMessage then
if v5 then
for v27 = 1, 10 do
if p14.BaseMessage.TextFits then
break;
end;
l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(p13.Scroller.AbsoluteSize.X - v27));
end;
else
local v28 = p13.Scroller.AbsoluteSize.X;
local v29 = math.min(p13.Scroller.AbsoluteSize.X - 10, 0);
while not p14.BaseMessage.TextFits do
v28 = v28 - 1;
if v28 < v29 then
break;
end;
l__BaseFrame__26.Size = UDim2.new(1, 0, 0, p14.GetHeightFunction(v28));
end;
end;
end;
if v5 then
if not p15 then
return;
end;
else
p15 = p13:IsScrolledDown();
p13.Scroller.CanvasSize = p13.Scroller.CanvasSize + UDim2.new(0, 0, 0, l__BaseFrame__26.Size.Y.Offset);
if p15 then
p13.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p13.Scroller.CanvasSize.Y.Offset - p13.Scroller.AbsoluteSize.Y));
end;
return;
end;
p13.Scroller.CanvasPosition = Vector2.new(0, math.max(0, p13.Scroller.CanvasSize.Y.Offset - p13.Scroller.AbsoluteSize.Y));
end;
function v8.ReorderAllMessages(p16)
p16:WaitUntilParentedCorrectly();
if p16.GuiObject.AbsoluteSize.Y < 1 then
return;
end;
p16.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0);
for v30, v31 in pairs(p16.MessageObjectLog) do
p16:PositionMessageLabelInWindow(v31);
end;
if not p16:IsScrolledDown() then
p16.Scroller.CanvasPosition = p16.Scroller.CanvasPosition;
end;
end;
function v8.Clear(p17)
for v32, v33 in pairs(p17.MessageObjectLog) do
v33:Destroy();
end;
p17.MessageObjectLog = {};
if not v5 then
p17.Scroller.CanvasSize = UDim2.new(0, 0, 0, 0);
end;
end;
function v8.SetCurrentChannelName(p18, p19)
p18.CurrentChannelName = p19;
end;
function v8.FadeOutBackground(p20, p21)
end;
function v8.FadeInBackground(p22, p23)
end;
function v8.FadeOutText(p24, p25)
for v34 = 1, #p24.MessageObjectLog do
if p24.MessageObjectLog[v34].FadeOutFunction then
p24.MessageObjectLog[v34].FadeOutFunction(p25, v3);
end;
end;
end;
function v8.FadeInText(p26, p27)
for v35 = 1, #p26.MessageObjectLog do
if p26.MessageObjectLog[v35].FadeInFunction then
p26.MessageObjectLog[v35].FadeInFunction(p27, v3);
end;
end;
end;
function v8.Update(p28, p29)
for v36 = 1, #p28.MessageObjectLog do
if p28.MessageObjectLog[v36].UpdateAnimFunction then
p28.MessageObjectLog[v36].UpdateAnimFunction(p29, v3);
end;
end;
end;
function v8.WaitUntilParentedCorrectly(p30)
while not p30.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer) do
p30.GuiObject.AncestryChanged:wait();
end;
end;
local function u3()
local v37 = Instance.new("Frame");
v37.Selectable = false;
v37.Size = UDim2.new(1, 0, 1, 0);
v37.BackgroundTransparency = 1;
local v38 = Instance.new("ScrollingFrame");
v38.Selectable = v4.GamepadNavigationEnabled;
v38.Name = "Scroller";
v38.BackgroundTransparency = 1;
v38.BorderSizePixel = 0;
v38.Position = UDim2.new(0, 0, 0, 3);
v38.Size = UDim2.new(1, -4, 1, -6);
v38.CanvasSize = UDim2.new(0, 0, 0, 0);
v38.ScrollBarThickness = u1.ScrollBarThickness;
v38.Active = false;
v38.Parent = v37;
local v39 = nil;
if v5 then
v39 = Instance.new("UIListLayout");
v39.SortOrder = Enum.SortOrder.LayoutOrder;
v39.Parent = v38;
end;
return v37, v38, v39;
end;
function u1.new()
local v40 = setmetatable({}, v8);
v40.Destroyed = false;
local v41, v42, v43 = u3();
v40.GuiObject = v41;
v40.Scroller = v42;
v40.Layout = v43;
v40.MessageObjectLog = {};
v40.Name = "MessageLogDisplay";
v40.GuiObject.Name = "Frame_" .. v40.Name;
v40.CurrentChannelName = "";
v40.GuiObject:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
spawn(function()
v40:ReorderAllMessages();
end);
end);
if v5 then
local u4 = true;
v40.Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
local l__AbsoluteContentSize__44 = v40.Layout.AbsoluteContentSize;
v40.Scroller.CanvasSize = UDim2.new(0, 0, 0, l__AbsoluteContentSize__44.Y);
if u4 then
v40.Scroller.CanvasPosition = Vector2.new(0, l__AbsoluteContentSize__44.Y - v40.Scroller.AbsoluteWindowSize.Y);
end;
end);
v40.Scroller:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
u4 = v40:IsScrolledDown();
end);
end;
return v40;
end;
return u1;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.