Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I fix script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)?

script.Parent.ClickDetector.MouseClick:connect(function(playerWhoClicked)

local userplayer = playerWhoClicked.name

game.Players.userplayer.PlayerGui.NoteGui.Enabled = true

end)

How do I fix that.

3 comments

0

This script won't work.

0

What's the error? Try elaborating more on what fixing is needed.

0

I want to open the gui when the player clicks the click detector but when I go into a public game it won't work.

2 answers

script.Parent.ClickDetector.MouseClick:connect(function(player)
	player.PlayerGui.NoteGui.Enabled = true
end)

2 comments

0

Works! Thank you very much.

0

Was gonna say that, dang it! Good job anyways.

Too broad. Second of all, line 3 should be

game.Players[username].PlayerGui.NoteGui.Enabled = true

2 comments

0

can't it just be (game.Players.LocalPlayer OR playerWhoClicked.PlayerGui.Enabled = true) ?

0

But I won't know who clicked it.

This discussion is preserved as it was. New answers, comments, and votes are closed.