'Part' is not a valid object of workspace

this one, I can’t comprehend at all

local ZP = require(game.ReplicatedStorage.Modules["Zone⁺"])
print("work")
local cont = game.Workspace.go
local zone = ZP.new(cont)
zone.playerEntered:Connect(function(player)
	print(("%s entered the zone!"):format(player.Name))
	bossfight = script.BossFight:Clone()
	bossfight.Parent = game.StarterGui.Other
end)

zone.playerExited:Connect(function(player)
	print(("%s exited the zone!"):format(player.Name))
	bossfight:Destroy()
end)

image
ignore everything else, im just testing so everything is sloppy

1 Like

Please give us a little bit more info, this is quite confusing with no context. Explain what the expected outcome is, the output, the workarounds and so on please.

1 Like

Sometimes parts do not load fast enough, consider trying

local cont = game.Workspace:WaitForChild("go")

Going to point out, you can’t do this. Instead do

bossfight.Parent = game.Players.plr.PlayerGui.Other

and replace plr with the player.

Can you please send the ModuleScript? That would help out a lot. :+1:

1 Like

Expected outcome: the script recognises ‘go’ and the script continues
the output is ‘go’ is not a valid object of workspace
workarounds: I’ve tried using WaitForChild() and moving the script location, nowhere has worked.

well, it’s actually @ForeverHD 's ZonePlus v2
Unless you want to comb thru an 876 line modulescript, I got nothing

1 Like

This is a workaround that has already been applied, excluding the last bit

Alright, what are you trying to script? I am still confused about your goal.

1 Like

Ok, so, I’m trying to make it so that when you enter a certain area, something is printed and a GUI is shown. Nothing more at the moment.

When you added WaitForChild(), did it infinite yield?

1 Like

Yeah, It did, which is annoying :disappointed:

Try adding this before the zone variable. :+1:

repeat
    wait()
until game.Workspace:FindFirstChild("go")
1 Like

Oops… I meant the cont variable. Sorry! :joy:

1 Like

It… works? Thanks so much bro!

1 Like