prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[[ The Class ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local VRNavigation = setmetatable({}, BaseCharacterController)
VRNavigation.__index = VRNavigation
function VRNavigation.new(CONTROL_ACTION_PRIORITY)
local self = setmetatable(BaseCharacterController.new(), VRNavigation)
self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY
self.navigationRequestedConn = nil
self.heartbeatConn = nil
self.currentDestination = nil
self.currentPath = nil
self.currentPoints = nil
self.currentPointIdx = 0
self.expectedTimeToNextPoint = 0
self.timeReachedLastPoint = tick()
self.moving = false
self.isJumpBound = false
self.moveLatch = false
self.userCFrameEnabledConn = nil
return self
end
function VRNavigation:SetLaserPointerMode(mode)
pcall(function()
StarterGui:SetCore("VRLaserPointerMode", mode)
end)
end
function VRNavigation:GetLocalHumanoid()
local character = LocalPlayer.Character
if not character then
return
end
for _, child in pairs(character:GetChildren()) do
if child:IsA("Humanoid") then
return child
end
end
return nil
end
function VRNavigation:HasBothHandControllers()
return VRService:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) and VRService:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand)
end
function VRNavigation:HasAnyHandControllers()
return VRService:GetUserCFrameEnabled(Enum.UserCFrame.RightHand) or VRService:GetUserCFrameEnabled(Enum.UserCFrame.LeftHand)
end
function VRNavigation:IsMobileVR()
return UserInputService.TouchEnabled
end
function VRNavigation:HasGamepad()
return UserInputService.GamepadEnabled
end
function VRNavigation:ShouldUseNavigationLaser()
--Places where we use the navigation laser:
-- mobile VR with any number of hands tracked
-- desktop VR with only one hand tracked
-- desktop VR with no hands and no gamepad (i.e. with Oculus remote?)
--using an Xbox controller with a desktop VR headset means no laser since the user has a thumbstick.
--in the future, we should query thumbstick presence with a features API
if self:IsMobileVR() then
return true
else
if self:HasBothHandControllers() then
return false
end
if not self:HasAnyHandControllers() then
return not self:HasGamepad()
end
return true
end
end
function VRNavigation:StartFollowingPath(newPath)
currentPath = newPath
currentPoints = currentPath:GetPointCoordinates()
currentPointIdx = 1
moving = true
timeReachedLastPoint = tick()
local humanoid = self:GetLocalHumanoid()
if humanoid and humanoid.Torso and #currentPoints >= 1 then
local dist = (currentPoints[1] - humanoid.Torso.Position).magnitude
expectedTimeToNextPoint = dist / humanoid.WalkSpeed
end
movementUpdateEvent:Fire("targetPoint", self.currentDestination)
end
function VRNavigation:GoToPoint(point)
currentPath = true
currentPoints = { point }
currentPointIdx = 1
moving = true
local humanoid = self:GetLocalHumanoid()
local distance = (humanoid.Torso.Position - point).magnitude
local estimatedTimeRemaining = distance / humanoid.WalkSpeed
timeReachedLastPoint = tick()
expectedTimeToNextPoint = estimatedTimeRemaining
movementUpdateEvent:Fire("targetPoint", point)
end
function VRNavigation:StopFollowingPath()
currentPath = nil
currentPoints = nil
currentPointIdx = 0
moving = false
self.moveVector = ZERO_VECTOR3
end
function VRNavigation:TryComputePath(startPos, destination)
local numAttempts = 0
local newPath = nil
while not newPath and numAttempts < 5 do
newPath = PathfindingService:ComputeSmoothPathAsync(startPos, destination, MAX_PATHING_DISTANCE)
numAttempts = numAttempts + 1
if newPath.Status == Enum.PathStatus.ClosestNoPath or newPath.Status == Enum.PathStatus.ClosestOutOfRange then
newPath = nil
break
end
if newPath and newPath.Status == Enum.PathStatus.FailStartNotEmpty then
startPos = startPos + (destination - startPos).unit
newPath = nil
end
if newPath and newPath.Status == Enum.PathStatus.FailFinishNotEmpty then
destination = destination + Vector3.new(0, 1, 0)
newPath = nil
end
end
return newPath
end
function VRNavigation:OnNavigationRequest(destinationCFrame, inputUserCFrame )
local destinationPosition = destinationCFrame.p
local lastDestination = self.currentDestination
if not IsFiniteVector3(destinationPosition) then
return
end
self.currentDestination = destinationPosition
local humanoid = self:GetLocalHumanoid()
if not humanoid or not humanoid.Torso then
return
end
local currentPosition = humanoid.Torso.Position
local distanceToDestination = (self.currentDestination - currentPosition).magnitude
if distanceToDestination < NO_PATH_THRESHOLD then
self:GoToPoint(self.currentDestination)
return
end
if not lastDestination or (self.currentDestination - lastDestination).magnitude > RECALCULATE_PATH_THRESHOLD then
local newPath = self:TryComputePath(currentPosition, self.currentDestination)
if newPath then
self:StartFollowingPath(newPath)
if PathDisplay then
PathDisplay.setCurrentPoints(self.currentPoints)
PathDisplay.renderPath()
end
else
self:StopFollowingPath()
if PathDisplay then
PathDisplay.clearRenderedPath()
end
end
else
if moving then
self.currentPoints[#currentPoints] = self.currentDestination
else
self:GoToPoint(self.currentDestination)
end
end
end
function VRNavigation:OnJumpAction(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
self.isJumping = true
end
return Enum.ContextActionResult.Sink
end
function VRNavigation:BindJumpAction(active)
if active then
if not self.isJumpBound then
self.isJumpBound = true
ContextActionService:BindActionAtPriority("VRJumpAction", (function() return self:OnJumpAction() end), false,
self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.ButtonA)
end
else
if self.isJumpBound then
self.isJumpBound = false
ContextActionService:UnbindAction("VRJumpAction")
end
end
end
function VRNavigation:ControlCharacterGamepad(actionName, inputState, inputObject)
if inputObject.KeyCode ~= Enum.KeyCode.Thumbstick1 then return end
if inputState == Enum.UserInputState.Cancel then
self.moveVector = ZERO_VECTOR3
return
end
if inputState ~= Enum.UserInputState.End then
self:StopFollowingPath()
if PathDisplay then
PathDisplay.clearRenderedPath()
end
if self:ShouldUseNavigationLaser() then
self:BindJumpAction(true)
self:SetLaserPointerMode("Hidden")
end
if inputObject.Position.magnitude > THUMBSTICK_DEADZONE then
self.moveVector = Vector3.new(inputObject.Position.X, 0, -inputObject.Position.Y)
if self.moveVector.magnitude > 0 then
self.moveVector = self.moveVector.unit * math.min(1, inputObject.Position.magnitude)
end
self.moveLatch = true
end
else
self.moveVector = ZERO_VECTOR3
if self:ShouldUseNavigationLaser() then
self:BindJumpAction(false)
self:SetLaserPointerMode("Navigation")
end
if self.moveLatch then
self.moveLatch = false
movementUpdateEvent:Fire("offtrack")
end
end
return Enum.ContextActionResult.Sink
end
function VRNavigation:OnHeartbeat(dt)
local newMoveVector = self.moveVector
local humanoid = self:GetLocalHumanoid()
if not humanoid or not humanoid.Torso then
return
end
if self.moving and self.currentPoints then
local currentPosition = humanoid.Torso.Position
local goalPosition = currentPoints[1]
local vectorToGoal = (goalPosition - currentPosition) * XZ_VECTOR3
local moveDist = vectorToGoal.magnitude
local moveDir = vectorToGoal / moveDist
if moveDist < POINT_REACHED_THRESHOLD then
local estimatedTimeRemaining = 0
local prevPoint = currentPoints[1]
for i, point in pairs(currentPoints) do
if i ~= 1 then
local dist = (point - prevPoint).magnitude
prevPoint = point
estimatedTimeRemaining = estimatedTimeRemaining + (dist / humanoid.WalkSpeed)
end
end
table.remove(currentPoints, 1)
currentPointIdx = currentPointIdx + 1
if #currentPoints == 0 then
self:StopFollowingPath()
if PathDisplay then
PathDisplay.clearRenderedPath()
end
return
else
if PathDisplay then
PathDisplay.setCurrentPoints(currentPoints)
PathDisplay.renderPath()
end
local newGoal = currentPoints[1]
local distanceToGoal = (newGoal - currentPosition).magnitude
expectedTimeToNextPoint = distanceToGoal / humanoid.WalkSpeed
timeReachedLastPoint = tick()
end
else
local ignoreTable = {
game.Players.LocalPlayer.Character,
workspace.CurrentCamera
}
local obstructRay = Ray.new(currentPosition - Vector3.new(0, 1, 0), moveDir * 3)
local obstructPart, obstructPoint, obstructNormal = workspace:FindPartOnRayWithIgnoreList(obstructRay, ignoreTable)
if obstructPart then
local heightOffset = Vector3.new(0, 100, 0)
local jumpCheckRay = Ray.new(obstructPoint + moveDir * 0.5 + heightOffset, -heightOffset)
local jumpCheckPart, jumpCheckPoint, jumpCheckNormal = workspace:FindPartOnRayWithIgnoreList(jumpCheckRay, ignoreTable)
local heightDifference = jumpCheckPoint.Y - currentPosition.Y
if heightDifference < 6 and heightDifference > -2 then
humanoid.Jump = true
end
end
local timeSinceLastPoint = tick() - timeReachedLastPoint
if timeSinceLastPoint > expectedTimeToNextPoint + OFFTRACK_TIME_THRESHOLD then
self:StopFollowingPath()
if PathDisplay then
PathDisplay.clearRenderedPath()
end
movementUpdateEvent:Fire("offtrack")
end
newMoveVector = self.moveVector:Lerp(moveDir, dt * 10)
end
end
if IsFiniteVector3(newMoveVector) then
self.moveVector = newMoveVector
end
end
function VRNavigation:OnUserCFrameEnabled()
if self:ShouldUseNavigationLaser() then
self:BindJumpAction(false)
self:SetLaserPointerMode("Navigation")
else
self:BindJumpAction(true)
self:SetLaserPointerMode("Hidden")
end
end
function VRNavigation:Enable(enable)
self.moveVector = ZERO_VECTOR3
self.isJumping = false
if enable then
self.navigationRequestedConn = VRService.NavigationRequested:Connect(function(destinationCFrame, inputUserCFrame) self:OnNavigationRequest(destinationCFrame, inputUserCFrame) end)
self.heartbeatConn = RunService.Heartbeat:Connect(function(dt) self:OnHeartbeat(dt) end)
ContextActionService:BindAction("MoveThumbstick", (function(actionName, inputState, inputObject) return self:ControlCharacterGamepad(actionName, inputState, inputObject) end),
false, self.CONTROL_ACTION_PRIORITY, Enum.KeyCode.Thumbstick1)
ContextActionService:BindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2)
self.userCFrameEnabledConn = VRService.UserCFrameEnabled:Connect(function() self:OnUserCFrameEnabled() end)
self:OnUserCFrameEnabled()
VRService:SetTouchpadMode(Enum.VRTouchpad.Left, Enum.VRTouchpadMode.VirtualThumbstick)
VRService:SetTouchpadMode(Enum.VRTouchpad.Right, Enum.VRTouchpadMode.ABXY)
self.enabled = true
else
-- Disable
self:StopFollowingPath()
ContextActionService:UnbindAction("MoveThumbstick")
ContextActionService:UnbindActivate(Enum.UserInputType.Gamepad1, Enum.KeyCode.ButtonR2)
self:BindJumpAction(false)
self:SetLaserPointerMode("Disabled")
if self.navigationRequestedConn then
self.navigationRequestedConn:Disconnect()
self.navigationRequestedConn = nil
end
if self.heartbeatConn then
self.heartbeatConn:Disconnect()
self.heartbeatConn = nil
end
if self.userCFrameEnabledConn then
self.userCFrameEnabledConn:Disconnect()
self.userCFrameEnabledConn = nil
end
self.enabled = false
end
end
return VRNavigation
|
--MainScript
|
repeat
local Code1 = script.Parent.Code
local EnteredCode1 = script.Parent.EnteredCode
wait()
until Code1.Value == EnteredCode1.Value and Ready == true
CodeT1.Color = Color
CodeT1C:Destroy()
CodeT2.Color = Color
CodeT2C:Destroy()
CodeT3.Color = Color
CodeT3C:Destroy()
script.Parent.MainPart.Move:Play()
script.Parent.MainDoor:Destroy()
script:Destroy()
|
-- functions
|
function onRunning(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
pose = "Jumping"
end
function onClimbing()
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function moveJump()
RightShoulder.MaxVelocity = 0.4
LeftShoulder.MaxVelocity = 0.4
RightShoulder:SetDesiredAngle(3.14)
LeftShoulder:SetDesiredAngle(-3.14)
RightHip:SetDesiredAngle(0)
LeftHip:SetDesiredAngle(0)
wait(0.8)
end
|
-- child.C0 = CFrame.new(0,-0.6,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0) --// Reposition player
|
if child.Part1.Name == "HumanoidRootPart" then
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and (not player.PlayerGui:FindFirstChild("Screen")) then --// The part after the "and" prevents multiple GUI's to be copied over.
GUI.CarSeat.Value = script.Parent --// Puts a reference of the seat in this ObjectValue, now you can use this ObjectValue's value to find the car directly.
GUI:Clone().Parent = player.PlayerGui --// Compact version
end
end
end
end)
script.Parent.ChildRemoved:connect(function(child)
if child:IsA("Weld") then
if child.Part1.Name == "HumanoidRootPart" then
game.Workspace.CurrentCamera.FieldOfView = 70
player = game.Players:GetPlayerFromCharacter(child.Part1.Parent)
if player and player.PlayerGui:FindFirstChild("SS3") then
player.PlayerGui:FindFirstChild("SS3"):Destroy()
end
end
end
end)
|
--[=[
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
function Promise.prototype:Destroy()
self:cancel()
end
|
-- Catch any Blocker unloaded descendants
|
blockerFolder.DescendantAdded:Connect(function(instance)
configureBlockerEffect(instance, adPortal.Status == Enum.AdUnitStatus.Active)
end)
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.HealingCandy -- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--Protected Turn 1--: Standard GYR with a protected turn for one signal direction
|
--USES: Signal1, Signal1a, Signal2, Signal2a(Optional), Turn1
while true do
PedValues = script.Parent.Parent.PedValues
SignalValues = script.Parent.Parent.SignalValues
TurnValues = script.Parent.Parent.TurnValues
|
--[=[
@return Timer
Creates a new timer.
]=]
|
function Timer.new(interval: number)
assert(type(interval) == "number", "Argument #1 to Timer.new must be a number; got " .. type(interval))
assert(interval >= 0, "Argument #1 to Timer.new must be greater or equal to 0; got " .. tostring(interval))
local self = setmetatable({}, Timer)
self._runHandle = nil
self.Interval = interval
self.UpdateSignal = RunService.Heartbeat
self.TimeFunction = time
self.AllowDrift = true
self.Tick = Signal.new()
return self
end
|
--["Walk"] = "rbxassetid://1136173829",
|
["Walk"] = "http://www.roblox.com/asset/?id=507767714",
["Idle"] = "http://www.roblox.com/asset/?id=507766666",
["SwingTool"] = "rbxassetid://1262318281"
}
local anims = {}
for animName,animId in next,preAnims do
local anim = Instance.new("Animation")
anim.AnimationId = animId
game:GetService("ContentProvider"):PreloadAsync({anim})
anims[animName] = animController:LoadAnimation(anim)
end
local fallConstant = -2
run.Heartbeat:connect(function()
local part,pos,norm,mat = workspace:FindPartOnRay(Ray.new(root.Position,Vector3.new(0,-2.8,0)),char)
if target.Value then
local facingCFrame = CFrame.new(Vector3.new(root.CFrame.X,pos.Y+6.8,root.CFrame.Z),CFrame.new(target.Value.CFrame.X,pos.Y+3,target.Value.CFrame.Z).p)
bg.CFrame = facingCFrame
else
--bg.CFrame = CFrame.new(root.CFrame.X,pos.Y+3,root.CFrame.Z)
end
if target.Value then
bv.P = 100000
bv.Velocity = root.CFrame.lookVector*14
if not part then
bv.Velocity = bv.Velocity+Vector3.new(0,fallConstant,0)
fallConstant = fallConstant-1
else
fallConstant = -2
end
if not anims["Walk"].IsPlaying then
anims["Walk"]:Play()
end
else
bv.P = 0
bv.Velocity = Vector3.new(0,0,0)
anims["Walk"]:Stop()
anims["Idle"]:Play()
end
end)
while task.wait(1) do
local thresh,nearest = 120,nil
for _,player in next,game.Players:GetPlayers() do
if player.Character and player.Character.PrimaryPart then
local dist = (player.Character.PrimaryPart.Position-root.Position).magnitude
if dist < thresh then
thresh = dist
nearest = player.Character.PrimaryPart
end
end
end
if nearest then
if thresh < 8 then
anims["SwingTool"]:Play()
nearest.Parent.Humanoid:TakeDamage(24)
target.Value = nil
task.wait(1)
end
target.Value = nearest
else
target.Value = nil
end
end
|
--local origWarn = warn
|
local startTime = time()
local clientLocked = false
local oldInstNew = Instance.new
local oldReq = require
local Folder = script.Parent;
local locals = {}
local client = {}
local service = {}
local ServiceSpecific = {}
local function isModule(module)
for ind, modu in pairs(client.Modules) do
if rawequal(module, modu) then
return true
end
end
end
local function logError(...)
warn("ERROR: ", ...)
if client and client.Remote then
client.Remote.Send("LogError", table.concat({...}, " "))
end
end
local oldPrint = print;
local print = function(...)
oldPrint(":: Adonis ::", ...)
end
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 700 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 920 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 11000 -- Use sliders to manipulate values
Tune.Redline = 14000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[Status Vars]]
|
local _IsOn = _Tune.AutoStart
if _Tune.AutoStart then script.Parent.IsOn.Value=true end
local _GSteerT=0
local _GSteerC=0
local _GThrot=0
local _GBrake=0
local _ClutchOn = true
local _ClPressing = false
local _RPM = 0
local _HP = 0
local _OutTorque = 0
local _CGear = 0
local _PGear = _CGear
local _spLimit = 0
local _TMode = _Tune.TransModes[1]
local _MSteer = false
local _SteerL = false
local _SteerR = false
local _PBrake = false
local _TCS = _Tune.TCSEnabled
local _TCSActive = false
local _ABS = _Tune.ABSEnabled
local _ABSActive = false
local FlipWait=tick()
local FlipDB=false
local _InControls = false
|
--// Function stuff
|
return function()
local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings
local function Init()
Functions = server.Functions;
Admin = server.Admin;
Anti = server.Anti;
Core = server.Core;
HTTP = server.HTTP;
Logs = server.Logs;
Remote = server.Remote;
Process = server.Process;
Variables = server.Variables;
Settings = server.Settings;
Logs:AddLog("Script", "Functions Module Initialized")
end;
server.Functions = {
Init = Init;
PlayerFinders = {
["me"] = {
Match = "me";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
table.insert(players,plr)
plus()
end;
};
["all"] = {
Match = "all";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local everyone = true
if isKicking then
for i,v in next,parent:GetChildren() do
local p = getplr(v)
if p.Name:lower():sub(1,#msg)==msg:lower() then
everyone = false
table.insert(players,p)
plus()
end
end
end
if everyone then
for i,v in next,parent:GetChildren() do
local p = getplr(v)
if p then
table.insert(players,p)
plus()
end
end
end
end;
};
["@everyone"] = {
Match = "@everyone";
Absolute = true;
Function = function(...)
return Functions.PlayerMatchers.all.Function(...)
end
};
["others"] = {
Match = "others";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
for i,v in next,parent:GetChildren() do
local p = getplr(v)
if p ~= plr then
table.insert(players,p)
plus()
end
end
end;
};
["random"] = {
Match = "random";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
if #players>=#parent:GetChildren() then return end
local rand = parent:GetChildren()[math.random(#parent:children())]
local p = getplr(rand)
for i,v in pairs(players) do
if(v.Name == p.Name)then
Functions.PlayerFinders.random.Function(msg, plr, parent, players, getplr, plus, isKicking)
return;
end
end
table.insert(players,p)
plus();
end;
};
["admins"] = {
Match = "admins";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
for i,v in next,parent:children() do
local p = getplr(v)
if Admin.CheckAdmin(p,false) then
table.insert(players, p)
plus()
end
end
end;
};
["nonadmins"] = {
Match = "nonadmins";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
for i,v in next,parent:children() do
local p = getplr(v)
if not Admin.CheckAdmin(p,false) then
table.insert(players,p)
plus()
end
end
end;
};
["friends"] = {
Match = "friends";
Prefix = true;
Absolute = true;
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
for i,v in next,parent:children() do
local p = getplr(v)
if p:IsFriendsWith(plr.userId) then
table.insert(players,p)
plus()
end
end
end;
};
["%team"] = {
Match = "%";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local matched = msg:match("%%(.*)")
if matched then
for i,v in next,service.Teams:GetChildren() do
if v.Name:lower():sub(1,#matched) == matched:lower() then
for k,m in next,parent:GetChildren() do
local p = getplr(m)
if p.TeamColor == v.TeamColor then
table.insert(players,p)
plus()
end
end
end
end
end
end;
};
["$group"] = {
Match = "$";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local matched = msg:match("%$(.*)")
if matched and tonumber(matched) then
for i,v in next,parent:children() do
local p = getplr(v)
if p:IsInGroup(tonumber(matched)) then
table.insert(players,p)
plus()
end
end
end
end;
};
["id-"] = {
Match = "id-";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local matched = tonumber(msg:match("id%-(.*)"))
local foundNum = 0
if matched then
for i,v in next,parent:children() do
local p = getplr(v)
if p and p.userId == matched then
table.insert(players,p)
plus()
foundNum = foundNum+1
end
end
if foundNum == 0 then
local ran,name = pcall(function() return service.Players:GetNameFromUserIdAsync(matched) end)
if ran and name then
local fakePlayer = service.Wrap(service.New("Folder"))
local data = {
Name = name;
ToString = name;
ClassName = "Player";
AccountAge = 0;
CharacterAppearanceId = tostring(matched);
UserId = tonumber(matched);
userId = tonumber(matched);
Parent = service.Players;
Character = Instance.new("Model");
Backpack = Instance.new("Folder");
PlayerGui = Instance.new("Folder");
PlayerScripts = Instance.new("Folder");
Kick = function() fakePlayer:Destroy() fakePlayer:SetSpecial("Parent", nil) end;
IsA = function(ignore, arg) if arg == "Player" then return true end end;
}
for i,v in next,data do fakePlayer:SetSpecial(i, v) end
table.insert(players, fakePlayer)
plus()
end
end
end
end;
};
["team-"] = {
Match = "team-";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
print(1)
local matched = msg:match("team%-(.*)")
if matched then
for i,v in next,service.Teams:GetChildren() do
if v.Name:lower():sub(1,#matched) == matched:lower() then
for k,m in next,parent:GetChildren() do
local p = getplr(m)
if p.TeamColor == v.TeamColor then
table.insert(players, p)
plus()
end
end
end
end
end
end;
};
["group-"] = {
Match = "group-";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local matched = msg:match("group%-(.*)")
if matched and tonumber(matched) then
for i,v in next,parent:children() do
local p = getplr(v)
if p:IsInGroup(tonumber(matched)) then
table.insert(players,p)
plus()
end
end
end
end;
};
["-name"] = {
Match = "-";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local matched = msg:match("%-(.*)")
if matched then
local removes = service.GetPlayers(plr,matched,true)
for i,v in next,players do
for k,p in next,removes do
if v.Name == p.Name then
table.remove(players,i)
plus()
end
end
end
end
end;
};
["#number"] = {
Match = "#";
Function = function(msg, plr, ...)
local matched = msg:match("%#(.*)")
if matched and tonumber(matched) then
local num = tonumber(matched)
if not num then
Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = "Invalid number!"})
end
for i = 1,num do
Functions.PlayerFinders.random.Function(msg, plr, ...)
end
end
end;
};
["radius-"] = {
Match = "radius-";
Function = function(msg, plr, parent, players, getplr, plus, isKicking)
local matched = msg:match("radius%-(.*)")
if matched and tonumber(matched) then
local num = tonumber(matched)
if not num then
Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = "Invalid number!"})
end
for i,v in next,parent:GetChildren() do
local p = getplr(v)
if p ~= plr and plr:DistanceFromCharacter(p.Character.Head.Position) <= num then
table.insert(players,p)
plus()
end
end
end
end;
};
};
IsClass = function(obj, classList)
for _,class in next,classList do
if obj:IsA(class) then
return true
end
end
end;
PerformOnEach = function(itemList, func, ...)
for i,v in next,itemList do
pcall(func, v, ...)
end
end;
ArgsToString = function(args)
local str = ""
for i,arg in next,args do
str = str.."Arg"..tostring(i)..": "..tostring(arg).."; "
end
return str
end;
GetPlayers = function(plr, names, dontError, isServer, isKicking, noID)
local players = {}
local prefix = Settings.SpecialPrefix
if isServer then prefix = "" end
local parent = service.NetworkServer or service.Players
local function getplr(p)
if p and p:IsA("Player") then
return p
elseif p and p:IsA('NetworkReplicator') then
if p:GetPlayer()~=nil and p:GetPlayer():IsA('Player') then
return p:GetPlayer()
end
end
end
local function checkMatch(msg)
for ind, data in next, Functions.PlayerFinders do
if not data.Level or (data.Level and Admin.GetLevel(plr) >= data.Level) then
local check = ((data.Prefix and Settings.SpecialPrefix) or "")..data.Match
if (data.Absolute and msg:lower() == check) or (not data.Absolute and msg:lower():sub(1,#check) == check:lower()) then
return data
end
end
end
end
if plr == nil then
for i,v in pairs(parent:GetChildren()) do
local p = getplr(v)
if p then
table.insert(players,p)
end
end
elseif plr and not names then
return {plr}
else
if names:lower():sub(1,2) == "##" then
error("String passed to GetPlayers is filtered: "..tostring(names))
else
for s in names:gmatch('([^,]+)') do
local plrs = 0
local function plus()
plrs = plrs+1
end
local matchFunc = checkMatch(s)
if matchFunc then
matchFunc.Function(s, plr, parent, players, getplr, plus, isKicking, isServer, dontError)
else
for i,v in next,parent:children() do
local p = getplr(v)
if p and p.Name:lower():sub(1,#s)==s:lower() then
table.insert(players,p)
plus()
end
end
if plrs == 0 then
local ran,userid = pcall(function() return service.Players:GetUserIdFromNameAsync(s) end)
if ran and tonumber(userid) then
local fakePlayer = service.Wrap(service.New("Folder"))
local data = {
Name = s;
ToString = s;
ClassName = "Player";
AccountAge = 0;
CharacterAppearanceId = tostring(userid);
UserId = tonumber(userid);
userId = tonumber(userid);
Parent = service.Players;
Character = Instance.new("Model");
Backpack = Instance.new("Folder");
PlayerGui = Instance.new("Folder");
PlayerScripts = Instance.new("Folder");
Kick = function() fakePlayer:Destroy() fakePlayer:SetSpecial("Parent", nil) end;
IsA = function(ignore, arg) if arg == "Player" then return true end end;
}
for i,v in next,data do fakePlayer:SetSpecial(i, v) end
table.insert(players, fakePlayer)
plus()
end
end
end
if plrs == 0 and not dontError then
Remote.MakeGui(plr,'Output',{Title = 'Output'; Message = 'No players matching '..s..' were found!'})
end
end
end
end
if not isKicking then
for i,Player in pairs(players) do
for _,Card in pairs(Variables.NOU) do
if plr==Card.Target and Player==Card.User then
table.remove(players,i)
table.insert(players,i,plr)
end
end
end
end
return players
end;
GetRandom = function(pLen)
--local str = ""
--for i=1,math.random(5,10) do str=str..string.char(math.random(33,90)) end
--return str
local Len = (type(pLen) == "number" and pLen) or math.random(5,10) --// reru
local Res = {};
for Idx = 1, Len do
Res[Idx] = string.format('%02x', math.random(126));
end;
return table.concat(Res)
end;
Base64Encode = function(data)
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
return ((data:gsub('.', function(x)
local r,b='',x:byte()
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
return r;
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
if (#x < 6) then return '' end
local c=0
for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
return b:sub(c+1,c+1)
end)..({ '', '==', '=' })[#data%3+1])
end;
Base64Decode = function(data)
local b = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
data = string.gsub(data, '[^'..b..'=]', '')
return (data:gsub('.', function(x)
if (x == '=') then return '' end
local r,f='',(b:find(x)-1)
for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
return r;
end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
if (#x ~= 8) then return '' end
local c=0
for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(7-i) or 0) end
return string.char(c)
end))
end;
Hint = function(message,players,time)
for i,v in pairs(players) do
Remote.MakeGui(v,"Hint",{
Message = message;
Time = time;
})
end
end;
Message = function(title,message,players,scroll,tim)
for i,v in pairs(players) do
Remote.RemoveGui(v,"Message")
Remote.MakeGui(v,"Message",{
Title = title;
Message = message;
Scroll = scroll;
Time = tim;
})
end
end;
Notify = function(title,message,players,tim)
for i,v in pairs(players) do
Remote.RemoveGui(v,"Notify")
Remote.MakeGui(v,"Notify",{
Title = title;
Message = message;
Time = tim;
})
end
end;
MakeWeld = function(a, b)
local weld = service.New("ManualWeld", a)
weld.Part0 = a
weld.Part1 = b
weld.C0 = a.CFrame:inverse() * b.CFrame
return weld
end;
SetView = function(ob)
if ob == 'reset' then
workspace.CurrentCamera.CameraType = 'Custom'
workspace.CurrentCamera.CameraSubject = service.Player.Character.Humanoid
workspace.CurrentCamera.FieldOfView = 70
else
workspace.CurrentCamera.CameraSubject = ob
end
end;
SetLighting = function(prop,value)
if service.Lighting[prop]~=nil then
service.Lighting[prop] = value
Variables.LightingSettings[prop] = value
for ind,p in pairs(service.GetPlayers()) do
Remote.SetLighting(p,prop,value)
end
end
end;
LoadEffects = function(plr)
for i,v in pairs(Variables.LocalEffects) do
if (v.Part and v.Part.Parent) or v.NoPart then
if v.Type == "Cape" then
Remote.Send(plr,"Function","NewCape",v.Data)
elseif v.Type == "Particle" then
Remote.NewParticle(plr,v.Part,v.Class,v.Props)
end
else
Variables.LocalEffects[i] = nil
end
end
end;
NewParticle = function(target,type,props)
local ind = Functions.GetRandom()
Variables.LocalEffects[ind] = {
Part = target;
Class = type;
Props = props;
Type = "Particle";
}
for i,v in next,service.Players:GetPlayers() do
Remote.NewParticle(v,target,type,props)
end
end;
RemoveParticle = function(target,name)
for i,v in next,Variables.LocalEffects do
if v.Type == "Particle" and v.Part == target and (v.Props.Name == name or v.Class == name) then
Variables.LocalEffects[i] = nil
end
end
for i,v in next,service.Players:GetPlayers() do
Remote.RemoveParticle(v,target,name)
end
end;
UnCape = function(plr)
for i,v in pairs(Variables.LocalEffects) do
if v.Type == "Cape" and v.Player == plr then
Variables.LocalEffects[i] = nil
end
end
for i,v in pairs(service.GetPlayers()) do
Remote.Send(v,"Function","RemoveCape",plr.Character)
end
end;
Cape = function(player,isdon,material,color,decal,reflect)
Functions.UnCape(player)
local torso = player.Character:FindFirstChild("HumanoidRootPart")
if torso then
if type(color) == "table" then
color = Color3.new(color[1],color[2],color[3])
end
local data = {
Color = color;
Parent = player.Character;
Material = material;
Reflectance = reflect;
Decal = decal;
}
if (isdon and Settings.DonorCapes and Settings.LocalCapes) then
Remote.Send(player,"Function","NewCape",data)
else
local ind = Functions.GetRandom()
Variables.LocalEffects[ind] = {
Player = player;
Part = player.Character.HumanoidRootPart;
Data = data;
Type = "Cape";
}
for i,v in pairs(service.GetPlayers()) do
Remote.Send(v,"Function","NewCape",data)
end
end
end
end;
LoadOnClient = function(player,source,object,name)
if service.Players:FindFirstChild(player.Name) then
local parent = player:FindFirstChild('PlayerGui') or player:WaitForChild('Backpack')
local cl = Core.NewScript('LocalScript',source)
cl.Name = name or Functions.GetRandom()
cl.Parent = parent
cl.Disabled = false
if object then
table.insert(Variables.Objects,cl)
end
end
end;
Split = function(msg,key,num)
if not msg or not key or not num or num <= 0 then return {} end
if key=="" then key = " " end
local tab = {}
local str = ''
for arg in msg:gmatch('([^'..key..']+)') do
if #tab>=num then
break
elseif #tab>=num-1 then
table.insert(tab,msg:sub(#str+1,#msg))
else
str = str..arg..key
table.insert(tab,arg)
end
end
return tab
end;
BasicSplit = function(msg,key)
local ret = {}
for arg in msg:gmatch("([^"..key.."]+)") do
table.insert(ret,arg)
end
return ret
end;
CountTable = function(tab)
local num = 0
for i in pairs(tab) do
num = num+1
end
return num
end;
GetTexture = function(ID)
ID = Functions.Trim(tostring(ID))
local created
if not tonumber(ID) then
return false
else
ID = tonumber(ID)
end
if not pcall(function() updated=service.MarketPlace:GetProductInfo(ID).Created:match("%d+-%d+-%S+:%d+") end) then
return false
end
for i = 0,10 do
local info
local ran,error = pcall(function() info = service.MarketPlace:GetProductInfo(ID-i) end)
if ran then
if info.AssetTypeId == 1 and info.Created:match("%d+-%d+-%S+:%d+") == updated then
return ID-i
end
end
end
end;
Trim = function(str)
return str:match("^%s*(.-)%s*$")
end;
Round = function(num)
return math.floor(num + 0.5)
end;
RoundToPlace = function(num, places)
return math.floor((num*(10^(places or 0)))+0.5)/(10^(places or 0))
end;
GetOldDonorList = function()
local temp={}
for k,asset in pairs(service.InsertService:GetCollection(1290539)) do
local ins=service.MarketPlace:GetProductInfo(asset.AssetId)
local fo=ins.Description
for so in fo:gmatch('[^;]+') do
local name,id,cape,color=so:match('{(.*),(.*),(.*),(.*)}')
table.insert(temp,{Name=name,Id=tostring(id),Cape=tostring(cape),Color=color,Material='Plastic',List=ins.Name})
end
end
Variables.OldDonorList = temp
end;
CleanWorkspace = function()
for i,v in pairs(service.Workspace:children()) do
if v:IsA("Tool") or v:IsA("Accessory") or v:IsA("Hat") then
v:Destroy()
end
end
end;
GrabNilPlayers = function(name)
local AllGrabbedPlayers = {}
for i,v in pairs(service.NetworkServer:GetChildren()) do
pcall(function()
if v:IsA("ServerReplicator") then
if v:GetPlayer().Name:lower():sub(1,#name)==name:lower() or name=='all' then
table.insert(AllGrabbedPlayers, (v:GetPlayer() or "NoPlayer"))
end
end
end)
end
return AllGrabbedPlayers
end;
AssignName = function()
local name=math.random(100000,999999)
return name
end;
Shutdown = function(reason)
if not Core.PanicMode then
Functions.Message("SYSTEM MESSAGE", "Shutting down...", service.Players:GetChildren(), false, 5)
wait(1)
end
service.Players.PlayerAdded:connect(function(p)
p:Kick("Game shutdown: ".. tostring(reason or "No Reason Given"))
end)
for i,v in pairs(service.NetworkServer:children()) do
service.Routine(function()
if v and v:GetPlayer() then
v:GetPlayer():Kick("Game shutdown: ".. tostring(reason or "No Reason Given"))
wait(30)
if v.Parent and v:GetPlayer() then
Remote.Send(v:GetPlayer(),'Function','KillClient')
end
end
end)
end
end;
Donor = function(plr)
if (Admin.CheckDonor(plr) and Settings.DonorCapes) then
local PlayerData = Core.GetPlayer(plr) or {Donor = {}}
local donor = PlayerData.Donor or {}
if donor and donor.Enabled then
local img,color,material
if donor and donor.Cape then
img,color,material = donor.Cape.Image,donor.Cape.Color,donor.Cape.Material
else
img,color,material = '0','White','Neon'
end
if plr and plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
Functions.Cape(plr,true,material,color,img)
end
--[[
if Admin.CheckDonor(plr) and (Settings.DonorPerks or Admin.GetLevel(plr)>=4) then
local gear=service.InsertService:LoadAsset(57902997):children()[1]
if not plr.Backpack:FindFirstChild(gear.Name..'DonorTool') then
gear.Name=gear.Name..'DonorTool'
gear.Parent=plr.Backpack
else
gear:Destroy()
end
end --]]
end
end
end;
CheckMatch = function(check,match)
if check==match then
return true
elseif type(check)=="table" and type(match)=="table" then
local good = false
local num = 0
for k,m in pairs(check) do
if m == match[k] then
good = true
else
good = false
break
end
num = num+1
end
if good and num==Functions.CountTable(check) then
return true
end
end
end;
GetIndex = function(tab,match)
for i,v in pairs(tab) do
if v==match then
return i
elseif type(v)=="table" and type(match)=="table" then
local good = false
for k,m in pairs(v) do
if m == match[k] then
good = true
else
good = false
break
end
end
if good then
return i
end
end
end
end
};
end
|
--[[
Fired when state is left
]]
|
function Transitions.onLeavePreGame(stateMachine, event, from, to, playerComponent)
PlayerPreGame.leave(stateMachine, playerComponent)
end
|
-- This is meant for translating user game text that appears under CoreGui.
-- It uses Player.LocaleId and the LocalizationTables under LocalizationService.
-- This includes team names, score names, tool names, and notification toasts.
-- DO NOT USE THIS TO TRANSLATE ROBLOX TEXT IN ROBLOX GUIS!!!
-- Text from Roblox in Roblox guis should use LocalizationService.RobloxLocaleId
-- and the CoreScriptLocalization table, NOT user tables with the game locale ID.
|
function GameTranslator:TranslateGameText(context, text)
if CoreScriptTranslateGameText then
local translator = getTranslator()
if translator then
return translator:RobloxOnlyTranslate(context, text)
else
return text
end
else
return text
end
end
local function retranslateAll()
for element, info in pairs(registryInfoMap) do
element.Text = GameTranslator:TranslateGameText(info.context, info.text)
end
end
if CoreScriptTranslateGameText then
LocalizationService.AutoTranslateWillRun:Connect(retranslateAll)
end
function GameTranslator:TranslateAndRegister(element, context, text)
if CoreScriptTranslateGameText then
element.Text = self:TranslateGameText(context, text)
registerGui(element, context, text)
end
return text
end
return GameTranslator
|
-- tableUtil.Assign(Table target, ...Table sources)
|
local function Assign(target, ...)
for _,src in ipairs({...}) do
for k,v in pairs(src) do
target[k] = v
end
end
return target
end
local function Print(tbl, label, deepPrint)
assert(type(tbl) == "table", "First argument must be a table")
assert(label == nil or type(label) == "string", "Second argument must be a string or nil")
label = (label or "TABLE")
local strTbl = {}
local indent = " - "
-- Insert(string, indentLevel)
local function Insert(s, l)
strTbl[#strTbl + 1] = (indent:rep(l) .. s .. "\n")
end
local function AlphaKeySort(a, b)
return (tostring(a.k) < tostring(b.k))
end
local function PrintTable(t, lvl, lbl)
Insert(lbl .. ":", lvl - 1)
local nonTbls = {}
local tbls = {}
local keySpaces = 0
for k,v in pairs(t) do
if (type(v) == "table") then
table.insert(tbls, {k = k, v = v})
else
table.insert(nonTbls, {k = k, v = "[" .. typeof(v) .. "] " .. tostring(v)})
end
local spaces = #tostring(k) + 1
if (spaces > keySpaces) then
keySpaces = spaces
end
end
table.sort(nonTbls, AlphaKeySort)
table.sort(tbls, AlphaKeySort)
for _,v in pairs(nonTbls) do
Insert(tostring(v.k) .. ":" .. (" "):rep(keySpaces - #tostring(v.k)) .. v.v, lvl)
end
if (deepPrint) then
for _,v in pairs(tbls) do
PrintTable(v.v, lvl + 1, tostring(v.k) .. (" "):rep(keySpaces - #tostring(v.k)) .. " [Table]")
end
else
for _,v in pairs(tbls) do
Insert(tostring(v.k) .. ":" .. (" "):rep(keySpaces - #tostring(v.k)) .. "[Table]", lvl)
end
end
end
PrintTable(tbl, 1, label)
print(table.concat(strTbl, ""))
end
local function IndexOf(tbl, item)
for i = 1,#tbl do
if (tbl[i] == item) then
return i
end
end
return nil
end
local function Reverse(tbl)
local n = #tbl
local tblRev = table.create(n)
for i = 1,n do
tblRev[i] = tbl[n - i + 1]
end
return tblRev
end
local function Shuffle(tbl)
assert(type(tbl) == "table", "First argument must be a table")
local rng = Random.new()
for i = #tbl, 2, -1 do
local j = rng:NextInteger(1, i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
end
local function IsEmpty(tbl)
return (next(tbl) == nil)
end
local function EncodeJSON(tbl)
return http:JSONEncode(tbl)
end
local function DecodeJSON(str)
return http:JSONDecode(str)
end
local function FastRemoveFirstValue(t, v)
local index = IndexOf(t, v)
if (index) then
FastRemove(t, index)
return true, index
end
return false, nil
end
TableUtil.Copy = CopyTable
TableUtil.CopyShallow = CopyTableShallow
TableUtil.Sync = Sync
TableUtil.FastRemove = FastRemove
TableUtil.FastRemoveFirstValue = FastRemoveFirstValue
TableUtil.Print = Print
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.Assign = Assign
TableUtil.IndexOf = IndexOf
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON
return TableUtil
|
--[[Steering]]
|
Tune.SteerInner = 49 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 50 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .02 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .1 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 100000 -- Steering Aggressiveness
|
-- 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 = 28 -- 0% - 100%
exceptions = {"Horn","Engine","Ignition","Smoke"} -- put names of audios to ignore here (AUTO ONLY)
|
--[=[
Constructs a new value object
@param baseValue T
@return ValueObject
]=]
|
function ValueObject.new(baseValue)
local self = {}
rawset(self, "_value", baseValue)
self._maid = Maid.new()
|
-- Get the correct sound from our sound list.
|
local function getSoundProperties()
for name, data in pairs(IDList) do
if name == material then
oldWalkSpeed = humanoid.WalkSpeed
id = data.id
volume = data.volume
playbackSpeed = (humanoid.WalkSpeed / 16) * data.speed
break
end
end
end
|
-- Initialization
|
local MapPurgeProof = game.Workspace:FindFirstChild("MapPurgeProof")
if not MapPurgeProof then
MapPurgeProof = Instance.new("Folder", game.Workspace)
MapPurgeProof.Name = "MapPurgeProof"
end
|
--// Tables
|
local L_65_ = {
"285421759";
"151130102";
"151130171";
"285421804";
"287769483";
"287769415";
"285421687";
"287769261";
"287772525";
"287772445";
"287772351";
"285421819";
"287772163";
}
local L_66_ = workspace:FindFirstChild("BulletModel: " .. L_2_.Name) or Instance.new("Folder", workspace)
L_66_.Name = "BulletModel: " .. L_2_.Name
local L_67_
local L_68_ = L_21_.Ammo
local L_69_ = L_21_.StoredAmmo * L_21_.MagCount
IgnoreList = {
L_3_,
L_66_,
L_5_
}
|
--------LEFT DOOR --------
|
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(106)
game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
|
-------------------------------------------------------------------------------------
|
Loader:updateModel(Model, Config.userId.Value)
if Config.AutoUpdateCharacter.Value then
while wait() do
Loader:updateModel(Model, Config.userId.Value)
end
end
|
--[=[
@param name string
@param priority number
@param fn (dt: number) -> nil
Calls `RunService:BindToRenderStep` and registers a function in the
Janitor that will call `RunService:UnbindFromRenderStep` on cleanup.
```lua
Janitor:BindToRenderStep("Test", Enum.RenderPriority.Last.Value, function(dt)
-- Do something
end)
```
]=]
|
function Janitor:BindToRenderStep(name: string, priority: number, fn: (dt: number) -> nil)
RunService:BindToRenderStep(name, priority, fn)
self:Add(function()
RunService:UnbindFromRenderStep(name)
end)
end
|
-- How many times per second the gun can fire
|
local FireRate = 5 / 5.5
|
-- Variables --
|
local proximityPrompts = {}
local connections = {}
local tween
local isOpen = false
local shrinkSpeed = Settings["Shrink speed"].Value
local teamColorObjectValues = Settings.Teams:GetChildren()
local openGoal
local closedGoal
|
-- Create component
|
local ImageLabel = Roact.PureComponent:extend 'ImageLabel'
|
--[[
Plays an animation on humanoid/character/player. Returns {animationTrack, animation}
Functions.Animation(
id, <-- |REQ| Animation ID
instance, <-- |REQ| Player/character/humanoid
)
--]]
|
return function(id, parent)
local humanoid
--- Get humanoid
if parent.ClassName == "Humanoid" then
humanoid = parent
elseif parent:FindFirstChildOfClass("Humanoid") then
humanoid = parent:FindFirstChildOfClass("Humanoid")
elseif parent.ClassName == "Player" then
humanoid = parent.Character:FindFirstChild("Humanoid")
end
--- Play animation
if humanoid then
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://" .. id
--
local track = humanoid:LoadAnimation(animation)
track:Play()
--
return track
end
end
|
-- Load proper GUI
|
local gui = Guis:WaitForChild(IS_MOBILE and "MobileGui" or IS_CONSOLE and "ConsoleGui" or "DesktopGui")
gui.Parent = player.PlayerGui
local guiController = require(gui:WaitForChild("GuiController"))
|
-- ROBLOX deviation: omitted functionToString since we don't use it
| |
--local Part = script.Parent
--local Org = Part.Position
|
local rate = 1 / 30
local frames = Time.Value / rate
for frame = 1, frames do
wait(rate)
local percent = frame / frames
--Part.Position = Org + Vector3.new(0, 5 * percent, 0)
Lbl.Value.Parent.StudsOffset = Lbl.Value.Parent.StudsOffset + Vector3.new(0, 0.2, 0)
Lbl.Value.TextTransparency = percent
Lbl.Value.TextStrokeTransparency = percent
end
|
-- Folders to parse into databases
|
for _, databaseFolder in ipairs(ReplicateStorage.Common.Databases:GetChildren()) do
Database.ParseFolder(databaseFolder)
end
|
--// Settings //--
|
script.Parent.Triggered:Connect(function(plr)
plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + amount
s.Playing = true
end)
|
--Services
|
local UIS = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local ti = TweenInfo.new(
0.5,
Enum.EasingStyle.Sine
)
|
--s.Pitch = 0.7
|
s.Volume=1
s2.Volume=0
while true do
|
-- If gun has more than one part undisable this and it will weld everything for you!
|
function Weld(p0,p1)
local weld = Instance.new('Weld')
weld.Part0 = p0
weld.Part1 = p1
weld.C0 = p0.CFrame:inverse()*CFrame.new(p0.Position)
weld.C1 = p1.CFrame:inverse()*CFrame.new(p0.Position)
weld.Parent = p0
end
function WeldIt(obj) if obj then
if obj:IsA('BasePart') then Weld(script.Parent.Handle,obj) end
for i,v in pairs(obj:children()) do WeldIt(v) end
end
end
script.Parent.Equipped:connect(function() WeldIt(script.Parent) end)
script.Parent.Unequipped:connect(function() WeldIt(script.Parent) end)
WeldIt(script.Parent)
|
--Made by Superluck, Uploaded by FederalSignal_QCB. and Dalek For the Amps
--Made by Superluck, Uploaded by FederalSignal_QCB. and Dalek For the Amps
--Made by Superluck, Uploaded by FederalSignal_QCB. and Dalek For the Amps
|
script.Parent.Material = Enum.Material.Glass
script.Parent.Parent.Parent.On.Changed:Connect(function()
if script.Parent.Parent.Parent.On.Value == true then
script.Parent.Material = Enum.Material.Neon
else
script.Parent.Material = Enum.Material.Glass
end
end)
|
--]]
|
primaryWeaponSlot.ChildAdded:Connect(function(newChild)
weapon1Label.BackgroundColor3 = offColor
weapon1Label.Text = newChild.Name
end)
secondaryWeaponSlot.ChildAdded:Connect(function(newChild)
weapon2Label.BackgroundColor3 = offColor
weapon2Label.Text = newChild.Name
end)
tertiaryWeaponSlot.ChildAdded:Connect(function(newChild)
weapon3Label.BackgroundColor3 = offColor
weapon3Label.Text = newChild.Name
end)
|
-- Local variable defaults
|
local startCheckpoint = nil
local finishCheckpoint = nil
local numLaps = 1
local raceDuration = 60
local debugEnabled = false
|
-------------------------
|
function onClicked()
R.Function1.Disabled = true
FX.ROLL.BrickColor = BrickColor.new("CGA brown")
FX.ROLL.loop.Disabled = true
FX.REVERB.BrickColor = BrickColor.new("CGA brown")
FX.REVERB.loop.Disabled = true
FX.GATE.BrickColor = BrickColor.new("CGA brown")
FX.GATE.loop.Disabled = true
FX.PHASER.BrickColor = BrickColor.new("CGA brown")
FX.PHASER.loop.Disabled = true
FX.SLIPROLL.BrickColor = BrickColor.new("CGA brown")
FX.SLIPROLL.loop.Disabled = true
FX.FILTER.BrickColor = BrickColor.new("CGA brown")
FX.FILTER.loop.Disabled = true
FX.SENDRETURN.BrickColor = BrickColor.new("Really red")
FX.SENDRETURN.loop.Disabled = true
FX.TRANS.BrickColor = BrickColor.new("CGA brown")
FX.TRANS.loop.Disabled = true
FX.MultiTapDelay.BrickColor = BrickColor.new("CGA brown")
FX.MultiTapDelay.loop.Disabled = true
FX.DELAY.BrickColor = BrickColor.new("CGA brown")
FX.DELAY.loop.Disabled = true
FX.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--end
|
end
end
function Plaka()
for i,v in pairs(Car.Body.Plate:GetChildren()) do
|
--------------------------------------------------------------------------------------------------
|
if Module.DualEnabled then
Handle2 = Tool:WaitForChild("Handle2",2)
if Handle2 == nil and Module.DualEnabled then error("\"Dual\" setting is enabled but \"Handle2\" is missing!") end
end
local Equipped = false
local Enabled = true
local Down = false
local HoldDown = false
local Reloading = false
local AimDown = false
local Scoping = false
local Mag = MagValue.Value
local Ammo = AmmoValue.Value
local MaxAmmo = Module.MaxAmmo
if Module.IdleAnimationID ~= nil or Module.DualEnabled then
IdleAnim = Tool:WaitForChild("IdleAnim")
IdleAnim = Humanoid:LoadAnimation(IdleAnim)
end
if Module.FireAnimationID ~= nil then
FireAnim = Tool:WaitForChild("FireAnim")
FireAnim = Humanoid:LoadAnimation(FireAnim)
end
if Module.ReloadAnimationID ~= nil then
ReloadAnim = Tool:WaitForChild("ReloadAnim")
ReloadAnim = Humanoid:LoadAnimation(ReloadAnim)
end
if Module.ShotgunClipinAnimationID ~= nil then
ShotgunClipinAnim = Tool:WaitForChild("ShotgunClipinAnim")
ShotgunClipinAnim = Humanoid:LoadAnimation(ShotgunClipinAnim)
end
if Module.HoldDownAnimationID ~= nil then
HoldDownAnim = Tool:WaitForChild("HoldDownAnim")
HoldDownAnim = Humanoid:LoadAnimation(HoldDownAnim)
end
if Module.EquippedAnimationID ~= nil then
EquippedAnim = Tool:WaitForChild("EquippedAnim")
EquippedAnim = Humanoid:LoadAnimation(EquippedAnim)
end
function wait(TimeToWait)
if TimeToWait ~= nil then
local TotalTime = 0
TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
while TotalTime < TimeToWait do
TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
end
else
game:GetService("RunService").Heartbeat:wait()
end
end
function numLerp(A, B, Alpha)
return A + (B - A) * Alpha
end
function RAND(Min, Max, Accuracy)
local Inverse = 1 / (Accuracy or 1)
return (math.random(Min * Inverse, Max * Inverse) / Inverse)
end
function GetFireDirection(CurrentPosOnScreen, FirePointObject)
local X = CurrentPosOnScreen.X + math.random(-Module.SpreadX * 2, Module.SpreadX * 2) * (AimDown and 1-Module.SpreadRedutionIS and 1-Module.SpreadRedutionS or 1)
local Y = CurrentPosOnScreen.Y + math.random(-Module.SpreadY * 2, Module.SpreadY * 2) * (AimDown and 1-Module.SpreadRedutionIS and 1-Module.SpreadRedutionS or 1)
local RayMag1 = Camera:ScreenPointToRay(X, Y) --Hence the var name, the magnitude of this is 1.
local NewRay = Ray.new(RayMag1.Origin, RayMag1.Direction * 5000)
local Target, Position = workspace:FindPartOnRay(NewRay, Character)
--NOTE: This ray is from camera to object's position. This is why I check for a position value - With that value, I can get the proper direction
return (Position - FirePointObject.WorldPosition).Unit
end
MarkerEvent.Event:connect(function(IsHeadshot)
pcall(function()
if Module.HitmarkerEnabled then
if IsHeadshot then
GUI.Crosshair.Hitmarker.ImageColor3 = Module.HitmarkerColorHS
GUI.Crosshair.Hitmarker.ImageTransparency = 0
TweeningService:Create(GUI.Crosshair.Hitmarker, TweenInfo.new(Module.HitmarkerFadeTimeHS, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
local markersound = GUI.Crosshair.MarkerSound:Clone()
markersound.PlaybackSpeed = Module.HitmarkerSoundPitchHS
markersound.Parent = Player.PlayerGui
markersound:Play()
game:GetService("Debris"):addItem(markersound,markersound.TimeLength)
else
GUI.Crosshair.Hitmarker.ImageColor3 = Module.HitmarkerColor
GUI.Crosshair.Hitmarker.ImageTransparency = 0
TweeningService:Create(GUI.Crosshair.Hitmarker, TweenInfo.new(Module.HitmarkerFadeTime, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {ImageTransparency = 1}):Play()
local markersound = GUI.Crosshair.MarkerSound:Clone()
markersound.PlaybackSpeed = Module.HitmarkerSoundPitch
markersound.Parent = Player.PlayerGui
markersound:Play()
game:GetService("Debris"):addItem(markersound,markersound.TimeLength)
end
end
end)
end)
function EjectShell(ShootingHandle)
if Module.BulletShellEnabled then
local ShellPos = (ShootingHandle.CFrame * CFrame.new(Module.BulletShellOffset.X,Module.BulletShellOffset.Y,Module.BulletShellOffset.Z)).p
local Chamber = Instance.new("Part")
Chamber.Name = "Chamber"
Chamber.Size = Vector3.new(0.01,0.01,0.01)
Chamber.Transparency = 1
Chamber.Anchored = false
Chamber.CanCollide = false
Chamber.TopSurface = Enum.SurfaceType.SmoothNoOutlines
Chamber.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
local Weld = Instance.new("Weld",Chamber)
Weld.Part0 = ShootingHandle
Weld.Part1 = Chamber
Weld.C0 = CFrame.new(Module.BulletShellOffset.X,Module.BulletShellOffset.Y,Module.BulletShellOffset.Z)
Chamber.Position = ShellPos
Chamber.Parent = workspace.CurrentCamera
local function spawner()
local Shell = Instance.new("Part")
Shell.CFrame = Chamber.CFrame * CFrame.fromEulerAnglesXYZ(-2.5,1,1)
Shell.Size = Module.ShellSize
Shell.CanCollide = Module.AllowCollide
Shell.Name = "Shell"
--VVV Edit here VVV--
Shell.Velocity = Chamber.CFrame.lookVector * 20 + Vector3.new(math.random(-10,10),20,math.random(-10,10))
Shell.RotVelocity = Vector3.new(0,200,0)
--^^^ Edit here ^^^--
Shell.Parent = workspace.CurrentCamera
local shellmesh = Instance.new("SpecialMesh")
shellmesh.Scale = Module.ShellScale
shellmesh.MeshId = "rbxassetid://"..Module.ShellMeshID
shellmesh.TextureId = "rbxassetid://"..Module.ShellTextureID
shellmesh.MeshType = "FileMesh"
shellmesh.Parent = Shell
game:GetService("Debris"):addItem(Shell,Module.DisappearTime)
end
spawn(spawner)
game.Debris:AddItem(Chamber,10)
end
end
function RecoilCamera()
if Module.CameraRecoilingEnabled then
local CurrentRecoil = Module.Recoil*(AimDown and 1-Module.RecoilRedution or 1)
local RecoilX = math.rad(CurrentRecoil * RAND(Module.AngleX_Min, Module.AngleX_Max, Module.Accuracy))
local RecoilY = math.rad(CurrentRecoil * RAND(Module.AngleY_Min, Module.AngleY_Max, Module.Accuracy))
local RecoilZ = math.rad(CurrentRecoil * RAND(Module.AngleZ_Min, Module.AngleZ_Max, Module.Accuracy))
CameraModule:accelerate(RecoilX,RecoilY,RecoilZ)
delay(0.05, function()
CameraModule:accelerateXY(-RecoilX,-RecoilY)
end)
end
end
function Fire(ShootingHandle, InputPos)
if FireAnim then FireAnim:Play(nil,nil,Module.FireAnimationSpeed) end
if not ShootingHandle.FireSound.Playing or not ShootingHandle.FireSound.Looped then ShootingHandle.FireSound:Play() end
local FireDirection = GetFireDirection(InputPos, ShootingHandle:FindFirstChild("GunFirePoint"))
Player.PlayerScripts.BulletVisualizerScript.Visualize:Fire(nil,Tool,ShootingHandle,FireDirection,
ShootingHandle:FindFirstChild("GunFirePoint"),
{Module.HitEffectEnabled,Module.HitSoundIDs,Module.HitSoundPitch,Module.HitSoundVolume,script:WaitForChild("HitEffect"),Module.CustomHitEffect},
{Module.BloodEnabled,Module.HitCharSndIDs,Module.HitCharSndPitch,Module.HitCharSndVolume,script:WaitForChild("BloodEffect")},
{Module.BulletHoleEnabled,Module.BulletHoleSize,Module.BulletHoleTexture,Module.PartColor,Module.BulletHoleVisibleTime,Module.BulletHoleFadeTime},
{Module.FleshHole,Module.FleshHoleSize,Module.FleshHoleTexture,Module.FleshHoleColor,Module.FleshHoleVisibleTime,Module.FleshHoleFadeTime},
{Module.ExplosiveEnabled,Module.ExplosionRadius,Module.ExplosionSoundEnabled,Module.ExplosionSoundIDs,Module.ExplosionSoundPitch,Module.ExplosionSoundVolume,Module.CustomExplosion,script:WaitForChild("ExplosionEffect")},
{Module.BulletTracerEnabled,Module.BulletTracerOffset0,Module.BulletTracerOffset1,script:WaitForChild("TracerEffect"),Module.BulletParticleEnaled,script:WaitForChild("ParticleEffect"),Module.Range,Module.BulletSpeed,Module.DropGravity,Module.WindOffset,Module.BulletSize,Module.BulletColor,Module.BulletTransparency,Module.BulletMaterial,Module.BulletShape,Module.BulletMeshEnabled,Module.BulletMeshID,Module.BulletTextureID,Module.BulletMeshScale},
{Module.BaseDamage,Module.HeadshotDamageMultiplier,Module.HeadshotEnabled},
{Module.WhizSoundEnabled,Module.WhizSoundID,Module.WhizSoundVolume,Module.WhizSoundPitch},
{Module.BulletLightEnabled,Module.BulletLightBrightness,Module.BulletLightColor,Module.BulletLightRange,Module.BulletLightShadows},
{Module.Knockback, Module.Lifesteal, Module.FlamingBullet})
VisualizeBullet:FireServer(Tool,ShootingHandle,FireDirection,
ShootingHandle:FindFirstChild("GunFirePoint"),
{Module.HitEffectEnabled,Module.HitSoundIDs,Module.HitSoundPitch,Module.HitSoundVolume,script:WaitForChild("HitEffect"),Module.CustomHitEffect},
{Module.BloodEnabled,Module.HitCharSndIDs,Module.HitCharSndPitch,Module.HitCharSndVolume,script:WaitForChild("BloodEffect")},
{Module.BulletHoleEnabled,Module.BulletHoleSize,Module.BulletHoleTexture,Module.PartColor,Module.BulletHoleVisibleTime,Module.BulletHoleFadeTime},
{Module.FleshHole,Module.FleshHoleSize,Module.FleshHoleTexture,Module.FleshHoleColor,Module.FleshHoleVisibleTime,Module.FleshHoleFadeTime},
{Module.ExplosiveEnabled,Module.ExplosionRadius,Module.ExplosionSoundEnabled,Module.ExplosionSoundIDs,Module.ExplosionSoundPitch,Module.ExplosionSoundVolume,Module.CustomExplosion,script:WaitForChild("ExplosionEffect")},
{Module.BulletTracerEnabled,Module.BulletTracerOffset0,Module.BulletTracerOffset1,script:WaitForChild("TracerEffect"),Module.BulletParticleEnaled,script:WaitForChild("ParticleEffect"),Module.Range,Module.BulletSpeed,Module.DropGravity,Module.WindOffset,Module.BulletSize,Module.BulletColor,Module.BulletTransparency,Module.BulletMaterial,Module.BulletShape,Module.BulletMeshEnabled,Module.BulletMeshID,Module.BulletTextureID,Module.BulletMeshScale},
{Module.BaseDamage,Module.HeadshotDamageMultiplier,Module.HeadshotEnabled},
{Module.WhizSoundEnabled,Module.WhizSoundID,Module.WhizSoundVolume,Module.WhizSoundPitch},
{Module.BulletLightEnabled,Module.BulletLightBrightness,Module.BulletLightColor,Module.BulletLightRange,Module.BulletLightShadows},
{Module.Knockback, Module.Lifesteal, Module.FlamingBullet})
end
function Reload()
if Enabled and not Reloading and (Ammo > 0 or not Module.LimitedAmmoEnabled) and Mag < Module.AmmoPerMag then
Reloading = true
if AimDown then
TweeningService:Create(Camera, TweenInfo.new(Module.TweenLengthNAD, Module.EasingStyleNAD, Module.EasingDirectionNAD), {FieldOfView = 70}):Play()
CrosshairModule:setcrossscale(1)
--[[local GUI = game:GetService("Players").LocalPlayer.PlayerGui:FindFirstChild("ZoomGui")
if GUI then GUI:Destroy() end]]
Scoping = false
game:GetService("Players").LocalPlayer.CameraMode = Enum.CameraMode.Classic
UserInputService.MouseDeltaSensitivity = InitialSensitivity
AimDown = false
end
UpdateGUI()
if Module.ShotgunReload then
for i = 1,(Module.AmmoPerMag - Mag) do
if ShotgunClipinAnim then ShotgunClipinAnim:Play(nil,nil,Module.ShotgunClipinAnimationSpeed) end
Handle.ShotgunClipin:Play()
wait(Module.ShellClipinSpeed)
end
end
if ReloadAnim then ReloadAnim:Play(nil,nil,Module.ReloadAnimationSpeed) end
Handle.ReloadSound:Play()
wait(Module.ReloadTime)
if Module.LimitedAmmoEnabled then
local ammoToUse = math.min(Module.AmmoPerMag - Mag, Ammo)
Mag = Mag + ammoToUse
Ammo = Ammo - ammoToUse
else
Mag = Module.AmmoPerMag
end
ChangeMagAndAmmo:FireServer(Mag,Ammo)
Reloading = false
UpdateGUI()
end
end
function UpdateGUI()
GUI.Frame.Mag.Fill:TweenSizeAndPosition(UDim2.new(Mag/Module.AmmoPerMag,0,1,0), UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25, true)
GUI.Frame.Ammo.Fill:TweenSizeAndPosition(UDim2.new(Ammo/Module.MaxAmmo,0,1,0), UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25, true)
GUI.Frame.Mag.Current.Text = Mag
GUI.Frame.Mag.Max.Text = Module.AmmoPerMag
GUI.Frame.Ammo.Current.Text = Ammo
GUI.Frame.Ammo.Max.Text = Module.MaxAmmo
GUI.Frame.Mag.Current.Visible = not Reloading
GUI.Frame.Mag.Max.Visible = not Reloading
GUI.Frame.Mag.Frame.Visible = not Reloading
GUI.Frame.Mag.Reloading.Visible = Reloading
GUI.Frame.Ammo.Current.Visible = not (Ammo <= 0)
GUI.Frame.Ammo.Max.Visible = not (Ammo <= 0)
GUI.Frame.Ammo.Frame.Visible = not (Ammo <= 0)
GUI.Frame.Ammo.NoMoreAmmo.Visible = (Ammo <= 0)
GUI.Frame.Ammo.Visible = Module.LimitedAmmoEnabled
GUI.Frame.Size = Module.LimitedAmmoEnabled and UDim2.new(0,250,0,100) or UDim2.new(0,250,0,55)
GUI.Frame.Position = Module.LimitedAmmoEnabled and UDim2.new(1,-260,1,-110)or UDim2.new(1,-260,1,-65)
GUI.MobileButtons.Visible = UserInputService.TouchEnabled --For mobile version
GUI.MobileButtons.AimButton.Visible = Module.SniperEnabled or Module.IronsightEnabled
GUI.MobileButtons.HoldDownButton.Visible = Module.HoldDownEnabled
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
script.Parent:WaitForChild("Speedo")
script.Parent:WaitForChild("Tach")
script.Parent:WaitForChild("ln")
script.Parent:WaitForChild("Gear")
script.Parent:WaitForChild("Speed")
local car = script.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false
local _Tune = require(car["A-Chassis Tune"])
local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline
local revEnd = (8)
local intach = car.Body.Dash.D.G.Tac.Needle
local inspd = car.Body.Dash.D.G.Spd.Needle
local Drive={}
if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("FL")~= nil then
table.insert(Drive,car.Wheels.FL)
end
if car.Wheels:FindFirstChild("FR")~= nil then
table.insert(Drive,car.Wheels.FR)
end
if car.Wheels:FindFirstChild("F")~= nil then
table.insert(Drive,car.Wheels.F)
end
end
if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
if car.Wheels:FindFirstChild("RL")~= nil then
table.insert(Drive,car.Wheels.RL)
end
if car.Wheels:FindFirstChild("RR")~= nil then
table.insert(Drive,car.Wheels.RR)
end
if car.Wheels:FindFirstChild("R")~= nil then
table.insert(Drive,car.Wheels.R)
end
end
local wDia = 0
for i,v in pairs(Drive) do
if v.Size.x>wDia then wDia = v.Size.x end
end
Drive = nil
local maxSpeed = math.ceil(wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
local maxSp = 160
local spInc = math.max(math.ceil(maxSp/200)*20,20)
for i=0,revEnd*2 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Tach
ln.Rotation = 45 + i * 225 / (revEnd*2)
ln.Num.Text = i/2
ln.Num.Rotation = -ln.Rotation
if i*500>=math.floor(_lRPM/500)*500 then
ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
if i<revEnd*2 then
ln2 = ln:clone()
ln2.Parent = script.Parent.Tach
ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
ln2.Num:Destroy()
ln2.Visible=true
end
end
if i%2==0 then
ln.Frame.Size = UDim2.new(0,3,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
ln.Num.Visible = true
else
ln.Num:Destroy()
end
ln.Visible=true
end
for i=1,90 do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Speedo
ln.Rotation = 45 + 225*(i/90)
if i%2==0 then
ln.Frame.Size = UDim2.new(0,2,0,10)
ln.Frame.Position = UDim2.new(0,-1,0,100)
else
ln.Frame.Size = UDim2.new(0,3,0,5)
end
ln.Num:Destroy()
ln.Visible=true
end
for i=0,maxSp,spInc do
local ln = script.Parent.ln:clone()
ln.Parent = script.Parent.Speedo
ln.Rotation = 45 + 225*(i/maxSp)
ln.Num.Text = math.floor(i)
ln.Num.Rotation = -ln.Rotation
ln.Frame:Destroy()
ln.Num.Visible=true
ln.Visible=true
end
if car.DriveSeat.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
car.DriveSeat.IsOn.Changed:connect(function()
if car.DriveSeat.IsOn.Value then
script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
intach.Rotation = -90 + script.Parent.Parent.Values.RPM.Value * 270 / 8000
end)
script.Parent.Parent.Values.Gear.Changed:connect(function()
local gearText = script.Parent.Parent.Values.Gear.Value
if gearText == 0 then
gearText = "N"
car.Body.Dash.D.G.Info.Gear.Text = "N"
elseif gearText == -1 then
gearText = "R"
car.Body.Dash.D.G.Info.Gear.Text = "R"
end
script.Parent.Gear.Text = gearText
car.Body.Dash.D.G.Info.Gear.Text = gearText
end)
script.Parent.Parent.Values.TCS.Changed:connect(function()
if script.Parent.Parent.Values.TCS.Value then
script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
if script.Parent.Parent.Values.TCSActive.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
else
wait()
script.Parent.TCS.Visible = false
end
else
script.Parent.TCS.Visible = true
script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
end
end)
script.Parent.Parent.Values.TCSActive.Changed:connect(function()
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
else
wait()
script.Parent.TCS.Visible = false
end
end)
script.Parent.TCS.Changed:connect(function()
if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = not script.Parent.TCS.Visible
elseif not script.Parent.Parent.Values.TCS.Value then
wait()
script.Parent.TCS.Visible = true
end
end)
script.Parent.Parent.Values.PBrake.Changed:connect(function()
script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end)
script.Parent.Parent.Values.TransmissionMode.Changed:connect(function()
if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
script.Parent.TMode.Text = "A/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
script.Parent.TMode.Text = "S/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255)
else
script.Parent.TMode.Text = "M/T"
script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
end
end)
script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
script.Parent.Speedo.Needle.Rotation =45 + 225 * math.min(1,script.Parent.Parent.Values.Velocity.Value.Magnitude/(maxSp*1.6))
inspd.Rotation = -90 + script.Parent.Parent.Values.Velocity.Value.Magnitude * 270 / 256
script.Parent.Speed.Text = math.floor(script.Parent.Parent.Values.Velocity.Value.Magnitude/1.6) .. " MPH"
end)
|
--------END RIGHT DOOR --------
|
end
wait(0.15)
if game.Workspace.DoorFlashing.Value == true then
|
-- print("Keyframe : ".. frameName)
|
local repeatAnim = stopToolAnimations()
playToolAnimation(repeatAnim, 0.0, Humanoid)
end
end
function playToolAnimation(animName, transitionTime, humanoid)
if animName ~= toolAnimName then
if toolAnimTrack then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
transitionTime = 0
end
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
|
--Zombie artificial stupidity script
--(Modified for skeletons)
|
sp=script.Parent
lastattack=0
nextrandom=0
|
--[[ Module functions ]]
|
--
function Invisicam:LimbBehavior(castPoints)
for limb, _ in pairs(self.trackedLimbs) do
castPoints[#castPoints + 1] = limb.Position
end
end
function Invisicam:MoveBehavior(castPoints)
for i = 1, MOVE_CASTS do
local position, velocity = self.humanoidRootPart.Position, self.humanoidRootPart.Velocity
local horizontalSpeed = Vector3.new(velocity.X, 0, velocity.Z).Magnitude / 2
local offsetVector = (i - 1) * self.humanoidRootPart.CFrame.lookVector * horizontalSpeed
castPoints[#castPoints + 1] = position + offsetVector
end
end
function Invisicam:CornerBehavior(castPoints)
local cframe = self.humanoidRootPart.CFrame
local centerPoint = cframe.p
local rotation = cframe - centerPoint
local halfSize = self.char:GetExtentsSize() / 2 --NOTE: Doesn't update w/ limb animations
castPoints[#castPoints + 1] = centerPoint
for i = 1, #CORNER_FACTORS do
castPoints[#castPoints + 1] = centerPoint + (rotation * (halfSize * CORNER_FACTORS[i]))
end
end
function Invisicam:CircleBehavior(castPoints)
local cframe = nil
if self.mode == MODE.CIRCLE1 then
cframe = self.humanoidRootPart.CFrame
else
local camCFrame = self.camera.CoordinateFrame
cframe = camCFrame - camCFrame.p + self.humanoidRootPart.Position
end
castPoints[#castPoints + 1] = cframe.p
for i = 0, CIRCLE_CASTS - 1 do
local angle = (2 * math.pi / CIRCLE_CASTS) * i
local offset = 3 * Vector3.new(math.cos(angle), math.sin(angle), 0)
castPoints[#castPoints + 1] = cframe * offset
end
end
function Invisicam:LimbMoveBehavior(castPoints)
self:LimbBehavior(castPoints)
self:MoveBehavior(castPoints)
end
function Invisicam:CharacterOutlineBehavior(castPoints)
local torsoUp = self.torsoPart.CFrame.upVector.unit
local torsoRight = self.torsoPart.CFrame.rightVector.unit
-- Torso cross of points for interior coverage
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p + torsoUp
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p - torsoUp
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p + torsoRight
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p - torsoRight
if self.headPart then
castPoints[#castPoints + 1] = self.headPart.CFrame.p
end
local cframe = CFrame.new(ZERO_VECTOR3,Vector3.new(self.camera.CoordinateFrame.lookVector.X,0,self.camera.CoordinateFrame.lookVector.Z))
local centerPoint = (self.torsoPart and self.torsoPart.Position or self.humanoidRootPart.Position)
local partsWhitelist = {self.torsoPart}
if self.headPart then
partsWhitelist[#partsWhitelist + 1] = self.headPart
end
for i = 1, CHAR_OUTLINE_CASTS do
local angle = (2 * math.pi * i / CHAR_OUTLINE_CASTS)
local offset = cframe * (3 * Vector3.new(math.cos(angle), math.sin(angle), 0))
offset = Vector3.new(offset.X, math.max(offset.Y, -2.25), offset.Z)
local ray = Ray.new(centerPoint + offset, -3 * offset)
local hit, hitPoint = game.Workspace:FindPartOnRayWithWhitelist(ray, partsWhitelist, false, false)
if hit then
-- Use hit point as the cast point, but nudge it slightly inside the character so that bumping up against
-- walls is less likely to cause a transparency glitch
castPoints[#castPoints + 1] = hitPoint + 0.2 * (centerPoint - hitPoint).unit
end
end
end
function Invisicam:SmartCircleBehavior(castPoints)
local torsoUp = self.torsoPart.CFrame.upVector.unit
local torsoRight = self.torsoPart.CFrame.rightVector.unit
-- SMART_CIRCLE mode includes rays to head and 5 to the torso.
-- Hands, arms, legs and feet are not included since they
-- are not canCollide and can therefore go inside of parts
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p + torsoUp
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p - torsoUp
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p + torsoRight
castPoints[#castPoints + 1] = self.torsoPart.CFrame.p - torsoRight
if self.headPart then
castPoints[#castPoints + 1] = self.headPart.CFrame.p
end
local cameraOrientation = self.camera.CFrame - self.camera.CFrame.p
local torsoPoint = Vector3.new(0,0.5,0) + (self.torsoPart and self.torsoPart.Position or self.humanoidRootPart.Position)
local radius = 2.5
-- This loop first calculates points in a circle of radius 2.5 around the torso of the character, in the
-- plane orthogonal to the camera's lookVector. Each point is then raycast to, to determine if it is within
-- the free space surrounding the player (not inside anything). Two iterations are done to adjust points that
-- are inside parts, to try to move them to valid locations that are still on their camera ray, so that the
-- circle remains circular from the camera's perspective, but does not cast rays into walls or parts that are
-- behind, below or beside the character and not really obstructing view of the character. This minimizes
-- the undesirable situation where the character walks up to an exterior wall and it is made invisible even
-- though it is behind the character.
for i = 1, SMART_CIRCLE_CASTS do
local angle = SMART_CIRCLE_INCREMENT * i - 0.5 * math.pi
local offset = radius * Vector3.new(math.cos(angle), math.sin(angle), 0)
local circlePoint = torsoPoint + cameraOrientation * offset
-- Vector from camera to point on the circle being tested
local vp = circlePoint - self.camera.CFrame.p
local ray = Ray.new(torsoPoint, circlePoint - torsoPoint)
local hit, hp, hitNormal = game.Workspace:FindPartOnRayWithIgnoreList(ray, {self.char}, false, false )
local castPoint = circlePoint
if hit then
local hprime = hp + 0.1 * hitNormal.unit -- Slightly offset hit point from the hit surface
local v0 = hprime - torsoPoint -- Vector from torso to offset hit point
local d0 = v0.magnitude
local perp = (v0:Cross(vp)).unit
-- Vector from the offset hit point, along the hit surface
local v1 = (perp:Cross(hitNormal)).unit
-- Vector from camera to offset hit
local vprime = (hprime - self.camera.CFrame.p).unit
-- This dot product checks to see if the vector along the hit surface would hit the correct
-- side of the invisicam cone, or if it would cross the camera look vector and hit the wrong side
if ( v0.unit:Dot(-v1) < v0.unit:Dot(vprime)) then
castPoint = RayIntersection(hprime, v1, circlePoint, vp)
if castPoint.Magnitude > 0 then
local ray = Ray.new(hprime, castPoint - hprime)
local hit, hitPoint, hitNormal = game.Workspace:FindPartOnRayWithIgnoreList(ray, {self.char}, false, false )
if hit then
local hprime2 = hitPoint + 0.1 * hitNormal.unit
castPoint = hprime2
end
else
castPoint = hprime
end
else
castPoint = hprime
end
local ray = Ray.new(torsoPoint, (castPoint - torsoPoint))
local hit, hitPoint, hitNormal = game.Workspace:FindPartOnRayWithIgnoreList(ray, {self.char}, false, false )
if hit then
local castPoint2 = hitPoint - 0.1 * (castPoint - torsoPoint).unit
castPoint = castPoint2
end
end
castPoints[#castPoints + 1] = castPoint
end
end
function Invisicam:CheckTorsoReference()
if self.char then
self.torsoPart = self.char:FindFirstChild("Torso")
if not self.torsoPart then
self.torsoPart = self.char:FindFirstChild("UpperTorso")
if not self.torsoPart then
self.torsoPart = self.char:FindFirstChild("HumanoidRootPart")
end
end
self.headPart = self.char:FindFirstChild("Head")
end
end
function Invisicam:CharacterAdded(char, player)
-- We only want the LocalPlayer's character
if player~=PlayersService.LocalPlayer then return end
if self.childAddedConn then
self.childAddedConn:Disconnect()
self.childAddedConn = nil
end
if self.childRemovedConn then
self.childRemovedConn:Disconnect()
self.childRemovedConn = nil
end
self.char = char
self.trackedLimbs = {}
local function childAdded(child)
if child:IsA("BasePart") then
if LIMB_TRACKING_SET[child.Name] then
self.trackedLimbs[child] = true
end
if (child.Name == "Torso" or child.Name == "UpperTorso") then
self.torsoPart = child
end
if (child.Name == "Head") then
self.headPart = child
end
end
end
local function childRemoved(child)
self.trackedLimbs[child] = nil
-- If removed/replaced part is 'Torso' or 'UpperTorso' double check that we still have a TorsoPart to use
self:CheckTorsoReference()
end
self.childAddedConn = char.ChildAdded:Connect(childAdded)
self.childRemovedConn = char.ChildRemoved:Connect(childRemoved)
for _, child in pairs(self.char:GetChildren()) do
childAdded(child)
end
end
function Invisicam:SetMode(newMode)
AssertTypes(newMode, 'number')
for modeName, modeNum in pairs(MODE) do
if modeNum == newMode then
self.mode = newMode
self.behaviorFunction = self.behaviors[self.mode]
return
end
end
error("Invalid mode number")
end
function Invisicam:GetObscuredParts()
return self.savedHits
end
|
-- This script only needs to run if increment values actually exist.
|
if earnTime > 0 and earnAmount ~= 0 then
-- The first shop in the game that loads will parent this script to
-- ServerScriptService. After that, the other shops will just change
-- the value of playerObject, and the player gets added to the increment list.
script.playerObject.Changed:connect(function(value)
if value and value:IsA("Player") then
for _, player in next, playersToIncrement do
if player == value then return end
end
table.insert(playersToIncrement, value)
end
script.playerObject.Value = nil
end)
while wait(earnTime) and wait() do
for i, player in next, playersToIncrement do
if player then
local cash = player.leaderstats:FindFirstChild(cashName)
if cash then
cash.Value = cash.Value + earnAmount
end
else
table.remove(playersToIncrement, i)
end
end
end
else
script:Destroy()
end
|
--Made by Luckymaxer
|
Seat = script.Parent
Model = Seat.Parent
Engine = Model:WaitForChild("Engine")
BeamPart = Model:WaitForChild("BeamPart")
Lights = Model:WaitForChild("Lights")
Seats = Model:WaitForChild("Seats")
Sounds = {
Flying = Engine:WaitForChild("UFO_Flying"),
Beam = Engine:WaitForChild("UFO_Beam"),
Idle = Engine:WaitForChild("UFO_Idle"),
TakingOff = Engine:WaitForChild("UFO_Taking_Off")
}
Players = game:GetService("Players")
Debris = game:GetService("Debris")
BeamSize = 50
CurrentBeamSize = 0
MaxVelocity = 40
MinVelocity = -40
MaxSideVelocity = 40
MinSideVelocity = -40
Acceleration = 2
Deceleration = 2
AutoDeceleration = 2
SideAcceleration = 2
SideDeceleration = 2
AutoSideDeceleration = 2
LiftOffSpeed = 5
LiftSpeed = 10
LowerSpeed = -10
Velocity = Vector3.new(0, 0, 0)
SideVelocity = 0
FlipForce = 1000000
InUse = false
PlayerUsing = nil
PlayerControlScript = nil
PlayerConnection = nil
BeamActive = false
TakingOff = false
LightsEnabled = false
Enabled = false
Controls = {
Forward = {Key = "W", Byte = 17, Mode = false},
Backward = {Key = "S", Byte = 18, Mode = false},
Left = {Key = "A", Byte = 20, Mode = false},
Right = {Key = "D", Byte = 19, Mode = false},
Up = {Key = "Q", Byte = 113, Mode = false},
Down = {Key = "E", Byte = 101, Mode = false},
}
ControlScript = script:WaitForChild("ControlScript")
Beam = Instance.new("Part")
Beam.Name = "Beam"
Beam.Transparency = 0.3
Beam.BrickColor = BrickColor.new("Pastel Blue")
Beam.Material = Enum.Material.Plastic
Beam.Shape = Enum.PartType.Block
Beam.TopSurface = Enum.SurfaceType.Smooth
Beam.BottomSurface = Enum.SurfaceType.Smooth
Beam.FormFactor = Enum.FormFactor.Custom
Beam.Size = Vector3.new(BeamPart.Size.X, 0.2, BeamPart.Size.Z)
Beam.Anchored = false
Beam.CanCollide = false
BeamMesh = Instance.new("CylinderMesh")
BeamMesh.Parent = Beam
script.Parent.Parent.BeamPart.SpotLight.Enabled = true
for i, v in pairs(Sounds) do
v:Stop()
end
RemoteConnection = script:FindFirstChild("RemoteConnection")
if not RemoteConnection then
RemoteConnection = Instance.new("RemoteFunction")
RemoteConnection.Name = "RemoteConnection"
RemoteConnection.Parent = script
end
BodyGyro = Engine:FindFirstChild("BodyGyro")
if not BodyGyro then
BodyGyro = Instance.new("BodyGyro")
BodyGyro.Parent = Engine
end
BodyGyro.maxTorque = Vector3.new(0, 0, 0)
BodyGyro.D = 7500
BodyGyro.P = 10000
BodyPosition = Engine:FindFirstChild("BodyPosition")
if not BodyPosition then
BodyPosition = Instance.new("BodyPosition")
BodyPosition.Parent = Engine
end
BodyPosition.maxForce = Vector3.new(0, 0, 0)
BodyPosition.D = 10000
BodyPosition.P = 50000
BodyVelocity = Engine:FindFirstChild("BodyVelocity")
if not BodyVelocity then
BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.Parent = Engine
end
BodyVelocity.velocity = Vector3.new(0, 0, 0)
BodyVelocity.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.P = 10000
FlipGyro = BeamPart:FindFirstChild("FlipGyro")
if not FlipGyro then
FlipGyro = Instance.new("BodyGyro")
FlipGyro.Name = "FlipGyro"
FlipGyro.Parent = BeamPart
end
FlipGyro.maxTorque = Vector3.new(0, 0, 0)
FlipGyro.D = 500
FlipGyro.P = 3000
RiseVelocity = BeamPart:FindFirstChild("RiseVelocity")
if not RiseVelocity then
RiseVelocity = Instance.new("BodyVelocity")
RiseVelocity.Name = "RiseVelocity"
RiseVelocity.Parent = BeamPart
end
RiseVelocity.velocity = Vector3.new(0, 0, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.P = 10000
function RayCast(Position, Direction, MaxDistance, IgnoreList)
return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
end
function ToggleLights()
for i, v in pairs(Lights:GetChildren()) do
if v:IsA("BasePart") then
for ii, vv in pairs(v:GetChildren()) do
if vv:IsA("Light") then
vv.Enabled = LightsEnabled
end
end
end
end
end
ToggleLights()
function CheckTable(Table, Instance)
for i, v in pairs(Table) do
if v == Instance then
return true
end
end
return false
end
function RandomizeTable(Table)
local TableCopy = {}
for i = 1, #Table do
local Index = math.random(1, #Table)
table.insert(TableCopy, Table[Index])
table.remove(Table, Index)
end
return TableCopy
end
for i, v in pairs(Model:GetChildren()) do
if v:IsA("BasePart") and v.Name == "Beam" then
v:Destroy()
end
end
function GetPartsInBeam(beam)
local IgnoreObjects = {(((PlayerUsing and PlayerUsing.Character) and PlayerUsing.Character) or nil), Model}
local NegativePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
local PositivePartRadius = Vector3.new((beam.Size.X / 2), ((CurrentBeamSize / 5) / 2), (beam.Size.Z / 2))
local Parts = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region3.new(beam.Position - NegativePartRadius, beam.Position + PositivePartRadius), IgnoreObjects, 100)
local Humanoids = {}
local Torsos = {}
for i, v in pairs(Parts) do
if v and v.Parent then
local humanoid = v.Parent:FindFirstChild("Humanoid")
local torso = v.Parent:FindFirstChild("Torso")
local player = Players:GetPlayerFromCharacter(v.Parent)
if player and humanoid and humanoid.Health > 0 and torso and not CheckTable(Humanoids, humanoid) then
table.insert(Humanoids, humanoid)
table.insert(Torsos, {Humanoid = humanoid, Torso = torso})
end
end
end
return Torsos
end
RemoteConnection.OnServerInvoke = (function(Player, Script, Action, Value)
if Script and Script ~= PlayerControlScript then
Script.Disabled = true
Script:Destroy()
else
if Action == "KeyDown" then
if Value == "l" then
LightsEnabled = not LightsEnabled
ToggleLights()
elseif Value == "t" then
if TemporaryBeam and TemporaryBeam.Parent then
local Torsos = GetPartsInBeam(TemporaryBeam)
local TorsosUsed = {}
Torsos = RandomizeTable(Torsos)
for i, v in pairs(Seats:GetChildren()) do
if v:IsA("Seat") and not v:FindFirstChild("SeatWeld") then
for ii, vv in pairs(Torsos) do
if vv.Humanoid and vv.Humanoid.Parent and vv.Humanoid.Health > 0 and not vv.Humanoid.Sit and vv.Torso and vv.Torso.Parent and not CheckTable(TorsosUsed, vv.Torso) then
table.insert(TorsosUsed, vv.Torso)
vv.Torso.CFrame = v.CFrame
break
end
end
end
end
end
end
if not TakingOff then
for i, v in pairs(Controls) do
if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
v.Mode = true
end
end
if Controls.Up.Mode or Controls.Down.Mode then
RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
end
if Controls.Forward.Mode or Controls.Backward.Mode or Controls.Left.Mode or Controls.Right.Mode or Controls.Up.Mode or Controls.Down.Mode then
Sounds.Idle:Stop()
Sounds.Flying:Play()
end
end
elseif Action == "KeyUp" then
if not TakingOff then
for i, v in pairs(Controls) do
if string.lower(v.Key) == string.lower(Value) or v.Byte == string.byte(Value) then
v.Mode = false
end
end
if not Controls.Up.Mode and not Controls.Down.Mode then
BodyPosition.position = Engine.Position
BodyPosition.maxForce = Vector3.new(0, 100000000, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.velocity = Vector3.new(0, 0, 0)
end
if not Controls.Forward.Mode and not Controls.Backward.Mode and not Controls.Left.Mode and not Controls.Right.Mode and not Controls.Up.Mode and not Controls.Down.Mode then
Sounds.Flying:Stop()
Sounds.Idle:Play()
end
end
elseif Action == "Button1Down" then
if not BeamActive and not TakingOff then
BeamActive = true
if TemporaryBeam and TemporaryBeam.Parent then
TemporaryBeam:Destroy()
end
TemporaryBeam = Beam:Clone()
TemporaryBeam.Parent = Model
Spawn(function()
while TemporaryBeam and TemporaryBeam.Parent do
local Torsos = GetPartsInBeam(TemporaryBeam)
for i, v in pairs(Torsos) do
if v.Humanoid and v.Humanoid.Parent and v.Humanoid.Health > 0 and v.Torso and v.Torso.Parent and not v.Torso:FindFirstChild("UFOPullForce") and not v.Torso:FindFirstChild("UFOBalanceForce") then
local UFOPullForce = Instance.new("BodyVelocity")
UFOPullForce.Name = "UFOPullForce"
UFOPullForce.maxForce = Vector3.new(0, 1000000, 0)
UFOPullForce.velocity = CFrame.new(v.Torso.Position, BeamPart.Position).lookVector * 25
Debris:AddItem(UFOPullForce, 0.25)
UFOPullForce.Parent = v.Torso
local UFOBalanceForce = Instance.new("BodyGyro")
UFOBalanceForce.Name = "UFOBalanceForce"
UFOBalanceForce.maxTorque = Vector3.new(1000000, 0, 1000000)
Debris:AddItem(UFOBalanceForce, 0.25)
UFOBalanceForce.Parent = v.Torso
end
end
wait()
end
end)
local BeamWeld = Instance.new("Weld")
BeamWeld.Part0 = BeamPart
BeamWeld.Part1 = TemporaryBeam
Spawn(function()
Sounds.Beam:Play()
while Enabled and BeamActive and TemporaryBeam and TemporaryBeam.Parent do
local IgnoreTable = {Model}
for i, v in pairs(Players:GetChildren()) do
if v:IsA("Player") and v.Character then
table.insert(IgnoreTable, v.Character)
end
end
local BeamPartClone = BeamPart:Clone()
local BeamPartCloneY = BeamPartClone:Clone()
BeamPartCloneY.CFrame = BeamPartCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
BeamPartCloneY.CFrame = BeamPartCloneY.CFrame - BeamPartCloneY.CFrame.lookVector * ((BeamPart.Size.Y / 2))
local Hit, Position = RayCast(BeamPart.Position, BeamPartCloneY.CFrame.lookVector, BeamSize, IgnoreTable)
CurrentBeamSize = ((BeamPart.Position - Position).magnitude * 5)
TemporaryBeam.Mesh.Scale = Vector3.new(1, CurrentBeamSize, 1)
BeamWeld.Parent = TemporaryBeam
BeamWeld.C0 = CFrame.new(0, 0, 0) - Vector3.new(0, ((CurrentBeamSize / 2) + (BeamPart.Size.Y / 2)) / 5 , 0)
wait()
end
BeamActive = false
Sounds.Beam:Stop()
if TemporaryBeam and TemporaryBeam.Parent then
TemporaryBeam:Destroy()
end
end)
end
elseif Action == "Button1Up" then
BeamActive = false
end
end
end)
function ManageMotionStep(ForceLift, CoordinateFrame)
local CameraForwards = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 0, 1))
local CameraSideways = -CoordinateFrame:vectorToWorldSpace(Vector3.new(1, 0, 0))
local CameraRotation = -CoordinateFrame:vectorToWorldSpace(Vector3.new(0, 1, 0))
CameraForwards = CameraForwards * Vector3.new(1, 0, 1)
CameraSideways = CameraSideways * Vector3.new(1, 0, 1)
if CameraForwards:Dot(CameraForwards) < 0.1 or CameraSideways:Dot(CameraSideways) < 0.1 then
return
end
CameraForwards = CameraForwards.unit
CameraSideways = CameraSideways.unit
if math.abs(Velocity.X) < 2 and math.abs(Velocity.Z) < 2 then
BodyVelocity.velocity = Vector3.new(0, 0, 0)
else
BodyVelocity.velocity = Velocity
end
BodyGyro.cframe = CFrame.new(0, 0, 0) * CFrame.Angles(Velocity:Dot(Vector3.new(0, 0, 1)) * (math.pi / 320), 0, math.pi - Velocity:Dot(Vector3.new(1, 0, 0)) * (math.pi / 320))
if Controls.Forward.Mode and (not Controls.Backward.Mode) and Velocity:Dot(CameraForwards) < MaxVelocity then
Velocity = Velocity + Acceleration * CameraForwards
elseif Controls.Backward.Mode and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > MinVelocity then
Velocity = Velocity - Deceleration * CameraForwards
elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) > 0 then
Velocity = Velocity - AutoDeceleration * CameraForwards
elseif (not Controls.Backward.Mode) and (not Controls.Forward.Mode) and Velocity:Dot(CameraForwards) < 0 then
Velocity = Velocity + AutoDeceleration * CameraForwards
end
if Controls.Left.Mode and (not Controls.Right.Mode) and Velocity:Dot(CameraSideways) < MaxSideVelocity then
Velocity = Velocity + SideAcceleration * CameraSideways
elseif Controls.Right.Mode and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > MinSideVelocity then
Velocity = Velocity - SideDeceleration * CameraSideways
elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) > 0 then
Velocity = Velocity - AutoSideDeceleration * CameraSideways
elseif (not Controls.Right.Mode) and (not Controls.Left.Mode) and Velocity:Dot(CameraSideways) < 0 then
Velocity = Velocity + AutoSideDeceleration * CameraSideways
end
if ForceLift then
RiseVelocity.velocity = Vector3.new(0, LiftOffSpeed, 0)
else
if Controls.Up.Mode and (not Controls.Down.Mode) then
RiseVelocity.velocity = Vector3.new(0, LiftSpeed, 0)
BodyPosition.maxForce = Vector3.new(0, 0, 0)
elseif Controls.Down.Mode and (not Controls.Up.Mode) then
RiseVelocity.velocity = Vector3.new(0, LowerSpeed, 0)
BodyPosition.maxForce = Vector3.new(0, 0, 0)
end
end
end
function MotionManager()
Spawn(function()
TakingOff = true
RiseVelocity.maxForce = Vector3.new(0, 1000000, 0)
local StartTime = tick()
Sounds.TakingOff:Play()
while Enabled and PlayerConnection and (tick() - StartTime) < 3 do
local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
ManageMotionStep(true, CoordinateFrame)
wait()
end
TakingOff = false
Sounds.TakingOff:Stop()
while PlayerConnection and (Enabled or Velocity:Dot(Velocity) > 0.5) do
local CoordinateFrame = PlayerConnection:InvokeClient(PlayerUsing, "CoordinateFrame")
ManageMotionStep(false, CoordinateFrame)
wait()
end
end)
end
function LiftOff()
BodyGyro.maxTorque = Vector3.new(1000000, 1000000, 1000000)
BodyVelocity.maxForce = Vector3.new(1000000, 0, 1000000)
Velocity = Vector3.new(0, 0, 0)
Enabled = true
MotionManager()
end
function Equipped(Player)
local Backpack = Player:FindFirstChild("Backpack")
if Backpack then
InUse = true
PlayerUsing = Player
PlayerControlScript = ControlScript:Clone()
local RemoteController = Instance.new("ObjectValue")
RemoteController.Name = "RemoteController"
RemoteController.Value = RemoteConnection
RemoteController.Parent = PlayerControlScript
local VehicleSeat = Instance.new("ObjectValue")
VehicleSeat.Name = "VehicleSeat"
VehicleSeat.Value = Seat
VehicleSeat.Parent = PlayerControlScript
PlayerConnection = Instance.new("RemoteFunction")
PlayerConnection.Name = "PlayerConnection"
PlayerConnection.Parent = PlayerControlScript
PlayerControlScript.Disabled = false
PlayerControlScript.Parent = Backpack
LiftOff()
end
end
function Unequipped()
if PlayerControlScript and PlayerControlScript.Parent then
PlayerControlScript:Destroy()
end
Enabled = false
PlayerControlScript = nil
PlayerUsing = nil
PlayerConnection = nil
BeamActive = false
TakingOff = false
InUse = false
BodyGyro.maxTorque = Vector3.new(0, 0, 0)
BodyPosition.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.maxForce = Vector3.new(0, 0, 0)
BodyVelocity.velocity = Vector3.new(0, 0, 0)
RiseVelocity.maxForce = Vector3.new(0, 0, 0)
RiseVelocity.velocity = Vector3.new(0, 0, 0)
for i, v in pairs(Controls) do
v.Mode = false
end
end
function Flip()
local EngineCloneY = Engine:Clone()
EngineCloneY.CFrame = EngineCloneY.CFrame * CFrame.Angles(-math.rad(90), 0, 0)
if EngineCloneY.CFrame.lookVector.Y < 0.707 then
FlipGyro.cframe = CFrame.new(Vector3.new(0, 0, 0), Vector3.new(0, 1, 0)) * CFrame.Angles((-math.pi / 2), 0, 0)
FlipGyro.maxTorque = Vector3.new(FlipForce, FlipForce, FlipForce)
wait(2)
FlipGyro.maxTorque = Vector3.new(0,0,0)
end
end
Seat.ChildAdded:connect(function(Child)
if Child:IsA("Weld") and Child.Name == "SeatWeld" then
if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
if Player then
Equipped(Player)
end
end
end
end)
Seat.ChildRemoved:connect(function(Child)
if Child:IsA("Weld") and Child.Name == "SeatWeld" then
if Child.Part0 and Child.Part0 == Seat and Child.Part1 and Child.Part1.Parent then
local Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
if Player and Player == PlayerUsing then
Unequipped(Player)
end
end
end
end)
Spawn(function()
while true do
Flip()
wait(5)
end
end)
|
--// Recoil Settings
|
gunrecoil = -0.3; -- How much the gun recoils backwards when not aiming
camrecoil = 0.05; -- How much the camera flicks when not aiming
AimGunRecoil = -0.1; -- How much the gun recoils backwards when aiming
AimCamRecoil = 0.02; -- How much the camera flicks when aiming
CamShake = 56; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
AimCamShake = 38; -- THIS IS ALSO NEW!!!!
Kickback = 3; -- Upward gun rotation when not aiming
AimKickback = 0.1; -- Upward gun rotation when aiming
|
-- innit bruv
|
local renderResolution = 10
local cam = workspace.CurrentCamera
local viewportSize = cam.ViewportSize
|
-- Driver Input Loop --
|
while script.Parent ~= nil do
--Update throttle, steer, handbrake
getInputValues()
local currentVel = Chassis.GetAverageVelocity()
local steer = script.Steering.Value
Chassis.UpdateSteering(steer, currentVel)
-- Taking care of throttling
local throttle = script.Throttle.Value
script.AngularMotorVelocity.Value = currentVel
script.ForwardVelocity.Value = DriverSeat.CFrame.LookVector:Dot(DriverSeat.Velocity)
Chassis.UpdateThrottle(currentVel, throttle)
-- Taking care of handbrake
if script.HandBrake.Value > 0 then
Chassis.EnableHandbrake()
end
wait()
end
|
-- LIGHT SETTINGS
--[[
LIGHT TYPES:
- Halogen
- LED
]]
|
--
local Low_Beam_Brightness = 0.55
local High_Beam_Brightness = 0.80
local Fog_Light_Brightness = 0.7
local Rear_Light_Brightness = 1.0
local Brake_Light_Brightness = 1.5
local Reverse_Light_Brightness = 1
local Headlight_Type = "Halogen"
local Indicator_Type = "Halogen"
local Fog_Light_Type = "Halogen"
local Plate_Light_Type = "Halogen"
local Rear_Light_Type = "Halogen"
local Reverse_Light_Type = "Halogen"
local Running_Light_Location = "Custom DRL" -- Where your running lights will luminate. ("Low Beam / Indicators" and "Low Beam". LED DRLS or any DRL in a differnet position go in the Running model, change the string to "Custom DRL")
local CustomDRL_Type = "LED"
local Fade_Time = 0.35 -- How long it takes for the light to fully turn on. (works only with Halogen, default is 0.35 seconds)
local Indicator_Flash_Rate = 0.3 -- Rate of change between each indicator state. (in seconds)
local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups)
|
--use this to determine if you want this human to be harmed or not, returns boolean
|
function checkTeams(otherHuman)
return not (sameTeam(otherHuman) and not FriendlyFire==true)
end
function boom()
wait(1.5)
Used = true
Object.Anchored = true
Object.CanCollide = true
Object.Sparks.Enabled = false
Object.Orientation = Vector3.new(0,0,0)
Object.Transparency = 1
Object.Fuse:Stop()
Object.Explode:Play()
Object.Explosion:Emit(100)
Explode()
end
Object.Touched:Connect(function(part)
if Used == true or part.Name == "Handle" then return end
if part:IsDescendantOf(Tag.Value.Character) then return end
if part.Parent then
if part.Parent:FindFirstChild("Humanoid") then
local human = part.Parent.Humanoid
if checkTeams(human) then
tagHuman(human)
human:TakeDamage(Damage)
end
end
Used = true
Object.Impact:Play()
Object.Velocity = Vector3.new(Object.Velocity.x/10,Object.Velocity.y/10,Object.Velocity.z/10)
Object.RotVelocity = Vector3.new(Object.RotVelocity.x/10,Object.RotVelocity.y/10,Object.RotVelocity.z/10)
game:GetService("Debris"):AddItem(Object, 10)
end
end)
boom()
|
--[[ The Module ]]
|
--
local BaseCharacterController = require(script.Parent:WaitForChild("BaseCharacterController"))
local Keyboard = setmetatable({}, BaseCharacterController)
Keyboard.__index = Keyboard
local bindAtPriorityFlagExists, bindAtPriorityFlagEnabled = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserPlayerScriptsBindAtPriority")
end)
local FFlagPlayerScriptsBindAtPriority = bindAtPriorityFlagExists and bindAtPriorityFlagEnabled
function Keyboard.new(CONTROL_ACTION_PRIORITY)
local self = setmetatable(BaseCharacterController.new(), Keyboard)
self.CONTROL_ACTION_PRIORITY = CONTROL_ACTION_PRIORITY
self.textFocusReleasedConn = nil
self.textFocusGainedConn = nil
self.windowFocusReleasedConn = nil
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
return self
end
function Keyboard:Enable(enable)
if not UserInputService.KeyboardEnabled then
return false
end
if enable == self.enabled then
-- Module is already in the state being requested. True is returned here since the module will be in the state
-- expected by the code that follows the Enable() call. This makes more sense than returning false to indicate
-- no action was necessary. False indicates failure to be in requested/expected state.
return true
end
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.moveVector = ZERO_VECTOR3
self.isJumping = false
if enable then
self:BindContextActions()
self:ConnectFocusEventListeners()
else
self:UnbindContextActions()
self:DisconnectFocusEventListeners()
end
self.enabled = enable
return true
end
function Keyboard:UpdateMovement(inputState)
if inputState == Enum.UserInputState.Cancel then
self.moveVector = ZERO_VECTOR3
else
self.moveVector = Vector3.new(self.leftValue + self.rightValue, 0, self.forwardValue + self.backwardValue)
end
end
function Keyboard:BindContextActions()
-- Note: In the previous version of this code, the movement values were not zeroed-out on UserInputState. Cancel, now they are,
-- which fixes them from getting stuck on.
local handleMoveForward = function(actionName, inputState, inputObject)
self.forwardValue = (inputState == Enum.UserInputState.Begin) and -1 or 0
self:UpdateMovement(inputState)
if FFlagPlayerScriptsBindAtPriority then
return Enum.ContextActionResult.Sink
end
end
local handleMoveBackward = function(actionName, inputState, inputObject)
self.backwardValue = (inputState == Enum.UserInputState.Begin) and 1 or 0
self:UpdateMovement(inputState)
if FFlagPlayerScriptsBindAtPriority then
return Enum.ContextActionResult.Sink
end
end
local handleMoveLeft = function(actionName, inputState, inputObject)
self.leftValue = (inputState == Enum.UserInputState.Begin) and -1 or 0
self:UpdateMovement(inputState)
if FFlagPlayerScriptsBindAtPriority then
return Enum.ContextActionResult.Sink
end
end
local handleMoveRight = function(actionName, inputState, inputObject)
self.rightValue = (inputState == Enum.UserInputState.Begin) and 1 or 0
self:UpdateMovement(inputState)
if FFlagPlayerScriptsBindAtPriority then
return Enum.ContextActionResult.Sink
end
end
local handleJumpAction = function(actionName, inputState, inputObject)
self.isJumping = (inputState == Enum.UserInputState.Begin)
if FFlagPlayerScriptsBindAtPriority then
return Enum.ContextActionResult.Sink
end
end
-- TODO: Revert to KeyCode bindings so that in the future the abstraction layer from actual keys to
-- movement direction is done in Lua
if FFlagPlayerScriptsBindAtPriority then
ContextActionService:BindActionAtPriority("moveForwardAction", handleMoveForward, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterForward)
ContextActionService:BindActionAtPriority("moveBackwardAction", handleMoveBackward, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterBackward)
ContextActionService:BindActionAtPriority("moveLeftAction", handleMoveLeft, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterLeft)
ContextActionService:BindActionAtPriority("moveRightAction", handleMoveRight, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterRight)
ContextActionService:BindActionAtPriority("jumpAction", handleJumpAction, false,
self.CONTROL_ACTION_PRIORITY, Enum.PlayerActions.CharacterJump)
else
ContextActionService:BindAction("moveForwardAction", handleMoveForward, false, Enum.PlayerActions.CharacterForward)
ContextActionService:BindAction("moveBackwardAction", handleMoveBackward, false, Enum.PlayerActions.CharacterBackward)
ContextActionService:BindAction("moveLeftAction", handleMoveLeft, false, Enum.PlayerActions.CharacterLeft)
ContextActionService:BindAction("moveRightAction", handleMoveRight, false, Enum.PlayerActions.CharacterRight)
ContextActionService:BindAction("jumpAction",handleJumpAction,false,Enum.PlayerActions.CharacterJump)
end
end
function Keyboard:UnbindContextActions()
ContextActionService:UnbindAction("moveForwardAction")
ContextActionService:UnbindAction("moveBackwardAction")
ContextActionService:UnbindAction("moveLeftAction")
ContextActionService:UnbindAction("moveRightAction")
ContextActionService:UnbindAction("jumpAction")
end
function Keyboard:ConnectFocusEventListeners()
local function onFocusReleased()
self.moveVector = ZERO_VECTOR3
self.forwardValue = 0
self.backwardValue = 0
self.leftValue = 0
self.rightValue = 0
self.isJumping = false
end
local function onTextFocusGained(textboxFocused)
self.isJumping = false
end
self.textFocusReleasedConn = UserInputService.TextBoxFocusReleased:Connect(onFocusReleased)
self.textFocusGainedConn = UserInputService.TextBoxFocused:Connect(onTextFocusGained)
self.windowFocusReleasedConn = UserInputService.WindowFocused:Connect(onFocusReleased)
end
function Keyboard:DisconnectFocusEventListeners()
if self.textFocusReleasedCon then
self.textFocusReleasedCon:Disconnect()
self.textFocusReleasedCon = nil
end
if self.textFocusGainedConn then
self.textFocusGainedConn:Disconnect()
self.textFocusGainedConn = nil
end
if self.windowFocusReleasedConn then
self.windowFocusReleasedConn:Disconnect()
self.windowFocusReleasedConn = nil
end
end
return Keyboard
|
---Finds the characters position, based off their torso
|
local t = P.Character:FindFirstChild("Torso")
if t then
local Char = P.Character
local X = Char.Torso.Position.X
local Y = Char.Torso.Position.Y
local Z = Char.Torso.Position.Z
local X1 = Instance.new("IntValue")
X1.Value = X
local Y1 = Instance.new("IntValue")
Y1.Value = Y
local Z1 = Instance.new("IntValue")
Z1.Value = Z
script.Parent.Text = " " ..X1.Value.. ", " ..Y1.Value.. ", " ..Z1.Value.. " "
end
end
wait(T)
end
|
-- print(animName .. " " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
-- set up keyframe name triggers
if currentAnimKeyframeHandler then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
|
--[[
Gamepad Character Control - This module handles controlling your avatar using a game console-style controller
2018 PlayerScripts Update - AllYourBlox
--]]
|
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
|
--------------| SYSTEM SETTINGS |--------------
|
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Blue"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[0] = "Yellow";
[5] = "White";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 0;
["Admin"] = 0;
["Settings"] = 0;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
RankRequiredToViewIcon = 0;
WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit'
CommandLimits = { -- Enables you to set limits for commands which have a number argument. Ranks equal to or higher than 'IgnoreLimit' will not be affected by Limit.
["fly"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["fly2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["noclip2"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["speed"] = {
Limit = 10000;
IgnoreLimit = 3;
};
["jumpPower"] = {
Limit = 10000;
IgnoreLimit = 3;
};
};
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
for v2, v3 in ipairs(script:GetChildren()) do
if not v2 then
break;
end;
if v3.ClassName == "ModuleScript" then
for v5, v6 in pairs((require(v3))) do
v1[v5] = v6;
end;
end;
end;
return v1;
|
----------------------------------
------------VARIABLES-------------
----------------------------------
|
PianoId = nil
Connector = game.Workspace:FindFirstChild("GlobalPianoConnector")
local Transposition, Volume = script.Parent:WaitForChild("Transpose"), 1
|
---Box thing
|
for _,v in pairs(script.Parent.ShopFrame.Boxes:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
---Clean
for _,y in pairs(script.Parent.ShopFrame.BoxContaining.Frame:GetChildren()) do
if y:IsA("ImageLabel") then
y:Destroy()
end
end
--Add
local Weaponfolder = game.ReplicatedStorage.Weapons:FindFirstChild(v.Parent.Weapon.Value)
print(Weaponfolder.Name)
print(v.Name)
local Boxfolder = Weaponfolder:FindFirstChild(v.Name)
local Weapons = Boxfolder:GetChildren()
if #Weapons > 0 then
for _,y in pairs(Weapons) do
local ImgFrame = Instance.new("ImageLabel")
ImgFrame.Parent = script.Parent.ShopFrame.BoxContaining.Frame
ImgFrame.Image = y.TextureId
end
end
script.Parent.ShopFrame.BoxContaining.TextLabel.Text = (Boxfolder.Name).." box contains:"
script.Parent.ShopFrame.BoxContaining.Box.Value = Boxfolder
script.Parent.ShopFrame.BoxContaining.Visible = true
script.Parent.ShopFrame.Boxes.Visible = false
end)
end
end
|
--[[
LOWGames Studios
Date: 27 October 2022
by Elder
]]
|
--
local u1 = nil;
coroutine.wrap(function()
u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
return function(p1)
local v1 = Instance.new("Part");
v1.Anchored = true;
v1.CanCollide = false;
v1.Transparency = 1;
v1.Material = Enum.Material.SmoothPlastic;
v1.CastShadow = false;
v1.Size = Vector3.new();
v1.CFrame = typeof(p1) == "Vector3" and CFrame.new(p1) or p1;
v1.Name = "host";
local v2 = Instance.new("Attachment");
v2.Parent = v1;
v1.Parent = u1.Debris;
return v1, v2;
end;
|
-- Declaring Variables
|
local ts = game:GetService("TweenService")
local mainUI = script.Parent.Parent
local shopFrame = mainUI.Frame
local shopBtn = mainUI.OpenShop
|
--!strict
|
local function startsWith(value: string, substring: string, position: number?): boolean
if string.len(substring) == 0 then
return true
end
-- Luau FIXME: we have to use a tmp variable, as Luau doesn't understand the logic below narrow position to `number`
local position_
if position == nil or position < 1 then
position_ = 1
else
position_ = position
end
if position_ > string.len(value) then
return false
end
return value:find(substring, position_, true) == position_
end
return startsWith
|
--local function pad_and_xor(str, result_length, byte_for_xor)
-- return string.gsub(str, ".", function(c)
-- return string.char(bit32_bxor(string.byte(c), byte_for_xor))
-- end) .. string.rep(string.char(byte_for_xor), result_length - #str)
--end
| |
--bin.Equipped:connect(onEquipped)
--bin.Selected:connect(onSelected)
| |
--[[
Sets the text on the touchable button
]]
|
function BaseSystem:_setButtonText(text)
local button = self._model:FindFirstChild("ToggleButton")
if not button then
return
end
local textLabel = button:FindFirstChild("SurfaceGui"):FindFirstChild("Text")
if not textLabel then
return
end
textLabel.Text = text
end
|
--Disable script if car is removed from workspace
|
Car.AncestryChanged:Connect(function()
if not Car:IsDescendantOf(Workspace) then
unbindActions()
LocalVehicleSeating.ExitSeat()
LocalVehicleSeating.DisconnectFromSeatExitEvent(onExitSeat)
-- stop seated anim
--print("car removed from workspace")
script.Disabled = true
ProximityPromptService.Enabled = true
end
end)
local function exitVehicle(action, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
LocalVehicleSeating.ExitSeat()
-- stop seated anim
end
end
local function _updateRawInput(_, inputState, inputObj)
local key = inputObj.KeyCode
local data = Keymap.getData(key)
if not data then
return
end
local axis = data.Axis
local val = 0
if axis then
val = inputObj.Position:Dot(axis)
else
val = (inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change) and 1 or 0
end
val = val * (data.Sign or 1)
_rawInput[key] = val
if data.Pass then
return Enum.ContextActionResult.Pass
end
end
local function _calculateInput(action)
-- Loop through all mappings for this action and calculate a resultant value from the raw input
local mappings = Keymap[action]
local val = 0
local absVal = val
for _, data in ipairs(mappings) do
local thisVal = _rawInput[data.KeyCode]
if math.abs(thisVal) > absVal then
val = thisVal
absVal = math.abs(val)
end
end
return val
end
ContextActionService:BindAction(
EXIT_ACTION_NAME,
exitVehicle,
false,
Keymap.EnterVehicleGamepad,
Keymap.EnterVehicleKeyboard
)
ContextActionService:BindActionAtPriority(
RAW_INPUT_ACTION_NAME,
_updateRawInput,
false,
Enum.ContextActionPriority.High.Value,
unpack(Keymap.allKeys()))
|
--[[
Calculates a ratio for interface scaling based on resolution (screen size). Used for scaling down, not up.
Functions.ResolutionScale()
--]]
|
return function()
--- Return cache
if tick() - lastCalcTick <= 0.05 then
return lastCalc
end
--- calc
local resolution = camera.ViewportSize
local resolutionScale = resolution.Magnitude
local scale = math.clamp(resolutionScale / 1800, 0.33, 1)
--- Cache
lastCalc = scale
lastCalcTick = tick()
--
return scale
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0
script:WaitForChild("Rev")
if not FE then
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
for i,v in pairs(script:GetChildren()) do
v.Parent=car.DriveSeat
end
car.DriveSeat.Rev:Play()
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
end
else
local handler = car.AC6_FE_Sounds
handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
local pitch=0
while wait() do
local _RPM = script.Parent.Values.RPM.Value
if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
pitch = (script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume)
end
end
|
-- this script is optional and not required to have, delete it or keep it
|
local player = {}
local input = {}
local animation = {}
local players = game:GetService("Players")
local runservice = game:GetService("RunService")
local userinput = game:GetService("UserInputService")
do -- player
local PLAYER = players.LocalPlayer
player = setmetatable({}, {__index = function(k)
return rawget(player, k) or PLAYER:FindFirstChild(tostring(k))
end})
local function onCharacter(character)
wait()
player.character = character
player.mouse = PLAYER:GetMouse()
player.backpack = PLAYER:WaitForChild("Backpack")
player.humanoid = player.character:WaitForChild("Humanoid")
player.torso = player.character:WaitForChild("Torso")
player.alive = true
repeat wait() until player.humanoid.Parent == player.character and player.character:IsDescendantOf(game)
animation.crouch = player.humanoid:LoadAnimation(script:WaitForChild("crouch"))
input.stance = "stand"
local onDied onDied = player.humanoid.Died:connect(function()
player.alive = false
onDied:disconnect()
if animation.crouch then
animation.crouch:Stop(.2)
end
end)
end
if PLAYER.Character then
onCharacter(PLAYER.Character)
end
PLAYER.CharacterAdded:connect(onCharacter)
end
do -- input
input.stance = "stand"
local sprinting = false
local default_right = CFrame.new(1, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
local default_left = CFrame.new(-1, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
runservice.RenderStepped:connect(function()
if animation.crouch then
if animation.crouch.IsPlaying then
animation.crouch:AdjustSpeed(Vector3.new(player.torso.Velocity.x, 0, player.torso.Velocity.z).magnitude/10)
end
end
end)
userinput.TextBoxFocused:connect(function()
if sprinting then
sprinting = false
player.humanoid.WalkSpeed = 16
end
end)
userinput.InputBegan:connect(function(object, g)
if not g then
if object.UserInputType == Enum.UserInputType.Keyboard then
local key = object.KeyCode
if key == Enum.KeyCode.C then
if input.stance == "crouch" then
player.humanoid.HipHeight = 0
player.humanoid.WalkSpeed = 16
animation.crouch:Stop(.2)
input.stance = "stand"
else
input.stance = "crouch"
player.humanoid.HipHeight = -1
player.humanoid.WalkSpeed = 16 * 0.4
animation.crouch:Play(.2)
end
elseif key == Enum.KeyCode.LeftShift then
if not sprinting then
sprinting = true
player.humanoid.WalkSpeed = 16 * (input.stance == "crouch" and 0.8 or 1.25)
end
end
end
end
end)
userinput.InputEnded:connect(function(object, g)
if not g then
if object.UserInputType == Enum.UserInputType.Keyboard then
local key = object.KeyCode
if key == Enum.KeyCode.LeftShift then
if sprinting then
sprinting = false
player.humanoid.WalkSpeed = 16 * (input.stance == "crouch" and 0.4 or 1)
end
end
end
end
end)
end
|
-- UAEmaple
|
function onTouch(part)
local human = part.Parent:findFirstChild("Humanoid")
if human ~= nil then
part.Parent:findFirstChild("Head").Transparency = 0.99
part.Parent:findFirstChild("Torso").Transparency = 1
part.Parent:findFirstChild("Left Arm").Transparency = 1
part.Parent:findFirstChild("Right Arm").Transparency = 1
part.Parent:findFirstChild("Left Leg").Transparency = 1
part.Parent:findFirstChild("Right Leg").Transparency = 1
if part.Parent:findFirstChild("Head"):findFirstChild("face") == nil then return end
part.Parent:findFirstChild("Head"):findFirstChild("face"):remove()
if part.Parent:findFirstChild("Torso"):findFirstChild("roblox") == nil then return end
part.Parent:findFirstChild("Torso"):findFirstChild("roblox"):remove()
end
end
script.Parent.Touched:connect(onTouch)print("Hello world!")
|
--[=[
@return ... any
@yields
Yields the current thread until the signal is fired, and returns the arguments fired from the signal.
Yielding the current thread is not always desirable. If the desire is to only capture the next event
fired, using `ConnectOnce` might be a better solution.
```lua
task.spawn(function()
local msg, num = signal:Wait()
print(msg, num) --> "Hello", 32
end)
signal:Fire("Hello", 32)
```
]=]
|
function Signal:Wait()
local waitingCoroutine = coroutine.running()
local connection
local done = false
connection = self:Connect(function(...)
if done then
return
end
done = true
connection:Disconnect()
task.spawn(waitingCoroutine, ...)
end)
return coroutine.yield()
end
|
--Player.CameraMode = "LockFirstPerson"
|
elseif key == "q" or key== "ButtonL2" and zoomed then
zoomed = false
Cam.FieldOfView = 70
Player.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
|
-- << AUTO UPDATE FRAMES >>
|
spawn(function()
while wait(20) do
if frame.Visible and main.gui.MainFrame.Visible then
module:UpdatePages()
end
end
end)
return module
|
-- Given two pairs of arrays of strings:
-- Compare the pair of comparison arrays line-by-line.
-- Format the corresponding lines in the pair of displayable arrays.
|
local function diffLinesUnified2(
aLinesDisplay: { [number]: string },
bLinesDisplay: { [number]: string },
aLinesCompare: { [number]: string },
bLinesCompare: { [number]: string },
options: DiffOptions?
): string
if isEmptyString(aLinesDisplay) and isEmptyString(aLinesCompare) then
aLinesDisplay = {}
aLinesCompare = {}
end
if isEmptyString(bLinesDisplay) and isEmptyString(bLinesCompare) then
bLinesDisplay = {}
bLinesCompare = {}
end
if #aLinesDisplay ~= #aLinesCompare or #bLinesDisplay ~= #bLinesCompare then
-- Fall back to diff of display lines.
return diffLinesUnified(aLinesDisplay, bLinesDisplay, options)
end
local diffs = diffLinesRaw(aLinesCompare, bLinesCompare)
-- Replace comparison lines with displayable lines.
local aIndex = 0
local bIndex = 0
for _, d in ipairs(diffs) do
local case = d[1]
if case == DIFF_DELETE then
d[2] = aLinesDisplay[aIndex + 1]
aIndex += 1
elseif case == DIFF_INSERT then
d[2] = bLinesDisplay[bIndex + 1]
bIndex += 1
else
d[2] = bLinesDisplay[bIndex + 1]
aIndex += 1
bIndex += 1
end
end
return printDiffLines(diffs, normalizeDiffOptions(options))
end
|
--// F key, Manual
|
mouse.KeyDown:connect(function(key)
if key=="f" then
script.Parent.Parent.Man.TextTransparency = 0
veh.Lightbar.middle.Man:Play()
veh.Lightbar.middle.Wail.Volume = 0
veh.Lightbar.middle.Yelp.Volume = 0
veh.Lightbar.middle.Priority.Volume = 0
veh.Lightbar.middle.Hilo.Volume = 0
veh.Lightbar.middle.Rwail.Volume = 0
script.Parent.Parent.MBOV.Visible = true
script.Parent.Parent.MBOV.Text = "Made by OfficerVargas"
end
end)
|
--// Variables
|
repeat wait() until Players.LocalPlayer
local Player = Players.LocalPlayer
|
-- Set the tank's welds to face the right direction
|
function setTurretDirection(elevation, rotation)
parts.MantletBase.MainGunWeld.C1 = CFrame.new(0,0,0) * CFrame.fromEulerAnglesXYZ(0, elevation, 0);
parts.TurretRing2.TurretRingWeld.C1 = CFrame.new(0,0,0.8) * CFrame.fromEulerAnglesXYZ(0, 0, rotation);
end
|
-- Create component
|
local AboutPane = Roact.PureComponent:extend(script.Name)
function AboutPane:init()
self.DockSize, self.SetDockSize = Roact.createBinding(UDim2.new())
self.Maid = Maid.new()
end
function AboutPane:willUnmount()
self.Maid:Destroy()
end
function AboutPane:render()
return new('ImageButton', {
Image = '';
BackgroundTransparency = 0.75;
BackgroundColor3 = Color3.fromRGB(0, 0, 0);
LayoutOrder = self.props.LayoutOrder;
Size = UDim2.new(1, 0, 0, 32);
[Roact.Event.Activated] = function (rbx)
self:setState({
IsManualOpen = not self.state.IsManualOpen;
})
end;
[Roact.Event.MouseButton1Down] = function (rbx)
local Dock = rbx.Parent
local InitialAbsolutePosition = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
local InitialPosition = Dock.Position
self.Maid.DockDragging = UserInputService.InputChanged:Connect(function (Input)
if (Input.UserInputType.Name == 'MouseMovement') or (Input.UserInputType.Name == 'Touch') then
-- Suppress activation response if dragging detected
if (Vector2.new(Input.Position.X, Input.Position.Y) - InitialAbsolutePosition).Magnitude > 3 then
rbx.Active = false
end
-- Reposition dock
Dock.Position = UDim2.new(
InitialPosition.X.Scale,
InitialPosition.X.Offset + (Input.Position.X - InitialAbsolutePosition.X),
InitialPosition.Y.Scale,
InitialPosition.Y.Offset + (Input.Position.Y - InitialAbsolutePosition.Y)
)
end
end)
self.Maid.DockDraggingEnd = UserInputService.InputEnded:Connect(function (Input)
if (Input.UserInputType.Name == 'MouseButton1') or (Input.UserInputType.Name == 'Touch') then
self.Maid.DockDragging = nil
self.Maid.DockDraggingEnd = nil
rbx.Active = true
end
end)
end;
}, {
Corners = new('UICorner', {
CornerRadius = UDim.new(0, 3);
});
Signature = new('ImageLabel', {
AnchorPoint = Vector2.new(0, 0.5);
BackgroundTransparency = 1;
Size = UDim2.new(1, 0, 0, 13);
Image = 'rbxassetid://2326685066';
Position = UDim2.new(0, 6, 0.5, 0);
}, {
AspectRatio = new('UIAspectRatioConstraint', {
AspectRatio = 2.385;
});
});
HelpIcon = new('ImageLabel', {
AnchorPoint = Vector2.new(1, 0.5);
BackgroundTransparency = 1;
Position = UDim2.new(1, 0, 0.5, 0);
Size = UDim2.new(0, 30, 0, 30);
Image = 'rbxassetid://141911973';
});
ManualWindowPortal = new(Roact.Portal, {
target = self.props.Core.UI;
}, {
ManualWindow = (self.state.IsManualOpen or nil) and new(ToolManualWindow, {
Text = MANUAL_CONTENT;
ThemeColor = Color3.fromRGB(255, 176, 0);
});
});
})
end
return AboutPane
|
----------------------------------
|
local PhysicsManager, SeatManager, ControlManager
local BoatModel = script.Parent
local Seat = WaitForChild(BoatModel, "qBoatSeat")
|
--[[
Function called upon entering the state
]]
|
function PlayerPreGame.enter(stateMachine, playerComponent)
end
|
--[[Weight and CG]]
|
Tune.Weight = 3472 -- Total weight (in pounds)
Tune.WeightBSize = { -- Size of weight brick (dimmensions in studs ; larger = more stable)
--[[Width]] 6 ,
--[[Height]] 3 ,
--[[Length]] 14 }
Tune.WeightDist = 60 -- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
Tune.CGHeight = 1 -- Center of gravity height (studs relative to median of all wheels)
Tune.WBVisible = false -- Makes the weight brick visible
--Unsprung Weight
Tune.FWheelDensity = .45 -- Front Wheel Density
Tune.RWheelDensity = .45 -- 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
|
-- Standard Flash Rates
-- 50 flashes/min -> wait(.6)
-- 60 flashes/min -> wait(.5) (default)
| |
-- module
|
local INPUT = {}
function INPUT.GetActionInput(self, action)
local input = "nil"
local replacements = {
Zero = "0";
One = "1";
Two = "2";
Three = "3";
Four = "4";
Five = "5";
Six = "6";
Seven = "7";
Eight = "8";
Nine = "9";
MouseButton1 = "MB1";
MouseButton2 = "MB2";
MouseButton3 = "MB3";
Return = "Enter";
Slash = "/";
Tilde = "~";
Backquote = "`";
}
if actions[action] then
local primary, secondary = actions[action].Primary, actions[action].Secondary
if primary then
input = primary.Name
elseif secondary then
input = secondary.Name
end
end
if replacements[input] then
input = replacements[input]
end
return string.upper(input)
end
if not initialized then
local keybindChanged = Instance.new("BindableEvent")
INPUT.KeybindChanged = keybindChanged.Event
actionBegan = Instance.new("BindableEvent")
actionEnded = Instance.new("BindableEvent")
INPUT.ActionBegan = actionBegan.Event
INPUT.ActionEnded = actionEnded.Event
-- register actions
local function Register(action, bindP, bindS)
local primary, secondary
if bindP then
local A, B = string.match(bindP, "(.-)%.(.+)")
if A and B then
primary = Enum[A][B]
end
end
if bindS then
local A, B = string.match(bindS, "(.-)%.(.+)")
if A and B then
secondary = Enum[A][B]
end
end
RegisterAction(action, primary, secondary)
keybindChanged:Fire(action)
end
local function Handle(keybind)
local action = keybind.Name
local bind = keybind.Value
if string.match(bind, ";") then
local bindP, bindS = string.match(bind, "(.-);(.+)")
if bindP and bindS then
Register(action, bindP, bindS)
elseif bindP then
Register(action, bindP)
elseif bindS then
Register(action, nil, bindS)
end
else
Register(action, bind)
end
end
initialized = true
end
return INPUT
|
--[=[
Converts the string to `UpperCamelCase` from `camelCase` or `snakeCase` or `YELL_CASE`
@param str string
@return string
]=]
|
function String.toCamelCase(str: string): string
str = str:lower()
str = str:gsub("[ _](%a)", string.upper)
str = str:gsub("^%a", string.upper)
str = str:gsub("%p", "")
return str
end
|
-- Door variables
|
local Door = script.Parent.Parent.Door.Door
local DoorLogo = Door.DoorLogo
local DoorSeg = Door.DoorSegment
Door.PrimaryPart = Door.DoorSegment
local Open, ShouldBe = false, false
local InZone = {}
|
--[[
Button for opening the EmoteBar on gamepad enabled devices.
]]
|
local ContextActionService = game:GetService("ContextActionService")
local Roact = require(script.Parent.Parent.Packages.Roact)
local t = require(script.Parent.Parent.Packages.t)
local ConfigurationContext = require(script.Parent.Parent.Libraries.Configuration).ConfigurationContext
local GamepadToggleButton = Roact.Component:extend("GamepadToggleButton")
local MAX_SIZE = 66
GamepadToggleButton.defaultProps = {
actionName = "GamepadToggleButton",
onActivated = function() end,
}
GamepadToggleButton.validateProps = t.interface({
onActivated = t.callback,
transparency = t.optional(t.union(t.table, t.number)), -- Binding or number
})
function GamepadToggleButton:init()
self.onActivated = function(_actionName, inputState)
if inputState ~= Enum.UserInputState.Begin then
return
end
self.props.onActivated()
end
end
function GamepadToggleButton:render()
return Roact.createElement("ImageButton", {
Size = UDim2.fromOffset(MAX_SIZE, MAX_SIZE),
Image = self.props.configuration.gamepadButtonIcon,
ImageTransparency = self.props.transparency,
BackgroundTransparency = 1,
[Roact.Event.Activated] = self.props.onActivated,
}, {
AspectRatio = Roact.createElement("UIAspectRatioConstraint", {
AspectRatio = 1,
}),
GamepadButton = Roact.createElement("ImageLabel", {
Image = self.props.configuration.toggleButtonImage,
ImageTransparency = self.props.transparency,
Size = UDim2.fromScale(0.5, 0.5),
Position = UDim2.fromScale(1, 1),
AnchorPoint = Vector2.new(0.85, 0.85),
BackgroundTransparency = 1,
}),
})
end
function GamepadToggleButton:didMount()
ContextActionService:BindAction(
self.props.actionName,
self.onActivated,
false,
self.props.configuration.toggleButton
)
end
function GamepadToggleButton:willUnmount()
ContextActionService:UnbindAction(self.props.actionName)
end
return ConfigurationContext.withConfiguration(GamepadToggleButton)
|
--Made by Stickmasterluke ;D
|
sp=script.Parent
theface="http://www.roblox.com/asset?id=103838612"
health=80
textureclosed="http://www.roblox.com/asset?id=103920391"
textureopen="http://www.roblox.com/asset?id=103920471"
storedface=""
local debris=game:GetService("Debris")
check=true
sp.Equipped:connect(function(mouse)
equipped=true
if mouse~=nil then
mouse.Icon="rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function()
local chr=sp.Parent
if chr and check then
local t=chr:FindFirstChild("Torso")
local h=chr:FindFirstChild("Humanoid")
local anim=sp:FindFirstChild("Eat")
if anim and t and h and h.Health>0 and equipped and check then
mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
check=false
anim2=h:LoadAnimation(anim)
anim2:Play()
local handle=sp:FindFirstChild("Handle")
if handle~=nil then
local mesh=handle:FindFirstChild("Mesh")
if mesh~=nil then
mesh.TextureId=textureopen
end
end
wait(2)
local s=sp.Handle:FindFirstChild("Sound")
if s~=nil and equipped and w~=nil then
w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(-.3,0,math.pi/4)
s:Play()
else
check=true
return
end
wait(2)
if h~=nil and h.Health>0 and equipped and w~=nil then
h:TakeDamage(-math.min(health*.5,h.MaxHealth-h.Health))
head=nil
face=nil
local head=h.Parent:FindFirstChild("Head")
if head~=nil then
face=head:FindFirstChild("face")
if face~=nil then
storedface=face.Texture
face.Texture=theface
end
end
w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(.3,0,math.pi/4)
else
check=true
return
end
wait(2)
local s=sp.Handle:FindFirstChild("Sound")
if s~=nil and equipped and w~=nil then
w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(-.3,0,math.pi/4)
s:Play()
else
check=true
return
end
wait(2)
if h~=nil and h.Health>0 and equipped and w~=nil then
h:TakeDamage(-math.min(health*.5,h.MaxHealth-h.Health))
w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(0,0,math.pi/4)
end
wait(3)
if mouse~=nil then
mouse.Icon="rbxasset://textures\\GunCursor.png"
end
if face~=nil then
face.Texture=storedface
end
local handle=sp:FindFirstChild("Handle")
if handle~=nil then
local mesh=handle:FindFirstChild("Mesh")
if mesh~=nil then
mesh.TextureId=textureclosed
end
end
check=true
end
end
end)
end
delay(0,function()
local la=sp.Parent:FindFirstChild("Left Arm")
if la~=nil then
if spoon then
spoon:remove()
end
spoon=Instance.new("Part")
spoon.FormFactor="Custom"
spoon.Name="Handle"
spoon.Size=Vector3.new(.2,.2,1.3)
spoon.TopSurface="Smooth"
spoon.BottomSurface="Smooth"
spoon.CanCollide=false
local m=Instance.new("SpecialMesh")
m.MeshId="http://www.roblox.com/asset?id=103919885"
m.TextureId=textureopen
m.Parent=spoon
w=Instance.new("Motor")
w.Part0=la
w.Part1=spoon
w.C0=CFrame.new(0,-1,-.3)*CFrame.Angles(0,0,math.pi/4)
w.Parent=spoon
debris:AddItem(spoon,600)
spoon.Parent=game.Workspace
end
end)
end)
sp.Unequipped:connect(function()
equipped=false
if anim2 then
anim2:Stop()
end
if face~=nil then
face.Texture=storedface
end
local handle=sp:FindFirstChild("Handle")
if handle~=nil then
local mesh=handle:FindFirstChild("Mesh")
if mesh~=nil then
mesh.TextureId=textureclosed
end
end
if spoon then
spoon:remove()
end
end)
|
-- Fires off everytime the link is reconfigured into a valid link
-- Fires with link, linkValue
|
function RxLinkUtils.observeValidityBrio(linkName, link)
assert(typeof(link) == "Instance" and link:IsA("ObjectValue"), "Bad link")
assert(type(linkName) == "string", "Bad linkName")
return Observable.new(function(sub)
local maid = Maid.new()
local function updateValidity()
if not ((link.Name == linkName) and link.Value) then
maid._lastValid = nil
return
end
local newValid = Brio.new(link, link.Value)
maid._lastValid = newValid
sub:Fire(newValid)
end
maid:GiveTask(link:GetPropertyChangedSignal("Value")
:Connect(updateValidity))
maid:GiveTask(link:GetPropertyChangedSignal("Name")
:Connect(updateValidity))
updateValidity()
return maid
end)
end
return RxLinkUtils
|
---------------------------------------DO NOT EDIT-------------------------------------------------------
|
local AbiltyGui = script.Parent.ScreenGui:Clone()
AbiltyGui.AbilitySecs.Value = script.Parent.Configuration.AbilityCoolDown.Value
AbiltyGui.AbilitySecs2.Value = script.Parent.Configuration.AbilityCoolDown.Value
wait(0.01)
AbiltyGui.LocalScript.Disabled = false
wait()
AbiltyGui.LocalScript2.Disabled = false
wait(0.1)
AbiltyGui.Parent = Player.PlayerGui
wait(script.Parent.Configuration.AbilityCoolDown.Value)
script.Disabled = false
script.Parent.Ability.Disabled = false
end
end)
|
-- elseif inputType == Enum.UserInputType.Keyboard or inputType.Value <= 4 then
| |
-- SpeederSpawnLocation part
|
local SpeederSpawnLocation = workspace:FindFirstChild("SpeederSpawnLocation")
|
--[[
The symbol used to denote the children of an instance when working with the
`New` function.
]]
|
local Package = script.Parent.Parent
local PubTypes = require(Package.PubTypes)
return {
type = "Symbol",
name = "Children"
} :: PubTypes.ChildrenKey
|
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types
|
function CameraModule:GetCameraControlChoice()
local player = Players.LocalPlayer
if player then
if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
-- Touch
if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
else
return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
end
else
-- Computer
if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
else
return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
end
end
end
end
function CameraModule:OnCharacterAdded(char, player)
if self.activeOcclusionModule then
self.activeOcclusionModule:CharacterAdded(char, player)
end
end
function CameraModule:OnCharacterRemoving(char, player)
if self.activeOcclusionModule then
self.activeOcclusionModule:CharacterRemoving(char, player)
end
end
function CameraModule:OnPlayerAdded(player)
player.CharacterAdded:Connect(function(char)
self:OnCharacterAdded(char, player)
end)
player.CharacterRemoving:Connect(function(char)
self:OnCharacterRemoving(char, player)
end)
end
function CameraModule:OnMouseLockToggled()
if self.activeMouseLockController then
local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
if self.activeCameraController then
self.activeCameraController:SetIsMouseLocked(mouseLocked)
self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
end
end
end
return CameraModule.new()
|
--[[**
ensures value is a number where min < value
@param min The minimum to use
@returns A function that will return true iff the condition is passed
**--]]
|
function t.numberMinExclusive(min)
return function(value)
local success, errMsg = t.number(value)
if not success then
return false, errMsg or ""
end
if min < value then
return true
else
return false, string.format("number > %s expected, got %s", min, value)
end
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = {};
v1.__index = v1;
local l__Players__2 = game:GetService("Players");
local l__RunService__3 = game:GetService("RunService");
local l__UserInputService__4 = game:GetService("UserInputService");
local l__VRService__5 = game:GetService("VRService");
local l__UserGameSettings__6 = UserSettings():GetService("UserGameSettings");
local v7 = require(script:WaitForChild("CameraUtils"));
local v8 = require(script:WaitForChild("CameraInput"));
local v9 = require(script:WaitForChild("ClassicCamera"));
local v10 = require(script:WaitForChild("OrbitalCamera"));
local v11 = require(script:WaitForChild("LegacyCamera"));
local v12 = require(script:WaitForChild("VehicleCamera"));
local v13 = require(script:WaitForChild("VRCamera"));
local v14 = require(script:WaitForChild("VRVehicleCamera"));
local v15 = require(script:WaitForChild("Invisicam"));
local v16 = require(script:WaitForChild("Poppercam"));
local v17 = require(script:WaitForChild("TransparencyController"));
local v18 = require(script:WaitForChild("MouseLockController"));
local l__PlayerScripts__19 = l__Players__2.LocalPlayer:WaitForChild("PlayerScripts");
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Default);
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Follow);
l__PlayerScripts__19:RegisterTouchCameraMovementMode(Enum.TouchCameraMovementMode.Classic);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Default);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Follow);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.Classic);
l__PlayerScripts__19:RegisterComputerCameraMovementMode(Enum.ComputerCameraMovementMode.CameraToggle);
local u1 = { "CameraMinZoomDistance", "CameraMaxZoomDistance", "CameraMode", "DevCameraOcclusionMode", "DevComputerCameraMode", "DevTouchCameraMode", "DevComputerMovementMode", "DevTouchMovementMode", "DevEnableMouseLock" };
local u2 = { "ComputerCameraMovementMode", "ComputerMovementMode", "ControlMode", "GamepadCameraSensitivity", "MouseSensitivity", "RotationType", "TouchCameraMovementMode", "TouchMovementMode" };
function v1.new()
local v20 = setmetatable({}, v1);
v20.activeCameraController = nil;
v20.activeOcclusionModule = nil;
v20.activeTransparencyController = nil;
v20.activeMouseLockController = nil;
v20.currentComputerCameraMovementMode = nil;
v20.cameraSubjectChangedConn = nil;
v20.cameraTypeChangedConn = nil;
for v21, v22 in pairs(l__Players__2:GetPlayers()) do
v20:OnPlayerAdded(v22);
end;
l__Players__2.PlayerAdded:Connect(function(p1)
v20:OnPlayerAdded(p1);
end);
v20.activeTransparencyController = v17.new();
v20.activeTransparencyController:Enable(true);
if not l__UserInputService__4.TouchEnabled then
v20.activeMouseLockController = v18.new();
local v23 = v20.activeMouseLockController:GetBindableToggleEvent();
if v23 then
v23:Connect(function()
v20:OnMouseLockToggled();
end);
end;
end;
v20:ActivateCameraController(v20:GetCameraControlChoice());
v20:ActivateOcclusionModule(l__Players__2.LocalPlayer.DevCameraOcclusionMode);
v20:OnCurrentCameraChanged();
l__RunService__3:BindToRenderStep("cameraRenderUpdate", Enum.RenderPriority.Camera.Value, function(p2)
v20:Update(p2);
end);
for v24, v25 in pairs(u1) do
l__Players__2.LocalPlayer:GetPropertyChangedSignal(v25):Connect(function()
v20:OnLocalPlayerCameraPropertyChanged(v25);
end);
end;
for v26, v27 in pairs(u2) do
l__UserGameSettings__6:GetPropertyChangedSignal(v27):Connect(function()
v20:OnUserGameSettingsPropertyChanged(v27);
end);
end;
game.Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
v20:OnCurrentCameraChanged();
end);
return v20;
end;
function v1.GetCameraMovementModeFromSettings(p3)
if l__Players__2.LocalPlayer.CameraMode == Enum.CameraMode.LockFirstPerson then
return v7.ConvertCameraModeEnumToStandard(Enum.ComputerCameraMovementMode.Classic);
end;
if l__UserInputService__4.TouchEnabled then
local v28 = v7.ConvertCameraModeEnumToStandard(l__Players__2.LocalPlayer.DevTouchCameraMode);
local v29 = v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.TouchCameraMovementMode);
else
v28 = v7.ConvertCameraModeEnumToStandard(l__Players__2.LocalPlayer.DevComputerCameraMode);
v29 = v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.ComputerCameraMovementMode);
end;
if v28 == Enum.DevComputerCameraMovementMode.UserChoice then
return v29;
end;
return v28;
end;
local u3 = {};
function v1.ActivateOcclusionModule(p4, p5)
if p5 == Enum.DevCameraOcclusionMode.Zoom then
local v30 = v16;
else
if p5 ~= Enum.DevCameraOcclusionMode.Invisicam then
warn("CameraScript ActivateOcclusionModule called with unsupported mode");
return;
end;
v30 = v15;
end;
p4.occlusionMode = p5;
if p4.activeOcclusionModule and p4.activeOcclusionModule:GetOcclusionMode() == p5 then
if not p4.activeOcclusionModule:GetEnabled() then
p4.activeOcclusionModule:Enable(true);
end;
return;
end;
local l__activeOcclusionModule__31 = p4.activeOcclusionModule;
p4.activeOcclusionModule = u3[v30];
if not p4.activeOcclusionModule then
p4.activeOcclusionModule = v30.new();
if p4.activeOcclusionModule then
u3[v30] = p4.activeOcclusionModule;
end;
end;
if p4.activeOcclusionModule then
if p4.activeOcclusionModule:GetOcclusionMode() ~= p5 then
warn("CameraScript ActivateOcclusionModule mismatch: ", p4.activeOcclusionModule:GetOcclusionMode(), "~=", p5);
end;
if l__activeOcclusionModule__31 then
if l__activeOcclusionModule__31 ~= p4.activeOcclusionModule then
l__activeOcclusionModule__31:Enable(false);
else
warn("CameraScript ActivateOcclusionModule failure to detect already running correct module");
end;
end;
if p5 == Enum.DevCameraOcclusionMode.Invisicam then
if l__Players__2.LocalPlayer.Character then
p4.activeOcclusionModule:CharacterAdded(l__Players__2.LocalPlayer.Character, l__Players__2.LocalPlayer);
end;
else
for v32, v33 in pairs(l__Players__2:GetPlayers()) do
if v33 and v33.Character then
p4.activeOcclusionModule:CharacterAdded(v33.Character, v33);
end;
end;
p4.activeOcclusionModule:OnCameraSubjectChanged(game.Workspace.CurrentCamera.CameraSubject);
end;
p4.activeOcclusionModule:Enable(true);
end;
end;
function v1.ShouldUseVehicleCamera(p6)
local l__CurrentCamera__34 = workspace.CurrentCamera;
if not l__CurrentCamera__34 then
return false;
end;
local l__CameraType__35 = l__CurrentCamera__34.CameraType;
local l__CameraSubject__36 = l__CurrentCamera__34.CameraSubject;
local v37 = true;
if l__CameraType__35 ~= Enum.CameraType.Custom then
v37 = l__CameraType__35 == Enum.CameraType.Follow;
end;
return (l__CameraSubject__36 and l__CameraSubject__36:IsA("VehicleSeat") or false) and (v37 and p6.occlusionMode ~= Enum.DevCameraOcclusionMode.Invisicam);
end;
local u4 = {};
function v1.ActivateCameraController(p7, p8, p9)
local v38 = nil;
if p9 ~= nil then
if p9 == Enum.CameraType.Scriptable then
if p7.activeCameraController then
p7.activeCameraController:Enable(false);
p7.activeCameraController = nil;
end;
return;
end;
if p9 == Enum.CameraType.Custom then
p8 = p7:GetCameraMovementModeFromSettings();
elseif p9 == Enum.CameraType.Track then
p8 = Enum.ComputerCameraMovementMode.Classic;
elseif p9 == Enum.CameraType.Follow then
p8 = Enum.ComputerCameraMovementMode.Follow;
elseif p9 == Enum.CameraType.Orbital then
p8 = Enum.ComputerCameraMovementMode.Orbital;
elseif p9 == Enum.CameraType.Attach or p9 == Enum.CameraType.Watch or p9 == Enum.CameraType.Fixed then
v38 = v11;
else
warn("CameraScript encountered an unhandled Camera.CameraType value: ", p9);
end;
end;
if not v38 then
if l__VRService__5.VREnabled then
v38 = v13;
elseif p8 == Enum.ComputerCameraMovementMode.Classic or p8 == Enum.ComputerCameraMovementMode.Follow or p8 == Enum.ComputerCameraMovementMode.Default or p8 == Enum.ComputerCameraMovementMode.CameraToggle then
v38 = v9;
else
if p8 ~= Enum.ComputerCameraMovementMode.Orbital then
warn("ActivateCameraController did not select a module.");
return;
end;
v38 = v10;
end;
end;
if p7:ShouldUseVehicleCamera() then
if l__VRService__5.VREnabled then
v38 = v14;
else
v38 = v12;
end;
end;
if not u4[v38] then
local v39 = v38.new();
u4[v38] = v39;
else
v39 = u4[v38];
if v39.Reset then
v39:Reset();
end;
end;
if p7.activeCameraController then
if p7.activeCameraController ~= v39 then
p7.activeCameraController:Enable(false);
p7.activeCameraController = v39;
p7.activeCameraController:Enable(true);
elseif not p7.activeCameraController:GetEnabled() then
p7.activeCameraController:Enable(true);
end;
elseif v39 ~= nil then
p7.activeCameraController = v39;
p7.activeCameraController:Enable(true);
end;
if p7.activeCameraController then
if p8 == nil then
if p9 ~= nil then
p7.activeCameraController:SetCameraType(p9);
end;
return;
end;
else
return;
end;
p7.activeCameraController:SetCameraMovementMode(p8);
end;
function v1.OnCameraSubjectChanged(p10)
local l__CurrentCamera__40 = workspace.CurrentCamera;
local v41 = l__CurrentCamera__40 and l__CurrentCamera__40.CameraSubject;
if p10.activeTransparencyController then
p10.activeTransparencyController:SetSubject(v41);
end;
if p10.activeOcclusionModule then
p10.activeOcclusionModule:OnCameraSubjectChanged(v41);
end;
p10:ActivateCameraController(nil, l__CurrentCamera__40.CameraType);
end;
function v1.OnCameraTypeChanged(p11, p12)
if p12 == Enum.CameraType.Scriptable and l__UserInputService__4.MouseBehavior == Enum.MouseBehavior.LockCenter then
v7.restoreMouseBehavior();
end;
p11:ActivateCameraController(nil, p12);
end;
function v1.OnCurrentCameraChanged(p13)
local l__CurrentCamera__42 = game.Workspace.CurrentCamera;
if not l__CurrentCamera__42 then
return;
end;
if p13.cameraSubjectChangedConn then
p13.cameraSubjectChangedConn:Disconnect();
end;
if p13.cameraTypeChangedConn then
p13.cameraTypeChangedConn:Disconnect();
end;
p13.cameraSubjectChangedConn = l__CurrentCamera__42:GetPropertyChangedSignal("CameraSubject"):Connect(function()
p13:OnCameraSubjectChanged(l__CurrentCamera__42.CameraSubject);
end);
p13.cameraTypeChangedConn = l__CurrentCamera__42:GetPropertyChangedSignal("CameraType"):Connect(function()
p13:OnCameraTypeChanged(l__CurrentCamera__42.CameraType);
end);
p13:OnCameraSubjectChanged(l__CurrentCamera__42.CameraSubject);
p13:OnCameraTypeChanged(l__CurrentCamera__42.CameraType);
end;
function v1.OnLocalPlayerCameraPropertyChanged(p14, p15)
if p15 == "CameraMode" then
if l__Players__2.LocalPlayer.CameraMode ~= Enum.CameraMode.LockFirstPerson then
if l__Players__2.LocalPlayer.CameraMode == Enum.CameraMode.Classic then
p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p14:GetCameraMovementModeFromSettings())));
return;
else
warn("Unhandled value for property player.CameraMode: ", l__Players__2.LocalPlayer.CameraMode);
return;
end;
end;
if not p14.activeCameraController or p14.activeCameraController:GetModuleName() ~= "ClassicCamera" then
p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard(Enum.DevComputerCameraMovementMode.Classic));
end;
if p14.activeCameraController then
p14.activeCameraController:UpdateForDistancePropertyChange();
return;
end;
else
if p15 == "DevComputerCameraMode" or p15 == "DevTouchCameraMode" then
p14:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p14:GetCameraMovementModeFromSettings())));
return;
end;
if p15 == "DevCameraOcclusionMode" then
p14:ActivateOcclusionModule(l__Players__2.LocalPlayer.DevCameraOcclusionMode);
return;
end;
if p15 == "CameraMinZoomDistance" or p15 == "CameraMaxZoomDistance" then
if p14.activeCameraController then
p14.activeCameraController:UpdateForDistancePropertyChange();
return;
end;
else
if p15 == "DevTouchMovementMode" then
return;
end;
if p15 == "DevComputerMovementMode" then
return;
end;
if p15 == "DevEnableMouseLock" then
end;
end;
end;
end;
function v1.OnUserGameSettingsPropertyChanged(p16, p17)
if p17 == "ComputerCameraMovementMode" then
p16:ActivateCameraController(v7.ConvertCameraModeEnumToStandard((p16:GetCameraMovementModeFromSettings())));
end;
end;
function v1.Update(p18, p19)
if p18.activeCameraController then
p18.activeCameraController:UpdateMouseBehavior();
local v43, v44 = p18.activeCameraController:Update(p19);
if p18.activeOcclusionModule then
local v45, v46 = p18.activeOcclusionModule:Update(p19, v43, v44);
v43 = v45;
v44 = v46;
end;
local l__CurrentCamera__47 = game.Workspace.CurrentCamera;
l__CurrentCamera__47.CFrame = v43;
l__CurrentCamera__47.Focus = v44;
if p18.activeTransparencyController then
p18.activeTransparencyController:Update(p19);
end;
if v8.getInputEnabled() then
v8.resetInputForFrameEnd();
end;
end;
end;
function v1.GetCameraControlChoice(p20)
local l__LocalPlayer__48 = l__Players__2.LocalPlayer;
if not l__LocalPlayer__48 then
return;
end;
if l__UserInputService__4:GetLastInputType() == Enum.UserInputType.Touch or l__UserInputService__4.TouchEnabled then
if l__LocalPlayer__48.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
return v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.TouchCameraMovementMode);
else
return v7.ConvertCameraModeEnumToStandard(l__LocalPlayer__48.DevTouchCameraMode);
end;
end;
if l__LocalPlayer__48.DevComputerCameraMode ~= Enum.DevComputerCameraMovementMode.UserChoice then
return v7.ConvertCameraModeEnumToStandard(l__LocalPlayer__48.DevComputerCameraMode);
end;
return v7.ConvertCameraModeEnumToStandard((v7.ConvertCameraModeEnumToStandard(l__UserGameSettings__6.ComputerCameraMovementMode)));
end;
function v1.OnCharacterAdded(p21, p22, p23)
if p21.activeOcclusionModule then
p21.activeOcclusionModule:CharacterAdded(p22, p23);
end;
end;
function v1.OnCharacterRemoving(p24, p25, p26)
if p24.activeOcclusionModule then
p24.activeOcclusionModule:CharacterRemoving(p25, p26);
end;
end;
function v1.OnPlayerAdded(p27, p28)
p28.CharacterAdded:Connect(function(p29)
p27:OnCharacterAdded(p29, p28);
end);
p28.CharacterRemoving:Connect(function(p30)
p27:OnCharacterRemoving(p30, p28);
end);
end;
function v1.OnMouseLockToggled(p31)
if p31.activeMouseLockController then
local v49 = p31.activeMouseLockController:GetIsMouseLocked();
local v50 = p31.activeMouseLockController:GetMouseLockOffset();
if p31.activeCameraController then
p31.activeCameraController:SetIsMouseLocked(v49);
p31.activeCameraController:SetMouseLockOffset(v50);
end;
end;
end;
local v51 = v1.new();
return {};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.