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

RenderStepped with a wait?

Asked by 4 years ago
Edited 4 years ago

I'm sending an Http Request and I want it to be sent every second. however since I'm not sure how to use render stepped with a wait() I can't accomplish this. I would use while wait() do but that's not an option since i'm sending a http request constantly but I need to put in an OAuth Token after the script is executed so it will give an error and break the script. Have any ideas?

Nevermind I figured out the pcall return.

1 answer

Log in to vote
0
Answered by
Ziffixture 6913 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

You can simply allocate the RBXScriptSignal and use the :Wait() method, or you can embed the request within the event.

local runService = game:GetService("RunService")
local rStepped = runService.RenderStepped

while rStepped:Wait() do

end

local runService = game:GetService("RunService")

runService.RenderStepped:Connect(function()

end)
0
I still get the same error, 'attempt to concatenate string with nil' as if I were to use while wait() do. GreenBushed 13 — 4y
0
I would use a pcall() but I need to get a return, unless is that possible? GreenBushed 13 — 4y
0
You can do that, show me your code so I can help. Ziffixture 6913 — 4y
0
I added my code to the post GreenBushed 13 — 4y
View all comments (2 more)
0
I figured out the pcall return. kinda weird how you dont use parenthesis for the function but it works, thanks :) GreenBushed 13 — 4y
0
Ah! Alright, great! Ziffixture 6913 — 4y
Ad

Answer this question