function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
local player = script.Parent.Parent.Parent.Workspace
if h.Parent.Name == Player then --If the one who pressed the button is the owner 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("Money")
if (score~=nil) then
score.Value = score.Value + script.Parent.Parent.Money.Value
script.Parent.Parent.Money.Value = 0
end
end
end
end
end
end
script.Parent.Touched:connect(onTouched)
OK, this may seem complex, but im trying to make a system, where you take a brick or part, drop it inside of an "cash to collect", and get points. My problem is..
TO get points, i dont want you to be owner. I want it to be anyone. If i could get some help, that would be awesome .IM not asking for a script. I just need help editing it -Beginner Scripter

1 comment
well is this a ServerScript or a LocalScript?