So, I made a localscript that is inside a startergui that also has a textbutton. In the workspace there is a part called “Collison”. What I wanted to do is that when a player enters this collision, the textbutton becomes visible only to him and not to the other players, but this is not happening because it only takes one player to touch the collision and the outside ones also have the textbutton visible. Any way to resolve this?
You never checked that the player who touched the collision part was the local player, hence why it would run for everyone. In the code below, I have added a simple check. It gets the player based off the character, then compares the player to the local player
workspace.Collison.Touched:Connect(function(hit)
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player == game.Players.LocalPlayer then
script.Parent.TextButton.Visible = true
end
end)