|
| 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 |
|
|
|
| 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 |
|
|
|
| 18 Jul 2015 05:13 PM |
A GUI
▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲ |
|
|
| Report Abuse |
|
|
|
| 18 Jul 2015 05:14 PM |
| I mean the part of the code. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 18 Jul 2015 06:16 PM |
IT WORKS! Thanks man!
▲☭⎊▲Obama is a giant overlord space lizard▲⎊☭▲ |
|
|
| Report Abuse |
|
|
| |
|