I need a script to make a bolt 103 studs out and make an explosion at the end

i ask studio because, i dont know how to script this. i am a beginner, still learning.

heres how i want things to work:

generate a bolt using only parts that extends out 103 studs in a random direction
give it the properties of: Neon, (Color3.FromRGB(255, 255, 255))

set its “Origin” to workspace.Core, its position being -649.633, 661.956, 246.006
parent said bolt to game.Workspace.CoreBeams
put an explosion at the end of the bolt (not at the origin)
after 0.3 seconds, delete the bolt

Search for videos on youtube, look for modules and resources

Yep also draw a flow chart on what you plan to happen similar to the one you did in your previous post.

Otherwise there is insufficient information here. No one will be able to help further unless these are explained further:

Define bolt further such as if its model or part. Is arc the shape of the model or projectile trajectory of how you want it to move?

Ok so it starts from the origin so you can obtain the initial position from workspace.Core if its a model or part the method to obtain it will be different.

Also you need to define the direction you want it to to go, up down left right, random, etc.

Repeat the code using for loop or while loop.

alright, heres a further explanantion

i want a bolt generated with a random arc using parts, with neon and white color properties, and generate an explosion 103 studs away from workspace.Core at the same position as the part of the bolt that reaches that 103 stud gap. i also want all these generated bolt parts parented to workspace.CoreBeams. also the direction will be completely randomized.

That was the key information that was missing. Now you can split up our system into 3 components.

  1. Generating the bolt
  2. Positioning the bolt
  3. Parenting the bolt

Then you can do research to find resources as @hbgnhu said.

for 1 generating the bolt, I am assuming it’s a lightning bolt and not a machine part bolt

for 2 you could use trig, 103 studs away + random direction equals circle with a radius of 103.

number 3 is a simple .Parent property editing.

I will not probably respond anymore as this is an entire system which requires effort hope you can use this to get started on researching how to script the system.

im a beginner i wont understand that lol

Here is an example script in Lua (the programming language used in Roblox) that will create a bolt with a random arc, using parts, and have it move out 103 studs from the origin of the workspace:

local bolt = Instance.new("Part")
bolt.Anchored = true
bolt.Position = Vector3.new(0, 0, 0)
bolt.Shape = "Block"
bolt.Size = Vector3.new(1,1,1)
bolt.Parent = game.Workspace

local trajectory = math.random(1, 360)
bolt.CFrame = CFrame.new(bolt.Position) * CFrame.fromEulerAnglesXYZ(math.rad(trajectory), 0, 0)

local explosion = Instance.new("Part")
explosion.Anchored = true
explosion.Position = bolt.Position + Vector3.new(103, 0, 0)
explosion.Shape = "Ball"
explosion.Size = Vector3.new(10,10,10)
explosion.Parent = game.Workspace

The script creates a new “Part” object and sets it as a block shape. Then it sets the position of the bolt to the origin (0,0,0) of the workspace and sets the parent to the workspace. Then it randomly generates an arc for the bolt to follow and sets the CFrame. Finally, it creates an explosion “Part” object, sets its position to 103 studs away from the bolt, sets it as a ball shape, and sets the parent to the workspace.

This script will create a bolt and explosion when executed. However, it’s only a basic example and you may need to tweak and modify it to fit your specific needs.

should of clarfied, the “origin” is workspace.Core and its position is -649.633, 661.956, 246.006, might be able to modify your script to work though

i updated what i actually want to happen in my post, read that for more info