prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Decompiled with the Synapse X Luau decompiler.
|
while true do
wait();
local l__LocalPlayer__1 = game.Players.LocalPlayer;
local l__Human__2 = l__LocalPlayer__1.Character:WaitForChild("Human");
local l__Infected__3 = l__LocalPlayer__1.Character:WaitForChild("Infected");
local l__Day__4 = l__LocalPlayer__1.PlayerGui:FindFirstChild("Day");
local l__Night__5 = l__LocalPlayer__1.PlayerGui:FindFirstChild("Night");
if l__Human__2.Value == true and game.Workspace.Events.event.Value == false then
game.Lighting.FogStart = 10;
game.Lighting.FogEnd = 120;
game.Lighting.FogColor = Color3.new(0, 0, 0);
game.Lighting.TimeOfDay = "00:00";
elseif l__Infected__3.Value == true and game.Workspace.Events.event.Value == false then
game.Lighting.FogStart = 10;
game.Lighting.FogEnd = 300;
game.Lighting.FogColor = Color3.new(0, 0, 0);
game.Lighting.TimeOfDay = "00:00";
elseif game.Workspace.Events.event.Value == true and l__Human__2.Value == true then
game.Lighting.FogStart = 10;
game.Lighting.FogEnd = 35;
game.Lighting.FogColor = Color3.new(0, 0, 0);
game.Lighting.TimeOfDay = "00:00";
elseif game.Workspace.Events.event.Value == true and l__Infected__3.Value == true then
game.Lighting.FogStart = 10;
game.Lighting.FogEnd = 80;
game.Lighting.FogColor = Color3.new(0, 0, 0);
game.Lighting.TimeOfDay = "00:00";
end;
end;
|
-- WorldSize + ScreenSize -> Depth needed
|
function ScreenSpace.GetDepthForWidth(screenWidth, worldWidth)
local aspectRatio = ScreenSpace.AspectRatio()
local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
local wfactor = aspectRatio*hfactor
local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
--
return -(sx * worldWidth) / (screenWidth * 2 * wfactor)
end
function ScreenSpace.GetDepthForHeight(screenHeight, worldHeight)
local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
local sy = ScreenSpace.ViewSizeY()
--
return -(sy * worldHeight) / (screenHeight * 2 * hfactor)
end
|
-- Public Constructors
|
function GJK.new(SetA, SetB, CentroidA, CentroidB, SupportA, SupportB)
local self = setmetatable({}, GJK)
self.SetA = SetA
self.SetB = SetB
self.CentroidA = CentroidA
self.CentroidB = CentroidB
self.SupportA = SupportA
self.SupportB = SupportB
return self
end
|
-- @Description Retrieve a random element from a table, %Random is an optional Random Object.
-- @Arg1 Table
-- @Arg2 Random
|
function Basic.GetTableRandom(Tbl, rng)
if type(Tbl) ~= "table" then return Tbl end
local Rng = rng or System.Random
if Tbl.Min and Tbl.Max then
return Rng:NextNumber(Tbl.Min, Tbl.Max)
end
local Array = Basic.TableToArray(Tbl)
return Array[Rng:NextInteger(1, #Array)]
end
|
--[[local camera = workspace.Camera
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
game:GetService("RunService").RenderStepped:Connect(function()
local rx, ry, rz = camera.CFrame:ToOrientation()
ry = math.rad( math.clamp(math.deg(ry), -60, 60) )
if humanoid.Sit == true then
camera.CFrame = camera.CFrame:Lerp(CFrame.new(character.PrimaryPart.Position) *
CFrame.Angles(0, ry, 0) * -- limited Y rotation
CFrame.Angles(rx, 0, rz), 0.3) -- retain X and Z rotation
end
end)]]
|
--
local camera = workspace.Camera
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")
game:GetService("RunService").RenderStepped:Connect(function()
local rx, ry, rz = camera.CFrame:ToOrientation()
ry = math.rad( math.clamp(math.deg(ry), -60, 60) )
if humanoid.Sit == true then
camera.CFrame = camera.CFrame:Lerp(CFrame.new(character.PrimaryPart.Position) *
CFrame.Angles(0, ry, 0) * CFrame.Angles(rx, 0, rz), 0.3) -- limited Y rotation
end
end)
|
-- if math.floor(v) < 75 then
-- carSeat.Parent.Body.MP.Sound.RollOffMode = "LinearSquare"
-- else
-- carSeat.Parent.Body.MP.Sound.RollOffMode = "Inverse"
-- end
|
end
F.volumeup = function(VolUp)
carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + 1
scg.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..carSeat.Parent.Body.MP.Sound.Volume
end
local m = 0
F.IMode = function()
if m == 0 then
scg.Weather.Visible = false
scg.Blank.Visible = true
scg.Radio.Visible = false
m = 1
elseif m == 1 then
scg.Weather.Visible = true
scg.Blank.Visible = false
scg.Radio.Visible = false
m = 2
else
scg.Weather.Visible = false
scg.Blank.Visible = false
scg.Radio.Visible = true
m = 0
end
end
F.updateSong = function(Song)
carSeat.Parent.Body.MP.Sound:Stop()
wait()
carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..Song
wait()
carSeat.Parent.Body.MP.Sound:Play()
end
F.lg = function(n)
carSeat.Parent.Body.MP.Sound.ES.HighGain = n
end
F.mg = function(n)
carSeat.Parent.Body.MP.Sound.ES.HighGain = n
end
F.hg = function(n)
carSeat.Parent.Body.MP.Sound.ES.HighGain = n
end
F.eq = function(n)
carSeat.Parent.Body.MP.Sound.ES.Enabled = n
end
F.updateVolume = function(Vol)
carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + Vol
scg.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..carSeat.Parent.Body.MP.Sound.Volume
end
|
-- Directions of movement for each handle's dragged face
|
local AxisMultipliers = {
[Enum.NormalId.Top] = Vector3.new(0, 1, 0);
[Enum.NormalId.Bottom] = Vector3.new(0, -1, 0);
[Enum.NormalId.Front] = Vector3.new(0, 0, -1);
[Enum.NormalId.Back] = Vector3.new(0, 0, 1);
[Enum.NormalId.Left] = Vector3.new(-1, 0, 0);
[Enum.NormalId.Right] = Vector3.new(1, 0, 0);
}
function HandleDragging.new(Tool)
local self = {
Tool = Tool;
-- Handle state
IsHandleDragging = false;
Handles = nil;
-- Selection state
InitialExtentsSize = nil;
InitialExtentsCFrame = nil;
InitialState = nil;
InitialFocusCFrame = nil;
}
return setmetatable(self, HandleDragging)
end
function HandleDragging:AttachHandles(Part, Autofocus)
-- Creates and attaches handles to `Part`, and optionally automatically attaches to the focused part
-- Enable autofocus if requested and not already on
if Autofocus and not self.Tool.Maid.AutofocusHandle then
self.Tool.Maid.AutofocusHandle = Selection.FocusChanged:Connect(function ()
self:AttachHandles(Selection.Focus, true)
end)
-- Disable autofocus if not requested and on
elseif not Autofocus and self.Tool.Maid.AutofocusHandle then
self.Tool.Maid.AutofocusHandle = nil
end
-- Just attach and show the handles if they already exist
if self.Handles then
self.Handles:BlacklistObstacle(BoundingBox.GetBoundingBox())
self.Handles:SetAdornee(Part)
return
end
local AreaPermissions
local function OnHandleDragStart()
-- Prepare for moving parts when the handle is clicked
-- Prevent selection
Core.Targeting.CancelSelecting()
-- Indicate dragging via handles
self.IsHandleDragging = true
-- Freeze bounding box extents while dragging
if BoundingBox.GetBoundingBox() then
local InitialExtentsSize, InitialExtentsCFrame =
BoundingBox.CalculateExtents(Selection.Parts, BoundingBox.StaticExtents)
self.InitialExtentsSize = InitialExtentsSize
self.InitialExtentsCFrame = InitialExtentsCFrame
BoundingBox.PauseMonitoring()
end
-- Stop parts from moving, and capture the initial state of the parts
local InitialPartStates, InitialModelStates, InitialFocusCFrame = self.Tool:PrepareSelectionForDragging()
self.InitialPartStates = InitialPartStates
self.InitialModelStates = InitialModelStates
self.InitialFocusCFrame = InitialFocusCFrame
-- Track the change
self.Tool:TrackChange()
-- Cache area permissions information
if Core.Mode == 'Tool' then
AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player)
end
end
local function OnHandleDrag(Face, Distance)
-- Update parts when the handles are moved
-- Only drag if handle is enabled
if not self.IsHandleDragging then
return
end
-- Calculate the increment-aligned drag distance
Distance = MoveUtil.GetIncrementMultiple(Distance, self.Tool.Increment)
-- Move the parts along the selected axes by the calculated distance
self.Tool:MovePartsAlongAxesByFace(Face, Distance, self.InitialPartStates, self.InitialModelStates, self.InitialFocusCFrame)
-- Make sure we're not entering any unauthorized private areas
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
local Part, InitialPartState = next(self.InitialPartStates)
Part.CFrame = InitialPartState.CFrame
MoveUtil.TranslatePartsRelativeToPart(Part, self.InitialPartStates, self.InitialModelStates)
Distance = 0
end
-- Signal out change in dragged distance
self.Tool.DragChanged:Fire(Distance)
-- Update bounding box if enabled in global axes movements
if self.Tool.Axes == 'Global' and BoundingBox.GetBoundingBox() then
BoundingBox.GetBoundingBox().CFrame = self.InitialExtentsCFrame + (AxisMultipliers[Face] * Distance)
end
end
local function OnHandleDragEnd()
if not self.IsHandleDragging then
return
end
-- Disable dragging
self.IsHandleDragging = false
-- Make joints, restore original anchor and collision states
for Part, State in pairs(self.InitialPartStates) do
Part:MakeJoints()
Core.RestoreJoints(State.Joints)
Part.CanCollide = State.CanCollide
Part.Anchored = State.Anchored
end
-- Register change
self.Tool:RegisterChange()
-- Resume bounding box updates
BoundingBox.RecalculateStaticExtents()
BoundingBox.ResumeMonitoring()
end
-- Create the handles
local Handles = require(Libraries:WaitForChild 'Handles')
self.Handles = Handles.new({
Color = self.Tool.Color.Color,
Parent = Core.UIContainer,
Adornee = Part,
ObstacleBlacklist = { BoundingBox.GetBoundingBox() },
OnDragStart = OnHandleDragStart,
OnDrag = OnHandleDrag,
OnDragEnd = OnHandleDragEnd
})
end
function HandleDragging:HideHandles()
-- Hides the resizing handles
-- Make sure handles exist and are visible
if not self.Handles then
return
end
-- Hide the handles
self.Handles = self.Handles:Destroy()
-- Disable handle autofocus
self.Tool.Maid.AutofocusHandle = nil
end
return HandleDragging
|
--while true do
-- wait(0.5)
-- script.Parent.Parent.Name=script.Parent.Owner.Value .. "'s Ship"
--end
|
seat.ChildAdded:connect(onChildAdded)
|
--[=[
Constructs a new Observable
```lua
local function observeAllChildren(parent)
return Observable.new(function(sub)
local maid = Maid.new()
for _, item in pairs(parent:GetChildren()) do
sub:Fire(item)
end
maid:GiveTask(parent.ChildAdded:Connect(function(child)
sub:Fire(child)
end))
return maid
end)
end
-- Prints out all current children, and whenever a new
-- child is added to workspace
local maid = Maid.new()
maid:GiveTask(observeAllChildren(workspace):Subscribe(print))
```
@param onSubscribe (subscription: Subscription<T>) -> MaidTask
@return Observable<T>
]=]
|
function Observable.new(onSubscribe)
assert(type(onSubscribe) == "function", "Bad onSubscribe")
return setmetatable({
_source = ENABLE_STACK_TRACING and debug.traceback() or "";
_onSubscribe = onSubscribe;
}, Observable)
end
|
--[[**
ensures value is an enum of the correct type
@param enum The enum to check
@returns A function that will return true iff the condition is passed
**--]]
|
function t.enum(enum)
assert(t.Enum(enum))
return function(value)
local enumItemSuccess = t.EnumItem(value)
if not enumItemSuccess then
return false
end
if value.EnumType == enum then
return true
else
return false
end
end
end
do
local checkWrap = t.tuple(t.callback, t.callback)
|
-- << Functions >> --
|
UserInputService.MouseIconEnabled = true
function lerp(a, b, c)
return a + (b - a) * c
end
bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
deltaTime = deltaTime * 60
if Humanoid.Health <= 0 then
bobbing:Disconnect()
return
end
local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0
local calcRootMagnitude = math.min(rootMagnitude, 50)
if deltaTime > 3 then
func1 = 0
func2 = 0
else
func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime)
func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime)
end
Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10)))
val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2)
func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime)
func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)
if rootMagnitude > 1 then
val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
else
val = lerp(val, 0, 0.05 * deltaTime)
end
if rootMagnitude > 12 then
int = 20
int2 = 18
elseif rootMagnitude > 0.1 then
int = 12
int2 = 14
else
int2 = 0
end
Player.CameraMaxZoomDistance = 0.5
Player.CameraMinZoomDistance = 0.5
vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime)
end)
|
-- Any arguments passed into Tree:run() can be received after the first parameter, obj
-- Example: Tree:run(deltaTime) - > task:start(obj,deltaTime)
|
function task:start(obj)
--[[
(optional) this function is called directly before the run method
is called. It allows you to setup things before starting to run
Beware: if task is resumed after calling running(), start is not called.
--]]
end
function task:finish(obj)
--[[
(optional) this function is called directly after the run method
is completed with either success() or fail(). It allows you to clean up
things, after you run the task.
--]]
end
function task:run(obj)
--[[
This is the meat of your task. The run method does everything you want it to do.
Finish it with one of these method calls:
success() - The task did run successfully
fail() - The task did fail
running() - The task is still running and will be called directly from parent node
--]]
--obj:print("Run Enemy Sequence")
local Type = obj.Model.HostileType.Value
local TypeFolder = game.ServerScriptService.Source.HostileNPCs.NPCs.HostileTypes:FindFirstChild(Type)
if TypeFolder then
local treeType = TypeFolder[Node].Value
local tree = TreeCreator:Create(obj,treeType..Node)
tree:run()
end
self:success();
return
end
return task;
|
-- Rapid Flash Rates
-- 120 flashes/min -> wait(.25) (Canadian protected turns)
-- 150 flashes/min -> wait(.2) (Canadian protected turns)
|
FlashRate = script.Parent.Parent.Configuration.BasicSettings.FlashRate.Value
RapidFlashRate = script.Parent.Parent.Configuration.BasicSettings.FlashRate.RapidFlashRate.Value
RapidFlashRateCheck = script.Parent.Parent.Configuration.BasicSettings.FlashRate.EnableRapidFlashRate.Value
while true do
script.Parent.Value = true
wait(FlashRate)
script.Parent.Value = false
if RapidFlashRateCheck == true then
wait(RapidFlashRate)
elseif RapidFlashRateCheck == false then
wait(FlashRate)
end
end
|
-- Event binding
|
Players.PlayerAdded:connect(OnPlayerAdded)
Players.PlayerRemoving:connect(OnPlayerRemoving)
return PlayerManager
|
--[[Engine]]
|
-- [TORQUE CURVE VISUAL]
-- https://www.desmos.com/calculator/nap6stpjqf
-- Use sliders to manipulate values
-- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
Tune.Horsepower = 270 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 5800
Tune.Redline = 6500
Tune.EqPoint = 5250
Tune.PeakSharpness = 3.5
Tune.CurveMult = 0.02
Tune.InclineComp = 1.2 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Turbo Settings
Tune.Aspiration = "Single" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 6 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 45 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 4.6 --The compression ratio (look it up)
--Misc
Tune.RevAccel = 220 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 450 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
|
--------------| SYSTEM SETTINGS |--------------
|
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Blue"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 9161622880; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 0;
["Admin"] = 0;
["Settings"] = 0;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
RankRequiredToViewIcon = 1;
WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
["fly"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["fly2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["speed"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["jumpPower"] = {
Limit = 10000;
IgnoreLimit = 3;
};
};
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
|
--
|
local Triangle = {}
Triangle.__index = Triangle
function Triangle.new(parent)
local self = setmetatable({}, Triangle)
self.a = nil
self.b = nil
self.c = nil
self.Beam = BEAM:Clone()
self.Attachment0 = ATTACHMENT:Clone()
self.Attachment1 = ATTACHMENT:Clone()
self.Parent = nil
self.Beam.Attachment0 = self.Attachment0
self.Beam.Attachment1 = self.Attachment1
self:SetParent(parent)
return self
end
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Lightblue",Paint)
end)
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Mauve",Paint)
end)
|
-- copied from `expect` - should be shared
|
export type ExpectationResult = {
pass: boolean,
message: () -> string,
}
return {}
|
--//Shifting//-
|
if key == "k" then
carSeat.DriveSeat.Idle.Volume = .5
carSeat.DriveSeat.Idle.MaxDistance = 250
carSeat.DriveSeat.Idle.EmitterSize = 5
carSeat.DriveSeat.Rev.Volume = .5
carSeat.DriveSeat.Rev.MaxDistance = 250
carSeat.DriveSeat.Rev.EmitterSize = 5
carSeat.DriveSeat.Rev2.Volume = .4
carSeat.DriveSeat.Rev2.MaxDistance = 250
carSeat.DriveSeat.Rev2.EmitterSize = 5
carSeat.DriveSeat.Rev3.Volume = .5
carSeat.DriveSeat.Rev3.MaxDistance = 250
carSeat.DriveSeat.Rev3.EmitterSize = 5
carSeat.DriveSeat.Start2.Volume = .5
carSeat.DriveSeat.Start2.MaxDistance = 250
carSeat.DriveSeat.Start2.EmitterSize = 5
carSeat.Body.RipEars.Rev.Volume = 2
carSeat.Body.RipEars.Rev.MaxDistance = 250
carSeat.Body.RipEars.Rev.EmitterSize = 5
elseif key == "l" then
carSeat.DriveSeat.Idle.Volume = 5.5
carSeat.DriveSeat.Idle.MaxDistance = 450
carSeat.DriveSeat.Rev.Volume = 1
carSeat.DriveSeat.Rev.MaxDistance = 450
carSeat.DriveSeat.Rev2.Volume = 0.8
carSeat.DriveSeat.Rev2.MaxDistance = 450
carSeat.DriveSeat.Rev3.Volume = 1
carSeat.DriveSeat.Rev3.MaxDistance = 450
carSeat.DriveSeat.Start2.Volume = 8.5
carSeat.DriveSeat.Start2.MaxDistance = 450
carSeat.Body.RipEars.Rev.Volume = 10
carSeat.Body.RipEars.Rev.MaxDistance = 450
carSeat.Body.RipEars.Rev.EmitterSize = 10
end
end)
|
--// F key, Horn
|
mouse.KeyDown:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Airhorn:Play()
end
end)
|
--[[
TODO: Delete
@param int amount
]]
|
function Cell:SetNeighbours(amount)
self.Neighbours = amount
self.Label.Text = amount
end
|
--Made by Stickmasterluke
|
sp = script.Parent
speedboost = 1 --100% speed bonus
speedforsmoke = math.huge --smoke apears when character running >= 10 studs/second.
local tooltag = script:WaitForChild("ToolTag",2)
if tooltag~=nil then
local tool=tooltag.Value
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16+16*speedboost
local hrp = sp:FindFirstChild("HumanoidRootPart")
if hrp ~= nil then
smokepart=Instance.new("Part")
smokepart.FormFactor="Custom"
smokepart.Size=Vector3.new(0,0,0)
smokepart.TopSurface="Smooth"
smokepart.BottomSurface="Smooth"
smokepart.CanCollide=false
smokepart.Transparency=1
local weld=Instance.new("Weld")
weld.Name="SmokePartWeld"
weld.Part0 = hrp
weld.Part1=smokepart
weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
weld.Parent=smokepart
smokepart.Parent=sp
smoke=Instance.new("Smoke")
smoke.Enabled = hrp.Velocity.magnitude>speedforsmoke
smoke.RiseVelocity=2
smoke.Opacity=0
smoke.Size=0
smoke.Parent=smokepart
h.Running:connect(function(speed)
if smoke and smoke~=nil then
smoke.Enabled=speed>speedforsmoke
end
end)
end
end
while tool~=nil and tool.Parent==sp and h~=nil do
sp.ChildRemoved:wait()
end
local h=sp:FindFirstChild("Humanoid")
if h~=nil then
h.WalkSpeed=16
end
end
if smokepart~=nil then
smokepart:Destroy()
end
script:Destroy()
|
--[[Steering]]
|
Tune.SteerInner = 34 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 34 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .06 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .06 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 330 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
---
|
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Mint",Paint)
end)
|
-- Get player control module
|
function GuiController:_getPlayerControls()
if not self._playerControls then
pcall(function()
self._playerControls = require(self.player.PlayerScripts.PlayerModule):GetControls()
end)
end
return self._playerControls
end
|
-- May return NaN or inf or -inf
|
local function findAngleBetweenXZVectors(vec2, vec1)
-- This is a way of finding the angle between the two vectors:
return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
end
|
--// Use the below table to define "pre-set" command aliases
--// Command aliases; Format: {[":alias <arg1> <arg2> ..."] = ":command <arg1> <arg2> ..."}
|
settings.Aliases = {
[":examplealias <player> <fireColor>"] = ":ff <player> | :fling <player> | :fire <player> <fireColor>" --// Order arguments appear in alias string determines their required order in the command message when ran later
};
settings.Banned = {} -- List of people banned from the game Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";}
settings.Muted = {} -- List of people muted (cannot send chat messages) Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";}
settings.Blacklist = {} -- List of people banned from running commands Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";}
settings.Whitelist = {} -- People who can join if whitelist enabled Format: {"Username"; "Username:UserId"; UserId; "Group:GroupId:GroupRank"; "Group:GroupId"; "Item:ItemID"; "GamePass:GamePassID";}
settings.MusicList = {} -- List of songs to appear in the :musiclist Format: {{Name = "somesong", ID = 1234567}, {Name = "anotherone", ID = 1243562}}
settings.CapeList = {} -- List of capes Format: {{Name = "somecape", Material = "Fabric", Color = "Bright yellow", ID = 12345567, Reflectance = 1}; {etc more stuff here}}
settings.InsertList = {} -- List of models to appear in the :insertlist and can be inserted using ':insert <name>' Format: {{Name = "somemodel", ID = 1234567}; {Name = "anotherone", ID = 1243562}}
settings.OnStartup = {} -- List of commands ran at server start Format: {":notif TestNotif"}
settings.OnJoin = {} -- List of commands ran as player on join (ignores adminlevel) Format: {":cmds"}
settings.OnSpawn = {} -- List off commands ran as player on spawn (ignores adminlevel) Format: {"!fire Really red",":ff me"}
settings.SaveAdmins = true -- If true anyone you :admin or :headadmin in-game will save
settings.LoadAdminsFromDS = true -- If false, any admins saved in your DataStores will not load
settings.WhitelistEnabled = false -- If true enables the whitelist/server lock; Only lets admins & whitelisted users join
settings.Prefix = ":" -- The : in :kill me
settings.PlayerPrefix = "!" -- The ! in !donate; Mainly used for commands that any player can run; Do not make it the same as settings.Prefix
settings.SpecialPrefix = "" -- Used for things like "all", "me" and "others" (If changed to ! you would do :kill !me)
settings.SplitKey = " " -- The space in :kill me (eg if you change it to / :kill me would be :kill/me)
settings.BatchKey = "|" -- :kill me | :ff bob | :explode scel
settings.ConsoleKeyCode = "Quote" -- Keybind to open the console; Rebindable per player in userpanel; KeyCodes: https://developer.roblox.com/en-us/api-reference/enum/KeyCode
|
--// Requst
|
local CameraModule = require(rp.Shared['Camera'])
|
--[[
Runs the given TestPlan and returns a TestResults object representing the
results of the run.
]]
|
function TestRunner.runPlan(plan)
local session = TestSession.new(plan)
local lifecycleHooks = LifecycleHooks.new()
local exclusiveNodes = plan:findNodes(function(node)
return node.modifier == TestEnum.NodeModifier.Focus
end)
session.hasFocusNodes = #exclusiveNodes > 0
TestRunner.runPlanNode(session, plan, lifecycleHooks)
return session:finalize()
end
|
--[[Transmission]]
|
Tune.TransModes = {"Auto"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--Loop For Making Rays For The Bullet's Trajectory
|
for i = 1, 30 do
local thisOffset = offset + Vector3.new(0, yOffset*(i-1), 0)
local travelRay = Ray.new(point1,thisOffset)
local hit, position = workspace:FindPartOnRay(travelRay, parts.Parent)
local distance = (position - point1).magnitude
round.Size = Vector3.new(1, distance, 1)
round.CFrame = CFrame.new(position, point1)
* CFrame.new(0, 0, -distance/2)
* CFrame.Angles(math.rad(90),0,0)
round.Parent = workspace
point1 = point1 + thisOffset
if hit then
round:remove()
local e = Instance.new("Explosion")
e.BlastRadius = 4
e.ExplosionType = "NoCraters"
e.BlastPressure = 1
e.Position = position
e.Parent = workspace
local players = game.Players:getChildren()
for i = 1, #players do
if players[i].TeamColor ~= script.Parent.Parent.Tank.Value then --if he's not an ally
character = players[i].Character
if character then
torso = character:findFirstChild'Torso'
if torso then
torsoPos = torso.Position
origPos = round.Position
local ray = Ray.new(origPos, torsoPos-origPos)
local hit, position = game.Workspace:FindPartOnRayWithIgnoreList(ray,ignoreList)
if hit then
if hit.Parent == character then
human = hit.Parent:findFirstChild("Humanoid")
if human then
distance = (position-origPos).magnitude
|
-- SAVE --
|
function API:SavePlayerBoothText(TargetId, Text)
rawset(BoothText, TargetId, Text)
end
function API:SavePlayerSingText(TargetId, Text)
rawset(SingText, TargetId, Text)
end
function API:SavePlayerBooth(TargetId, Id)
rawset(CurrentBooth, TargetId, Id)
end
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 5
local slash_damage = 8
local lunge_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 = .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)
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
force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.2)
swordOut()
wait(.2)
force.Parent = nil
wait(.4)
swordUp()
damage = slash_damage
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
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
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)
|
--// Connections
|
L_1_.Equipped:connect(function()
local L_39_ = L_3_:FindFirstChild('Torso')
local L_40_ = L_3_:FindFirstChild('Head')
local L_41_ = L_3_:FindFirstChild('HumanoidRootPart')
L_14_ = Instance.new("Motor6D", L_39_)
L_14_.Parent = L_39_
L_14_.Name = "Clone"
L_14_.Part0 = L_41_
L_14_.Part1 = L_40_
L_14_.C0 = L_39_:WaitForChild("Neck").C0
L_14_.C1 = L_39_:WaitForChild("Neck").C1
|
-- Settings
|
local Universal = true
local BulletType = "Universal"
local Infinite = true
local Stored = script.Stored
if not Infinite then
script.Parent.ObjectText = BulletType.." | "..Stored.Value
else
script.Parent.ObjectText = BulletType
end
|
-- Local Functions
|
local function toggleNonTutorialGui(isEnabled)
local PlayerGui = player.PlayerGui
for _, child in ipairs(PlayerGui:GetChildren()) do
if child:IsA("GuiObject") and child.Name ~= "Tutorial" then
child.Enabled = isEnabled
end
end
end
local function startTutorial()
toggleNonTutorialGui(false)
Panels.Visible = true
Panel1.Visible = true
Panel2.Visible = false
end
local function nextPanel(input, gameProcessed)
if Panel1.Visible == true then
Panel1.Visible = false
Panel2.Visible = true
NextButton.ButtonLabel.Text = "GOT IT"
elseif Panel2.Visible == true then
Panel2.Visible = false
-- Disable tutorial
Panels.Visible = false
-- Enable other gui
toggleNonTutorialGui(true)
if not IS_MOBILE then
-- Show and tween arrow over move button until player earns
-- 10 points
Arrow.Visible = true
local arrowThread = coroutine.create(
function()
local goal = totalPoints.Value + 10
local startPos = Arrow.Position
repeat
Arrow:TweenPosition(UDim2.new(startPos.X.Scale, 0, startPos.Y.Scale, -20),
Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, true)
wait(1)
Arrow:TweenPosition(UDim2.new(startPos.X.Scale, 0, startPos.Y.Scale, 0),
Enum.EasingDirection.In, Enum.EasingStyle.Quad, 1, true)
wait(1)
until totalPoints.Value >= goal
Arrow.Visible = false
end)
coroutine.resume(arrowThread)
end
end
end
|
--// All global vars will be wiped/replaced except script
--// All guis are autonamed client.Variables.CodeName..gui.Name
--// Be sure to update the console gui's code if you change stuff
|
return function(data, env)
if env then
setfenv(1, env)
end
local Title,Message = data.Title,data.Message
if not Title or not Message then return end
local gTable = data.gTable
local baseClip = script.Parent.Parent.BaseClip
local messageTemplate = baseClip.Frame
local messageClone = messageTemplate
messageClone.Size = UDim2.new(1,0,0,baseClip.AbsoluteSize.Y)
messageClone.Position = UDim2.new(0,0,-1,0)
messageClone.Parent = baseClip
messageClone.Visible = true
local closeButton = messageClone:WaitForChild('TextButton')
local Top = messageClone:WaitForChild('Top')
local Body = messageClone:WaitForChild('Body')
local topTitle = Top:WaitForChild('Title')
local bodyText = Body:WaitForChild('To Name Later')
local Left = Top:WaitForChild('Left')
local tim = data.Time
topTitle.Text = Title
bodyText.Text = Message
local bodyBounds_Y = bodyText.TextBounds.Y
if bodyBounds_Y < 30 then
bodyBounds_Y = 30
else
bodyBounds_Y = bodyBounds_Y + 15
end
local titleSize_Y = Top.Size.Y.Offset
messageClone.Size = UDim2.new(1,0,0,bodyBounds_Y+titleSize_Y)
local function Resize()
local toDisconnect
local Success, Message = pcall(function()
toDisconnect = gTable.BindEvent(baseClip.Changed, function(Prop)
if Prop == "AbsoluteSize" then
messageClone.Size = UDim2.new(1,0,0,baseClip.AbsoluteSize.Y)
local bodyBounds_Y = bodyText.TextBounds.Y
if bodyBounds_Y < 30 then
bodyBounds_Y = 30
else
bodyBounds_Y = bodyBounds_Y + 15
end
local titleSize_Y = Top.Size.Y.Offset
messageClone.Size = UDim2.new(1,0,0,bodyBounds_Y+titleSize_Y)
if messageClone ~= nil and messageClone.Parent == baseClip then
messageClone:TweenPosition(UDim2.new(0,0,0.5,-messageClone.Size.Y.Offset/2),'Out','Quint',0.5,true)
else
if toDisconnect then
toDisconnect:Disconnect()
end
return
end
end
end)
end)
if Message and toDisconnect then
toDisconnect:Disconnect()
return
end
end
gTable.CustomDestroy = function()
gTable.CustomDestroy = nil
gTable.ClearEvents()
pcall(function()
messageClone:TweenPosition(UDim2.new(0,0,1,0),'Out','Quint',0.3,true,function(Done)
if Done == Enum.TweenStatus.Completed and messageClone then
messageClone:Destroy()
elseif Done == Enum.TweenStatus.Canceled and messageClone then
messageClone:Destroy()
end
end)
wait(0.3)
end)
return gTable.Destroy()
end
gTable:Ready()
messageClone:TweenPosition(UDim2.new(0,0,0.5,-messageClone.Size.Y.Offset/2),'Out','Quint',0.5,true,function(Status)
if Status == Enum.TweenStatus.Completed then
Resize()
end
end)
gTable.BindEvent(closeButton.MouseButton1Click, function()
pcall(function()
messageClone:TweenPosition(UDim2.new(0,0,1,0),'Out','Quint',0.3,true,function(Done)
if Done == Enum.TweenStatus.Completed and messageClone then
messageClone:Destroy()
gTable:Destroy()
elseif Done == Enum.TweenStatus.Canceled and messageClone then
messageClone:Destroy()
gTable:Destroy()
end
end)
end)
end)
local waitTime = tim or (#bodyText.Text*0.1)+1
local Position_1,Position_2 = string.find(waitTime,"%p")
if Position_1 and Position_2 then
local followingNumbers = tonumber(string.sub(waitTime,Position_1))
if followingNumbers >= 0.5 then
waitTime = tonumber(string.sub(waitTime,1,Position_1))+1
else
waitTime = tonumber(string.sub(waitTime,1,Position_1))
end
end
--[[if waitTime > 15 then
waitTime = 15
elseif waitTime <= 1 then
waitTime = 2
end]]--
Left.Text = `{waitTime}.00`
for i=waitTime,1,-1 do
if not Left then break end
Left.Text = `{i}.00`
wait(1)
end
Left.Text = "Closing.."
wait(0.3)
if messageClone then
pcall(function()
messageClone:TweenPosition(UDim2.new(0,0,1,0),'Out','Quint',0.3,true,function(Done)
if Done == Enum.TweenStatus.Completed and messageClone then
messageClone:Destroy()
gTable:Destroy()
elseif Done == Enum.TweenStatus.Canceled and messageClone then
messageClone:Destroy()
gTable:Destroy()
end
end)
end)
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Players__1 = game:GetService("Players");
local l__ReplicatedStorage__2 = game:GetService("ReplicatedStorage");
local l__Chat__3 = game:GetService("Chat");
local l__TextService__4 = game:GetService("TextService");
local v5 = l__Players__1.LocalPlayer;
while v5 == nil do
l__Players__1.ChildAdded:wait();
v5 = l__Players__1.LocalPlayer;
end;
local l__PlayerGui__6 = v5:WaitForChild("PlayerGui");
local v7, v8 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserShouldLocalizeGameChatBubble");
end);
local v9, v10 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixBubbleChatText");
end);
local v11, v12 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserRoactBubbleChatBeta");
end);
local v13, v14 = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPreventOldBubbleChatOverlap");
end);
local v15 = 128 - utf8.len(utf8.nfcnormalize("...")) - 1;
local v16 = Instance.new("ScreenGui");
v16.Name = "BubbleChat";
v16.ResetOnSpawn = false;
v16.Parent = l__PlayerGui__6;
local function u1()
local v17 = {
data = {}
};
local v18 = Instance.new("BindableEvent");
v17.Emptied = v18.Event;
function v17.Size(p1)
return #v17.data;
end;
function v17.Empty(p2)
return v17:Size() <= 0;
end;
function v17.PopFront(p3)
table.remove(v17.data, 1);
if v17:Empty() then
v18:Fire();
end;
end;
function v17.Front(p4)
return v17.data[1];
end;
function v17.Get(p5, p6)
return v17.data[p6];
end;
function v17.PushBack(p7, p8)
table.insert(v17.data, p8);
end;
function v17.GetData(p9)
return v17.data;
end;
return v17;
end;
local function u2(p10, p11, p12)
local v19 = {
ComputeBubbleLifetime = function(p13, p14, p15)
if p15 then
return 8 + 7 * math.min(utf8.len(utf8.nfcnormalize(p14)) / 75, 1);
end;
return 12 + 8 * math.min(utf8.len(utf8.nfcnormalize(p14)) / 75, 1);
end,
Origin = nil,
RenderBubble = nil,
Message = p10
};
v19.BubbleDieDelay = v19:ComputeBubbleLifetime(p10, p12);
v19.BubbleColor = p11;
v19.IsLocalPlayer = p12;
return v19;
end;
local u3 = {
WHITE = "dub",
BLUE = "blu",
GREEN = "gre",
RED = "red"
};
function createChatBubbleMain(p16, p17)
local v20 = Instance.new("ImageLabel");
v20.Name = "ChatBubble";
v20.ScaleType = Enum.ScaleType.Slice;
v20.SliceCenter = p17;
v20.Image = "rbxasset://textures/" .. tostring(p16) .. ".png";
v20.BackgroundTransparency = 1;
v20.BorderSizePixel = 0;
v20.Size = UDim2.new(1, 0, 1, 0);
v20.Position = UDim2.new(0, 0, 0, 0);
return v20;
end;
function createChatBubbleTail(p18, p19)
local v21 = Instance.new("ImageLabel");
v21.Name = "ChatBubbleTail";
v21.Image = "rbxasset://textures/ui/dialog_tail.png";
v21.BackgroundTransparency = 1;
v21.BorderSizePixel = 0;
v21.Position = p18;
v21.Size = p19;
return v21;
end;
function createChatBubbleWithTail(p20, p21, p22, p23)
local v22 = createChatBubbleMain(p20, p23);
createChatBubbleTail(p21, p22).Parent = v22;
return v22;
end;
function createScaledChatBubbleWithTail(p24, p25, p26, p27)
local v23 = createChatBubbleMain(p24, p27);
local v24 = Instance.new("Frame");
v24.Name = "ChatBubbleTailFrame";
v24.BackgroundTransparency = 1;
v24.SizeConstraint = Enum.SizeConstraint.RelativeXX;
v24.Position = UDim2.new(0.5, 0, 1, 0);
v24.Size = UDim2.new(p25, 0, p25, 0);
v24.Parent = v23;
createChatBubbleTail(p26, UDim2.new(1, 0, 0.5, 0)).Parent = v24;
return v23;
end;
function createChatImposter(p28, p29, p30)
local v25 = Instance.new("ImageLabel");
v25.Name = "DialogPlaceholder";
v25.Image = "rbxasset://textures/" .. tostring(p28) .. ".png";
v25.BackgroundTransparency = 1;
v25.BorderSizePixel = 0;
v25.Position = UDim2.new(0, 0, -1.25, 0);
v25.Size = UDim2.new(1, 0, 1, 0);
local v26 = Instance.new("ImageLabel");
v26.Name = "DotDotDot";
v26.Image = "rbxasset://textures/" .. tostring(p29) .. ".png";
v26.BackgroundTransparency = 1;
v26.BorderSizePixel = 0;
v26.Position = UDim2.new(0.001, 0, p30, 0);
v26.Size = UDim2.new(1, 0, 0.7, 0);
v26.Parent = v25;
return v25;
end;
local u4 = {
ChatBubble = {},
ChatBubbleWithTail = {},
ScalingChatBubbleWithTail = {},
CharacterSortedMsg = (function()
local v27 = {
data = {}
};
local u5 = 0;
function v27.Size(p31)
return u5;
end;
function v27.Erase(p32, p33)
if v27.data[p33] then
u5 = u5 - 1;
end;
v27.data[p33] = nil;
end;
function v27.Set(p34, p35, p36)
v27.data[p35] = p36;
if p36 then
u5 = u5 + 1;
end;
end;
function v27.Get(p37, p38)
if not p38 then
return;
end;
if not v27.data[p38] then
v27.data[p38] = {
Fifo = u1(),
BillboardGui = nil
};
local u6 = nil;
u6 = v27.data[p38].Fifo.Emptied:connect(function()
u6:disconnect();
v27:Erase(p38);
end);
end;
return v27.data[p38];
end;
function v27.GetData(p39)
return v27.data;
end;
return v27;
end)()
};
local function v28(p40, p41, p42, p43, p44)
u4.ChatBubble[p40] = createChatBubbleMain(p41, p44);
if p43 then
local v29 = -1;
else
v29 = 0;
end;
u4.ChatBubbleWithTail[p40] = createChatBubbleWithTail(p41, UDim2.new(0.5, -14, 1, v29), UDim2.new(0, 30, 0, 14), p44);
if p43 then
local v30 = -1;
else
v30 = 0;
end;
u4.ScalingChatBubbleWithTail[p40] = createScaledChatBubbleWithTail(p41, 0.5, UDim2.new(-0.5, 0, 0, v30), p44);
end;
v28(u3.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5, 5, 15, 15));
v28(u3.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7, 7, 33, 33));
v28(u3.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7, 7, 33, 33));
v28(u3.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7, 7, 33, 33));
function u4.SanitizeChatLine(p45, p46)
if not (v15 < utf8.len(utf8.nfcnormalize(p46))) then
return p46;
end;
return string.sub(p46, 1, utf8.offset(p46, v15 + utf8.len(utf8.nfcnormalize("...")) + 1) - 1);
end;
local function u7(p47)
local v31 = Instance.new("BillboardGui");
v31.Adornee = p47;
v31.Size = UDim2.new(0, 400, 0, 250);
v31.StudsOffset = Vector3.new(0, 1.5, 2);
v31.Parent = v16;
local v32 = Instance.new("Frame");
v32.Name = "BillboardFrame";
v32.Size = UDim2.new(1, 0, 1, 0);
v32.Position = UDim2.new(0, 0, -0.5, 0);
v32.BackgroundTransparency = 1;
v32.Parent = v31;
local u8 = nil;
u8 = v32.ChildRemoved:connect(function()
if #v32:GetChildren() <= 1 then
u8:disconnect();
v31:Destroy();
end;
end);
u4:CreateSmallTalkBubble(u3.WHITE).Parent = v32;
return v31;
end;
function u4.CreateBillboardGuiHelper(p48, p49, p50)
if p49 and not u4.CharacterSortedMsg:Get(p49).BillboardGui then
if not p50 and p49:IsA("BasePart") then
u4.CharacterSortedMsg:Get(p49).BillboardGui = u7(p49);
return;
end;
if p49:IsA("Model") then
local l__Head__33 = p49:FindFirstChild("Head");
if l__Head__33 and l__Head__33:IsA("BasePart") then
u4.CharacterSortedMsg:Get(p49).BillboardGui = u7(l__Head__33);
end;
end;
end;
end;
function u4.SetBillboardLODNear(p51, p52)
local l__Adornee__34 = p52.Adornee;
if l__Adornee__34 and l__Players__1.LocalPlayer.Character then
local v35 = l__Adornee__34:IsDescendantOf(l__Players__1.LocalPlayer.Character);
else
v35 = nil;
end;
p52.Size = UDim2.new(0, 400, 0, 250);
if v35 then
local v36 = 1.5;
else
v36 = 2.5;
end;
if v35 then
local v37 = 2;
else
v37 = 0.1;
end;
p52.StudsOffset = Vector3.new(0, v36, v37);
p52.Enabled = true;
local v38 = p52.BillboardFrame:GetChildren();
for v39 = 1, #v38 do
v38[v39].Visible = true;
end;
p52.BillboardFrame.SmallTalkBubble.Visible = false;
end;
function u4.SetBillboardLODDistant(p53, p54)
local l__Adornee__40 = p54.Adornee;
if l__Adornee__40 and l__Players__1.LocalPlayer.Character then
local v41 = l__Adornee__40:IsDescendantOf(l__Players__1.LocalPlayer.Character);
else
v41 = nil;
end;
p54.Size = UDim2.new(4, 0, 3, 0);
if v41 then
local v42 = 2;
else
v42 = 0.1;
end;
p54.StudsOffset = Vector3.new(0, 3, v42);
p54.Enabled = true;
local v43 = p54.BillboardFrame:GetChildren();
for v44 = 1, #v43 do
v43[v44].Visible = false;
end;
p54.BillboardFrame.SmallTalkBubble.Visible = true;
end;
function u4.SetBillboardLODVeryFar(p55, p56)
p56.Enabled = false;
end;
function u4.SetBillboardGuiLOD(p57, p58, p59)
if not p59 then
return;
end;
if p59:IsA("Model") then
local l__Head__45 = p59:FindFirstChild("Head");
if not l__Head__45 then
p59 = p59.PrimaryPart;
else
p59 = l__Head__45;
end;
end;
if not p59 then
local v46 = 100000;
else
v46 = (p59.Position - game.Workspace.CurrentCamera.CoordinateFrame.Position).magnitude;
end;
if v46 < 65 then
u4:SetBillboardLODNear(p58);
return;
end;
if v46 >= 65 and v46 < 100 then
u4:SetBillboardLODDistant(p58);
return;
end;
u4:SetBillboardLODVeryFar(p58);
end;
function u4.CameraCFrameChanged(p60)
for v47, v48 in pairs(u4.CharacterSortedMsg:GetData()) do
local l__BillboardGui__49 = v48.BillboardGui;
if l__BillboardGui__49 then
u4:SetBillboardGuiLOD(l__BillboardGui__49, v47);
end;
end;
end;
local u9 = v9 or v10;
local l__Enum_Font_SourceSans__10 = Enum.Font.SourceSans;
local l__Enum_FontSize_Size24__11 = Enum.FontSize.Size24;
function u4.CreateBubbleText(p61, p62, p63)
local v50 = Instance.new("TextLabel");
v50.Name = "BubbleText";
v50.BackgroundTransparency = 1;
if u9 then
v50.Size = UDim2.fromScale(1, 1);
else
v50.Position = UDim2.new(0, 15, 0, 0);
v50.Size = UDim2.new(1, -30, 1, 0);
end;
v50.Font = l__Enum_Font_SourceSans__10;
v50.ClipsDescendants = true;
v50.TextWrapped = true;
v50.FontSize = l__Enum_FontSize_Size24__11;
v50.Text = p62;
v50.Visible = false;
v50.AutoLocalize = p63;
if u9 then
local v51 = Instance.new("UIPadding");
v51.PaddingTop = UDim.new(0, 12);
v51.PaddingRight = UDim.new(0, 12);
v51.PaddingBottom = UDim.new(0, 12);
v51.PaddingLeft = UDim.new(0, 12);
v51.Parent = v50;
end;
return v50;
end;
function u4.CreateSmallTalkBubble(p64, p65)
local v52 = u4.ScalingChatBubbleWithTail[p65]:Clone();
v52.Name = "SmallTalkBubble";
v52.AnchorPoint = Vector2.new(0, 0.5);
v52.Position = UDim2.new(0, 0, 0.5, 0);
v52.Visible = false;
local v53 = u4:CreateBubbleText("...");
v53.TextScaled = true;
v53.TextWrapped = false;
v53.Visible = true;
v53.Parent = v52;
return v52;
end;
function u4.UpdateChatLinesForOrigin(p66, p67, p68)
local l__Fifo__54 = u4.CharacterSortedMsg:Get(p67).Fifo;
local v55 = l__Fifo__54:Size();
local v56 = l__Fifo__54:GetData();
if #v56 <= 1 then
return;
end;
for v57 = #v56 - 1, 1, -1 do
local l__RenderBubble__58 = v56[v57].RenderBubble;
if not l__RenderBubble__58 then
return;
end;
if v55 - v57 + 1 > 1 then
local l__ChatBubbleTail__59 = l__RenderBubble__58:FindFirstChild("ChatBubbleTail");
if l__ChatBubbleTail__59 then
l__ChatBubbleTail__59:Destroy();
end;
local l__BubbleText__60 = l__RenderBubble__58:FindFirstChild("BubbleText");
if l__BubbleText__60 then
l__BubbleText__60.TextTransparency = 0.5;
end;
end;
l__RenderBubble__58:TweenPosition(UDim2.new(l__RenderBubble__58.Position.X.Scale, l__RenderBubble__58.Position.X.Offset, 1, p68 - l__RenderBubble__58.Size.Y.Offset - 14), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true);
p68 = p68 - l__RenderBubble__58.Size.Y.Offset - 14;
end;
end;
function u4.DestroyBubble(p69, p70, p71)
if not p70 then
return;
end;
if p70:Empty() then
return;
end;
local l__RenderBubble__61 = p70:Front().RenderBubble;
if l__RenderBubble__61 then
local u12 = l__RenderBubble__61;
spawn(function()
while p70:Front().RenderBubble ~= p71 do
wait();
end;
u12 = p70:Front().RenderBubble;
local l__BubbleText__62 = u12:FindFirstChild("BubbleText");
local l__ChatBubbleTail__63 = u12:FindFirstChild("ChatBubbleTail");
while u12 and u12.ImageTransparency < 1 do
local v64 = wait();
if u12 then
local v65 = v64 * 1.5;
u12.ImageTransparency = u12.ImageTransparency + v65;
if l__BubbleText__62 then
l__BubbleText__62.TextTransparency = l__BubbleText__62.TextTransparency + v65;
end;
if l__ChatBubbleTail__63 then
l__ChatBubbleTail__63.ImageTransparency = l__ChatBubbleTail__63.ImageTransparency + v65;
end;
end;
end;
if u12 then
u12:Destroy();
p70:PopFront();
end;
end);
return;
end;
p70:PopFront();
end;
function u4.CreateChatLineRender(p72, p73, p74, p75, p76, p77)
if not p73 then
return;
end;
if not u4.CharacterSortedMsg:Get(p73).BillboardGui then
u4:CreateBillboardGuiHelper(p73, p75);
end;
local l__BillboardGui__66 = u4.CharacterSortedMsg:Get(p73).BillboardGui;
if l__BillboardGui__66 then
local v67 = nil;
local v68 = u4.ChatBubbleWithTail[p74.BubbleColor]:Clone();
v68.Visible = false;
local v69 = u4:CreateBubbleText(p74.Message, p77);
v69.Parent = v68;
v68.Parent = l__BillboardGui__66.BillboardFrame;
p74.RenderBubble = v68;
local v70 = l__TextService__4:GetTextSize(v69.Text, 24, l__Enum_Font_SourceSans__10, Vector2.new(400, 250));
v67 = v70.Y / 24;
if u9 then
local v71 = math.ceil(v70.X + 24);
local v72 = v67 * 34;
v68.Size = UDim2.fromOffset(0, 0);
v68.Position = UDim2.fromScale(0.5, 1);
v68:TweenSizeAndPosition(UDim2.fromOffset(v71, v72), UDim2.new(0.5, -v71 / 2, 1, -v72), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function()
v69.Visible = true;
end);
u4:SetBillboardGuiLOD(l__BillboardGui__66, p74.Origin);
u4:UpdateChatLinesForOrigin(p74.Origin, -v72);
else
local v73 = math.max((v70.X + 30) / 400, 0.1);
v68.Size = UDim2.new(0, 0, 0, 0);
v68.Position = UDim2.new(0.5, 0, 1, 0);
local v74 = v67 * 34;
v68:TweenSizeAndPosition(UDim2.new(v73, 0, 0, v74), UDim2.new((1 - v73) / 2, 0, 1, -v74), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function()
v69.Visible = true;
end);
u4:SetBillboardGuiLOD(l__BillboardGui__66, p74.Origin);
u4:UpdateChatLinesForOrigin(p74.Origin, -v74);
end;
delay(p74.BubbleDieDelay, function()
u4:DestroyBubble(p76, v68);
end);
end;
end;
function u4.OnPlayerChatMessage(p78, p79, p80, p81)
if not u4:BubbleChatEnabled() then
return;
end;
local l__LocalPlayer__75 = l__Players__1.LocalPlayer;
local v76 = false;
if l__LocalPlayer__75 ~= nil then
v76 = p79 ~= l__LocalPlayer__75;
end;
local v77 = u2(u4:SanitizeChatLine(p80), u3.WHITE, not v76);
if p79 then
v77.User = p79.Name;
v77.Origin = p79.Character;
end;
if p79 and v77.Origin then
local l__Fifo__78 = u4.CharacterSortedMsg:Get(v77.Origin).Fifo;
l__Fifo__78:PushBack(v77);
u4:CreateChatLineRender(p79.Character, v77, true, l__Fifo__78, false);
end;
end;
local u13 = v11 or v12;
local u14 = v13 or v14;
local u15 = v7 or v8;
function u4.OnGameChatMessage(p82, p83, p84, p85)
if u13 or u14 and l__Chat__3.BubbleChatEnabled then
return;
end;
local l__LocalPlayer__79 = l__Players__1.LocalPlayer;
local v80 = false;
if l__LocalPlayer__79 ~= nil then
v80 = l__LocalPlayer__79.Character ~= p83;
end;
local v81 = u3.WHITE;
if p85 == Enum.ChatColor.Blue then
v81 = u3.BLUE;
elseif p85 == Enum.ChatColor.Green then
v81 = u3.GREEN;
elseif p85 == Enum.ChatColor.Red then
v81 = u3.RED;
end;
local v82 = u2(u4:SanitizeChatLine(p84), v81, not v80);
v82.Origin = p83;
u4.CharacterSortedMsg:Get(v82.Origin).Fifo:PushBack(v82);
if u15 then
u4:CreateChatLineRender(p83, v82, false, u4.CharacterSortedMsg:Get(v82.Origin).Fifo, true);
return;
end;
u4:CreateChatLineRender(p83, v82, false, u4.CharacterSortedMsg:Get(v82.Origin).Fifo, false);
end;
function u4.BubbleChatEnabled(p86)
if u13 or u14 and l__Chat__3.BubbleChatEnabled then
return false;
end;
local l__ClientChatModules__83 = l__Chat__3:FindFirstChild("ClientChatModules");
if l__ClientChatModules__83 then
local l__ChatSettings__84 = l__ClientChatModules__83:FindFirstChild("ChatSettings");
if l__ChatSettings__84 then
local v85 = require(l__ChatSettings__84);
if v85.BubbleChatEnabled ~= nil then
return v85.BubbleChatEnabled;
end;
end;
end;
return l__Players__1.BubbleChat;
end;
function u4.ShowOwnFilteredMessage(p87)
local v86 = nil;
local l__ClientChatModules__87 = l__Chat__3:FindFirstChild("ClientChatModules");
if l__ClientChatModules__87 then
v86 = l__ClientChatModules__87:FindFirstChild("ChatSettings");
if not v86 then
return false;
end;
else
return false;
end;
return require(v86).ShowUserOwnFilteredMessage;
end;
function findPlayer(p88)
local v88, v89, v90 = pairs(l__Players__1:GetPlayers());
while true do
local v91, v92 = v88(v89, v90);
if v91 then
else
break;
end;
v90 = v91;
if v92.Name == p88 then
return v92;
end;
end;
end;
l__Chat__3.Chatted:connect(function(p89, p90, p91)
u4:OnGameChatMessage(p89, p90, p91);
end);
local v93 = nil;
if game.Workspace.CurrentCamera then
v93 = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function(p92)
u4:CameraCFrameChanged();
end);
end;
local u16 = v93;
game.Workspace.Changed:Connect(function(p93)
if p93 == "CurrentCamera" then
if u16 then
u16:disconnect();
end;
if game.Workspace.CurrentCamera then
u16 = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function(p94)
u4:CameraCFrameChanged();
end);
end;
end;
end);
local u17 = nil;
function getAllowedMessageTypes()
if u17 then
return u17;
end;
local l__ClientChatModules__94 = l__Chat__3:FindFirstChild("ClientChatModules");
if l__ClientChatModules__94 then
else
return { "Message", "Whisper" };
end;
local l__ChatSettings__95 = l__ClientChatModules__94:FindFirstChild("ChatSettings");
if l__ChatSettings__95 then
local v96 = require(l__ChatSettings__95);
if v96.BubbleChatMessageTypes then
u17 = v96.BubbleChatMessageTypes;
return u17;
end;
end;
local l__ChatConstants__97 = l__ClientChatModules__94:FindFirstChild("ChatConstants");
if l__ChatConstants__97 then
local v98 = require(l__ChatConstants__97);
u17 = { v98.MessageTypeDefault, v98.MessageTypeWhisper };
end;
return u17;
end;
function checkAllowedMessageType(p95)
local v99 = getAllowedMessageTypes();
local v100 = #v99;
local v101 = 1 - 1;
while true do
if v99[v101] == p95.MessageType then
return true;
end;
if 0 <= 1 then
if v101 < v100 then
else
break;
end;
elseif v100 < v101 then
else
break;
end;
v101 = v101 + 1;
end;
return false;
end;
local v102 = l__ReplicatedStorage__2:WaitForChild("DefaultChatSystemChatEvents");
local l__OnMessageDoneFiltering__103 = v102:WaitForChild("OnMessageDoneFiltering");
v102:WaitForChild("OnNewMessage").OnClientEvent:connect(function(p96, p97)
if not checkAllowedMessageType(p96) then
return;
end;
local v104 = findPlayer(p96.FromSpeaker);
if not v104 then
return;
end;
if (not p96.IsFiltered or p96.FromSpeaker == v5.Name) and (p96.FromSpeaker ~= v5.Name or u4:ShowOwnFilteredMessage()) then
return;
end;
u4:OnPlayerChatMessage(v104, p96.Message, nil);
end);
l__OnMessageDoneFiltering__103.OnClientEvent:connect(function(p98, p99)
if not checkAllowedMessageType(p98) then
return;
end;
local v105 = findPlayer(p98.FromSpeaker);
if not v105 then
return;
end;
if p98.FromSpeaker == v5.Name and not u4:ShowOwnFilteredMessage() then
return;
end;
u4:OnPlayerChatMessage(v105, p98.Message, nil);
end);
|
--lights
|
local Red1 = script.Parent.Red1
local Red2 = script.Parent.Red2
local RL = script.Parent.RL
local RR = script.Parent.RR
local FL = script.Parent.FL
local FR = script.Parent.FR
local f1 = script.Parent.WhiteFront
local f2 = script.Parent.WhiteFront2
local r1 = script.Parent.WhiteBack
local r2 = script.Parent.WhiteBack2
local B1 = script.Parent.Brake
local B2 = script.Parent.Brake2
local lgt = script.Parent.Lighting.Light
function lightson()
f1.Material = "Neon"
f2.Material = "Neon"
Red1.Material = "Neon"
Red2.Material = "Neon"
lgt.Enabled = true
end
function lightsoff()
f1.Material = "SmoothPlastic"
f2.Material = "SmoothPlastic"
Red1.Material = "SmoothPlastic"
Red2.Material = "SmoothPlastic"
lgt.Enabled = false
end
function reverse()
r1.Material = "Neon"
r2.Material = "Neon"
end
function unreverse()
r1.Material = "SmoothPlastic"
r2.Material = "SmoothPlastic"
end
function brake()
B1.Material = "Neon"
B2.Material = "Neon"
end
function unbrake()
B1.Material = "SmoothPlastic"
B2.Material = "SmoothPlastic"
end
|
-- Helper function for Determinant of 3x3
|
local function Det3x3(a,b,c,d,e,f,g,h,i)
return (a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g))
end
|
--[[Drivetrain]]
|
Tune.Config = "RWD" --"FWD" , "RWD" , "AWD"
|
-- Define the text button and frames
|
local textButton = script.Parent
local frame1 = script.Parent.Parent.Phone
local comps = script.Parent.Parent.Components
local apl = comps.cPhonePurchased
local sud = script.Parent.Sound
|
--Traction Control Settings
|
Tune.TCSEnabled = true -- Implements TCS
Tune.TCSThreshold = 20 -- Slip speed allowed before TCS starts working (in SPS)
Tune.TCSGradient = 20 -- Slip speed gradient between 0 to max reduction (in SPS)
Tune.TCSLimit = 10 -- Minimum amount of torque at max reduction (in percent)
|
--Make New Model For Rays If Enabled
|
if makeRays then
m = Instance.new("Model")
m.Name = "Rays"
m.Parent = Workspace
end
|
--Variables
|
local filteringFunction = game.ReplicatedStorage.FilteringFunction
|
-- HOW TO DO --
-- 1. Insert a ScreenGui then drag it into the StarterGui
-- 2. Insert a Frame
-- 3. Insert TextButton
-- 4. Insert a Local Script inside the TextButton
| |
-- Infinitely update the target position for the tank
|
currentElev = 0;
currentRot = 0;
while wait() do
if (myMouse) then
-- Position of mouse in world
mousePoint = myMouse.Hit.p;
-- Vector from tank to mouse point
targetVector = (mousePoint - parts.GunBase.CFrame.p).unit;
-- Determine where the gun should point
targetRotations = determineNewDirections(targetVector);
-- For each time we do all that math to determine the angle, we will smoothly rotate the gun towards it in 4 increments
-- This means less lag (fewer calculations) but it's still smooth
for i = 1, 4 do
newRotations = getSmoothRotation(targetRotations);
TFE:FireServer('RotateTurret',parts,currentElev, currentRot)
wait();
end
end
end
|
--Small tip: You don't need to use actual Roblox Attachments below. You can also create "fake" ones as follows:
--[[
local A1, A2 = {}, {}
A1.WorldPosition, A1.WorldAxis = chosenPos1, chosenAxis1
A2.WorldPosition, A2.WorldAxis = chosenPos2, chosenAxis2
local NewBolt = LightningBolt.new(A1, A2, 40)
--]]
|
function LightningBolt.new(Attachment0, Attachment1, PartCount)
local self = setmetatable({}, LightningBolt)
--Main (default) Properties--
--Bolt Appearance Properties--
self.Enabled = true --Hides bolt without destroying any parts when false
self.Attachment0, self.Attachment1 = Attachment0, Attachment1 --Bolt originates from Attachment0 and ends at Attachment1
self.CurveSize0, self.CurveSize1 = 0, 0 --Works similarly to beams. See https://dk135eecbplh9.cloudfront.net/assets/blt160ad3fdeadd4ff2/BeamCurve1.png
self.MinRadius, self.MaxRadius = 0, 2.4 --Governs the amplitude of fluctuations throughout the bolt
self.Frequency = 1 --Governs the frequency of fluctuations throughout the bolt. Lower this to remove jittery-looking lightning
self.AnimationSpeed = 7 --Governs how fast the bolt oscillates (i.e. how fast the fluctuating wave travels along bolt)
self.Thickness = 1 --The thickness of the bolt
self.MinThicknessMultiplier, self.MaxThicknessMultiplier = 0.2, 1 --Multiplies Thickness value by a fluctuating random value between MinThicknessMultiplier and MaxThicknessMultiplier along the Bolt
--Bolt Kinetic Properties--
--Allows for fading in (or out) of the bolt with time. Can also create a "projectile" bolt
--Recommend setting AnimationSpeed to 0 if used as projectile (for better aesthetics)
--Works by passing a "wave" function which travels from left to right where the wave height represents opacity (opacity being 1 - Transparency)
--See https://www.desmos.com/calculator/hg5h4fpfim to help customise the shape of the wave with the below properties
self.MinTransparency, self.MaxTransparency = 0, 1 --See https://www.desmos.com/calculator/hg5h4fpfim
self.PulseSpeed = 2 --Bolt arrives at Attachment1 1/PulseSpeed seconds later. See https://www.desmos.com/calculator/hg5h4fpfim
self.PulseLength = 1000000 --See https://www.desmos.com/calculator/hg5h4fpfim
self.FadeLength = 0.2 --See https://www.desmos.com/calculator/hg5h4fpfim
self.ContractFrom = 0.5 --Parts shorten or grow once their Transparency exceeds this value. Set to a value above 1 to turn effect off. See https://imgur.com/OChA441
--Bolt Color Properties--
self.Color = Color3.new(1, 1, 1) --Can be a Color3 or ColorSequence
self.ColorOffsetSpeed = 3 --Sets speed at which ColorSequence travels along Bolt
--
self.Parts = {} --The BoltParts which make up the Bolt
local a0, a1 = Attachment0, Attachment1
local parent = workspace.CurrentCamera
local p0, p1, p2, p3 = a0.WorldPosition, a0.WorldPosition + a0.WorldAxis*self.CurveSize0, a1.WorldPosition - a1.WorldAxis*self.CurveSize1, a1.WorldPosition
local PrevPoint, bezier0 = p0, p0
local MainBranchN = PartCount or 30
for i = 1, MainBranchN do
local t1 = i/MainBranchN
local bezier1 = CubicBezier(p0, p1, p2, p3, t1)
local NextPoint = i ~= MainBranchN and (CFrame.lookAt(bezier0, bezier1)).Position or bezier1
local BPart = BoltPart:Clone()
BPart.Size = Vector3.new((NextPoint - PrevPoint).Magnitude, 0, 0)
BPart.CFrame = CFrame.lookAt(0.5*(PrevPoint + NextPoint), NextPoint)*xInverse
BPart.Parent = parent
BPart.Locked, BPart.CastShadow = true, false
self.Parts[i] = BPart
PrevPoint, bezier0 = NextPoint, bezier1
end
self.PartsHidden = false
self.DisabledTransparency = 1
self.StartT = clock()
self.RanNum = math.random()*100
self.RefIndex = #ActiveBranches + 1
ActiveBranches[self.RefIndex] = self
return self
end
function LightningBolt:Destroy()
ActiveBranches[self.RefIndex] = nil
for i = 1, #self.Parts do
self.Parts[i]:Destroy()
if i%100 == 0 then wait() end
end
self = nil
end
local offsetAngle = math.cos(math.rad(90))
game:GetService("RunService").Heartbeat:Connect(function ()
for _, ThisBranch in pairs(ActiveBranches) do
if ThisBranch.Enabled == true then
ThisBranch.PartsHidden = false
local MinOpa, MaxOpa = 1 - ThisBranch.MaxTransparency, 1 - ThisBranch.MinTransparency
local MinRadius, MaxRadius = ThisBranch.MinRadius, ThisBranch.MaxRadius
local thickness = ThisBranch.Thickness
local Parts = ThisBranch.Parts
local PartsN = #Parts
local RanNum = ThisBranch.RanNum
local StartT = ThisBranch.StartT
local spd = ThisBranch.AnimationSpeed
local freq = ThisBranch.Frequency
local MinThick, MaxThick = ThisBranch.MinThicknessMultiplier, ThisBranch.MaxThicknessMultiplier
local a0, a1, CurveSize0, CurveSize1 = ThisBranch.Attachment0, ThisBranch.Attachment1, ThisBranch.CurveSize0, ThisBranch.CurveSize1
local p0, p1, p2, p3 = a0.WorldPosition, a0.WorldPosition + a0.WorldAxis*CurveSize0, a1.WorldPosition - a1.WorldAxis*CurveSize1, a1.WorldPosition
local timePassed = clock() - StartT
local PulseLength, PulseSpeed, FadeLength = ThisBranch.PulseLength, ThisBranch.PulseSpeed, ThisBranch.FadeLength
local Color = ThisBranch.Color
local ColorOffsetSpeed = ThisBranch.ColorOffsetSpeed
local contractf = 1 - ThisBranch.ContractFrom
local PrevPoint, bezier0 = p0, p0
if timePassed < (PulseLength + 1) / PulseSpeed then
for i = 1, PartsN do
--local spd = NoiseBetween(i/PartsN, 1.5, 0.1*i/PartsN, -MinAnimationSpeed, MaxAnimationSpeed) --Can enable to have an alternative animation which doesn't shift the noisy lightning "Texture" along the bolt
local BPart = Parts[i]
local t1 = i/PartsN
local Opacity = DiscretePulse(t1, PulseSpeed, PulseLength, FadeLength, timePassed, MinOpa, MaxOpa)
local bezier1 = CubicBezier(p0, p1, p2, p3, t1)
local time = -timePassed --minus to ensure bolt waves travel from a0 to a1
local input, input2 = (spd*time) + freq*10*t1 - 0.2 + RanNum*4, 5*((spd*0.01*time) / 10 + freq*t1) + RanNum*4
local noise0 = NoiseBetween(5*input, 1.5, 5*0.2*input2, 0, 0.1*2*math.pi) + NoiseBetween(0.5*input, 1.5, 0.5*0.2*input2, 0, 0.9*2*math.pi)
local noise1 = NoiseBetween(3.4, input2, input, MinRadius, MaxRadius)*math.exp(-5000*(t1 - 0.5)^10)
local thicknessNoise = NoiseBetween(2.3, input2, input, MinThick, MaxThick)
local NextPoint = i ~= PartsN and (CFrame.new(bezier0, bezier1)*CFrame.Angles(0, 0, noise0)*CFrame.Angles(math.acos(math.clamp(NoiseBetween(input2, input, 2.7, offsetAngle, 1), -1, 1)), 0, 0)*CFrame.new(0, 0, -noise1)).Position or bezier1
if Opacity > contractf then
BPart.Size = Vector3.new((NextPoint - PrevPoint).Magnitude, thickness*thicknessNoise*Opacity, thickness*thicknessNoise*Opacity)
BPart.CFrame = CFrame.lookAt(0.5*(PrevPoint + NextPoint), NextPoint)*xInverse
BPart.Transparency = 1 - Opacity
elseif Opacity > contractf - 1/(PartsN*FadeLength) then
local interp = (1 - (Opacity - (contractf - 1/(PartsN*FadeLength)))*PartsN*FadeLength)*(t1 < timePassed*PulseSpeed - 0.5*PulseLength and 1 or -1)
BPart.Size = Vector3.new((1 - math.abs(interp))*(NextPoint - PrevPoint).Magnitude, thickness*thicknessNoise*Opacity, thickness*thicknessNoise*Opacity)
BPart.CFrame = CFrame.lookAt(PrevPoint + (NextPoint - PrevPoint)*(math.max(0, interp) + 0.5*(1 - math.abs(interp))), NextPoint)*xInverse
BPart.Transparency = 1 - Opacity
else
BPart.Transparency = 1
end
if typeof(Color) == "Color3" then
BPart.Color = Color
else --ColorSequence
t1 = (RanNum + t1 - timePassed*ColorOffsetSpeed)%1
local keypoints = Color.Keypoints
for i = 1, #keypoints - 1 do --convert colorsequence onto lightning
if keypoints[i].Time < t1 and t1 < keypoints[i+1].Time then
BPart.Color = keypoints[i].Value:lerp(keypoints[i+1].Value, (t1 - keypoints[i].Time)/(keypoints[i+1].Time - keypoints[i].Time))
break
end
end
end
PrevPoint, bezier0 = NextPoint, bezier1
end
else
ThisBranch:Destroy()
end
else --Enabled = false
if ThisBranch.PartsHidden == false then
ThisBranch.PartsHidden = true
local datr = ThisBranch.DisabledTransparency
for i = 1, #ThisBranch.Parts do
ThisBranch.Parts[i].Transparency = datr
end
end
end
end
end)
return LightningBolt
|
--Script:
|
Button.Activated:Connect(function()
MarketplaceService:PromptProductPurchase(Player, DevProduct.Value)
end)
|
--[[ @brief Performs an operation on heartbeat based on a condition.
@param callback The callback function for each heartbeat step.
@param condition The condition we should check before running callback.
@param yield Whether this function should yield or return immediately.
--]]
|
function AnimateLib.ConditionalOnHeartbeat(callback, condition, yield, callbackOnComplete)
local cxn;
local event = Utils.new("Event");
local startTime = tick();
cxn = game:GetService("RunService").Heartbeat:connect(function(step)
if condition() then
callback(step, tick() - startTime)
else
cxn:disconnect();
event:Fire();
if callbackOnComplete then
callbackOnComplete();
end
end
end);
if yield then
event:wait();
end
end
|
--------------------------------------------------------------------------------------------------
|
On = false
Check = false
function check(Char)
Player = game.Players:FindFirstChild(Char.Name)
if Player ~= nil then
if Group == true then
if Player:IsInGroup(GroupId) == true then
Check = true
end
end
if Friends == true then
if Player:IsFriendsWith(game.CreatorId) == true then
Check = true
end
end
if Bestfriends == true then
if Player:IsBestFriendsWith(game.CreatorId) == true then
Check = true
end
end
if PeopleOn == true then
for i = 1,#People do
if People[i].Name == Player.Name then
Check = true
end
end
end
if Tshirt == true then
if Char:FindFirstChild("Torso") ~= nil and Char.Torso:FindFirstChild("roblox") ~= nil then
if Char.Torso.roblox.Texture == "http://www.roblox.com/asset/?id="..tostring(TTexture) then
Check = true
end
end
end
if Player.userId == game.CreatorId then
Check = true
end
if Pants == true then
if Char:FindFirstChild("Pants") ~= nil then
if Char.Pants.PantsTemplate == "http://www.roblox.com/asset/?id="..tostring(PTexture) then
Check = true
end
end
end
if Shirt == true then
if Char:FindFirstChild("Shirt") ~= nil then
if Char.Shirt.ShirtTemplate == "http://www.roblox.com/asset/?id="..tostring(STexture) then
Check = true
end
end
end
if BC == true then
if Player.MembershipType == "BuildersClub" then
Check = true
end
end
if Veterans == true then
if Player.AccountAge == 365 then
Check = true
end
end
end
end
function open(hit)
if On == false then
On = true
Player = game.Players:FindFirstChild(hit.Parent.Name)
if Player ~= nil then
Orig = script.Parent.Transparency
script.Parent.Transparency = OpenTransparency
script.Parent.CanCollide = false
wait(OpenTime)
script.Parent.CanCollide = true
script.Parent.Transparency = Orig
On = false
end
end
end
function kill(hit)
if hit.Parent ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= nil then
Player = game.Players:FindFirstChild(hit.Parent.Name)
if Player ~= nil then
if Player:IsInGroup(GroupId) == false then
hit.Parent:BreakJoints()
end
end
end
end
function knock(hit)
if hit.Parent ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent:FindFirstChild("Torso") ~= nil then
Player = game.Players:FindFirstChild(hit.Parent.Name)
if Player ~= nil then
if Player:IsInGroup(GroupId) == false then
hit.Parent.Torso.RotVelocity = Vector3.new(50, -230, 50)
end
end
end
end
function ontouched(hit)
print("On")
if hit.Parent ~= nil and hit.Parent:FindFirstChild("Humanoid") ~= nil then
print("On")
check(hit.Parent)
if Check == true then
open(hit)
elseif Check == false then
if Killing == true then
kill(hit)
end
if Knockback == true then
knock(hit)
end
end
Check = false
end
end
script.Parent.Touched:connect(ontouched)
|
-- Welcome to the variable museum:
|
local player = script.Parent.Parent.Parent
local plane,mainParts,info,main,move,gryo,seat,accel,canCrash,crashForce,crashSpin,crashVisual,maxBank,maxSpeed,speedVary,stallSpeed,throttleInc,altRestrict,altMin,altMax,altSet
local desiredSpeed,currentSpeed,realSpeed = 0,0,0
local mouseSave
local gearParts = {}
local flying,on,dead,gear,throttle = false,false,false,true,0
local gui = script.Parent.Parent.Plane
local panel = script.Parent.Panel
local lowestPoint = 0
local A = math.abs -- Creating a shortcut for the function
local keys = {
engine={key};
spdup={byte=0;down=false};
spddwn={byte=0;down=false};
}
function gears()
if script.Parent.Plane.Value.Animations.Value.Gears.Value.Value == true then
panel.Gear.Value.Text = "On"
else if script.Parent.Plane.Value.Animations.Value.Gears.Value.Value == false then
panel.Gear.Value.Text = "Off"
end
end
end
function flaps()
panel.Flaps.Value.Text = script.Parent.Plane.Value.Animations.Value.Flaps.Value.Value
end
function rthrust()
if script.Parent.Plane.Value.Animations.Value.RThrust.Value.Value == true then
panel.RThrust.Value.Text = "On"
else if script.Parent.Plane.Value.Animations.Value.RThrust.Value.Value == false then
panel.RThrust.Value.Text = "Off"
end
end
end
function spoilers()
if script.Parent.Plane.Value.Animations.Value.Spoilers.Value.Value == true then
panel.Spoilers.Value.Text = "On"
else if script.Parent.Plane.Value.Animations.Value.Spoilers.Value.Value == false then
panel.Spoilers.Value.Text = "Off"
end
end
end
function freeze()
if script.Parent.Plane.Value.MainParts.Main.Anchored == true then
panel.Frozen.Value.Text = "On"
else if script.Parent.Plane.Value.MainParts.Main.Anchored == false then
panel.Frozen.Value.Text = "Off"
end
end
end
function engine()
if script.Parent.Plane.Value.MainParts.Main.Engine.Value == true then
script.Parent.Panel.Engines.BackgroundColor3 = Color3.new(85/255, 255/255, 0)
script.Parent.Panel.Engines.BorderColor3 = Color3.new(0, 85/255, 0)
on = (not on)
end
end
script.Parent.Plane.Value.Animations.Value.Gears.Value.Changed:connect(gears)
script.Parent.Plane.Value.Animations.Value.Flaps.Value.Changed:connect(flaps)
script.Parent.Plane.Value.Animations.Value.RThrust.Value.Changed:connect(rthrust)
script.Parent.Plane.Value.Animations.Value.Spoilers.Value.Changed:connect(spoilers)
script.Parent.Plane.Value.MainParts.Main.Changed:connect(freeze)
function waitFor(parent,array) -- Backup system to wait for objects to 'load'
if (array) then
for _,name in pairs(array) do
while (not parent:findFirstChild(name)) do wait() end -- If the object is found right away, no time will be spent waiting. That's why 'while' loops work better than 'repeat' in this case
end
elseif (parent:IsA("ObjectValue")) then
while (not parent.Value) do wait() end
end
end
function fixVars() -- Correct your mistakes to make sure the plane still flies correctly!
maxBank = (maxBank < -90 and -90 or maxBank > 90 and 90 or maxBank)
throttleInc = (throttleInc < 0.01 and 0.01 or throttleInc > 1 and 1 or throttleInc)
stallSpeed = (stallSpeed > maxSpeed and maxSpeed or stallSpeed)
accel = (accel < 0.01 and 0.01 or accel > maxSpeed and maxSpeed or accel)
altMax = ((altMax-100) < altMin and (altMin+100) or altMax)
altMax = (altSet and (altMax+main.Position.y) or altMax)
altMin = (altSet and (altMin+main.Position.y) or altMin)
keys.engine.key = (keys.engine.key == "" and "e" or keys.engine.key)
keys.spdup.byte = (keys.spdup.byte == 0 and 17 or keys.spdup.byte)
keys.spddwn.byte = (keys.spddwn.byte == 0 and 18 or keys.spddwn.byte)
end
function getVars() -- Since this plane kit is supposed to make you avoid scripting altogether, I have to go the extra mile and write a messy function to account for all those object variables
plane = script.Parent.Plane.Value
waitFor(plane,{"MainParts","OtherParts","EDIT_THESE","Dead"})
mainParts = plane.MainParts
info = plane.EDIT_THESE
waitFor(mainParts,{"Main","MainSeat"})
main = mainParts.Main
seat = mainParts.MainSeat
waitFor(main,{"Move","Gyro"})
move = main.Move
gyro = main.Gyro
accel,canCrash,crashForce,crashSpin,crashVisual,maxBank,maxSpeed,speedVary,stallSpeed,throttleInc,altRestrict,altMin,altMax,altSet = -- Quickest way to assign tons of variables
A(info.Acceleration.Value),info.CanCrash.Value,A(info.CanCrash.Force.Value),info.CanCrash.SpinSpeed.Value,info.CanCrash.VisualFX.Value,
info.MaxBank.Value,A(info.MaxSpeed.Value),A(info.SpeedDifferential.Value),A(info.StallSpeed.Value),A(info.ThrottleIncrease.Value),
info.AltitudeRestrictions.Value,info.AltitudeRestrictions.MinAltitude.Value,info.AltitudeRestrictions.MaxAltitude.Value,info.AltitudeRestrictions.SetByOrigin.Value
keys.engine.key = info.Hotkeys.Engine.Value:gmatch("%a")():lower()
local sU,sD = info.Hotkeys.SpeedUp.Value:lower(),info.Hotkeys.SpeedDown.Value:lower()
keys.spdup.byte = (sU == "arrowkeyup" and 17 or sU == "arrowkeydown" and 18 or sU:gmatch("%a")():byte()) -- Ternary operations use logical figures to avoid 'if' statements
keys.spddwn.byte = (sD == "arrowkeyup" and 17 or sD == "arrowkeydown" and 18 or sD:gmatch("%a")():byte())
fixVars()
plane.Dead.Changed:connect(function()
if ((plane.Dead.Value) and (not dead)) then -- DIE!
dead,flying,on = true,false,false
main.Fire.Enabled,main.Smoke.Enabled = info.CanCrash.VisualFX.Value,info.CanCrash.VisualFX.Value
move.maxForce = Vector3.new(0,0,0)
gyro.D = 1e3
while (not plane.Dead.Stop.Value) do
gyro.cframe = (gyro.cframe*CFrame.Angles(0,0,math.rad(crashSpin)))
wait()
end
end
end)
end
function getLowestPoint() -- Plane will use LowestPoint to determine where to look to make sure the plane is either flying or on the ground
if (#gearParts == 0) then
lowestPoint = (main.Position.y+5+(main.Size.y/2))
return
end
for _,v in pairs(gearParts) do -- Not very efficient, but it basically does what I designed it to do:
local _0 = (main.Position.y-(v.CFrame*CFrame.new((v.Size.x/2),0,0)).y)
local _1 = (main.Position.y-(v.CFrame*CFrame.new(-(v.Size.x/2),0,0)).y)
local _2 = (main.Position.y-(v.CFrame*CFrame.new(0,(v.Size.y/2),0)).y)
local _3 = (main.Position.y-(v.CFrame*CFrame.new(0,-(v.Size.y/2),0)).y)
local _4 = (main.Position.y-(v.CFrame*CFrame.new(0,0,(v.Size.z/2))).y)
local _5 = (main.Position.y-(v.CFrame*CFrame.new(0,0,-(v.Size.z/2))).y)
local n = (math.max(_0,_1,_2,_3,_4,_5)+5)
lowestPoint = (n > lowestPoint and n or lowestPoint)
end
end
function guiSetup() -- Setting up the GUI buttons and such
local cur = 0
gears()
flaps()
rthrust()
spoilers()
freeze()
engine()
end
getVars()
getLowestPoint()
guiSetup()
script.Parent.Name = "Plane"
function updateGui(taxiing,stalling)
panel.Title.Text = info.PlaneName.Value
panel.StallSpeed.Value.Text = info.StallSpeed.Value
panel.Stall.Visible = (not taxiing and stalling)
if ((realSpeed > -10000) and (realSpeed < 10000)) then
panel.Speed.Value.Text = tostring(math.floor(realSpeed+0.5))
main.Speed.Value = tostring(math.floor(realSpeed+0.5))
end
panel.Altitude.Value.Text = tostring(math.floor(main.Position.y+0.5))
main.Altitude.Value = tostring(math.floor(main.Position.y+0.5))
panel.Throttle.Bar.Amount.Size = UDim2.new(throttle,0,1,0)
end
function taxi() -- Check to see if the plane is on the ground or not
return (currentSpeed <= stallSpeed and game.Workspace:findPartOnRay(Ray.new(main.Position,Vector3.new(0,-lowestPoint,0)),plane)) -- Make sure plane is on a surface
end
function stall() -- Originally set as a giant ternary operation, but got WAY too complex, so I decided to break it down for my own sanity
if ((altRestrict) and (main.Position.y > altMax)) then return true end
local diff = ((realSpeed-stallSpeed)/200)
diff = (diff > 0.9 and 0.9 or diff)
local check = { -- Table placed here so I could easily add new 'checks' at ease. If anything in this table is 'true,' then the plane will be considered to be taxiing
(currentSpeed <= stallSpeed);
(main.CFrame.lookVector.y > (realSpeed < stallSpeed and -1 or -diff));
}
for _,c in pairs(check) do
if (not c) then return false end
end
return true
end
function fly(m) -- Main function that controls all of the flying stuff. Very messy.
flying = true
local pos,t = main.Position,time()
local lastStall = false
while ((flying) and (not dead)) do
realSpeed = ((pos-main.Position).magnitude/(time()-t)) -- Calculate "real" speed
pos,t = main.Position,time()
local max = (maxSpeed+(-main.CFrame.lookVector.y*speedVary)) -- Speed variety based on the pitch of the aircraft
desiredSpeed = (max*(on and throttle or 0)) -- Find speed based on throttle
local change = (desiredSpeed > currentSpeed and 1 or -1) -- Decide between accelerating or decelerating
currentSpeed = (currentSpeed+(accel*change)) -- Calculate new speed
|
------------------------------------------------------------------------
-- parse a for loop body for both versions of the for loop
-- * used in fornum(), forlist()
------------------------------------------------------------------------
|
function luaY:forbody(ls, base, line, nvars, isnum)
-- forbody -> DO block
local bl = {} -- BlockCnt
local fs = ls.fs
self:adjustlocalvars(ls, 3) -- control variables
self:checknext(ls, "TK_DO")
local prep = isnum and luaK:codeAsBx(fs, "OP_FORPREP", base, luaK.NO_JUMP)
or luaK:jump(fs)
self:enterblock(fs, bl, false) -- scope for declared variables
self:adjustlocalvars(ls, nvars)
luaK:reserveregs(fs, nvars)
self:block(ls)
self:leaveblock(fs) -- end of scope for declared variables
luaK:patchtohere(fs, prep)
local endfor = isnum and luaK:codeAsBx(fs, "OP_FORLOOP", base, luaK.NO_JUMP)
or luaK:codeABC(fs, "OP_TFORLOOP", base, 0, nvars)
luaK:fixline(fs, line) -- pretend that `OP_FOR' starts the loop
luaK:patchlist(fs, isnum and endfor or luaK:jump(fs), prep + 1)
end
|
--[[
INSTALL INSTRUCTIONS:
Firstly, place this script inside of ServerScriptService.
Secondly, move modules and features that you don't care for into the DeactivatedModules folder, and if any modules in there are ones you would
like, just drop them into Modules!
Configuration for each module should be stored in a configuration folder inside of the module, or in a module script named "Configuration."
raidRoleplay is meant to be modular, so read the documentation and write your own code, or simply install modules created by others into the
"Modules" folder.
Finally, global configuration for rank ID and such should be in the Configuration folder attached to this script.
With love,
r_aidmaster
--]]
|
require(script:WaitForChild("Assets"):WaitForChild("Loader")).Main() -- Here we go!
|
--This script exists to let you add armor to mobs and also, to auto re-equip armor on respawn.
|
function ArmorModule.GetLevel(armor)
if game.ReplicatedStorage.ARMORS:FindFirstChild(armor) ~= nil then
return game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Level.Value
else
return 0 --If it's not found, returns 0.
end
end
function ArmorModule.GetDefense(armor)
if game.ReplicatedStorage.ARMORS:FindFirstChild(armor) ~= nil then
if game.Workspace.GAME_PROPERTIES.DefenseMode.Value == 1 or game.Workspace.GAME_PROPERTIES.DefenseMode.Value == 2 then
return game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Defense.Value
elseif game.Workspace.GAME_PROPERTIES.DefenseMode.Value == 3 then
return game.ReplicatedStorage.ARMORS:FindFirstChild(armor).HPBoost.Value
else
return 0
end
else
return 0 --If the armor is not found, returns 0.
end
end
function ArmorModule.RemoveArmor(character)
local humanoid = character:FindFirstChild("Humanoid") or character:FindFirstChild("Human")
--Remove old armour.
if humanoid ~= nil then
if character:FindFirstChild("Arm1") ~= nil then
character:FindFirstChild("Arm1"):Remove()
end
if character:FindFirstChild("Arm2") ~= nil then
character:FindFirstChild("Arm2"):Remove()
end
if character:FindFirstChild("Leg1") ~= nil then
character:FindFirstChild("Leg1"):Remove()
end
if character:FindFirstChild("Leg2") ~= nil then
character:FindFirstChild("Leg2"):Remove()
end
if character:FindFirstChild("Chest") ~= nil then
character:FindFirstChild("Chest"):Remove()
end
else
return false --Exits the function if it's nil. Prevents the function from breaking.
end
end
function ArmorModule.EquipArmor(character, armor)
local humanoid = character:FindFirstChild("Humanoid") or character:FindFirstChild("Human")
if character ~= nil then
--Remove old armour.
if humanoid ~= nil then
if character:FindFirstChild("Arm1") ~= nil then
character:FindFirstChild("Arm1"):Remove()
end
if character:FindFirstChild("Arm2") ~= nil then
character:FindFirstChild("Arm2"):Remove()
end
if character:FindFirstChild("Leg1") ~= nil then
character:FindFirstChild("Leg1"):Remove()
end
if character:FindFirstChild("Leg2") ~= nil then
character:FindFirstChild("Leg2"):Remove()
end
if character:FindFirstChild("Chest") ~= nil then
character:FindFirstChild("Chest"):Remove()
end
end
else
return false --Exits the function if it's nil. Prevents the function from breaking.
end
--Arms
if humanoid ~= nil and character:FindFirstChild("Arm1") == nil then
local g = game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Arm1:Clone()
g.Parent = character
local C = g:GetChildren()
for i=1, #C do
if C[i].ClassName == "Part" then
if C[i].Name == "Middle" then
C[i].Transparency = 1
end
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = character["Left Arm"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
if humanoid ~= nil and character:FindFirstChild("Arm2") == nil then
local g = game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Arm2:Clone()
g.Parent = character
local C = g:GetChildren()
for i=1, #C do
if C[i].ClassName == "Part" then
if C[i].Name == "Middle" then
C[i].Transparency = 1
end
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = character["Right Arm"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
--Legs
if humanoid ~= nil and character:FindFirstChild("Leg1") == nil then
local g = game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Leg1:Clone()
g.Parent = character
local C = g:GetChildren()
for i=1, #C do
if C[i].ClassName == "Part" then
if C[i].Name == "Middle" then
C[i].Transparency = 1
end
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = character["Left Leg"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
if humanoid ~= nil and character:FindFirstChild("Leg2") == nil then
local g = game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Leg2:Clone()
g.Parent = character
local C = g:GetChildren()
for i=1, #C do
if C[i].ClassName == "Part" then
if C[i].Name == "Middle" then
C[i].Transparency = 1
end
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = character["Right Leg"]
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
--Torso
if humanoid ~= nil and character:FindFirstChild("Chest") == nil then
local g = game.ReplicatedStorage.ARMORS:FindFirstChild(armor).Chest:Clone()
g.Parent = character
local C = g:GetChildren()
for i=1, #C do
if C[i].ClassName == "Part" then
if C[i].Name == "Middle" then
C[i].Transparency = 1
end
local W = Instance.new("Weld")
W.Part0 = g.Middle
W.Part1 = C[i]
local CJ = CFrame.new(g.Middle.Position)
local C0 = g.Middle.CFrame:inverse()*CJ
local C1 = C[i].CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = g.Middle
end
local Y = Instance.new("Weld")
Y.Part0 = character.Torso
Y.Part1 = g.Middle
Y.C0 = CFrame.new(0, 0, 0)
Y.Parent = Y.Part0
end
local h = g:GetChildren()
for i = 1, # h do
h[i].Anchored = false
h[i].CanCollide = false
end
end
end
return ArmorModule
|
--[[ The Module ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local DynamicThumbstick = setmetatable({}, BaseCharacterController)
DynamicThumbstick.__index = DynamicThumbstick
function DynamicThumbstick.new()
local self = setmetatable(BaseCharacterController.new() :: any, DynamicThumbstick)
self.moveTouchObject = nil
self.moveTouchLockedIn = false
self.moveTouchFirstChanged = false
self.moveTouchStartPosition = nil
self.startImage = nil
self.endImage = nil
self.middleImages = {}
self.startImageFadeTween = nil
self.endImageFadeTween = nil
self.middleImageFadeTweens = {}
self.isFirstTouch = true
self.thumbstickFrame = nil
self.onRenderSteppedConn = nil
self.fadeInAndOutBalance = FADE_IN_OUT_BALANCE_DEFAULT
self.fadeInAndOutHalfDuration = FADE_IN_OUT_HALF_DURATION_DEFAULT
self.hasFadedBackgroundInPortrait = false
self.hasFadedBackgroundInLandscape = false
self.tweenInAlphaStart = nil
self.tweenOutAlphaStart = nil
return self
end
|
-- Options
|
local USE_CUSTOM_TIME = false
local USE_MILITARY_TIME = false
|
---[[ Fade Out and In Settings ]]
|
module.ChatWindowBackgroundFadeOutTime = 0.5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 30 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 20.0
|
--Both
|
local Loudness = .75 --volume of the boost supplier (not exact volume so you kinda have to experiment with it also)
script:WaitForChild("Whistle")
script:WaitForChild("Whine")
script:WaitForChild("BOV")
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
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
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
end
end)
handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","Whine",car.DriveSeat,script.Whine.SoundId,0,script.Whine.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
handler:FireServer("playSound","Whine")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("Whine")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = 0
if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Super" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end
while wait() do
local psi = (((script.Parent.Values.Boost.Value)/(_Tune.Boost*_TCount))*2)
local WP,WV,BP,BV,HP,HV = nil
BOVact = math.floor(psi*20)
if _Tune.Aspiration == "Single" or _Tune.Aspiration == "Double" then
WP = (psi)
WV = (psi/4)*Loudness
BP = (1-(-psi/20))*BOV_Pitch
BV = (((-0.5+((psi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))
if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
elseif _Tune.Aspiration == "Super" then
psi = psi/2
HP = psi*Whine_Pitch
HV = (psi/4)*Loudness
end
if FE then
handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
handler:FireServer("updateSound","Whine",script.Whine.SoundId,HP,HV)
handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
else
car.DriveSeat.Whistle.Pitch = WP
car.DriveSeat.Whistle.Volume = WV
car.DriveSeat.Whine.Pitch = HP
car.DriveSeat.Whine.Volume = HV
car.DriveSeat.BOV.Pitch = BP
car.DriveSeat.BOV.Volume = BV
end
if (tick()-ticc) >= 0.1 then
BOVact2 = math.floor(psi*20)
ticc = tick()
end
end
|
--------LEFT DOOR --------
|
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(194)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(194)
|
--[=[
Catches an error, and allows another observable to be subscribed
in terms of handling the error.
:::warning
This method is not yet tested
:::
@param callback (error: TError) -> Observable<TErrorResult>
@return (source: Observable<T>) -> Observable<T | TErrorResult>
]=]
|
function Rx.catchError(callback)
assert(type(callback) == "function", "Bad callback")
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local maid = Maid.new()
-- Yikes, let's hope event ordering is good
local alive = true
maid:GiveTask(function()
alive = false
end)
maid:GiveTask(source:Subscribe(
function(...)
sub:Fire(...)
end,
function(...)
if not alive then
-- if we failed because maid was cancelled, then we'll get called here?
-- I think.
return
end
-- at this point, we can only have one error, so we need to subscribe to the result
-- and continue the observiable
local observable = callback(...)
assert(Observable.isObservable(observable), "Bad observable")
maid:GiveTask(observable:Subscribe(sub:GetFireFailComplete()))
end,
function()
sub:Complete()
end));
return maid
end)
end
end
|
-- Other
|
local indicator = Instance.new("ImageLabel")
indicator.Name = "Indicator"
indicator.BackgroundTransparency = 1
indicator.Image = "rbxassetid://5278151556"
indicator.Size = UDim2.new(0,32,0,32)
indicator.AnchorPoint = Vector2.new(0.5,0)
indicator.Position = UDim2.new(0.5,0,0,5)
indicator.ScaleType = Enum.ScaleType.Fit
indicator.Visible = false
indicator.Active = true
indicator.Parent = topbarPlusGui
indicator.Active = false
|
-- Local private variables and constants
|
local UNIT_Z = Vector3.new(0,0,1)
local X1_Y0_Z1 = Vector3.new(1,0,1) --Note: not a unit vector, used for projecting onto XZ plane
local ZERO_VECTOR3 = Vector3.new(0,0,0)
local TAU = 2 * math.pi
|
-- Replacements for RootCamera:RotateCamera() which did not actually rotate the camera
-- suppliedLookVector is not normally passed in, it's used only by Watch camera
|
function BaseCamera:CalculateNewLookCFrame(suppliedLookVector)
local currLookVector = suppliedLookVector or self:GetCameraLookVector()
local currPitchAngle = math.asin(currLookVector.y)
local yTheta = math.clamp(self.rotateInput.y, -MAX_Y + currPitchAngle, -MIN_Y + currPitchAngle)
local constrainedRotateInput = Vector2.new(self.rotateInput.x, yTheta)
local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
local newLookCFrame = CFrame.Angles(0, -constrainedRotateInput.x, 0) * startCFrame * CFrame.Angles(-constrainedRotateInput.y,0,0)
return newLookCFrame
end
function BaseCamera:CalculateNewLookVector(suppliedLookVector)
local newLookCFrame = self:CalculateNewLookCFrame(suppliedLookVector)
return newLookCFrame.lookVector
end
function BaseCamera:CalculateNewLookVectorVR()
local subjectPosition = self:GetSubjectPosition()
local vecToSubject = (subjectPosition - game.Workspace.CurrentCamera.CFrame.p)
local currLookVector = (vecToSubject * X1_Y0_Z1).unit
local vrRotateInput = Vector2.new(self.rotateInput.x, 0)
local startCFrame = CFrame.new(ZERO_VECTOR3, currLookVector)
local yawRotatedVector = (CFrame.Angles(0, -vrRotateInput.x, 0) * startCFrame * CFrame.Angles(-vrRotateInput.y,0,0)).lookVector
return (yawRotatedVector * X1_Y0_Z1).unit
end
function BaseCamera:GetHumanoid()
local character = player and player.Character
if character then
local resultHumanoid = self.humanoidCache[player]
if resultHumanoid and resultHumanoid.Parent == character then
return resultHumanoid
else
self.humanoidCache[player] = nil -- Bust Old Cache
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
self.humanoidCache[player] = humanoid
end
return humanoid
end
end
return nil
end
function BaseCamera:GetHumanoidPartToFollow(humanoid, humanoidStateType)
if humanoidStateType == Enum.HumanoidStateType.Dead then
local character = humanoid.Parent
if character then
return character:FindFirstChild("Head") or humanoid.Torso
else
return humanoid.Torso
end
else
return humanoid.Torso
end
end
function BaseCamera:UpdateGamepad()
local gamepadPan = self.gamepadPanningCamera
if gamepadPan and (self.hasGameLoaded or not VRService.VREnabled) then
gamepadPan = Util.GamepadLinearToCurve(gamepadPan)
local currentTime = tick()
if gamepadPan.X ~= 0 or gamepadPan.Y ~= 0 then
self.userPanningTheCamera = true
elseif gamepadPan == ZERO_VECTOR2 then
if FFlagUserFixGamepadCameraTracking then
self.userPanningTheCamera = false
self.gamepadPanningCamera = false
end
self.lastThumbstickRotate = nil
if self.lastThumbstickPos == ZERO_VECTOR2 then
self.currentSpeed = 0
end
end
local finalConstant = 0
if self.lastThumbstickRotate then
if VRService.VREnabled then
self.currentSpeed = self.vrMaxSpeed
else
local elapsedTime = (currentTime - self.lastThumbstickRotate) * 10
self.currentSpeed = self.currentSpeed + (self.maxSpeed * ((elapsedTime*elapsedTime)/self.numOfSeconds))
if self.currentSpeed > self.maxSpeed then self.currentSpeed = self.maxSpeed end
if self.lastVelocity then
local velocity = (gamepadPan - self.lastThumbstickPos)/(currentTime - self.lastThumbstickRotate)
local velocityDeltaMag = (velocity - self.lastVelocity).magnitude
if velocityDeltaMag > 12 then
self.currentSpeed = self.currentSpeed * (20/velocityDeltaMag)
if self.currentSpeed > self.maxSpeed then self.currentSpeed = self.maxSpeed end
end
end
end
finalConstant = UserGameSettings.GamepadCameraSensitivity * self.currentSpeed * self.gamepadSensitivity
self.lastVelocity = (gamepadPan - self.lastThumbstickPos)/(currentTime - self.lastThumbstickRotate)
end
self.lastThumbstickPos = gamepadPan
self.lastThumbstickRotate = currentTime
return Vector2.new( gamepadPan.X * finalConstant, gamepadPan.Y * finalConstant * self.ySensitivity * UserGameSettings:GetCameraYInvertValue())
end
return ZERO_VECTOR2
end
|
--!strict
|
local function endsWith(value: string, substring: string, optionalLength: number?): boolean
local substringLength = substring:len()
if substringLength == 0 then
return true
end
local valueLength = value:len()
local length = optionalLength or valueLength
if length > valueLength then
length = valueLength
end
if length < 1 then
return false
end
local position = length - substringLength + 1
return value:find(substring, position, true) == position
end
return endsWith
|
--Controls
|
local _CTRL = _Tune.Controls
local Controls = Instance.new("Folder",script.Parent)
Controls.Name = "Controls"
for i,v in pairs(_CTRL) do
local a=Instance.new("StringValue",Controls)
a.Name=i
a.Value=v.Name
a.Changed:connect(function()
if i=="MouseThrottle" or i=="MouseBrake" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
local a = Instance.new("IntValue",Controls)
a.Name = i
a.Value = v
a.Changed:connect(function()
a.Value=math.min(100,math.max(0,a.Value))
_PPH[i] = a.Value
end)
end
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --No texting while driving
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.max(_CGear-1,-1)
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and (_TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 and (_TMode=="Auto" or not _ClPressing) then _ClutchOn = true end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrClutch"] or (_MSteer and input.KeyCode==_CTRL["MouseClutch"]) or ((not _MSteer) and input.KeyCode==_CTRL["Clutch"])) and _TMode=="Manual" then
if input.UserInputState == Enum.UserInputState.Begin then
_ClutchOn = false
_ClPressing = true
elseif input.UserInputState == Enum.UserInputState.End then
_ClutchOn = true
_ClPressing = false
end
elseif _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or (_MSteer and input.KeyCode==_CTRL["MousePBrake"]) or ((not _MSteer) and input.KeyCode==_CTRL["PBrake"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then
_PBrake = false
end
end
elseif (input.KeyCode == _CTRL["ContlrToggleTMode"] or input.KeyCode==_CTRL["ToggleTransMode"]) and input.UserInputState == Enum.UserInputState.Begin then
local n=1
for i,v in pairs(_Tune.TransModes) do
if v==_TMode then n=i break end
end
n=n+1
if n>#_Tune.TransModes then n=1 end
_TMode = _Tune.TransModes[n]
elseif _IsOn and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or (input.UserInputType == _CTRL["MouseThrottle"] and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle
end
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or (input.UserInputType == _CTRL["MouseBrake"] and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then
_GSteerT = 1
else
_GSteerT = 0
end
_SteerL = false
end
elseif (not _MSteer) and (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then
_GSteerT = -1
else
_GSteerT = 0
end
_SteerR = false
end
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
elseif _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then
_TCS = not _TCS
end
end
if input.UserInputType.Name:find("Gamepad") then
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X-cDZone)/(1-cDZone)
else
_GSteerT = 0
end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then
_GSteerT = (input.Position.X+cDZone)/(1-cDZone)
else
_GSteerT = 0
end
end
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = math.max(_Tune.IdleThrottle,input.Position.Z)
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = _Tune.IdleThrottle
_GSteerT = 0
_GBrake = 0
if _CGear~=0 then _ClutchOn = true end
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
|
--[[
Model for an UserAsset
{
userAssetId = string,
userId = name,
userName = string,
serialNumber = optional string,
priceInRobux = optional int
}
]]
|
local Modules = game:GetService("Players").LocalPlayer.PlayerGui.AvatarEditorInGame.Modules
local MockId = require(Modules.NotLApp.MockId)
local UserAssetModel = {}
function UserAssetModel.mock()
local self = {}
self.userAssetId = tostring(MockId())
self.userId = tostring(MockId())
self.userName = ""
self.serialNumber = tostring(MockId())
self.priceInRobux = 0
return self
end
function UserAssetModel.fromSellPageAndResellers(newData)
local userAssetInfo = {}
userAssetInfo.userAssetId = tostring(newData.userAssetId)
if newData.seller then
userAssetInfo.userId = tostring(newData.seller.id)
userAssetInfo.userName = newData.seller.name
end
userAssetInfo.serialNumber = newData.serialNumber and tostring(newData.serialNumber) or nil
userAssetInfo.priceInRobux = newData.price
return userAssetInfo
end
function UserAssetModel.fromPriceInRobux(userAssetId, priceInRobux)
local userAssetInfo = {}
userAssetInfo.userAssetId = tostring(userAssetId)
userAssetInfo.priceInRobux = priceInRobux
return userAssetInfo
end
return UserAssetModel
|
--UserInput.MouseBehavior = Enum.MouseBehavior.LockCenter
|
function CameraModule.new(Position, Rotation, Sensitivity, move)
local Camera = {}
Camera.Position = Position
Camera.Rotation = Rotation
Camera.CFrame = CFrame.new(Position) * CFrame.Angles(math.rad(Rotation.X), math.rad(Rotation.Y), math.rad(Rotation.Z))
Camera.Target = Vector3.new(1,0,0)
Camera.PressedKey = nil
Camera.fpsController = {
direction = 0,
pitch = 0,
}
Camera.Sensitivity = Sensitivity
Mouse.KeyDown:Connect(function(key)
Camera.PressedKey = key
end)
Mouse.KeyUp:Connect(function()
Camera.PressedKey = nil
end)
function Camera:Movement()
local key = Camera.PressedKey
if key == "e" then
Camera.CFrame += Vector3.new(0,0.4,0)
elseif key == "q" then
Camera.CFrame -= Vector3.new(0,0.4,0)
elseif key == "w" then
Camera.CFrame += Vector3.new(0.4*math.cos(-Camera.Rotation.Y), 0, 0.4*math.sin(-Camera.Rotation.Y))
elseif key == "s" then
Camera.CFrame -= Vector3.new(0.4*math.cos(-Camera.Rotation.Y), 0, 0.4*math.sin(-Camera.Rotation.Y))
elseif key == "a" then
Camera.CFrame += Vector3.new(0.4*math.sin(-Camera.Rotation.Y), 0, -0.4*math.cos(-Camera.Rotation.Y))
elseif key == "d" then
Camera.CFrame += Vector3.new(-0.4*math.sin(-Camera.Rotation.Y), 0, 0.4*math.cos(-Camera.Rotation.Y))
end
task.synchronize()
Camera:Pan(UserInput:GetMouseDelta().X, UserInput:GetMouseDelta().Y)
task.desynchronize()
end
function Camera:Pan(dx, dy)
Camera.fpsController.direction = math.max(math.min(Camera.fpsController.direction - dy * Camera.Sensitivity, math.pi * 0.5), math.pi * -0.5)
Camera.fpsController.pitch = Camera.fpsController.pitch - dx * Camera.Sensitivity
local rotationCFrame = CFrame.Angles(0, Camera.fpsController.pitch, 0) * CFrame.Angles(Camera.fpsController.direction, 0, 0)
local positionCFrame = CFrame.new(Camera.CFrame.Position)
Camera.CFrame = positionCFrame * rotationCFrame
end
function Camera:Update()
Camera.Position = Camera.CFrame.Position
local xRotation, yRotation, _ = Camera.CFrame:ToOrientation()
Camera.Rotation = Vector3.new(xRotation, yRotation + math.rad(90), 0)
if move == true then
Camera:Movement()
end
end
return Camera
end
return CameraModule
|
--[[
Calls a Promise executor with error handling.
]]
|
local function runExecutor(traceback, callback, ...)
return packResult(xpcall(callback, makeErrorHandler(traceback), ...))
end
|
-- Create a new explosion at the location of our grenade
|
local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = 19
Explosion.BlastPressure = 2000
Explosion.DestroyJointRadiusPercent = 0
Explosion.Position = RootModel:GetPrimaryPartCFrame().Position
local parts = workspace:GetPartBoundsInRadius(Explosion.Position,Explosion.BlastRadius)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {
spacing = 8,
image = "rbxasset://textures/Cursors/Gamepad/Pointer.png",
imageSize = Vector2.new(2, 2)
};
local v2 = Instance.new("Model");
v2.Name = "PathDisplayPoints";
local v3 = Instance.new("Part");
v3.Anchored = true;
v3.CanCollide = false;
v3.Transparency = 1;
v3.Name = "PathDisplayAdornee";
v3.CFrame = CFrame.new(0, 0, 0);
v3.Parent = v2;
local v4 = {};
for v5 = 1, 30 do
local v6 = Instance.new("ImageHandleAdornment");
v6.Archivable = false;
v6.Adornee = v3;
v6.Image = v1.image;
v6.Size = v1.imageSize;
v4[v5] = v6;
end;
local u1 = 30;
local u2 = {};
function v1.setCurrentPoints(p1)
if typeof(p1) == "table" then
u2 = p1;
return;
end;
u2 = {};
end;
local u3 = {};
function v1.clearRenderedPath()
local v7, v8, v9 = ipairs(u3);
while true do
v7(v8, v9);
if not v7 then
break;
end;
v9 = v7;
v8.Parent = nil;
u1 = u1 + 1;
v4[u1] = v8;
end;
u3 = {};
v2.Parent = nil;
end;
local function u4(p2, p3)
if u1 == 0 then
return nil;
end;
local v10, v11, v12 = workspace:FindPartOnRayWithIgnoreList(Ray.new(p2 + Vector3.new(0, 2, 0), Vector3.new(0, -8, 0)), { game.Players.LocalPlayer.Character, workspace.CurrentCamera });
if not v10 then
return nil;
end;
local v13 = v4[1];
if not v13 then
local v14 = nil;
else
v4[1] = v4[u1];
v4[u1] = nil;
u1 = u1 - 1;
v14 = v13;
end;
v14.CFrame = CFrame.new(v11, v11 + v12);
v14.Parent = v2;
return v14;
end;
function v1.renderPath()
v1.clearRenderedPath();
if not u2 or #u2 == 0 then
return;
end;
local v15 = #u2;
local v16 = 0;
u3[1] = u4(u2[v15], true);
if not u3[1] then
return;
end;
while true do
local v17 = u2[v15];
if v15 < 2 then
break;
end;
local v18 = u2[v15 - 1] - v17;
local l__magnitude__19 = v18.magnitude;
if l__magnitude__19 < v16 then
v16 = v16 - l__magnitude__19;
v15 = v15 - 1;
else
local v20 = u4(v17 + v18.unit * v16, false);
if v20 then
u3[#u3 + 1] = v20;
end;
v16 = v16 + v1.spacing;
end;
end;
v2.Parent = workspace.CurrentCamera;
end;
return v1;
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 800 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 600 -- Use sliders to manipulate values
Tune.Redline = 670 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 550
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
-- Libraries
|
local Roact = require(Vendor:WaitForChild 'Roact')
local new = Roact.createElement
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Players = game:GetService("Players")
RunService = game:GetService("RunService")
Animations = {}
ServerControl = Tool:WaitForChild("ServerControl")
ClientControl = Tool:WaitForChild("ClientControl")
ToolEquipped = false
function SetAnimation(mode, value)
if not ToolEquipped or not CheckIfAlive() then
return
end
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
elseif mode == "StopAnimation" and value then
for i, v in pairs(Animations) do
if v.Animation == value.Animation then
v.AnimationTrack:Stop()
table.remove(Animations, i)
end
end
end
end
function CheckIfAlive()
return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
end
function Equipped(Mouse)
Character = Tool.Parent
Player = Players:GetPlayerFromCharacter(Character)
Humanoid = Character:FindFirstChild("Humanoid")
ToolEquipped = true
if not CheckIfAlive() then
return
end
PlayerMouse = Player:GetMouse()
Mouse.KeyDown:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = true})
end)
Mouse.KeyUp:connect(function(Key)
InvokeServer("KeyPress", {Key = Key, Down = false})
end)
end
function Unequipped()
ToolEquipped = false
for i, v in pairs(Animations) do
if v and v.AnimationTrack then
v.AnimationTrack:Stop()
end
end
Animations = {}
end
function InvokeServer(mode, value)
local ServerReturn
pcall(function()
ServerReturn = ServerControl:InvokeServer(mode, value)
end)
return ServerReturn
end
function OnClientInvoke(mode, value)
if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
SetAnimation("PlayAnimation", value)
elseif mode == "StopAnimation" and value then
SetAnimation("StopAnimation", value)
elseif mode == "PlaySound" and value then
value:Play()
elseif mode == "StopSound" and value then
value:Stop()
elseif mode == "MouseData" then
return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
end
end
ClientControl.OnClientInvoke = OnClientInvoke
Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
|
--[[
*
* Creates a server listening event
]]
|
local function createServerListener(id, ...)
local args = { ... }
local event
if isMiddlewareArgument(args) then
local _binding = args
local middleware = _binding[1]
local connect = _binding[2]
event = ServerEventV2.new(id, middleware)
return event:Connect(connect)
else
local _binding = args
local connect = _binding[1]
event = ServerEventV2.new(id)
return event:Connect(connect)
end
end
return {
default = createServerListener,
}
|
-- Events
|
ClientOrchestration.ClientSceneMetadataEvent = Orchestra.Events.ClientEvents.ClientSceneMetadata
ClientOrchestration.SendMediaControllerConfig = Orchestra.Events.MediaControllerConfigEvents.SendMediaControllerConfig
ClientOrchestration.Seek = Orchestra.Events.ClientEvents.Seek
ClientOrchestration.Pause = Orchestra.Events.ClientEvents.Pause
ClientOrchestration.SceneEnded = Orchestra.Events.ClientEvents.SceneEnded
ClientOrchestration.SeekPermissionsEvent = Orchestra.Events.ClientEvents.SeekPermissions
ClientOrchestration.SeekerGuiComponent = nil
ClientOrchestration.playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
ClientOrchestration.taskLib = task
ClientOrchestration._warn = function(msg)
warn(msg)
end
ClientOrchestration._require = function(file)
return require(file)
end
ClientOrchestration.handleSeekPermissionsEvent = function(hasPermission)
if hasPermission and not ClientOrchestration.SeekerGuiComponent then
local SeekerGuiElement = ClientOrchestration.Roact.createElement(ClientOrchestration.SeekerGui)
ClientOrchestration.SeekerGuiComponent = ClientOrchestration.Roact.mount(
SeekerGuiElement,
ClientOrchestration.playerGui,
"SceneSeeker"
)
end
if not hasPermission and ClientOrchestration.SeekerGuiComponent then
if ClientOrchestration.SeekerGuiComponent then
ClientOrchestration.Roact.unmount(ClientOrchestration.SeekerGuiComponent)
ClientOrchestration.SeekerGuiComponent = nil
end
end
end
ClientOrchestration.ClientSceneMetadataRequestConnection = nil
ClientOrchestration.setupSchema = function()
ClientOrchestration.isSeekable = false
local lastCalledOrchestrationTime = ClientOrchestration.lastCalledOrchestrationTime
local setupSuccess, setupError = ClientOrchestration.SchemaProcessorInstance:Setup()
local isSameScene = lastCalledOrchestrationTime == ClientOrchestration.lastCalledOrchestrationTime
if not setupSuccess then
ClientOrchestration._warn("Client Schema Setup wasn't successful")
ClientOrchestration._warn(setupError)
elseif isSameScene then
ClientOrchestration.isSeekable = true
end
return setupSuccess
end
ClientOrchestration.processSchema = function(isSeeking)
local processSuccess, processError = ClientOrchestration.SchemaProcessorInstance:Process(isSeeking)
if not processSuccess then
ClientOrchestration._warn("Client Schema Process wasn't successful")
ClientOrchestration._warn(processError)
end
end
ClientOrchestration.cleanUp = function()
if ClientOrchestration.SchemaProcessorInstance then
ClientOrchestration.SchemaProcessorInstance:CleanUp()
end
end
ClientOrchestration.handleSceneEnded = function()
if ClientOrchestration.SchemaProcessorInstance then
local endSceneSuccess, endSceneError = ClientOrchestration.SchemaProcessorInstance:EndScene()
if not endSceneSuccess then
ClientOrchestration._warn("Client End Scene wasn't successful")
ClientOrchestration._warn(endSceneError)
end
ClientOrchestration.cleanUp()
end
end
|
-- << VARIABLES >>
|
local topBarFrame = main.gui.CustomTopBar
local topBarY = main.guiService:GetGuiInset().Y
local mainFrame = main.gui.MainFrame
local imageButton = topBarFrame.ImageButton
|
--If admin, give access to admin panel
|
else
--Alert user they are an admin
createAnnouncement("You are an admin.\nUse the 'B' key to open the admin panel.")
uis.InputBegan:Connect(function(inp, p)
if not p and inp.KeyCode == Enum.KeyCode.B then --Press B on keyboard to open admin panel
panel.Visible = not panel.Visible
end
end)
panel.CloseButton.MouseButton1Click:Connect(function() --Close admin panel when button is clicked on
panel.Visible = false
end)
selectPlrFrame.UserIdBox.FocusLost:Connect(function() --Search UserIds to select players not in the same server as the admin
local userId = selectPlrFrame.UserIdBox.Text
if tonumber(userId) then
local plrInfo = game:GetService("UserService"):GetUserInfosByUserIdsAsync({tonumber(userId)})[1]
if plrInfo then
local username = plrInfo.Username
local displayName = plrInfo.DisplayName
local inServer = game.Players:FindFirstChild(username)
local image = game.Players:GetUserThumbnailAsync(userId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size100x100)
selectedFrame.PlayerName.Text = username
selectedFrame.DisplayName.Text = "@" .. displayName
selectedFrame.UserId.Text = userId
selectedFrame.InGame.Text = inServer and "Currently in server 🟢" or "Not in server 🔴"
selectedFrame.PlayerImage.Image = image
selectedFrame.Visible = true
end
end
end)
--Command Bar
panel.CommandBar.FocusLost:Connect(function(enterPressed)
if enterPressed then
re:FireServer("COMMAND BAR", panel.CommandBar.Text)
end
end)
local btns = panel.Pages.MainButtonsFrame.ButtonsScroller; btns.Parent.Visible = true
local muteFrame = panel.Pages.MuteFrame; muteFrame.Visible = false
local banFrame = panel.Pages.BanFrame; banFrame.Visible = false
local kickFrame = panel.Pages.KickFrame; kickFrame.Visible = false
local annFrame = panel.Pages.AnnounceFrame; annFrame.Visible = false
local shutFrame = panel.Pages.ShutdownFrame; shutFrame.Visible = false
--MODERATION BUTTONS
--Mute Button
btns.ModerationButtons.MuteButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
muteFrame.DisplayName.Text = selectedFrame.DisplayName.Text
muteFrame.PlayerName.Text = selectedFrame.PlayerName.Text
muteFrame.PlayerImage.Image = selectedFrame.PlayerImage.Image
muteFrame.Visible = true
btns.Parent.Visible = false
end
end)
muteFrame.BackButton.MouseButton1Click:Connect(function()
btns.Parent.Visible = true
muteFrame.Visible = false
end)
muteFrame.ConfirmButton.MouseButton1Click:Connect(function()
local name = string.gsub(muteFrame.PlayerName.Text, "@", "")
local targetId = game.Players:GetUserIdFromNameAsync(name)
local length = tonumber(muteFrame.MuteLengthBox.Text)
if targetId and length then
btns.Parent.Visible = true
muteFrame.Visible = false
re:FireServer("MUTE", length, targetId)
end
end)
--Unmute Button
btns.ModerationButtons.UnmuteButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
re:FireServer("UNMUTE", nil, tonumber(selectedFrame.UserId.Text))
end
end)
--Ban Button
btns.ModerationButtons.BanButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
banFrame.DisplayName.Text = selectedFrame.DisplayName.Text
banFrame.PlayerName.Text = selectedFrame.PlayerName.Text
banFrame.PlayerImage.Image = selectedFrame.PlayerImage.Image
panel.Pages.BanFrame.Visible = true
btns.Parent.Visible = false
end
end)
banFrame.BackButton.MouseButton1Click:Connect(function()
btns.Parent.Visible = true
banFrame.Visible = false
end)
banFrame.ConfirmButton.MouseButton1Click:Connect(function()
local name = string.gsub(banFrame.PlayerName.Text, "@", "")
local targetId = game.Players:GetUserIdFromNameAsync(name)
local length = tonumber(banFrame.BanLengthBox.Text)
local compiled = {length, banFrame.ReasonBox.Text}
if targetId and length then
btns.Parent.Visible = true
banFrame.Visible = false
re:FireServer("BAN", compiled, targetId)
end
end)
--Unban Button
btns.ModerationButtons.UnbanButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
re:FireServer("UNBAN", nil, tonumber(selectedFrame.UserId.Text))
end
end)
--Kick Button
btns.ModerationButtons.KickButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
kickFrame.DisplayName.Text = selectedFrame.DisplayName.Text
kickFrame.PlayerName.Text = selectedFrame.PlayerName.Text
kickFrame.PlayerImage.Image = selectedFrame.PlayerImage.Image
panel.Pages.KickFrame.Visible = true
btns.Parent.Visible = false
end
end)
kickFrame.BackButton.MouseButton1Click:Connect(function()
btns.Parent.Visible = true
kickFrame.Visible = false
end)
kickFrame.ConfirmButton.MouseButton1Click:Connect(function()
local name = string.gsub(kickFrame.PlayerName.Text, "@", "")
local targetId = game.Players:GetUserIdFromNameAsync(name)
local reason = kickFrame.ReasonBox.Text
if targetId then
btns.Parent.Visible = true
kickFrame.Visible = false
re:FireServer("KICK", reason, targetId)
end
end)
--CHARACTER BUTTONS
--Go To Button
btns.CharacterButtons.GoToButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
re:FireServer("GO TO", nil, tonumber(selectedFrame.UserId.Text))
end
end)
--Bring Button
btns.CharacterButtons.BringButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
re:FireServer("BRING", nil, tonumber(selectedFrame.UserId.Text))
end
end)
--Freeze Button
btns.CharacterButtons.FreezeButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
re:FireServer("FREEZE", nil, tonumber(selectedFrame.UserId.Text))
end
end)
--Unfreeze Button
btns.CharacterButtons.UnfreezeButton.MouseButton1Click:Connect(function()
if tonumber(selectedFrame.UserId.Text) then
re:FireServer("UNFREEZE", nil, tonumber(selectedFrame.UserId.Text))
end
end)
--Speed Input Box
btns.CharacterButtons.WalkSpeedBox.FocusLost:Connect(function(enterPressed)
if enterPressed and tonumber(selectedFrame.UserId.Text) then
re:FireServer("SPEED", tonumber(btns.CharacterButtons.WalkSpeedBox.Text), tonumber(selectedFrame.UserId.Text))
end
end)
--Jump Input Box
btns.CharacterButtons.JumpHeightBox.FocusLost:Connect(function(enterPressed)
if enterPressed and tonumber(selectedFrame.UserId.Text) then
re:FireServer("JUMP", tonumber(btns.CharacterButtons.JumpHeightBox.Text), tonumber(selectedFrame.UserId.Text))
end
end)
--Health Input Box
btns.CharacterButtons.HealthBox.FocusLost:Connect(function(enterPressed)
if enterPressed and tonumber(selectedFrame.UserId.Text) then
re:FireServer("HEALTH", tonumber(btns.CharacterButtons.HealthBox.Text), tonumber(selectedFrame.UserId.Text))
end
end)
--SYSTEM BUTTONS
--Announce Button
btns.SystemButtons.AnnounceButton.MouseButton1Click:Connect(function()
panel.Pages.AnnounceFrame.Visible = true
btns.Parent.Visible = false
end)
annFrame.BackButton.MouseButton1Click:Connect(function()
btns.Parent.Visible = true
annFrame.Visible = false
end)
local server = annFrame.ServerButton
local global = annFrame.GlobalButton
server.CircleBackground.CircleFill.Visible = true
server.MouseButton1Click:Connect(function()
global.CircleBackground.CircleFill.Visible = false
server.CircleBackground.CircleFill.Visible = true
end)
global.CircleBackground.CircleFill.Visible = false
global.MouseButton1Click:Connect(function()
server.CircleBackground.CircleFill.Visible = false
global.CircleBackground.CircleFill.Visible = true
end)
annFrame.ConfirmButton.MouseButton1Click:Connect(function()
local message = annFrame.AnnouncementBox.Text
local messageGlobal = global.CircleBackground.CircleFill.Visible and "GLOBAL" or "SERVER"
if string.len(message) > 0 then
btns.Parent.Visible = true
annFrame.Visible = false
re:FireServer("ANNOUNCE", message, messageGlobal)
end
end)
--Shutdown Button
btns.SystemButtons.ShutdownButton.MouseButton1Click:Connect(function()
panel.Pages.ShutdownFrame.Visible = true
btns.Parent.Visible = false
end)
shutFrame.BackButton.MouseButton1Click:Connect(function()
btns.Parent.Visible = true
shutFrame.Visible = false
end)
shutFrame.ConfirmButton.MouseButton1Click:Connect(function()
btns.Parent.Visible = true
shutFrame.Visible = false
re:FireServer("SHUT DOWN")
end)
end
|
--[=[
Executes the task delayed after some time.
```lua
-- delays cleanup by 5 seconds
maid:GiveTask(MaidTaskUtils.delayed(5, gui))
```
@param time number -- Time in seconds
@param job MaidTask -- Job to delay execution
@return () -> () -- function that will execute the job delayed
]=]
|
function MaidTaskUtils.delayed(time, job)
assert(type(time) == "number", "Bad time")
assert(MaidTaskUtils.isValidTask(job), "Bad job")
return function()
task.delay(time, function()
MaidTaskUtils.doTask(job)
end)
end
end
return MaidTaskUtils
|
-- if ACS_Client:GetAttribute("Tourniquet") then
-- Dor.Value = math.clamp(Dor.Value + 0.05, 0, 300)
-- end
| |
--camShake:ShakeSustain(CameraShaker.Presets.RoughDriving)
| |
-- The states where the Last Standing Y Position variable will not be changed.
|
local States = {
[Enum.HumanoidStateType.Running] = true;
[Enum.HumanoidStateType.RunningNoPhysics] = true;
[Enum.HumanoidStateType.Climbing] = true;
[Enum.HumanoidStateType.Ragdoll] = true;
[Enum.HumanoidStateType.FallingDown] = true;
[Enum.HumanoidStateType.Flying] = true;
[Enum.HumanoidStateType.GettingUp] = true;
[Enum.HumanoidStateType.Dead] = true;
[Enum.HumanoidStateType.None] = true;
[Enum.HumanoidStateType.Physics] = true;
[Enum.HumanoidStateType.Swimming] = true;
[Enum.HumanoidStateType.Seated] = true;
[Enum.HumanoidStateType.PlatformStanding] = true;
}
local Character
repeat wait() until script.Parent.Parent:FindFirstChild("Humanoid")
Character = script.Parent.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local HRP = Character:WaitForChild("HumanoidRootPart")
local Values = require(script.Parent.Values)
while true do
local state = getHumanoidState(Humanoid)
--print(state)
if States[state] and not Values.DontUpdateYet then
Values.LastStandingPos = HRP.Position
--print(Values.LastStandingYPos)
end
task.wait()
end
|
-- Driver Input Loop --
|
while script.Parent ~= nil do
--Update throttle, steer, handbrake
getInputValues()
local currentVel = Chassis.GetAverageVelocity()
if Car:GetAttribute("Fuel") > 0 and Car:GetAttribute("Health") > 0 then
local steer = script.Steering.Value
Chassis.UpdateSteering(steer, currentVel)
-- Taking care of throttling
local throttle = script.Throttle.Value
script.AngularMotorVelocity.Value = currentVel
script.ForwardVelocity.Value = DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)
Chassis.UpdateThrottle(currentVel, throttle)
-- Taking care of handbrake
if script.HandBrake.Value > 0 then
Chassis.EnableHandbrake()
end
else
script.AngularMotorVelocity.Value = 0
script.ForwardVelocity.Value = 0
Chassis.UpdateThrottle(0, 0)
end
task.wait()
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__Value__1 = script.Parent.Car.Value;
local l__AC6_FE_Sounds__2 = l__Value__1:WaitForChild("AC6_FE_Sounds");
local v3 = require(l__Value__1["A-Chassis Tune"]);
local v4 = 0;
local v5 = 0;
local v6 = 0;
script:WaitForChild("Rev");
local u1 = 0;
local u2 = 0;
script.Parent.Values.Gear.Changed:connect(function()
u1 = 1;
if script.Parent.Values.RPM.Value > 5000 then
u2 = 0.2;
end;
end);
for v7, v8 in pairs(l__Value__1.DriveSeat:GetChildren()) do
for v9, v10 in pairs(script:GetChildren()) do
if v8.Name == v10.Name then
v8:Stop();
wait();
v8:Destroy();
end;
end;
end;
l__AC6_FE_Sounds__2:FireServer("newSound", true, "Rev", l__Value__1.DriveSeat, script.Rev.SoundId, 0, script.Rev.Volume, true);
l__AC6_FE_Sounds__2:FireServer("playSound", "Rev");
l__Value__1.DriveSeat:WaitForChild("Rev");
while wait() do
u1 = math.max(0, u1 - 0.1);
if script.Parent.Values.Throttle.Value <= v3.IdleThrottle / 100 then
local v11 = math.max(0.6, 0 - 0.2);
local v12 = math.max(0, 0 - 0.05);
local v13 = 1;
else
v11 = math.min(1.1, 0 + 0.1);
v12 = 1;
v13 = 0;
end;
u2 = math.min(1, u2 + 0.2);
if v3.Redline - v3.RevBounce / 4 < script.Parent.Values.RPM.Value and v3.IdleThrottle / 100 < script.Parent.Values.Throttle.Value then
local v14 = 1;
else
v14 = 1;
end;
if not script.Parent.IsOn.Value then
v4 = math.max(v4 - 0.015, 0);
else
v4 = 1;
end;
l__AC6_FE_Sounds__2:FireServer("updateSound", true, "Rev", script.Rev.SoundId, math.max((script.Rev.SetPitch.Value + script.Rev.SetRev.Value * script.Parent.Values.RPM.Value / v3.Redline) * v4 ^ 2 + v5 * u1 * math.sin(80 * tick()), script.Rev.SetPitch.Value), 1 * 0 * u2 * v14 + v6 * v13 * 0 * (3 - 0) * math.sin(tick() * 50));
end;
|
--Services
|
local UserInputService = game:GetService("UserInputService")
|
-------------------------------------------------------------------------------
-- Core:
|
local MAX_PATHS = 10
local pathfindingService = game:GetService("PathfindingService")
local function SimplifyPointsStraight(points)
local simplified = {}
local i = 1
while (i < #points) do
local pt = points[i]
table.insert(simplified, pt)
if (i < #points) then
local ptNext = points[i + 1]
local dx, dy, dz = (ptNext.x - pt.x), (ptNext.y - pt.y), (ptNext.z - pt.z)
for j = i+1, #points do
i = j
local ptLast = points[i - 1]
local pt2 = points[i]
local dx2, dy2, dz2 = (pt2.x - ptLast.x), (pt2.y - ptLast.y), (pt2.z - ptLast.z)
if (dx ~= dx2 or dy ~= dy2 or dz ~= dz2) then
i = (i - 1)
break
end
end
end
end
table.insert(simplified, points[#points])
return simplified
end
local function SimplifyPointsDiagonal(points)
local simplified = {}
local i = 3
while (i < #points) do
local p1 = points[i - 2]
local p2 = points[i - 1]
local p3 = points[i]
local a = (p1 - p2).magnitude
local b = (p2 - p3).magnitude
local c = (p1 - p3).magnitude
table.insert(simplified, p1)
if (a == b) then
i = (i + 2)
else
i = (i + 1)
end
end
table.insert(simplified, points[#points])
return simplified
end
function CreatePathObject(paths, points, finalStatus)
local path = {}
local api = {}
api.Status = finalStatus
function api:GetPointCoordinates()
return points
end
function api:CheckOcclusionAsync(start)
local n = 0
local startIndex = 1
for i,p in pairs(paths) do
local numPoints = #p:GetPointCoordinates()
n = (n + numPoints)
if (n >= start) then
startIndex = i + 1
local test = p:CheckOcclusionAsync(n - numPoints + start)
if (test ~= -1) then
return (n - numPoints + test)
end
break
end
end
for i = startIndex, #paths do
local p = paths[i]
local numPoints = #p:GetPointCoordinates()
n = (n + numPoints)
if (numPoints > 0) then
local test = p:CheckOcclusionAsync(1)
if (test ~= -1) then
return (n - numPoints + test)
end
end
end
return -1
end
return setmetatable(path, {
__metatable = true;
__index = api;
__newindex = function()
error("Cannot edit Path")
end;
})
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.CutieBear -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--// This script should be placed as a decendant to StarterGui for it to properly work.
|
local GENERAL_DAMPING = 2.5 -- Higher number equals less bob
local TILT_DAMPING = 1 -- Higher number equals less tilt
local OFFSET_DAMPING = 0.1 -- Higher number equals less camera offset bobbing
|
--l__LocalPlayer__1.Character.RightFoot.Touched:connect(function(p1) --r15
|
l__LocalPlayer__1.Character["Right Leg"].Touched:connect(function(p1) --r6
if p1.Name == "floor" and l__Running__2.SoundId ~= "rbxassetid://1977094302" then
l__Running__2.Pitch = 2.8;
l__Running__2.Volume = 0.2;
l__Running__2.SoundId = "rbxassetid://1977094302";
l__Running__2:Play();
end;
if p1.Name == "grass" and l__Running__2.SoundId ~= "rbxassetid://252965149" then
l__Running__2.Pitch = 2.3;
l__Running__2.Volume = 2;
l__Running__2.SoundId = "rbxassetid://252965149";
l__Running__2:Play();
end;
if p1.Name == "wood" and l__Running__2.SoundId ~= "rbxassetid://1244506786" then
l__Running__2.Pitch = 2.3;
l__Running__2.Volume = 0.1;
l__Running__2.SoundId = "rbxassetid://1244506786";
l__Running__2:Play();
end;
if p1.Name == "metal" and l__Running__2.SoundId ~= "rbxassetid://3477114901" then
l__Running__2.Pitch = 2.6;
l__Running__2.Volume = 1;
l__Running__2.SoundId = "rbxassetid://3477114901";
l__Running__2:Play();
end;
if p1.Name == "nasty" and l__Running__2.SoundId ~= "rbxassetid://3477114901" then
l__Running__2.Pitch = 3.1;
l__Running__2.Volume = 0.4;
l__Running__2.SoundId = "rbxassetid://344167846";
l__Running__2:Play();
end;
end);
|
-- скрипт ПРИМЕР по созданию ландшафта из блоков и переделке в воду
-- game.Workspace.Terrain:FillBlock(game.Workspace.Baseplate.CFrame, game.Workspace.Baseplate.Size, Enum.Material.Grass)
|
local mod=game.Workspace.Base
|
--[[spawn(function()
while wait(5) do
for i = 1,5 do
module:Notice(main.hdAdminCoreName, "Your rank is 'Owner'! Click to view the commands.", {"ShowSpecificPage", "Commands", "Commands"})
wait(1)
--module:Notice(main.hdAdminCoreName, "You're a Donor! Click to view Donor commands." )
--wait(1)
end
end
end)--]]
|
return module
|
-- Main script execution
|
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
local points = Instance.new("IntValue")
points.Name = "Points"
points.Parent = leaderstats
local survival = Instance.new("IntValue")
survival.Name = "Survival"
survival.Parent = leaderstats
leaderstats.Parent = player
end)
dayNightCycle()
|
-- Fixed By DT4E --
|
while true do
script.Parent.BrickColor = BrickColor.new("Lime green")
wait(0.15)
script.Parent.BrickColor = BrickColor.new("Bright Blue")
wait(0.15)
end
|
--[[Drivetrain Initialize]]
|
local Drive={}
--Power Front Wheels
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then table.insert(Drive,v) end end end
--Power Rear Wheels
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then for i,v in pairs(car.Wheels:GetChildren()) do if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then table.insert(Drive,v) end end end
--Determine Wheel Size
local wDia = 0 for i,v in pairs(Drive) do if v.Size.x>wDia then wDia = v.Size.x end end
--Pre-Toggled PBrake
for i,v in pairs(car.Wheels:GetChildren()) do if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then _PBrake=true end end
|
--[[**
Gets the player's primary group if it exists.
@param [Instance<Player>] Player The player you are checking for. Can also be their UserID.
@returns [DictionaryOrNil] The player's primary group if it exists, otherwise nil.
**--]]
|
function GroupService:GetPrimaryGroupAsync(Player)
for _, Group in ipairs(GroupService:GetGroupsAsync(Player)) do
if Group.IsPrimary then
return Group
end
end
return nil
end
|
--create tables:
|
for i,part in pairs(model:GetChildren()) do
if string.sub(part.Name, 1,1) == "e" then
table.insert(e, 1, part)
end
end
for i,part in pairs(model:GetChildren()) do
if string.sub(part.Name, 1,1) == "f" then
table.insert(f, 1, part)
end
end
function lightOn(T)
for i, part in pairs (T) do
if part:FindFirstChild("On") then
part.On.Value = true
end
end
end
function lightOff(T)
for i, part in pairs (T) do
if part:FindFirstChild("On") then
part.On.Value = false
end
end
end
while true do
lightOn(e)
lightOn(f)
wait(0.15)
lightOff(e)
lightOff(f)
wait(0.15)
end
|
--[=[
Transforms the observable with the following transformers
```lua
Rx.of(1, 2, 3):Pipe({
Rx.map(function(result)
return result + 1
end);
Rx.map(function(value)
return ("%0.2f"):format(value)
end);
}):Subscribe(print)
--> 2.00
--> 3.00
--> 4.00
```
@param transformers { (observable: Observable<T>) -> Observable<T> }
@return Observable<T>
]=]
|
function Observable:Pipe(transformers)
assert(type(transformers) == "table", "Bad transformers")
local current = self
for _, transformer in pairs(transformers) do
assert(type(transformer) == "function", "Bad transformer")
current = transformer(current)
assert(Observable.isObservable(current), "Transformer must return an observable")
end
return current
end
|
----------------------------------
-----------CONNECTIONS------------
----------------------------------
|
PianoKeysConnections = {}
ExitButtonConnection = nil
SheetsButtonConnection = nil
SheetsEditedConnection = nil
CapsButtonConnection = nil
function MakeGuiConnections()
for i, v in pairs(PianoGui.Keys:GetChildren()) do
PianoKeysConnections[i] = v.InputBegan:connect(function(Object) PianoKeyPressed(Object, tonumber(v.Name)) end)
end
ExitButtonConnection = PianoGui.ExitButton.InputBegan:connect(ExitButtonPressed)
SheetsButtonConnection = PianoGui.SheetsButton.InputBegan:connect(SheetsButtonPressed)
SheetsEditedConnection = SheetsGui.Sheet.ScrollingFrame.TextBox.Changed:connect(SheetsEdited)
CapsButtonConnection = PianoGui.CapsButton.InputBegan:connect(CapsButtonPressed)
end
function BreakGuiConnections()
for i, v in pairs(PianoKeysConnections) do
v:disconnect()
end
ExitButtonConnection:disconnect()
SheetsButtonConnection:disconnect()
SheetsEditedConnection:disconnect()
CapsButtonConnection:disconnect()
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.