Ok, so I'm making this obby game where you win obbies for points, the player starts with zero points so I made a door so if you have zero or more points you can enter, however, I have checked all the coding and nothing seems to be wrong but it isn't working. Does anyone have a solution and can send me the updated code? Here is the code:
db = false local min_lev = 0 script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) if db == false then db = true if player.leaderstats.Points >= min_lev then script.Parent.CanCollide = false script.Parent.Transparency = 1 wait(.5) script.Parent.CanCollide = true script.Parent.Transparency = 0.6 end db = false end end end)
Thanks!
ohhh ok so on line 9 it says:
if player.leaderstats.Points >= min_lev then
and I think you meant to put:
if player.leaderstats.Points.Value >= min_lev then
because right now you are comparing a number value instead of just the value.
i hope this helps!