Part spawning not working

  1. What do you want to achieve? Keep it simple and clear!

Part that randomly spawn on another part

  1. What is the issue? Include screenshots / videos if possible!

There’s an error happening when the script is run. CFrame expected, got vector3

  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I tried searching but still don’t know

local Bananas = game.ReplicatedStorage.Bananas
local Positon = script.Parent.Position

while wait(math.random(1,10)) do
	local Already = script.Parent:FindFirstChild("Bananas")
	if Already == nil then
		local Clone = Bananas:Clone()
		Clone.CFrame = CFrame.new(Positon + CFrame.new(0,0.5,0))
		Clone.Parent = script.Parent
	else
		return
	end
end
1 Like

Whenever you get an error, it helps us quite a bit of you can show the full stack trace and comment the line with the error. In this case though, it’s pretty clear what the issue is. Change the line with the error to this

Clone.CFrame = CFrame.new(Positon + Vector3.new(0,0.5,0))
1 Like