I want to create a door so that when a player walks tries to walk through it, it will find a leaderstat (Points) of the player and if it is over the amount (20) let them through otherwise it won't. Here is the script so far:
function onTouched(hit) if ting == 0 then ting = 1 check = hit.Parent:FindFirstChild("Humanoid") script.Parent.CanCollide=true if check ~= nil then if hit.Parent.Name == owner.Value then local user = game.Players:GetPlayerFromCharacter(hit.Parent) local stats = user:findFirstChild("leaderstats") if stats ~= nil then local Points = stats:findFirstChild("Points") if Points.Value > (0) then script.Parent.CanCollide=false wait(0.5) script.Parent.CanCollide=true end end end end end
Thanks,
CallKnuss