Help with the code problem
While restime do
local placemap = Choose.Clone()
placemap.Parent = game.Workspace
placemap.Position = Vector3.new (x, y, z)
wait (10)
end
The problem is that you indexed the Clone
function, rather than invoking it directly with a method. The normally defaulted self argument was not passed.
In other words, object:Clone();
is the same as object.Clone(object);
.
Here's an example of how that works:
local world = { Bob = { Name = "Bob"; SayHello = function(self) print(self.Name.. " said hello!"); end } } world.Bob:SayHello(); --> Bob said hello! world.Bob.SayHello(); -->attempt to index local 'self' (a nil value) world.Bob.SayHello(world.Bob); --> Bob said hello!
Also, due to how Roblox handles property listeners, you should set placemap's Parent after configuring the Position Property - read more here.
while restime and wait(10) do local placemap = Choose:Clone() --Invoke with ':' ! placemap.Position = Vector3.new(x, y, z) placemap.Parent = workspace --Parent afterwards ! end