local seat = script.Parent playerSat = false local lastplr seat.Changed:Connect(function(property) local plr = seat.Occupant if plr and property == "Occupant" then plr = game.Players:GetPlayerFromCharacter(plr.Parent) if plr.PlayerGui:FindFirstChild("ControlGroup") then return end lastplr = plr local c = script.ControlGroup:Clone() c.Parent = plr.PlayerGui c.DButton.Value = seat c.AandD.Disabled = false playerSat = true local PlayerNotch = Instance.new('NumberValue', c) --creates a part in the duped ControlGroup PlayerNotch.Name = "PlayerNotch" local PlayerNotchValue = PlayerNotch.Value--goes to the PlayerGui and finds the duped GUI called ControlGroup while playerSat == true do wait(1) print(PlayerNotchValue) --checks the value of playerNotch and prints it (problem where it always prints 0) end
I'm really unsure why this is happening, it seems like it might be checking some other number value but, it really just makes no sense to me. I created a variable for the number value that is created inside the group so surely it wouldn't be checking the wrong value?
By the looks of it, your script is local. This means that the value you set should be in a place where it can be located by the client, such as ReplicatedStorage. The client can also read Workspace. Also considering that the NumberValue should be set by the server, NOT the client, should fix your problem.