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

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

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

✓ Accepted answer

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.

2 comments

0

hmm so when you use the heart beat:wait() what happens?

0

it's just faster then using wait(), sorry for the late reply!

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