Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help making a ontouch script for my simulator called fishing simulator. Can anybody help?

Asked by 5 years ago

I am making a game called fishing simulator and i need help with my first event. I don't know how to make it to where the player who touched the object gets more coins.

 function onTouched(hit)

end
    script.Parent.Touched:connect(onTouched)

The Coins directory thing is in players game.Players.guyman123["???? Coins"] I hope that was understandable.

1 answer

Log in to vote
0
Answered by 5 years ago
script.Parent.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr["Coins"].Value = plr["Coins"].Value + 1 --here you need to change the value to how many coins player will get.
end)

Hope this helped.

Ad

Answer this question