I have a script the detects when a player click a clickdetector and then get their username. I also have a bool value that gets added into every player when they join. How would I set the bool value inside the player who clicked the part to true?
local button = script.Parent local inUse = game.Workspace.Booth1:WaitForChild("InUse") local Owner = game.Workspace.Booth1:WaitForChild("Owner") local Label = script.Parent.Parent.SurfaceGui:WaitForChild("TextLabel") button.MouseClick:Connect(function(player) if inUse.Value == false then inUse.Value = true Owner.Value = (player.Name) Label.Text = ("Claimed by " .. player.Name .. "!") -- change bool value of the player on line above ^^^^ else print("Already being used!") end end)
local button = script.Parent local inUse = game.Workspace.Booth1:WaitForChild("InUse") local Owner = game.Workspace.Booth1:WaitForChild("Owner") local Label = script.Parent.Parent.SurfaceGui:WaitForChild("TextLabel") button.MouseClick:Connect(function(player) -- I'm on my phone indentions are off local playerCharacter = player.Character -- Assuming the bool is the character's child, edited it removed: player. ... local theBool = playerCharacter:FindFirstChild("TheBool") if inUse.Value == false then inUse.Value = true Owner.Value = (player.Name) Label.Text = ("Claimed by " .. player.Name .. "!") -- There it is theBool.Value = true -- change bool value of the player on line above ^^^^ else print("Already being used!") end end)