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

need help to fix GUI script ?

Asked by 10 years ago

the script runs before the imagebutton enters slots.. it skips function MouseHover()

local gui = script.Parent
local slots = gui.Frame.ScrollingFrame.FrameH
local hats = slots:GetChildren()
local item = gui.Frame.item

function findfirstchild(slots)
if slots.Name == "a1" then
for i = 1,#hats do
    hats[i].MouseEnter:connect(function()
function MouseHover()
wait()
item.ImageLabel.Image = "http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=420&height=420&assetId="..hats[i].id.Value..""
MouseHover()
end
print("successful")
    end)
end
end
end

1 answer

Log in to vote
0
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
10 years ago

All you need to do is get rid of the new function MouseHover except for the item.ImageLabel.Image line, you're trying to call the function inside the function with your script.

In your script it was going like this.

function Msg()
print("Hi")
Msg()
end

--The script is only reading this part.

local gui = script.Parent
local slots = gui.Frame.ScrollingFrame.FrameH
local hats = slots:GetChildren()
local item = gui.Frame.item

function findfirstchild(slots)
    if slots.Name == "a1" then
        for i = 1,#hats do
            hats[i].MouseEnter:connect(function()
                item.ImageLabel.Image = "http://www.roblox.com/Thumbs/Asset.ashx?format=png&width=420&height=420&assetId="..hats[i].id.Value..""
                print("successful")
            end)
        end
    end
end
0
i found the problem its working fine i just moved local hats = slots:GetChildren() down to the function Layfonex 0 — 10y
Ad

Answer this question