Hello developers!
I’m creating game similiar to speedman and when someone hits finish line then everyone’s shoes destroys and the player who hit finish line gets their points.
Here is script:
for i, EndPart in pairs(Worlds:GetDescendants()) do
if EndPart.Name == "EndHitbox" then
EndPart.Touched:Connect(function(hit)
local hum = hit.Parent:WaitForChild("Humanoid")
if hum then
local plrShoe = Players:GetPlayerFromCharacter(hit.Parent)
if plrShoe and shoes and shoes:FindFirstChild("Energy") then
if MPS:UserOwnsGamePassAsync(plrShoe.UserId, VipPassId) then
plrShoe.leaderstats.Energy.Value += shoes.Energy.Value * plrShoe.Rebirth.EnergyR.Value * 1.25 * plrShoe.ValuesFolder.Multiplier1.Value
plrShoe.LvlFolder.Xp.Value += shoes.XP.Value * 1.5
else
plrShoe.leaderstats.Energy.Value += shoes.Energy.Value * plrShoe.Rebirth.EnergyR.Value * plrShoe.ValuesFolder.Multiplier1.Value
plrShoe.LvlFolder.Xp.Value += shoes.XP.Value
end
shoes:Destroy()
hum.WalkSpeed = 16
Equiped_Shoes = 0
end
end
end)
end
end