I tried using a local script on a part and it doesn't work. This script was supposed to make a person hallucinate and only that person who was affected by it can see the entity.
local plr = game.Players.LocalPlayer script.Parent.Touched:Connect(function() if plr and debounce == false then debounce = true for i,v in pairs(workspace.Dummy:GetChildren()) if v.ClassName == "Part" then v.Transparency = 0 end end end end)
It never really show any errors. I'm not sure what's wrong with it.
Put this in a SERVER SCRIPT(just "Script"), NOT a LOCAL SCRIPT!
game.Players.PlayerAdded:Connect(function() plr = true end) script.Parent.Touched:Connect(function() if plr and debounce == false then debounce = true for i,v in pairs(workspace.Dummy:GetChildren()) if v.ClassName == "Part" then v.Transparency = 0 end end end end)
Sorry for the bad formatting, im on mobile and i needed to re-write the script.