Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

RPG Level Door Suddenly only works in Solo?

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

0

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).

1 answer

i had the same thing with all my scripts i fixed it my making all script files local scripts and local scripts script files

1 comment

0

That's not the issue at hand. There's no hinting w/in his code that it's intended for a specific client, and he said it worked 2 yrs prior.

This discussion is preserved as it was. New answers, comments, and votes are closed.