What is wrong with my GUI Script?

function onClicked()
script.Telescope.Frame.Visible = true
wait(5)
script.Telescope.Frame.Visible = false
end
script.Parent.ClickDetector.MouseClick:connect(function(onClicked)

This is that script, i don’t know what is wrong. I tried everything But nothing work… Please Help me, There is Screenshot with this gui:
Screenshot

1 Like

are you trying to get the gui into the part?

then use SurfaceGui (set the adornee too) instead of ScreenGui

First put the Gui in Player Gui

function onClicked()
   local gui = script.Telescope:Clone()
   gui.Parent = game.Players.LocalPlayer.PlayerGui
   gui.Frame.Visible = true
   wait(5)
   gui.Frame.Visible = false
end
script.Parent.ClickDetector.MouseClick:connect(function(onClicked)

and make it a local script

1 Like

Ok, i will try this

don’treadthisimustwritethis

Ok i will try this too

don’treadthisimustwritethis

1 Like

Try use emojis to send without “don’treadthisimustwritethis”

ok :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop: :poop:

3 Likes

I guess it most be:

function onClicked()
   local gui = script.Telescope:Clone()
   gui.Parent = game.LocalPlayer.PlayerGui
   gui.Frame.Visible = true
   wait(5)
   gui.Frame.Visible = false
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

if it didnt work try this 
script.Parent.ClickDetector.MouseClick:connect(function onClicked()
   local gui = script.Telescope:Clone()
   gui.Parent = game.LocalPlayer.PlayerGui
   gui.Frame.Visible = true
   wait(5)
   gui.Frame.Visible = false
end)

hope it solve it

“First put the Gui in Player Gui” StarterGui?

2 Likes

No, PlayerGui (a folder inside the player)

Or put in StarterGui and make

function onClicked()
   local gui = game.Players.LocalPlayer.PlayerGui.Telescope
   gui.Frame.Visible = true
   wait(5)
   gui.Frame.Visible = false
end
script.Parent.ClickDetector.MouseClick:connect(function(onClicked)

remember to change to a Local Script

The script was wrong, try this new script I made (I edited the other comment)

Where? :no_mouth: :no_mouth: :thinking: :thinking:

2 Likes

Put the gui in StarterGui and put this in the button script

No one of this script works

first:

It’s

game.Players.LocalPlayer

and not

game.LocalPlayer

second:

It’s only

script.Parent.ClickDetector.MouseClick:Connect(function()
1 Like

It doesn’t work :no_mouth: :no_mouth:

The gui is in StarterGui?

So… to remind, use a LocalScript and not a Script

script.Parent.MouseClick:Connect(function()
   local gui = game.Players.PlayerGui.Telescope
   gui.Frame.Visible = true
   wait(5)
   gui.Frame.Visible = false
end)

And where this LocalScript must be?

1 Like

inside the clickdetector (clickdetector and not inside the part)

I do all what you say and nothing… it doesn’t work i have a virus in studio? idk, i give up.
i will do what @RocketB0ii say. that was only detail, Thank you for all but idk what is wrong

1 Like

Wait, it’s possible to gui opens up when you approach?

1 Like