Hi! This is supposed to work for whatever player touched this part, and it’s supposed to go invisible for them, but not other people that want to collect it. However, it isn’t going invisible for the ones that collected it? I need some help if I can get it.
What do you want to achieve? What the title says. How to make a Touched Function in a LocalScript work.
What is the issue? The code for it is not working. At all.
What solutions have you tried so far? Tried changing it, still nothing.
Okay, so here is my current code I have.
local Leaf = script.Parent
local Players = game.Players or game:GetService("Players")
debounce = false
Leaf.Touched:Connect(function(hit)
if hit.Parent ~= nil and Players:FindFirstChild(hit.Parent.Name) and debounce == false then
debounce = true
Leaf.Transparency = 1
end
end)