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

how do i add power to an anamation like this ?

local player = game.Players.LocalPlayer
repeat wait() until player.Character.Humanoid
local humanoid = player.Character.Humanoid
local mouse = player:GetMouse()

local anim = Instance.new("Animation")
anim.AnimationId = "https://www.roblox.com/item.aspx?id=487738693" -- id of animation

mouse.KeyDown:connect(function(key)
	if key == "z" then --Select a button, if you want shift then put 48 in it
		local playAnim = humanoid:LoadAnimation(anim)
		playAnim:Play()
	end
end) 

now i want to a like an aura in torso am good but not that good at scripting Please help me Thank you

13 comments

0

any one

0

Can you please use code block and what do you mean by power?

0

ok

0

there

0

i mean like and aura or like an blast or shield or somthing like dragonballz and hunter x hunter

0

You can add fire while the animation is playing as an example.

0

ok how i do that

0

I'le do an answer in a bit

0

Are you using FE?

0

am not sure

0

what does FE mean

0

am sorry i just dont get it

1 answer

✓ Accepted answer

This script will work with no filtering. Here is a better link that may help explain it in more detail FilteringEnabled

Also we can use StarterCharacterScripts for tasks involving the character as we do not need to check if the character is nil. We just wait for the contents of the character.

Lastly KeyDown is deprecated, the good news is that we have a whole new service that holds all of the users input called UserInputService.

Here is an example local script which goes into the StarterCharacterScripts:-

local humanoid = script.Parent:WaitForChild('Humanoid')
local anim = Instance.new("Animation")
anim.AnimationId = "https://www.roblox.com/item.aspx?id=487738693"
local playAnim = humanoid:LoadAnimation(anim)

local usrInpServ = game:GetService('UserInputService')

-- add fire function
local function addFire()
	local torso = script.Parent:FindFirstChild('Torso') -- finds torso
	if torso then -- if torso is found
		if not torso:FindFirstChild('fire') then -- if there is no fire we add fire
			local fire  = Instance.new('Fire', torso) -- adds fire to torso
			fire.Name = 'fire'
			fire.Heat = 0
			fire.Color = Color3.new(255/255, 0, 4/255)
			fire.Size = 12
			fire.SecondaryColor = Color3.new(255/255, 0, 4/255)
		end
	end
end

usrInpServ.InputBegan:connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard then -- input must be a keyboard
		if input.KeyCode == Enum.KeyCode.Z then -- check key press 
			playAnim:Play() -- plays animation
			addFire() -- adds fire 
		end
	end
end)

To make this work with FE you would simply need to move the add fire function to the server and fire the server to add the fire to the player.

I hope this helps as it is only an example which can be built upon such as removing the fire.

Pleas comment if you do not fully understand how / why this code works but also check the wiki page first.

1 comment

0

that very helpful and i added the remove so it looks good now

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