Jump to content

HOW DO I GIVE A CONTROL BY THE PANEL


[N]inja

Recommended Posts

  • 2 months later...
--Client side
--If you want with GUI
function clickButton()
if (source == button) then
triggerServerEvent("leaveP", localPlayer)
end
end
addEventHandler("onClientGUIClick", getRootElement(), clickButton)

--If you want with DX
function clickButton2(_,state)
if isMouseInPosition(coordonates here) then
if state == "down" then
triggerServerEvent("leaveP", localPlayer)
end
end
end
addEventHandler("onClientClick", getRootElement(), clickButton2)

--Server side
function leaveP()
kickPlayer(source, "asd")
end
addEvent("leaveP", true)
addEventHandler("leaveP", root, leaveP)

 

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...