im making a simulator and when i was making the rebirth system and i came across this error 13:37:53.949 - Rebirth is not a valid member of Player here's my code


local repStorage = game:GetService("ReplicatedStorage") local remote = repStorage:FindFirstChild("RebirthClick")

local button = script.Parent

local debounce = false

button.MouseButton1Click:Connect(function() local rebirths = game.Players.LocalPlayer.leaderstats:FindFirstChild("Rebirths") if not debounce then debounce = true local playerPoint = rebirths remote:FireServer(playerPoint) wait(0.01) debounce = false end end)

repeat local textButton = script.Parent textButton.Text = "Rebirth: ".. tostring(100 * game.Players.LocalPlayer.Rebirths.Value + 1) .." points required" wait(0.01) until script.Parent == nil`

6 comments

0

WaitForChild is your best friend.

0

You can replace FindFirstChild with WaitForChild since it always for the object to be found.

0

You can replace FindFirstChild with WaitForChild since it always for the object to be found.

0

Can you try click the little lua button and putting your code in that? That makes it easier for us to read.

0

Thanks

0

i couldnt find a lua button