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 want to achieve is that everytime my model needs to go to n.CFrame, I want call my function.
What is the issue? Include screenshots / videos if possible!
The issue is that my variable never changes
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried debounce. I have looked for solutions on the Developer Hub
local ss = game:GetService("ServerStorage")
local mf = ss:WaitForChild("Markers"):GetChildren()
local sp = workspace:FindFirstChild("MarkerSpawns")
local asp = sp:GetChildren()
local n = math.random(#asp)
local tmf = {
mf[1]:Clone(),
mf[2]:Clone(),
mf[3]:Clone(),
mf[4]:Clone(),
mf[5]:Clone(),
mf[6]:Clone(),
mf[7]:Clone()
}
local u = {}
local function random()
repeat
n = math.random(#asp)
until (not u[n])
u[n] = true
return n
end
random()
for _,v in pairs(tmf) do
wait(1)
v.Parent = workspace
wait(1)
if u[n] == true then
random()
v:PivotTo(CFrame.new(n,2,0) + Vector3.new(0,2,0))
end
end
Try to use a variable like current variable given,
For example, running a function, so function check the variable when random variable is same to current variable, run the function again until it makes different variables. when it makes different variable, the current variable now changed to new variable.