BenceDev Posted June 7, 2022 Share Posted June 7, 2022 (edited) Hi i have a problem with my script. So i write the script "nice" but i dont get it clientevent is why didnt work for me. And i want to create weapon and attach to the server side created vehicle(raindance) Error: ERROR: Server triggered clientside event createMinigun, but event is not added clientside Server Side: function createMinigunWeapon() triggerClientEvent("createMinigun", resourceRoot) end addEventHandler("onResourceStart", resourceRoot, createMinigunWeapon) Client side: function createMinigunWeapon() -- Create the weapon 1 meter above the player local x, y, z = getElementPosition(localPlayer) local weapon = createWeapon("minigun", x, y, z + 1) -- Give it some ammo and fire it setWeaponClipAmmo(weapon, 99999) setWeaponState(weapon, "firing") setWeaponProperty(weapon, "fire_rotation", 0, 0, 0) end addEventHandler("createMinigun", localPlayer, createMinigunWeapon) addEvent("createMinigun", true) Edited June 7, 2022 by SphinxDev wrong information Link to comment
nikitafloy Posted June 7, 2022 Share Posted June 7, 2022 several reasons, use setTimer with triggerClientEvent then Link to comment
BenceDev Posted June 7, 2022 Author Share Posted June 7, 2022 !!SOLVED!! but thanks for the help Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now