I made a toggle script and I don't know the parameter given by the event so it's giving an error?
I'm making a door that allows only the owner. The players can go through, if the owner toggles that they can go. The script below is the toggle script. I'm suspecting that the parameter is wrong. So the question is, what parameter does the event MouseButtonClick provide in the function?
02 | local TrueColor = game.Workspace.Model.Values.ValidColor |
03 | local Allow = game.Workspace.Model.Values.IsTheDoorUnlocked |
04 | local FalseColor = game.Workspace.Model.Values.InvalidColor |
05 | local toggle = script.Parent |
07 | toggle.ClickDetector.MouseClick:Connect( function (whoClicked) |
08 | local player = game.Players:GetPlayerFromCharacter(whoClicked) |
09 | if player.UserId = = 263105732 then |
10 | Allow.Value = not Allow.Value |
11 | if Allow.Value = = false then |
12 | toggle.BrickColor = FalseColor.Value |
14 | toggle.BrickColor = TrueColor.Value |