Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to make coin that only one player can see and get?

2 answers

This is the easiest method, there are other methods, though.

Have a localscript place the coin in workspace or workspace.CurrentCamera.

Whomever owns the localscript will see the coin.

This is because localscripts are client sided, that said, if a localscript places a part in workspace, and assuming no other player has the same script, the only player(s) who would see it would be the only player(s) to own the localscript.

By "own", I mean the localscript is inside the player's character, playergui, or backpack.

For this, make a LocalScript and put it in StarterGui.

local coin=game.Workspace.coin--replace this with where the coin is
local collectsfx=game.ReplicatedStorage.coinsound--this is optional
local debunk=false

coin.Touched:connect(function(hit)
	if game.Players:FindFirstChild(hit.Parent.Name) and coin.Transparency==0 and debunk==false then
		debunk=true
		collectsfx:Play()
		print("coin collected")
		local plr=game.Players:FindFirstChild(hit.Parent.Name)
		repeat
			coin.Transparency=coin.Transparency+0.05
			wait(0.05)
		until coin.Transparency==1
		coin.CanCollide=false
		--any extra code below (eg giving the player a +coin value
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.