Ive been making an RPG game for about 2 years now and suddenly the code for the doors stopped working online but still work solo
-------------------------------
level = script.Parent.Settings.Level
-------------------------------
function getPlayer(humanoid)
local players = game.Players:children()
for i = 1, #players do
if players[i].Character.Humanoid == humanoid then return players[i] end
end
end
Door = script.Parent
function onTouched(hit)
print("Lvl Door Hit! :O")
local human = hit.Parent:findFirstChild("Humanoid")
if (human ~= nil ) then
print("Human touched Lvl door! :O")
local player = getPlayer(human)
if (player == nil) then return end
local stats = player:findFirstChild("leaderstats")
local sp = stats:findFirstChild("Lvl")
if sp == nil then return false end
if (sp.Value < level.Value) then
hit.Parent.Torso.Velocity=Door.CFrame.lookVector * 1000 -- Push the Player back
end
end
end
connection = Door.Touched:connect(onTouched)
Idk if this will help but it uses a TouchInterest and 2 settings Lvl and Tag ~~~~~~~~~~~~~~~~~

1 comment
Have you checked in game for errors? (F9 to access the console) If so, could you please provide what it said? :) Also, I recommend putting prints around 21-24, if the console doesn't return anything, to see where it stops (its execution).