Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I make a charging blast like this?

https://gyazo.com/2a4a07eccb83b921846429e64ef4b84f

So I saw this and I was curious on how to do it. How would I do that? Wouldn't I use BodyPosition/BodyVelocity?

edit: the things going around it, how would you do it?

1 comment

0

I provied a in dept answer to your question

2 answers

✓ Accepted answer

I won't answer the whole questions, but i sure will point you in the right direction to creating a script like this.

First you will need a couple of Particle Emitters to be used as the effects shown in the example you gave us, then you will need a script to Detect either a KeyDown or MouseClick so it can begin to charge the blast using a loop constantly increasing it's size while the variable is true. If your still confused, here's an example.

local UIS = game:GetService("UserInputService")
debounce = false -- used so the script can only be ran ONCE at a time
canCharge = false
chargeVal = 0 -- gonna be using this to help increase the size and let's you now what number its up to

local function onCharged(Input, gameProcessedEvent)
local KeyCode = Input.KeyCode
if not gameProcessedEvent then -- checks if the player ISN'T typing
	
	if KeyCode == Enum.KeyCode.E and debounce == false and canCharge == false then -- change E to the key you want to be pressed down
		debounce = true -- prevents the script from being ran over and over
		canCharge = true -- gonna be used for a while loop
		local growingPart = Instance.new("Part", workspace) -- creates a part parented to the workspace
		while canCharge do -- while loop that only runs if canCharge = true
			wait(0.1) -- change '0.1' to how long you want to wait until the value is increased
			chargeVal = chargeVal + 1 -- adds 1 to the chargeVal while canCharge = true
			print(chargeVal) -- prints the chargeVal's value each time it is being increased, since it's in the while loop
			
			-- you can make it so it can increase the size using +Vector3.new(X, Y, Z). An example is given here :
				growingPart.Size = growingPart.Size +Vector3.new(.1, .1, .1)
			
			if chargeVal >= 50 then -- conditional statement to check if chargeVal is greater than or equal to '50'
				canCharge = false -- ends the while loop since it was used to check if canCharge = true
				print("Fully Charged!") -- prints Fully Charged
				wait(3) -- time until the script can be ran again
				chargeVal = 0 -- starts the chargeVal back to 0 so it can be fully looped until '50'
				debounce = false -- allows the script to be ran again after 3 seconds
				canCharge =  false -- allows the script to be ran again after 3 seconds
			end
		end
	end
end
end

UIS.InputBegan:Connect(onCharged)

If you have any other questions, please feel free to ask!

--oSy

2 comments

0

Thank you!

0

Np. :)

This script uses Instance.new and it takes time for developers to make these things "the things going around it, how would you do it?": Simply use a particle emitter and put the id of the particle you want and then change some other settings to make it look like in the video

This discussion is preserved as it was. New answers, comments, and votes are closed.