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 ~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
i had the same thing with all my scripts i fixed it my making all script files local scripts and local scripts script files