PassLevel function, broken? Help

So I have a PassLevel function, which is supposed to, you know, pass the level for the player.

Here's the module function
function module:PassLevelServer(pastLevel, nextLevel, player)
	local character = player.Character
	local hrp = character.HumanoidRootPart
	local LoadingScreenModel = workspace.World.LoadingScreen
	local sustainer = LoadingScreenModel.Sustainer --sus
	hrp.CFrame = sustainer.CFrame + Vector3.new(0,10,0)
	hrp.Anchored = true
	wait(1)
	pastLevel:Destroy()
	workspace.World.Placeable:Destroy()
	wait(1)
	nextLevel.Parent = workspace.World
	nextLevel.Placeable.Parent = workspace.World
	wait(8.1)
	hrp.Anchored = false
	hrp.CFrame = nextLevel.Spawn.CFrame
end

No errors in here.

Here's the server script that exists in every single PassLevel part at the end of a level.
ok = true
r = require(game.ReplicatedStorage.ForUseModules.GameFunctions)
local name = script.Parent.Parent.Name

script.Parent.Touched:Connect(function(e)
	if ok then
		ok = not ok
		local number = tonumber(name:match("%d+"))
		local plr = game.Players:GetPlayerFromCharacter(e.Parent)
		game.ReplicatedStorage.PassLevel:FireClient(plr, script.Parent.Parent.Name)
		r:PassLevelServer(workspace[name],game.ServerStorage.Levels["Level"..number+1], plr) -- line erroring
		script.Parent:Destroy()
	end
end)

It is erroring:
image
Making a game engine is hard. Does anyone has any idea how to solve the issue?

Oof

You should implement a sanity check to make sure that what you’re attempting to obtain is really a plr or not, cause there may be some instances where you’ll get a Part that’s not a descendant of the Character Model itself

For the error, it says that there’s no name that’s called “Level1” inside the workspace, are you sure that there is something that’s named that?

ok = true
r = require(game.ReplicatedStorage.ForUseModules.GameFunctions)
local name = script.Parent.Parent.Name

script.Parent.Touched:Connect(function(e)
    local plr = game.Players:GetPlayerFromCharacter(e.Parent)
    local number = tonumber(name:match("%d+"))

	if ok and plr then
		ok = not ok
		game.ReplicatedStorage.PassLevel:FireClient(plr, script.Parent.Parent.Name)
		r:PassLevelServer(workspace[name],game.ServerStorage.Levels["Level"..number+1], plr) -- line erroring
		script.Parent:Destroy()
	end
end)

I am not worrying about that, but thanks.


The level itself is in another folder called “World”, have modified the scripts and testing, thanks.
EDIT: Well thanks. I thought that was gonna search through all descendants of the game when using it.
[spoiler]Credits for the script goes to @EmbatTheHybrid [/spoiler]

Could you print what name outputs back? Or perhaps replace that with this line instead?

local name = script.Parent.Name

Cannot do that, since the script is in a part, inside the level folder. I need the folder name.