Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Event isn't working properly and skips lines?

Asked by
Galicate 106
6 years ago

lines 2 and 4 through 8 are ignored. The npc or layer does not take any damage.

function Damage(player, damage, bodypart, playerdamaged)
    workspace[playerdamaged].Humanoid:TakeDamage(damage)
    print("Hit " .. playerdamaged .. " in the " .. bodypart .. " and did " .. damage .. " damage.")
    if bodypart == "Helmet" then
        print("you knocked my helmet off")
        workspace[playerdamaged].Head.HelmetWeld:Destroy()
        workspace[playerdamaged].Helmet.Parent = workspace
    end
end

game.ReplicatedStorage.Damage.OnServerEvent:Connect(Damage)
0
You are not passing any arguments for all the parameters that you have. Is the script throwing any errors? User#21908 42 — 6y
0
Ok so it works online but not in studio, I know this doesnt affect real gameplay but it would be nice if will in studio i can see if its working. Galicate 106 — 6y
0
No errors. Galicate 106 — 6y
0
odd... I cant see what the issue is if it works online it should work is studio. User#21908 42 — 6y
0
Where is the LocalScript? User#19524 175 — 6y

Answer this question