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

What's wrong with this clickdetector system?

Asked by
3rdblox 30
10 years ago

I'm trying to make a clickdetector system that will show info when a player hovers over the detector, but I've ran into the problem that my hover info isn't showing up or giving any output errors?

script.Parent.MouseHoverEnter:connect(function(plr)
    if not plr.PlayerGui:findFirstChild("BankGui") then
        new = script.BankHoverInfo:clone()
        new.Parent = plr.PlayerGui
        new.Frame.Position = UDim2.new(plr:GetMouse().X,0,plr:GetMouse().Y,0)
        print("plox")
    end
end)

It printed "plox" and there were no output errors but the GUI didn't show up. What's wrong?

2 answers

Log in to vote
0
Answered by 10 years ago

What is that "MouseHoverEnter" can I see your script hierarchy?

Ad
Log in to vote
0
Answered by
Asleum 135
10 years ago

On line 5, you didn't set the coordinates correctly, because here you're trying to give your frame pixel coordinates, not scale coordinates, that's why you didn't se it : it appears way out of the screen. Changing line 5 to this should fix the problem :

new.Frame.Position = UDim2.new(0, plr:GetMouse().X,0,plr:GetMouse().Y)

Answer this question