so I have been trying to make a coin that will disappear after it is touched by the player but I want it to disappear only for that player, so a local script, the problem is I can’t use .touched with a local script so I need help finding a way to make the coin work,
Yes, you can. If you’re using the LocalScript on the Workspace it will not run, just declare the Part in a variable and use the LocalScript on StarterPlayer > StarterPlayerScripts
I just tested it with a friend and the part disappeared for the both of us, do you think you can give us a example so I know if I did anything wrong? please make sure it only disappears client side
Quick addon to this, considering using debounce here so that your script is not firing every time the Touched event is fired. This means that it will only trigger once per however often you choose.
The most optimal way is to create a folder with all your coins and loop through them.
local RS = game:GetService("ReplicatedStorage")
local PartsFolder = workspace.Parts
for _, obj in ipairs(PartsFolder:GetChildren()) do
obj.Touched:Connect(function()
obj.Parent = RS
end)
end