script.Parent.MouseButton1Click:connect(function() print("Light on Clicked") script.Parent.Parent.Parent.Parent.Parent.Beacon.Mechanism.Light.Material = Enum.Material.Neon script.Parent.Parent.Parent.Parent.Parent.Beacon.Mechanism.Light.SpotLight.Enabled = true script.Parent.Parent.Parent.Parent.Parent.Beacon.Mechanism.MotorPart.BottomSurfaceInput = "Constant" print("Light in action") end)
The GUI is in a vehicleseat. I have figured out how to make it open on seat, but what I want this to do is when this GUI button is pressed, that it makes the beacon's light material neon, and enables spotlight inside it, and makes the bottomsurfaceinput turn into Constant, so that it spins (yes I use old motor constraints). When i press it in play mode, the output says that beacon is not a valid member of players. Can you fix this for me please? It's all grouped.
You have one extra Parent, so the Parent of your Player is Players. Remove one of the parents and it should work just fine.
The better way to get the player would be using the code below:
local Player = game.Players.LocalPlayer
Then you can just do Player.Beacon and not worry about all those Parents.