I tried it as local script and regular still not working.
local plr = game.Players.LocalPlayer leaderstats = plr:WaitForChild("leaderstats") Rebirths = leaderstats:FindFirstChild("Rebirths") if plr.Rebirths.Vaule >= 5 then game.Workspace.RedCourtRebirth5.CanCollide = false game.Workspace.FiveRebirth.Rebirth5Door.CanCollide = false elseif plr.Leaderstats.Rebirths.Value < 5 then game.Workspace.RedCourtRebirth5.CanCollide = true game.Workspace.FiveRebirth.Rebirth5Door.CanCollide = true end
local plr = game:GetService("Players").LocalPlayer local leaderstats = plr:WaitForChild("leaderstats") local Rebirths = leaderstats:FindFirstChild("Rebirths") Rebirths.Changed:Connect(function(newValue) if newValue >= 5 then game.Workspace.RedCourtRebirth5.CanCollide = false game.Workspace.FiveRebirth.Rebirth5Door.CanCollide = false elseif plr.Leaderstats.Rebirths.Value < 5 then game.Workspace.RedCourtRebirth5.CanCollide = true game.Workspace.FiveRebirth.Rebirth5Door.CanCollide = true end end)
You forgot to use a function and listener for this. Codes without a function/listener will only run once when the server started up. Therefore, it will cache the player's rebirth stat.
There are 3 types of functions. This is the most common one. (Unrecommended)
function whateverYouWant(argument) if argument == "hi" then print("Hello!") end end
Why is it not good? It's because that code will take more memory for the server to run it. If you are making a large game, it'll causes lag.
The second one is commonly used because you don't have to open a new line for your listener. (Still unrecommended)
game.Workspace.Dummy.Humanoid.Died:Connect(function(argument) warn("Oh no! Dummy down! D:") end)
This one has the same issue that the upper one has.
The third one is the best.
local function whateverYouWant(argument) if argument == "hi" then print("Hello!") end end
If you only use the function code without listeners, they will never run.
Functions are like variables, you can store them into a variable. (Or remote function/remote event inside a script)
local function checkPassword(pass) if pass == "password" then return true end end local passed = checkPassword(password) if passed == true then print("yay!") end
I hope these helped you! For more information about functions/listeners, I recommend you to go on Roblox's API reference website or just learn it yourself! Good luck developing!