You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I need that the target constantly moves between these random X,Y,Z positions -
What is the issue? Include screenshots / videos if possible!
When i use my script the target goes to 0,0,0 position
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I didn’t find any so i’m making this post
local collection = game:GetService("CollectionService")
local tweenservice = game:GetService("TweenService")
game.Workspace.Activate.ClickDetector.MouseClick:Connect(function()
for i, model in pairs(collection:GetTagged("Target")) do
local randomX = Random.new(-70, -60)
local randomY = Random.new(1, 10)
local randomZ = Random.new(-17, 17)
local randomPosition = Vector3.new(randomX, randomY, randomZ)
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut)
local tween = tweenservice:Create(model:FindFirstChild("Part"), tweeninfo, {Position = randomPosition})
tween:Play()
end
end)