Hello, I've scripted a fireball. It works like a charm in roblox studio, however does not work in the actual game. I tried so many things but I don't know how to fix this problem. I would really like to finally know why this is happening and how to fix it. Sorry if my grammar is bad. My game does not have filtered enabled. I would be so happy if someone found a solution to this.
local uis = game:GetService("UserInputService")
local animation = script.Animation
local plr = game.Players.LocalPlayer
function blueball()
local bball = Instance.new("Part")
bball.Shape = "Ball"
bball.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame*CFrame.new(0,0,-5)
bball.Material = "Neon"
bball.BrickColor = BrickColor.new("Cyan")
bball.CanCollide = false
local BV = Instance.new("BodyVelocity")
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector*100
BV.Parent = bball
bball.Parent = workspace
local pe = script.ParticleEmitter:Clone()
pe.Parent = bball
bball.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(5)
end
end)
wait(2)
bball:Destroy()
end
uis.InputBegan:connect(function(i)
if i.KeyCode == Enum.KeyCode.F then
local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Animation)
anim.KeyframeReached:connect(function(nameofkey)
if nameofkey == "aylmao" then
blueball()
end
end)
anim:Play()
wait(0.5)
anim:Stop()
end
end)

2 comments
Hi, I made sure I used local script. I do have r6 enabled but still doesn’t work. Thanks for the help.
Well, did you get any errors?