So I want a script that when a block is clicked, a gui appears on screen. I have created a script here, but I don't know what I'm doing wrong. Please explain and correct my mistake, thanks in advance! script:

 function onClicked()
 	wait(0)
 player = game.Players.LocalPlayer
 player.PlayerGui.ScreenGui.ToDoList1.TextBox.Visible = true

 end

 
 script.Parent.ClickDetector.MouseClick:connect(onClicked)

5 comments

0

is this a local script

0

it should be a local script

0

It wasn't, but I changed it and its still not working. The gui is in StarterGui, is that the wrong place?

0

it should not be a local script, in its current form it should be a script placed inside of the block itself..in which you should not use LocalPlayer, instead use the first argument of MouseClick..you should also use a remote event to make the textbox visible

0

Thank you!