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

Doorbell Message wont work when clicked. Why?

I am currently making a game with a doorbell. When the doorbell rings a message will pop up on the bottom saying 'Seems like no one is home'. I tested the game out and clicked the bell, but the message wont work

Help!

script.Parent.ClickDetector.MouseClick:Connect(function(player) wait(2) local screengui= Instance.new'ScreenGui' screengui.Name = 'NobGui' screengui.Parent = player.PlayerGui local textlabel = Instance.new'TextLabel' textlabel.Text = 'Seems like no one is home.' textlabel.Font = 'Fantasy' textlabel.TextSize = 34 textlabel.BackgroundTransparency = 1 textlabel.TextColor3 = Color3.fromRGB(231,231,231) textlabel.Size = UDim2.new{0, 440},{0, 92} textlabel.Position = UDim2.new{0.277, 0},{0.742, 0} textlabel.Parent = screengui game:GetService'Debris':AddItem(screengui,5)--removes the ScreenGui after 5 seconds end)

3 comments

0

What does the output say?

0

Nothing

0

Accept my answer

1 answer

✓ Accepted answer

Don't do curly brackets for UDim2.new

script.Parent.ClickDetector.MouseClick:Connect(function(player)
wait(2) local screengui= Instance.new'ScreenGui' screengui.Name = 'NobGui' screengui.Parent = player.PlayerGui 
local textlabel = Instance.new'TextLabel' textlabel.Text = 'Seems like no one is home.' textlabel.Font = 'Fantasy' textlabel.TextSize = 34 textlabel.BackgroundTransparency = 1 textlabel.TextColor3 = Color3.fromRGB(231,231,231) 
textlabel.Size = UDim2.new(0, 440,0, 92) textlabel.Position = UDim2.new(0.277, 0,0.742, 0) textlabel.Parent = screengui game:GetService'Debris':AddItem(screengui,5)--removes the ScreenGui after 5 seconds 
end)

5 comments

0

Still not working... Error - Workspace.Doorbell.Bell.Script:12: ')' expected near ',' For - textlabel.Size = UDim2.new(0, 440),(0, 92)

0

If you copy-Pasted my script, it wouldn't have the extra parenthises.

0

Ohhh

0

Accept my answer,please

0

Sorry lol

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