To do this project I decided to use tween service. The main goal was to make it tween randomly in the confinement of "Base" in workplace. Base Is a small pad on the ground shaped like a brick but on the ground covering an area.
The script:
local TweenService = game:GetService("TweenService")
local base = script.Parent.Parent.Base
local part = script.Parent
local startPos = part.Position
while true do
local waitTime = math.random(5)
TweenService:Create(part, TweenInfo.new(waitTime), {
Position = startPos + Vector3.new(math.random(base,base), 0 , math.random(base,base))
}):Play()
task.wait(waitTime)
end
This may be confusing to read because the script goes between lines on line 9, but Just read it normally and ignore that.
The problem i've been having is the error code " invalid argument #1 to 'random' (number expected, got Instance)" Which is connected to the ;
(math.random(base,base), 0 , math.random(base,base))
Part in this script
any help is appreciated
