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

When Player Hovers Mouse over another Character, a GUI Appears?

Basically, There is a Billboard Gui on player's head, but ive set it To invisible, so only when players hover their mouse, it should appear, but i get this error: Character is not a valid member of Model

local Mouse = game.Players.LocalPlayer:GetMouse()

while wait() do
	if Mouse.Target and Mouse.Target.Parent:IsA("Model") and game.Players:GetPlayerFromCharacter(Mouse.Target.Parent) then
		print("hi")
		Mouse.Target.Parent.Character.Head.BillboardGui.Enabled = true
	end
end

2 comments

0

You tried to get the Character inside the Character in line 6

0

Don't use a for loop, use a MouseMove event.

2 answers

You tried to get the Character inside the Character in line 6. You already have the Character when writing" Mouse.Target.Parent", so remove Character in line 6.

1 comment

0

Now i get the error: BillboardGui is not a valid member of Part

local Mouse = game.Players.LocalPlayer:GetMouse()

while wait() do
    if Mouse.Target and Mouse.Target.Parent:IsA("Model") and game.Players:GetPlayerFromCharacter(Mouse.Target) then
	local Player = game.Players:GetPlayerFromCharacter(Mouse.Target)
        print("hi")
        Player.Character.Head.BillboardGui.Enabled = true
    end
end

Maybe this will work. I defined a variable called "Player" and changed Mouse.Target.Parent to Mouse.Target because the target is the entire model.

2 comments

0

then why exactly did u still do "Mouse.Target.Parent:IsA("Model")" im confused

0

oh sorry. I didn't read the whole thing. Silly me! You can delete the parent

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