I'm having some trouble with getting my GUI to show up, basically I'm trying to get the "window" to detect if the player is holding a "brick", if they are then it will unanchor, but if they detect the player is not holding a brick a text will apear alerting the player about it. The window part works fine, but the Textlable wont show up, the script is in a server script which is under the "windowpart1" part in the workspace, thank you!
this is the script:
local windowpart1 = game.Workspace.window.windowpart1
local windowpart2 = game.Workspace.window.windowpart2
local prompt = game.Workspace.window.windowpart1.breakwindow
local brick = game.Workspace.brick
local nobrickgui = game.StarterGui.ScreenGui.nobrickgui
nobrickgui.Visible = false
windowpart1.Anchored = true
windowpart2.Anchored = true
prompt.Triggered:Connect(function(player)
if brick.Parent == player.Character then
windowpart1.Anchored = false
windowpart2.Anchored = false
windowpart1:ApplyImpulse(Vector3.new(25, 0, 0))
windowpart2:ApplyImpulse(Vector3.new(25, 0, 0))
else
nobrickgui.Visible = true
task.wait(3)
nobrickgui.Visible = false
end
end)