Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can somebody help me with this script?

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.