So I tried making my script so that when u click, tap, etc it will launch a fireball but this only works on roblox studio and not online. Idk why. THIS IS IN A SCRIPT. Pls Help! <3
My code
local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local head = char:WaitForChild("Head")
local ammo = 1
tool.Activated:Connect(function()
if ammo == 1 then
ammo = 0
local fireballclone = game.ServerStorage.BallEx:Clone()
fireballclone.Parent = game.Workspace
fireballclone.Position = head.Position + (head.CFrame.lookVector * 8)
local v = Instance.new("BodyVelocity")
v.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
v.Velocity = player.Character.UpperTorso.CFrame.lookVector * 80
v.Parent = fireballclone
wait(3)
ammo = 1
end
end)

2 comments
thank you so much it worked :D
You are most welcome. Please accept my answer.