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

GUI and ImageLabel help?

Asked by
0x72 20
10 years ago

So, i want to make a gui that shows up on the right corner of my screen, but with an script. i made it work with a screengui, now i need a script to make it work, here is what i got.

a=Instance.new("ScreenGui", StarterGui)
b=Instance.new("ImageLabel", ScreenGui)
b.Image = 'http://www.roblox.com/asset/?id=160594350'
Label.Size = UDim2.new(0,570,0,320)
Label.Position = UDim2.new(0,256,0,256)

any mistakes?

0
does it need to be local a=Instance.new("ScreenGui", StarterGui)Q? 0x72 20 — 10y
0
The answer I put in should be sufficeint. HexC3D 830 — 10y

2 answers

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago

Here's my share to the script :) Put this in the backpack of the player and I can assure this will work.

local plr = script.Parent.Parent
a=Instance.new("ScreenGui", plr:WaitForDataReady("PlayerGui")) -- Don't want the script to be running ahead of the PlayerGui :)
b=Instance.new("ImageLabel", a)
b.Image = 'http://www.roblox.com/asset/?id=160594350'
b.Size = UDim2.new(0,570,0,320)
b.Position = UDim2.new(0,256,0,256)

if this helped +1, if this answered your question check mark.

Also I'm not so sure of the positioning of the ImageLabel or ImageButton would be on the right side Next time. Instead of using "Label" actually use the variable you assigned the ImageLabel or ImageButton to.

                                                      Happy Scripting ~ HexC3D
0
Quick suggestion: Comment the Happy Scripting ~ HexC3D fireboltofdeath 635 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

You don't put it in the StarterGui, you put it in the PlayerGui. Here's what i suggest doing.(Put the script in the StarterGui)

local player = script.Parent
a = Instance.new("ScreenGui",player.PlayerGui
b = Instance.new("ImageLabel",a)
b.Image = 'http://www.roblox.com/asset/?id=160594350'
b.Size = UDim2.new(0,570,0,320) -- I didn't know what Label was so i assumed it was the imagelabel
b.Position = UDim2.new(0,256,0,256)

You could just put the ScreenGui in the startergui instead of using this script. The StarterGui contents automatically goes into the PlayerGui

Answer this question