Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

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

Asked by
OFF_S4LE 127
4 years ago
Edited 4 years ago

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)
1
mods please dont ban me this is a serious situation OFF_S4LE 127 — 4y
1
any genuine reason why you would want to do this? zadobyte 692 — 4y

3 answers

Log in to vote
2
Answered by 4 years ago

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

Ad
Log in to vote
2
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago
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

Log in to vote
2
Answered by 4 years ago

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)?

Answer this question