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

Can somebody help me with this script?

Asked by 10 years ago

Can somebody help me with this script? It's supposed to make a frame visible, when you hover your mouse on it. But the problem is, it wont even do that... Can somebody fix this error please?

script.Parent.MouseEnter:connect(function (plyr)
for i,v in pairs(PlayerList) do
if string.name == v then
sript.Parent.FrameTwo.Visible = true
end
end
end)
script.Parent.MouseLeave:connect(function (plyr)
for i,v in pairs (PlayerList) do
if string.Name == v then
script.Parent.FrameTwo.Visible = false
end
end
end)

1 answer

Log in to vote
0
Answered by 10 years ago

You are calling the method on each player, you don't need to use a player variable, use a LocalScript instead, so change your code to this:

script.Parent.MouseEnter:connect(function()
    if string.name == v then
        script.Parent.FrameTwo.Visible = true -- You typed "sript"
    end
end)

script.Parent.MouseLeave:connect(function()
    if string.Name == v then
        script.Parent.FrameTwo.Visible = false
    end
end)

It should work.

Ad

Answer this question