Help with scripting

Why this resource doesnt work?
client.lua

AddEventHandler("playerSpawned", function() 
	TriggerServerEvent("plrSpw")
end)

server.lua

RegisterServerEvent("plrSpw")
AddEventHandler("plrSpw",  function() 
	GiveWeaponToPed(GetPlayerPed(-1), GetHashKey("WEAPON_ASSAULTSMG"), 100, false, true)
end)

__resource.lua

client_script "client.lua"
server_script"server.lua"

I am new so sorry for my big mistakes

The GiveWeaponToPed needs to be run from the client.

1 Like

Ok thanks <3 [20 char]