Jump to content

[HELP] takePlayerMoney when you click the gui button


eVeeYx

Recommended Posts

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

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 by Patrick
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...