Hey, i get no bug in my script no errors, but this script is when you hit a marker you will find a gui asking you to buy a drunk, so when i hit the marker, nothing happens, please if you can help me, leave a commenter, and thanks,
Client side :
[lua]
GUIEditor = {
tab = {},
tabpanel = {},
label = {},
button = {},
window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
window[1] = guiCreateWindow(450, 450, 402, 120, "Buy a drunk", false)
guiWindowSetSizable(window[1], false)
guiSetVisible (window[1], false )
image[1] = guiCreateStaticImage(14, 29, 83, 76, "question.png", false, window[1])
llabel[1] = guiCreateLabel(107, 33, 271, 20, "Are you sure you want to buy a drunk for 1000$ ?", false, window[1])
button[yes] = guiCreateButton(212, 73, 74, 22, "Yes", false, window[1])
guiSetProperty(button[yes], "NormalTextColour", "FFAAAAAA")
button[no] = guiCreateButton(294, 73, 74, 22, "No", false, window[1])
guiSetProperty(button[no], "NormalTextColour", "FFAAAAAA")
end
)
function drunk(hitElement)
guiSetVisible(window[1],true)
if getElementType(hitElement) == "player" and (hitElement == localPlayer) then
showCursor(true)
playSound("files/notif.mp3")
end
end
addEvent("drunk",true)
addEventHandler("drunk", getRootElement(), drunk)
function showGUIbf()
guiSetVisible (window[1], false )
showCursor ( false )
end
addEventHandler("onClientGUIClick", button[no], showGUIbf, false)
function showPedAnim()
guiSetVisible (window[1], false )
showCursor ( false )
end
addEventHandler("onClientGUIClick", button[yes], showPedAnim, false)
function Bar( Player )
setElementPosition(Player, 1633.6669921875, 1667.9755859375, 16.987487792969)
outputChatBox (" #ffffffYou have teleported to : #FF0030Bar#ffffff(Command: /bar)", root, 255, 255, 255, true)
end
addCommandHandler( "bar",Bar)
[/lua]
Server Side :
marker = createMarker( 1672.900390625, 1661.099609375, 16, "cylinder", 0.7, 0, 0, 0 ,0)
marker2 = createMarker( 1679.5, 1679.4333496094, 11.4, "cylinder", 0.7, 0, 0, 0 ,0)
function Hit(hitPlayer)
if hitPlayer and getElementType(hitPlayer) == "player" then
triggerClientEvent (hitPlayer,"drunk",getRootElement(),hitPlayer)
end
end
addEventHandler("onMarkerHit",marker,Hit)
addEventHandler("onMarkerHit",marker2,Hit)