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

Why isn't my gui popping up when i equip the tool?

Please help me



 tool.Equipped:Connect(function(mouse)
	local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local TextLabel = Instance.new("TextLabel")
local TextLabel_2 = Instance.new("TextLabel")
local TextLabel_3 = Instance.new("TextLabel")
local TextLabel_4 = Instance.new("TextLabel")

ScreenGui.Parent = player.PlayerGui

Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(1, 1, 1)
Frame.Position = UDim2.new(0.00952986069, 0, 0.0444663763, 0)
Frame.Size = UDim2.new(0, 772, 0, 461)
Frame.Visible = false

TextLabel.Parent = Frame
TextLabel.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel.Position = UDim2.new(0.0225903615, 0, 0.0368763544, 0)
TextLabel.Size = UDim2.new(0, 150, 0, 427)
TextLabel.Font = Enum.Font.Cartoon
TextLabel.Text = "Main Meals: Noodles,Soup,Pizza and Meatballs"
TextLabel.TextScaled = true
TextLabel.TextSize = 14
TextLabel.TextWrapped = true

TextLabel_2.Parent = Frame
TextLabel_2.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel_2.Position = UDim2.new(0.255181342, 0, 0.0368763544, 0)
TextLabel_2.Size = UDim2.new(0, 161, 0, 427)
TextLabel_2.Font = Enum.Font.Cartoon
TextLabel_2.Text = "Snacks: Cucumber, Doritos and a Biscuit"
TextLabel_2.TextScaled = true
TextLabel_2.TextSize = 14
TextLabel_2.TextWrapped = true

TextLabel_3.Parent = Frame
TextLabel_3.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel_3.Position = UDim2.new(0.497409344, 0, 0.0368763544, 0)
TextLabel_3.Size = UDim2.new(0, 161, 0, 427)
TextLabel_3.Font = Enum.Font.Cartoon
TextLabel_3.Text = "Drinks: Coke, Water and Lemonade"
TextLabel_3.TextScaled = true
TextLabel_3.TextSize = 14
TextLabel_3.TextWrapped = true

TextLabel_4.Parent = Frame
TextLabel_4.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel_4.Position = UDim2.new(0.757772028, 0, 0.0368763544, 0)
TextLabel_4.Size = UDim2.new(0, 161, 0, 427)
TextLabel_4.Font = Enum.Font.Cartoon
TextLabel_4.Text = "Dessert: Ice Cream, Chocolate and a Ice Cream Sundae"
TextLabel_4.TextScaled = true
TextLabel_4.TextSize = 14
TextLabel_4.TextWrapped = true
end) -- Used Gui to Lua

1 comment

0

help me pls

1 answer

✓ Accepted answer

You don't have to create the gui each time. Just create it once and then change the Visible property.

local ScreenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
local TextLabel = Instance.new("TextLabel")
local TextLabel_2 = Instance.new("TextLabel")
local TextLabel_3 = Instance.new("TextLabel")
local TextLabel_4 = Instance.new("TextLabel")

ScreenGui.Parent = player.PlayerGui

Frame.Parent = ScreenGui
Frame.BackgroundColor3 = Color3.new(1, 1, 1)
Frame.Position = UDim2.new(0.00952986069, 0, 0.0444663763, 0)
Frame.Size = UDim2.new(0, 772, 0, 461)
Frame.Visible = false

TextLabel.Parent = Frame
TextLabel.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel.Position = UDim2.new(0.0225903615, 0, 0.0368763544, 0)
TextLabel.Size = UDim2.new(0, 150, 0, 427)
TextLabel.Font = Enum.Font.Cartoon
TextLabel.Text = "Main Meals: Noodles,Soup,Pizza and Meatballs"
TextLabel.TextScaled = true
TextLabel.TextSize = 14
TextLabel.TextWrapped = true

TextLabel_2.Parent = Frame
TextLabel_2.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel_2.Position = UDim2.new(0.255181342, 0, 0.0368763544, 0)
TextLabel_2.Size = UDim2.new(0, 161, 0, 427)
TextLabel_2.Font = Enum.Font.Cartoon
TextLabel_2.Text = "Snacks: Cucumber, Doritos and a Biscuit"
TextLabel_2.TextScaled = true
TextLabel_2.TextSize = 14
TextLabel_2.TextWrapped = true

TextLabel_3.Parent = Frame
TextLabel_3.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel_3.Position = UDim2.new(0.497409344, 0, 0.0368763544, 0)
TextLabel_3.Size = UDim2.new(0, 161, 0, 427)
TextLabel_3.Font = Enum.Font.Cartoon
TextLabel_3.Text = "Drinks: Coke, Water and Lemonade"
TextLabel_3.TextScaled = true
TextLabel_3.TextSize = 14
TextLabel_3.TextWrapped = true

TextLabel_4.Parent = Frame
TextLabel_4.BackgroundColor3 = Color3.new(0.333333, 1, 1)
TextLabel_4.Position = UDim2.new(0.757772028, 0, 0.0368763544, 0)
TextLabel_4.Size = UDim2.new(0, 161, 0, 427)
TextLabel_4.Font = Enum.Font.Cartoon
TextLabel_4.Text = "Dessert: Ice Cream, Chocolate and a Ice Cream Sundae"
TextLabel_4.TextScaled = true
TextLabel_4.TextSize = 14
TextLabel_4.TextWrapped = true
end) -- Used Gui to Lua

tool.Equipped:Connect(function()
	Frame.Visible = true
end)
tool.Unequipped:Connect(function()
	Frame.Visible = false
end)

1 comment

0

Thx so much!! btw i just removed the end) bit near the comment gui to lua

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