Hello Community, I need your help, about this Coins Script, and what happens is that when a person enters the coins script only works for the first person and not for the others.
Script:
WaitTime = 5
Amount = 1
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local thisplr = game.Players:FindFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local stats = thisplr:findFirstChild("leaderstats")
if (stats~=nil) then
local Score = stats:findFirstChild("Level")
if (Score~=nil) then
Score.Value = Score.Value + Amount * thisplr.Multiplier.Value
end
end
end
script.Parent.Transparency = 1
script.Disabled = true
wait(WaitTime)
script.Parent.Transparency = 0
script.Disabled = false
end
end
script.Parent.Touched:Connect(onTouched)
Player: