I’ve been trying to make something where the player receives the amount of points the tier value is
e.g.
tier = 10 points receiving after win = 10
ive been trying to do for loops
please help me if you can:
code:
local workspace = game.Workspace
local plr = game.Players.LocalPlayer
local humanoid = plr.Character:WaitForChild("Humanoid")
for model, v in pairs(workspace:GetChildren()) do
if v:IsA("Model") and v.Name == "Obby" then
for tier, v in pairs(model:GetChildren()) do
v.win.Touched:Connect(function(hit)
if hit.Parent == plr then
if tonumber(v.Tier.Value) then
plr.leaderstats.Tokens.Value += v.Tier.Value
v.kill.Touched:Connect(function(hit)
if hit.Parent == humanoid then
humanoid.Health = 0
end
end)
end
end
end)
end
end
end