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:

01local thicc = wait(31)
02thicc
03if game.Workspace.Time.Value == 0 then
04    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
05for i, player in ipairs(game.Players:GetChildren()) do
06 
07   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
08 
09                player.Character.HumanoidRootPart.CFrame = target
10   end
11end
12    end
1print(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:

01local function thicc() -- This is how you do it
02    wait(31)
03end
04thicc()
05if game.Workspace.Time.Value == 0 then
06    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
07for i, player in ipairs(game.Players:GetChildren()) do
08 
09   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
10 
11                player.Character.HumanoidRootPart.CFrame = target
12   end
13end
14    end

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

01local function thicc(x) -- This is how you do it
02    wait(x)
03end
04thicc(31) -- It will wait for 31 sec
05if game.Workspace.Time.Value == 0 then
06    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
07for i, player in ipairs(game.Players:GetChildren()) do
08 
09   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
10 
11                player.Character.HumanoidRootPart.CFrame = target
12   end
13end
14    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
01local function thicc()
02    wait(30)
03    if game.Workspace.Time.Value == 0 then
04        target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
05        for i, player in ipairs(game.Players:GetChildren()) do
06            if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
07                player.Character.HumanoidRootPart.CFrame = target
08            end
09        end
10    end
11end
Log in to vote
2
Answered by 4 years ago

ummm just do this?

01local thicc = 30
02wait(thicc)
03if game.Workspace.Time.Value == 0 then
04    target = CFrame.new(80.04, 0.5, -63.9) --could be near a brick or in a new area
05for i, player in ipairs(game.Players:GetChildren()) do
06 
07   if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
08 
09                player.Character.HumanoidRootPart.CFrame = target
10   end
11end
12    end

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

Answer this question