generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: cant create imagelabel instance?

Previous Thread :: Next Thread 
coreynj3 is not online. coreynj3
Joined: 21 Jul 2012
Total Posts: 12
19 Oct 2014 11:04 AM
while true do
il = Instance.new("ImageLabel",script.Parent)
il.Image = "http://www.roblox.com/asset/?id=157979926"
wait(0.5)
end

why wont this work?
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Oct 2014 11:06 AM
It needs to be in a ScreenGui inside PlayerGui
Report Abuse
coreynj3 is not online. coreynj3
Joined: 21 Jul 2012
Total Posts: 12
19 Oct 2014 11:06 AM
its inside a screengui in the startergui
it needs to be in playergui?...
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Oct 2014 11:07 AM
Well, when a char respawns, everything in startergui clones into the player's playergui.
Report Abuse
coreynj3 is not online. coreynj3
Joined: 21 Jul 2012
Total Posts: 12
19 Oct 2014 11:08 AM
well, will this work?

while true do
il = Instance.new("ImageLabel",game.Players:children().PlayerGui)
il.Image = "http://www.roblox.com/asset/?id=157979926"
wait(0.5)
end
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
19 Oct 2014 11:09 AM
No.
Report Abuse
coreynj3 is not online. coreynj3
Joined: 21 Jul 2012
Total Posts: 12
19 Oct 2014 11:11 AM
meh ill just make a basic imagelabel and clone it in random positions
Report Abuse
slayer1928 is not online. slayer1928
Joined: 19 Feb 2010
Total Posts: 32
19 Oct 2014 11:12 AM
Why are you running a loop?
Just do something like this...

local Player = game.Players.LocalPlayer
sg = Instance.new("ScreenGui", Player.PlayerGui)
il = Instance.new("ImageLabel", sg)
il.Image = "http://www.roblox.com/asset/?id=157979926"
Report Abuse
coreynj3 is not online. coreynj3
Joined: 21 Jul 2012
Total Posts: 12
19 Oct 2014 11:15 AM
because i want them to appear over and over again inside their playergui at random positions that are still visible on screen
Report Abuse
coreynj3 is not online. coreynj3
Joined: 21 Jul 2012
Total Posts: 12
19 Oct 2014 11:17 AM
and slayer that didnt work...
does it need to be a localscript or a normal script?
Report Abuse
slayer1928 is not online. slayer1928
Joined: 19 Feb 2010
Total Posts: 32
19 Oct 2014 12:53 PM
It needs to be a local script.
Report Abuse
slayer1928 is not online. slayer1928
Joined: 19 Feb 2010
Total Posts: 32
19 Oct 2014 01:16 PM
Also, the script i put above works perfectly. But you still need to set a size for the imagelabel.

If you want something that loops, creates images, and puts them all at random positions then use something like this.

Should work just fine in a localscript.

local Player = game.Players.LocalPlayer
local nums = {}
local v = 0
local sg = Instance.new("ScreenGui", Player.PlayerGui)

for i = 1, 100 do
table.insert(nums, #nums, v)
v = v + 0.01
end

while true do
il = Instance.new("ImageLabel", sg)
il.Image = "http://www.roblox.com/asset/?id=157979926"
il.BackgroundTransparency = 1
il.Size = UDim2.new(0.2, 0, 0.2, 0)
il.Position = UDim2.new(nums[math.random(1, #nums)], 0, nums[math.random(1, #nums)], 0)
wait(0.1)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image