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 » Scripters
Home Search
 

Re: How to put images into tables

Previous Thread :: Next Thread 
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Jul 2015 05:05 PM
23:02:50.668 - Players.Player1.PlayerGui.ScreenGui.LocalScript:9: bad argument #3 to 'Image' (string expected, got nil)
images = {"rbxgameasset://Images/Gewher", "rbxgameasset://Images/MP40"}

How would I put an image into a table?
Thanks


▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
18 Jul 2015 05:06 PM
Just put the ID only, but that should work fine?

Whats the part that uses the image?
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Jul 2015 05:13 PM
A GUI

▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
18 Jul 2015 05:14 PM
I mean the part of the code.
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Jul 2015 05:15 PM
Start

images = {"rbxgameasset://Images/Gewher", "rbxgameasset://Images/MP40"}
buttons = {script.Parent.Frame["CXi - 13"], script.Parent.Frame["CXi - 23"]}

while true do
wait()
for i,v in pairs(buttons) do
v.MouseEnter:connect(function()
x = v.Value
script.Parent.Frame.GunImage.Image = images[x]

end)
end
end


▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
18 Jul 2015 05:19 PM
try this...You dont need to put it in a loop btw.

images = {"Gewher", "MP40"}
buttons = {script.Parent.Frame["CXi - 13"], script.Parent.Frame["CXi - 23"]}

for i,v in pairs(buttons) do
v.MouseEnter:connect(function()
x = v.Value
if images[x] then
script.Parent.Frame.GunImage.Image = "rbxgameasset://Images/"..images[x]
end
end)
end
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Jul 2015 05:26 PM
Still no luck. Not even changing the image, no errors though. This is the hierachy
http://gyazo.com/00031d39bae3bdcf1ef2ae4bae10d468

▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
18 Jul 2015 05:29 PM
...

images = {"Gewher", "MP40"}

for i,v in pairs(script.Parent.Frame:GetChildren()) do
if v:IsA("TextButton") then
v.MouseEnter:connect(function()
x = v.Value
if images[x.Value] then
script.Parent.Frame.GunImage.Image = "rbxgameasset://Images/"..images[x.Value]
end
end)
end
end
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Jul 2015 06:05 PM
Getting frustrated here (Not at you)! Still doesn't work, I tried it a different method but it said my concatinations are wrong


images = {"271602915", "271604562"}


for i,v in pairs(script.Parent.Frame:GetChildren()) do
if v:IsA("TextButton") then
v.MouseEnter:connect(function()
x = v.Value
if images[x.Value] then
script.Parent.Frame.GunImage.Image = "http://www.roblox.com/asset/?id=" .. images[x]
end
end)
end
end


▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
18 Jul 2015 06:11 PM
Change the name of "Value" to something like Var, so the script doesnt get confused

images = {"271602915", "271604562"}

for i,v in pairs(script.Parent.Frame:getChildren()) do
if v:IsA("TextButton") then
v.MouseEnter:connect(function()
if images[v.Var.Value] then
script.Parent.Frame.GunImage.Image = "http://www.roblox.com/asset/?id=" .. images[v.Var.Value-1]
end
end)
end
end
Report Abuse
WolfgangVonPrinz is not online. WolfgangVonPrinz
Joined: 24 Oct 2013
Total Posts: 4656
18 Jul 2015 06:16 PM
IT WORKS! Thanks man!

▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
18 Jul 2015 06:17 PM
np
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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