function changeWalkSettings (arg)
toggleControl(source, "sprint", arg)
toggleControl(source, "jump", arg)
toggleControl(source, "aim_weapon", arg)
toggleControl(source, "next_weapon", arg)
toggleControl(source, "previous_weapon", arg)
toggleControl(source, "fire", arg)
toggleControl(source, "enter_exit", arg)
end
addEvent("changeWalkSettings", true)
addEventHandler("changeWalkSettings", root, changeWalkSettings)
--// In another script it will be like this
triggerClientEvent(source, "changeWalkSettings", source, true or false) --// for client to server
triggerServerEvent("changeWalkSettings", localPlayer, true or false) --// for server to client
triggerEvent("changeWalkSettings", localPlayer, true or false) --// if you trigger the client function in another client script
triggerEvent("changeWalkSettings", source, true or false) --// if you trigger the server function in another server script
or via exports
exports.theResourceWhereTheFunctionIs:theFunction(arguments)
Example: exports.myScript:changeWalkSettings(true)
If you want to use the export method you need to put in meta.xml this:
<export function="changeWalkSettings" type="(client, server or shared)" />
( type="client" will mean the function can be exported only in client scripts )
( type="server" will mean the function can be exported only in server scripts )
( type="shared" will mean the function can be exported in client and server scripts )
In my opinion, I recommend using the trigger method
I hope I helped you