Im trying to change this script to make it play on the player, and the sever so other people can see it.
But i dont know exactly what to change to make it do so. I know it likely involves :FindFirstChild (“Humanoid”)
local Rig = workspace.TemplateR6
local Rstor = game:GetService("ReplicatedStorage")
local Orb = Rig.Humanoid:LoadAnimation(Rstor.Animations.OrbFire)
local Isactive = false
local UIS = game:GetService("UserInputService")
function PlayAnim(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if Isactive == false then
Isactive = true
Orb:Play()
wait(0.917)
Isactive = false
end
end
end
UIS.InputBegan:Connect(PlayAnim)
This script is currently on a localscript in starterplayerscripts
and i need to change it so part of the code is in a remote event in rep storage.
Humanoids have a child called an Animator that, when playing animations on a character, will replicate it to all other clients and the server. Try loading the animation like that instead.
local Rig = workspace.TemplateR6
local Rstor = game:GetService("ReplicatedStorage")
local Orb = Rig.Humanoid.Animator:LoadAnimation(Rstor.Animations.OrbFire)
local Isactive = false
local UIS = game:GetService("UserInputService")
function PlayAnim(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if Isactive == false then
Isactive = true
Orb:Play()
wait(0.917)
Isactive = false
end
end
end
UIS.InputBegan:Connect(PlayAnim)