Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't this GUI bind working?

Asked by 8 years ago
Edited 8 years ago
01local screenGui = Instance.new("ScreenGui")
02screenGui.Parent = script.Parent
03 
04local textLabel = Instance.new("TextLabel")
05textLabel.Parent = screenGui
06textLabel.Position = UDim2.new(0, 0, 0, 0)
07textLabel.Size = UDim2.new(0, 200, 0, 180)
08textLabel.BackgroundColor3 = BrickColor.Green().Color
09textLabel.TextXAlignment = 0
10textLabel.TextYAlignment = 0
11textLabel.Font = 10
12textLabel.FontSize = 5
13textLabel.Text = ""
14textLabel.Visible = false
15 
View all 34 lines...

Everything except for the final paragraph of code is working. Does anyone know what the problem is? Thank you!

EDIT: I've figured out that the tilde is actually the thing causing the problem, not the other commands.

0
Read this: http://wiki.roblox.com/index.php?title=Keyboard_input and read the section on UserInputService Gey4Jesus69 2705 — 8y
0
I already did, that's where I got that code from. I just edited it slightly. AvatarAang400 35 — 8y
0
Can you try print(inputObject.KeyCode.Value) prior to the if statement and tell us what is produced in the output? M39a9am3R 3210 — 8y
0
It say "Players.Player1.PlayerGui.GoldSrcBx - StarterGui:46: attempt to index global 'inputObject' (a nil value)" AvatarAang400 35 — 8y

Answer this question