Supposed to Clone a cookie on the workspace and teleport it to the specified coordinates. Every 0.5 seconds.
enable = true
script.Parent.Touched:connect(function(hit)
while enable do
local Cookie = game.ReplicatedStorage.Cookie
local copy = Cookie:Clone()
copy.Parent = game.Workspace
copy.Position.CFrame = CFrame.new(2.737, 4.2, 6.376)
enable = false
wait(0.5)
enable = true
end
end)
Errors
Attempt to call a nil value
Position is not a valid member of Tool

4 comments
p.s if this is what i think it is(not snippet from a larger code), u dont need the enable there
also it might be that u didnt add a debounce
wait i think i got it
can you give me a cookie