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.
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.