Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

The thing i defined had a red line/ error, fix? the error says incomplete function :/

Update: I made wait(31) damn(thicc) I'm trying to define thicc as wait(31) since im not a bully :/ if thats even posssible btw Time is a intvalue the script i workspace:

local thicc = wait(31)
thicc
if game.Workspace.Time.Value == 0 then
	target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do
  
   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
				      
				player.Character.HumanoidRootPart.CFrame = target
   end
end
	end
	
print(fla)

2 comments

1

mods please dont ban me this is a serious situation

1

any genuine reason why you would want to do this?

3 answers

✓ Accepted answer

You could use a local function here:

local function thicc() -- This is how you do it
	wait(31)
end
thicc()
if game.Workspace.Time.Value == 0 then
    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do

   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then

                player.Character.HumanoidRootPart.CFrame = target
   end
end
    end

Bonus: You could use parameter to change the amount of sec it will wait

local function thicc(x) -- This is how you do it
	wait(x)
end
thicc(31) -- It will wait for 31 sec
if game.Workspace.Time.Value == 0 then
    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do

   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then

                player.Character.HumanoidRootPart.CFrame = target
   end
end
    end

Hope that helped

local function thicc()
    wait(30)
    if game.Workspace.Time.Value == 0 then
        target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
        for i, player in ipairs(game.Players:GetChildren()) do
            if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
                player.Character.HumanoidRootPart.CFrame = target
            end
        end
    end
end

ummm just do this?

local thicc = 30
wait(thicc)
if game.Workspace.Time.Value == 0 then
    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
for i, player in ipairs(game.Players:GetChildren()) do

   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then

                player.Character.HumanoidRootPart.CFrame = target
   end
end
    end

btw why you are defining a wait to a variable instead of just writing wait(30)?

This discussion is preserved as it was. New answers, comments, and votes are closed.