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

How to enable a script in a npc when fired?

Asked by 2 years ago

Hello! Hello! I've been developing a zombie infection game. I've tried to make a gun. When the bullet gets touched by a zombie, it gives them however many points that zombie gives. I can't seem to disable an npc's stunned script via a remote event. The main bullet fire script is a local script. I fire the enable stun event in the local script. Though it doesn't enable that zombie's stunned script. Any thoughts?

script.Parent.StunEnableEvent.OnServerEvent:Connect(function(character)
    if character:FindFirstChild("Player") and not game.Players:FindFirstChild(character.Name) then
        --they aint it bro
    else
        character.StunnedHandler.Disabled = false
    end
end)

Any help would be greatly appreciated!!

Answer this question