local UserInput = game:GetService("UserInputService")
local offset = Vector3.new(0,0,-3)
local player = game.Players.LocalPlayer
local Character = player.Character or player.CharacterAdded:wait()
local rootpart = Character:WaitForChild("HumanoidRootPart",3)
local FireBallEvent = game.ReplicatedStorage.FireBallEvent
UserInput.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.R then
print("You pressed R")
local CreateFireBall = Instance.new("Part", workspace)
CreateFireBall.Shape = "Ball"
CreateFireBall.Size = Vector3.new(5,5,5)
CreateFireBall.Anchored = true
CreateFireBall.CanCollide = true
CreateFireBall.BrickColor = BrickColor.new("Really red")
CreateFireBall.CFrame = rootpart.CFrame * CFrame.new(offset)
while true do
wait(.001)
CreateFireBall.CFrame = CreateFireBall.CFrame * CFrame.new(offset)
end
CreateFireBall.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local character = hit.Parent
FireBallEvent:FireServer(character)
end
end)
end
end)
that is the server script, the event is call FireBallEvent
local FireBallEvent = game.ReplicatedStorage.FireBallEvent
FireBallEvent.OnServerEvent:Connect(function(player, character)
character.Humanoid.Health = character.Humanoid.Health -5
end)
and that is the local script, for some reason this wont work help! The fireball comes out and moves but it doesnt do damage upon hitting a dummy. No errors come up either

1 comment
You can't have a LocalScript change something that should show in the server