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

Egg is not a valid member of Player?

Asked by 5 years ago

I have a button that when clicked will change the color of a part attached to a player. In game, it is in Workspace.[playerign].Egg.Handle and Handle is the part that I want to change the material. I don't want it to change everyones handle color, just the person to click it. I keep geting the error message "Egg is not a valid member of Player" This is in a local script.

script.Parent.MouseButton1Down:Connect(function()
          wait(0.5)
          game.Players.LocalPlayer.Egg.Handle.Material = Enum.Material.Neon
          print("testComplete")
end)

1
can you give a bigger explanation on where it is located? RetroGalacticGamer 331 — 5y
1
Maybe you forgot the player's character: game.Players.LocalPlayer.Character.Egg.Handle.Material. If it doesn't work, try using :WaitForChild() so the script can yield until the egg has loaded. Rheines 661 — 5y
0
Thank you Rheines! :D chook100 48 — 5y
0
Remember that if you change the color in a localscript, only the player who clicked will see it change, all other players will not see that parts new color. Lucke0051 165 — 5y

Answer this question