Help with preventing players from clicking another player's part!

I have a question, is there a way, I can prevent other players from clicking a part? and only the player who instanced the part, is allowed to click it?

1 Like

Just add a debounce whenever a player clicks it to prevent it from being clicked again

1 Like

Whenever you create the clickable part, save the player who created it into a value. When someone clicks on it again, just check if who clicked is equal to the player who created it. Let me know if you need help with code, try doing that yourself first though!

2 Likes

Well that isnt what Im looking for, so basically…I have this quest; everything works perfectly fine…but another player is allowed to click the part, which I dont want. I only want the player who fired the event, to be able to click it.

1 Like

Alright, thank you for your assistance…I will make sure to come for help.

If you only intend one player to be able to click the part, it’s best to probably use FireClient to the player, and have the player LocalScript give a ClickDetector to the part to click, and then handle if the player clicks it by FireServer back.

If you just intend others to not be able to click yours or want to know who clicked, MouseClick on ClickDetectors do return a player argument…

ClickDetector.MouseClick:Connect(function(playerClicked)
print("playerClicked: "..tostring(playerClicked))
end)

Thank you, this helped me a lot…it also worked!