I've already asked this but the only answer I got was "Your script could be a lot simpler", so I'm asking it again (with an updated script).
You're supposed to get 1 coin for touching this coin, but you can't get it again. In a Script (Normal):
(EDITED SCRIPT)
game.Players.PlayerAdded:connect(function(player) got = false print("SET UP GOT VARIABLE") script.Parent.Touched:connect(function(part) if part.Parent.findFirstChild("Torso") ~= nil then print("PLAYER TOUCHED IT") if got == false then _G.Coins = _G.Coins + 1 got = true print("PLAYER DOESN'T HAVE YET! GAVE PLAYER 1 COIN") part.Parent.Torso.CFrame = CFrame.new(Vector3.new(-16.1, 3, -219)) end print("ENDING PLAYER CHECK") end print("ENDING SCRIPT!") end) end)
Why doesn't it work? It doesn't even print the messages!
It should not be a localscript if the script is inside the workspace.
You need to modify it so that its a regular script.
Which also means you need to find other means to keep track if the user has gotten that coin or not.
On line, you're checking if the "got" variable is false, and it only gives out a coin if it's false. However, the first time the player touches the coin, it sets got to true. Since it is never set back to false, no more coins are awarded.