So i have a fireball script. This is the script used to fire it.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local RemoteEvent = game.Workspace.Fired
local UIS = game:GetService("UserInputService")
local Debounce = false
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.R then wait(0.5)
if Debounce == true then return end
RemoteEvent:FireServer(Debounce)
end
end)
Im trying to figure out how i could put my animation i made on to this to make it look like its being thrown when the fireball spawns in.
Right now im using this animation script with it to make it look like its being thrown, but I know that this is not a good way to do it, and that there may be a way for them to be combined into one script.
Animation = Instance.new("Animation")
Animation.Parent = game.Workspace
Animation.AnimationId = "http://www.roblox.com/asset/?id=2019308824"
local Player = game.Players.LocalPlayer
local mouse = game.Players.LocalPlayer:GetMouse()
mouse.KeyDown:connect(function (key)
for i, v in pairs(game.Players:GetChildren()) do
if key == "r" then
local AnimationTrack = Player.Character.Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
end
end
end)

1 comment
So im assuming that the server code goes into serverscriptservice, and i put my animation script where you told me to, and i put the client code into starterplayerscripts. But now the fireball doesnt fire at all. And both scripts have errors in output, im not sure how to fix it.