So I'm trying to make a script that when you click on this "crystal" It creates a SurfaceGui Above it. Im doing so by creating a part and placing it on the position of the crystal and then putting the surfacegui on that part, but It Isn't working; I get no errors. It's probably worng since It's my first time using SurfaceGui. Please help, Thanks!
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local crystal = script.Parent
mouse.ClickDetector.OnClicked:connect(function()
local Part = Instance.new('Part',(game.Workspace))
Part.Position = Vector3.new(crystal.Position)
Part.Size = Vector3.new(4, 1, 2)
Part.Anchored = true
Part.Transparency = 1
local SGui = Instance.new("ScreenGui", (Part))
local Frame = Instance.new("Frame",(SGui))
local TextLabel = Instance.new("TextLabel"),(Frame)
TextLabel.Transparency = 1
TextLabel.Text = ("Work In Progress")
end)
This is in a local script.

14 comments
Still Doesn't work
I updated it.
I know, It still doesn't work :(
What does the output say and how are you using it.
Output says nothing, no errors.
Oh wait, it's in a local script. That's why.
Is it not suppose to be?
So what romove the player variable?
No... Read my answer, i updated it.
You said the problem is , is that it's a local script right?
I'll rewrite it.
Okay, Thanks.
The part is inserting, but The surfacegui Isn't showing on the part
Cause you didn't give the GUI a size. I'll update the answer again.