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

what is "Run Service"? What can this service be good for?Do you have to use it?

Asked by
Tizzel40 243 Moderation Voter
5 years ago

I heard something called run service before but I don't rly know how to use it.

I know it consist of delta time and change in rate and Frames but I don't know what you could use this technique on.

could you use it to script a sword or a growing part (meaning for I = 1,10 do part.Size = Part.Size + Vector3.new(0,2,0) ?

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

It has many uses, like checking if a script is running on the client, or server, or in studio. Also, it has RenderStepped (only in local scripts) and Heartbeat (basically the same but can be used in the server) which fires faster than wait() . More info at https://developer.roblox.com/api-reference/class/RunService

for your example, you could use

for i = 1,10 do
    part.Size = Part.Size + Vector3.new(0,1,0) -- changed to 1 because heartbeat fires faster
    game:GetService("RunService").Heartbeat:Wait()
end

It probably has more uses, but these are basically what I use it for. I recommend you check the wiki link.

0
hmm so when you use the heart beat:wait() what happens? Tizzel40 243 — 5y
0
it's just faster then using wait(), sorry for the late reply! the8bitdude11 358 — 5y
Ad

Answer this question