I don't know how to do this this is my code, it's a zombie spawner by the way.
local ZS = script.Parent while true do local spawner = game.Lighting.Zombie:Clone(ZS) spawner.Parent = game.Workspace spawner.Position = ZS.Position == Vector3.new(ZS.Postion.X, ZS.Position.Y + 50, ZS.Position.Z) wait(4) end
Just remove the ZS.Position == part and it should work fine
ZS = script.Parent while true do local spawner = game.Lighting.Zombie:Clone(ZS) spawner.Parent = game.Workspace spawner.Position = Vector3.new(ZS.Postion.X, ZS.Position.Y + 50, ZS.Position.Z) wait(4) end
You're doing this:
ZS.Position == Vector3.new(ZS.Position.X, ZS.Position.Y + 50, ZS.Position.Z)
This returns a boolean, not a Vector3. You'll get an error as a result.
The ==
syntax tells the compiler that what you're giving it is a condition. This means that ==
will make the statement return a boolean, which will either be true
or false
. This is not what you're looking for, and telling us that it checks to make sure that it isn't nil is completely stupid.
I think what you mean is this, if I'm not mistaken:
spawner.Position = ZS.Position + Vector3.new(ZS.Position.X, ZS.Position.Y + 50, ZS.Position.Z) -- The plus sign can also be a minus sign if you're subtracting the two Vector3's