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
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
thanks for the help!
No problem ;D Remember to accept my answer to ensure we both get reputation we deserve
Just in case, up-votes for the lovely answer and question!
Muchos gracias ;D
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
Format your code correctly in Lua Code block, please.
sorry about this the code looks weird
lol you don't need a codeblock for every line
I just signed up.... XD
__namecall refers to a pathway and/or naming problem. I am assuming its trying to find 'Chose' before its loaded