eVeeYx Posted February 25, 2020 Share Posted February 25, 2020 how to make a script when the player clicks on the button on the gui and automatically takes the player's money GUI = { button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUI.window[1] = guiCreateWindow(484, 203, 285, 124, "", false) guiWindowSetSizable(GUI.window[1], false) GUI.button[1] = guiCreateButton(37, 32, 213, 36, "Take your money", false, GUI.window[1]) end ) Link to comment
Moderators Patrick Posted February 25, 2020 Moderators Share Posted February 25, 2020 (edited) https://wiki.multitheftauto.com/wiki/OnClientGUIClick https://wiki.multitheftauto.com/wiki/TriggerServerEvent https://wiki.multitheftauto.com/wiki/TakePlayerMoney Create an event what attached to `GUI.button[1]`, when client click on this button, its call the function. Then trigger a server sided function with localPlayer's element, whats takes the money. Help: https://forum.multitheftauto.com/topic/121619-Lua-for-absolute-beginners Edited February 25, 2020 by Patrick 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