This is what I have:
function onClicked(playerWhoClicked) local player = game.Players:GetPlayerFromCharacter(playerWhoClicked.Parent); player.PlayerGUI.Elevator.Frame.Visible = true; end script.Parent.ClickDetector.MouseClick:connect(onClicked)
I just want the GUI to be visible when you click the part.
You don't need to get the player from character. MouseButton1Click
returns the actual player object on click.
function onClicked(playerWhoClicked) playerWhoClicked.PlayerGui.Elevator.Frame.Visible = true; -- Spelling error on PlayerGui end script.Parent.ClickDetector.MouseClick:Connect(onClicked)
Any questions? Leave them in the comments. Thanks!