local x = script.parent.x.value
local y = script.parent.y.value
local z = script.parent.z.value
local clo = it:Clone()
clo.Parent = it.Parent
print("Parented")
it:Destroy()
print("Destroyed")
print(clo.Parent)
clo:MoveTo(Vector3.New(x,y,z)) --in this line (error. Line 35)
This error is kind of self explanatory, you’re trying to call the function :MoveTo() which does not exist in clo. What type of instance is clo? It must be a Model if you’re trying to call :MoveTo()
script.Parent.Touched:Connect(function(hit)
local obj
local huma = hit.Parent.Name
--local va = script.Parent.Valu.Value
local x = script.parent.x.value
local y = script.parent.y.value
local z = script.parent.z.value
wait()
print(huma)
print(x)
print(y)
print(z)
wait()
for i,v in pairs(game.Workspace.kit.Tycoons:GetChildren()) do
print(i)
print(v)
print(v.Owner.Value)
local t = v.Owner.Value
wait()
print(t.Name)
if v.Owner.Value.Name == huma then
local it = v.PurchasedObjects.Up
print("Found it here")
local clo = it:Clone()
print("Cloned")
clo.Parent = it.Parent
print("Parented")
it:Destroy()
print("Destroyed")
print(clo.Parent)
print("ABOVE IS THE PARENT")
clo:MoveTo(Vector3.New(x,y,z))
--vector3.new(x,y,z)
print("Positioned")
end
end
end)