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

Animation don't work fe. Making animation working with fe?

hello, im am Tomekcz and i need your help with those scripts it works in roblox studio but not in game

script in StarterCharacterScripts

module = require(script.attacks)
RemoteEvent = game.ReplicatedStorage.Attack

RemoteEvent.OnServerEvent:Connect(function(player)
	module.NormalFirstAttack(player)
end)

module script in script

local module = {}
	function module.NormalFirstAttack(player)
	 animation = player.Character.Humanoid
	animationPlay = animation:LoadAnimation(script.NormalAttack)
	animationPlay.Priority = Enum.AnimationPriority.Action
	animationPlay:Play()
	
	end
return module

local script in starterCharacterScripts

local module = {}
	function module.NormalFirstAttack(player)
	 animation = player.Character.Humanoid
	animationPlay = animation:LoadAnimation(script.NormalAttack)
	animationPlay.Priority = Enum.AnimationPriority.Action
	animationPlay:Play()
	
	end
return module

1 answer

✓ Accepted answer

You can just make a LocalScript in the "StarterCharacterScripts" and put the animation in it then write this script into the LocalScript.

game.Players:WaitForChild("LocalPlayer"):WaitForChild("Character"):WaitForChild("Humanoid")
local function playanim()
     animation = player.Character.Humanoid
    animationPlay = animation:LoadAnimation(script.NormalAttack)
    animationPlay.Priority = Enum.AnimationPriority.Action -- You can set it in the animation editor.
    animationPlay:Play()
 end
-- Now you can do whatever you want with it.
-- For an example:
script.Parent.MouseButton1Click:Connect(function()
 	playanim()
end)

Also , you don't need RemoteEvents for animtions because they work with fe even if they're in a LocalScript. Hope this helped!

1 comment

0

Thanks, i realized animation won't work becouse my script is broke and i used it at friends place (cannot use animations at friends place idk why)

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