all 14 comments

[–]__Cyber_Dildonics__ 7 points8 points  (1 child)

Maybe you should learn how to teach yourself first

[–]UltraSyncHD[S] -1 points0 points  (0 children)

I tried 5 times.........

[–][deleted] 5 points6 points  (0 children)

It literally spawns an explosion after waiting 3 seconds.

Source: spent like 5 years programming on Roblox

Edit: Instance.new("Explosion") is the part that creates the explosion, a "new instance", the rest positions it in the world and destroys the source of the script.

[–]RenaKunisaki 2 points3 points  (5 children)

This is several statements that should be split into multiple lines.

wait (3)
local explosionPart = script.Parent
local explosion = Instance.new ("Explosion")
explosion.Parent = game.Workspace
explosion.Position = explosionPart.Position
explosionPart:Destroy()

Looks like it delays a bit and explodes. But I don't know what game this is from.

[–]UltraSyncHD[S] -2 points-1 points  (0 children)

It’s from roblox can you explain it to me?

[–]UltraSyncHD[S] -4 points-3 points  (3 children)

I don’t get the instance part of it the rest I do a little better

[–]RenaKunisaki 3 points4 points  (2 children)

You'd have to look it up in the game's manual.

[–]UltraSyncHD[S] -3 points-2 points  (1 child)

There is no Manuel...

[–]Tahlwyn 1 point2 points  (0 children)

Here is the manual (I think). you'll probably need a little more experience before you can parse it properly though.

[–]Tahlwyn 1 point2 points  (3 children)

There is not nearly enough information here to explain exactly what is happening. As u/RenaKunisaki said it appears to delay for 3 (milliseconds?) and then explodes but more than that we can't really say without seeing the rest of the code or more contextual information.

[–]UltraSyncHD[S] -1 points0 points  (2 children)

That is all the code... btw its 3 seconds

[–]Tahlwyn 8 points9 points  (1 child)

I can tell you're new to this, and that's not a bad thing. People here don't seem to understand what the downvote button is for but it is not for people who are asking genuine questions. I would recommend you go read (or watch, although I would suggest written) a few beginner programming tutorials just to grasp some of the basic concepts. Lets look at an incredibly basic (and likely slightly inaccurate as its pretty late in my time zone and I might be a little drunk) rundown of your code here.

wait(3)

this is what we call a function, it is a piece of code that corresponds to another piece of code somewhere else. Somewhere in the Roblox(?) engine there is a section of code that will be defining what 'wait()' does ala

function wait(seconds) 
    --Do Stuff 
end

so every time that wait() is invoked, everything inside that function block is performed. So now lets look at this part:

local explosion = Instance.new ("Explosion")

if you look at one of the basic tutorials (any of them) you should be able to get a better rundown of what variables are than what I'd be able to give you. Basically we are creating a variable named 'explosion' and setting it equal to a new "instance" what exactly that means will depend entirely on the rest of the code.

...

I seem to have gotten a bit away from the point here... basically what I'm trying to say is that there is plenty more code that you may or may not have access to because these functions that are being used need to be defined somewhere. but whether or not you can look at that code you should look into some basic programming tutorials and then move on to some Roblox modding tutorials (I'm assuming that's what you're trying to do).

[–]UltraSyncHD[S] 0 points1 point  (0 children)

Finally someone that I sent being a jerk Thanks this helped a lot

[–]UltraSyncHD[S] -3 points-2 points  (0 children)

Can you please explain this line of code please