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

How to make a block regenerate every 5 minutes? [closed]

Asked by 4 years ago

I tried to but I couldn't get a script that work can anyone reply a script to me?

0
this isnt a request site, there are tons of sources please google it and come back with a script matiss112233 258 — 4y
0
same maumaumaumaumaumua 628 — 4y
0
what? Koley_Moley -7 — 4y
0
This isn't a site where you ask people to make you scripts, if you want you can paste your script and we can gladly help out. finn383 2 — 4y
View all comments (2 more)
0
This site is called "scriptinghelpers" so I want someone to help me with a script. Koley_Moley -7 — 4y
0
its not called "scriptinggivers", yes, you are right, its called "scriptinghelpers" because people help other people who have scripts matiss112233 258 — 4y

Closed as Not Constructive by jediplocoon, maumaumaumaumaumua, Nguyenlegiahung, ScuffedAI, and PrismaticFruits

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
sheepposu 561 Moderation Voter
4 years ago

This is not a request site, so we will not make something for you. We will help you with a script that you've built and is having problems, and help with suggestions on how to starts scripting something. Since you have not brought a script, I will help you on how to begin scripting this. So, I would suggest putting the script under the part. The script should grab a copy of the part, it is under, then wait 5 seconds. Next, the script should place the cloned part into the Workspace or folder that the original part is in, no need to mess with positions. Once that is done, simply destroy the original part. If you don't know how to something, try looking it up for yourself and doing some research before you come for help.

Ad
Log in to vote
0
Answered by 4 years ago

Since you want it every 5 minutes you need to use a loop.Use a while loop since you want this to last forever

while true do

end

this loop makes it so any code in it will be repeated forever because the loop is always true you could also do something like local num = 1

while num == 1 do

end it just means if the statement is equal to the thing you assigned it then the loop happends.

After that you want to make a new part which would be your regenerating part. we are gonna create the part in the script like this

Instance.new("Part")

this creates a new instance which is a Part.the part is the block too make it easier to change its properties like brickColor and its name we turn it into a variable to make it a lot easier to reference in the script

local newPart = Instance.new("Part") put the part in workspace or else it wont be visible in game

newPart.Parent = game.Workspace this puts the part in Workspace after that we now have the part so change its name to "Block" because u want a block

newPart.Name = "Block"

you can also change its position and anchor it which means it wont move at all it just stands in place where you put it in the game which i recommend.

Since you want to regenerate the "Block" that means it has to get Destroyed sometime in the game

so you could use the Destroy() method to delete the part and then you use Instance.new() to create a new one which is like destroying it then regenerating it back.

newPart:Destroy() which will destroy it/delete it.

too make it so it happends every 5 minutes you use a wait() which pauses the code for the amount of seconds you put in the parathensies so since 5 * 6 = 300 seconds which is 5 minutes you do wait(300) to regenerate it every 5 minutes and use this code. You need 2 waits because you create the object then it will get destroyed so you need another wait in between newPart:Destroy() and Instance.new()

make the script yourself because of them comments