I don't know how to do this this is my code, it's a zombie spawner by the way.
1 | local ZS = script.Parent |
2 |
3 | while true do |
4 | local spawner = game.Lighting.Zombie:Clone(ZS) |
5 | spawner.Parent = game.Workspace |
6 | spawner.Position = ZS.Position = = Vector 3. new(ZS.Postion.X, ZS.Position.Y + 50 , ZS.Position.Z) |
7 | wait( 4 ) |
8 | end |
Just remove the ZS.Position == part and it should work fine
1 | ZS = script.Parent |
2 |
3 | while true do |
4 | local spawner = game.Lighting.Zombie:Clone(ZS) |
5 | spawner.Parent = game.Workspace |
6 | spawner.Position = Vector 3. new(ZS.Postion.X, ZS.Position.Y + 50 , ZS.Position.Z) |
7 | wait( 4 ) |
8 | end |
You're doing this:
1 | ZS.Position = = Vector 3. 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:
1 | spawner.Position = ZS.Position + Vector 3. 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 |