I’ve not heard about tick() being deprecated, but I have seen some some forum posts saying that - is there an official announcement for it being deprecated? It doesn’t show it as deprecated on the Roblox Globals page of the DevHub
I know this is the second time asking for a source today lol, I don’t mean to be questioning everything you’re saying
if timeActivated - tick()==10 then-- you can change the number of time you want the part (bomb) explode
end
Because you’re checking if the time difference is an exact time, when it’ll very very very likely be a decimal, so it won’t be true. It should change to >=
(also Instance.new should always have a capital i which was missed in the last code segment. It would be good to test these in studio before posting to make sure. I like the idea of the post though!)
Appreciated! Though, that post says os.clock() is the better alternative instead, since os.time() returns an integer instead of a decimal number of seconds.
Because a new tick is always going to be greater in this case and you’re trying to see if it’s equal to a positive number. Although, it’s only going to check for exact equality, which I guess it’s fine if you need that, although probably better to be >=. Also
local function bombMaker(position)
local timeActivated = tick()
if timeActivated - tick()==10 then
local Explosion = instance.new("Explosion", workspace)-- create explosion
Explosion.Position = position-- we use the position parameter to position our Explosion
end
end
This only checks the condition once, nothing repeats it, it’s probably better if you just use wait(10) instead
local function bombMaker(position)
wait(10)
local Explosion = Instance.new("Explosion", workspace)-- create explosion
Explosion.Position = position-- we use the position parameter to position our Explosion
end
Also, I thnik you accidentally did the bold thing as there’s this line
Overall, not sure what the Tutorial is trying to teach besides what tick is, there’s no proper examples of how it can be used from what I can see
I think I may’ve worded myself incorrectly, I meant to write that it, while yes it does the job and explains what tick is and what it does, it doesn’t give good examples as to how it can be properly used, as the examples given won’t work properly, such as the bomb example because the statement is only checked once, thus the condition is not going to be met.
Proper examples are a good way to teach someone new to a topic how a thing is done and how it can be used. But I’ll give @OP some benefit of the doubt because there is a slight bit of effort, but a lot of improvement is required
Actually the 2nd argument of Instance.new isn’t deprecated last I heard, it’s just not recommended to be used, especially if a lot of properties are being set
i will admit i didnt put as much work in this one then my first one i will try not to do the same thing with my next one which is going to be about the coolest Danial os.clock and his best friend os.date
plz flag this tutorial
That’s a recommendation by a Roblox staff member, it isn’t publicly mentioned that the argument is deprecated, it’s just recommended to parent it at the end instead of relying on the 2nd argument
Although the 2nd argument does have uses, such as if you only change 0 or 1 property for example, such as wanting to make a blank folder
local Folder = Instance.new("Folder",workspace)
Is going to be the same as
local Folder = Instance.new("Folder")
Folder.Parent = workspace
In terms of performance, so it still has slight usecases, should only really cause problems if tons of properties need to be changed or if tons of Instances are going to be made, then parenting it last is better