I know how to do this with Touched scripts, but with a ClickDetector I'm lost. I have this gate and a button, but I only want the button to be activated if the player's name is the same as the Owner.Value within the tycoon. Here's the part I'm having trouble with
script.Parent.ClickDetector.MouseClick:connect(function(clicker)
local player = game.Players:GetPlayerFromCharacter(clicker.Parent)
if open == false and moving == false and script.Parent.Parent.Parent.Parent.Owner.Value==player then
--gate script stuff
the script is within the button and the open and moving part can be ignored. The script works but when I try and make it run only when the players name matches with the owner value it stops working. Thanks for the help.
