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
1 | local Mouse = game.Players.LocalPlayer:GetMouse() |
2 |
3 | while wait() do |
4 | if Mouse.Target and Mouse.Target.Parent:IsA( "Model" ) and game.Players:GetPlayerFromCharacter(Mouse.Target.Parent) then |
5 | print ( "hi" ) |
6 | Mouse.Target.Parent.Character.Head.BillboardGui.Enabled = true |
7 | end |
8 | end |
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 | local Mouse = game.Players.LocalPlayer:GetMouse() |
2 |
3 | while wait() do |
4 | if Mouse.Target and Mouse.Target.Parent:IsA( "Model" ) and game.Players:GetPlayerFromCharacter(Mouse.Target) then |
5 | local Player = game.Players:GetPlayerFromCharacter(Mouse.Target) |
6 | print ( "hi" ) |
7 | Player.Character.Head.BillboardGui.Enabled = true |
8 | end |
9 | 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.