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

How do i make a script that makes things appear after i put wait() in the script?

Asked by 4 years ago

I am making a camping game but i want parts or models or npc to appear using a script that starts with wait()

0
May I ask why are you starting with wait()? This is bad practice programmerHere 371 — 4y
0
Don’t start with wait, you could make the parts transparent or set their parent to nil or any number of ways to make them appear under your conditions. ABK2017 406 — 4y
0
I think @Aqil_Whiz means things happening in between the wait like coroutines 123nabilben123 499 — 4y

2 answers

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

*Self-explanatory script: * You may ask how to change multiple parts so that it will appear within wait(), I will answer that right now. In order to change multiple parts, you would use the :GetChildren() instance and call this instance using a generic for loop which looks like this for _, test in pairs() do. BUUUUT don't woorrryyyyy, you can just copy and paste this script in all the parts you want to appear. script.Parent is the same as saying game.workspace.PartName; it's way quicker! when you put -- in a script it means you can put comments, good for organizing codes! local time = 5 is just a local variable, meaning it contains something. so you can say print(time+time) which would give you 10 because 5 + 5 is 10.

local time = 5 -- change "5" to any number, btw it's in seconds so it would be 5 seconds
script.Parent.Transparency = 1 -- 1 means it's completely transparent 
script.Parent.CanCollide = false -- this basically means that, well you can go through the block. Do you want an invisible block that you can collide? (meaning you can stand on it, it'd be like you're floating lol)
wait(time) -- remember since local time is a variable it uh means that it will wait whatever you put in time, so if you put 5 in local time, it will be 5 seconds. by the way local time is like on the top of the script if you can't find it.
scrript.Parent.Transparency = 0 -- 0 means it's completely visible.
script.Parent.CanCollide = true -- now that the part is visible, you can stand on the part.
Ad
Log in to vote
-2
Answered by
0_2k 496 Moderation Voter
4 years ago
local part = workspace.Part
part.BrickColor = BrickColor.new("Really Red")

wait(5)

part.BrickColor = BrickColor.new("New Yeller")
1
-1 for not explaining whatsoever. programmerHere 371 — 4y

Answer this question