Jump to content

takePlayerMoney problem


Recommended Posts

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayerMoney() 
    takePlayerMoney (50000 ) 
    end 
    addEventHandler('onClientMarkerHit', Marker,) 
  

it's a full gamemode but can't set " takeplayerMoney ' up

I mean when the player click on Buy Ticket then take 50k then destroy the window

Link to comment
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayerMoney() 
    takePlayerMoney (50000 ) 
    end 
    addEventHandler('onClientMarkerHit', Marker,) 
  

it's a full gamemode but can't set " takeplayerMoney ' up

I mean when the player click on Buy Ticket then take 50k then destroy the window

what about this ?

addEventHandler('onClientMarkerHit', Marker,) 

Edited by Guest
Link to comment
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayerMoney() 
    takePlayerMoney (50000 ) 
    end 
    addEventHandler('onClientMarkerHit', Marker,) 
  

it's a full gamemode but can't set " takeplayerMoney ' up

I mean when the player click on Buy Ticket then take 50k then destroy the window

any way

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayermoney() 
    takePlayerMoney (50000) 
    end 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], takePlayermoney, true) 
  

Link to comment
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayerMoney() 
    takePlayerMoney (50000 ) 
    end 
    addEventHandler('onClientMarkerHit', Marker,) 
  

it's a full gamemode but can't set " takeplayerMoney ' up

I mean when the player click on Buy Ticket then take 50k then destroy the window

any way

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayermoney() 
    takePlayerMoney (50000) 
    end 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], takePlayermoney, true) 
  

I told you before in MSN it's a ( nil value ) GUIEditor_Button

Link to comment
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takePlayerMoney() 
    takePlayerMoney (50000 ) 
    end 
    addEventHandler('onClientMarkerHit', Marker,) 
  

it's a full gamemode but can't set " takeplayerMoney ' up

I mean when the player click on Buy Ticket then take 50k then destroy the window

what about this ?

addEventHandler('onClientMarkerHit', Marker,) 

ANYWAY thanks i fixed it with my self no help needed

Link to comment

try this:

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
function DestroyWindow() 
    guiSetVisible(GUIEditor_Window[1],false) --set Window not visible, so if the player walks in to the marker again then they pay and the window comes back up 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
    
    
    function take() --try not using the function as a function 
    takePlayerMoney (50000) 
    end 
    addEventHandler('onClientMarkerHit', Marker,take) --forgot to add the function name 
  

Link to comment

Try this:

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker, 
function (hitPlayer) 
    if (hitPlayer == localPlayer) then 
    guiSetVisible(GUIEditor_Window[1], true) 
    showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
  
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
      addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
    function DestroyWindow() 
    destroyElement(GUIEditor_Window[1]) 
    guiSetInputEnabled(false) 
    showCursor(false) 
    end 
     
     
    function takeMoney() 
    takePlayerMoney ( source, 50000 ) 
    end 
    addEventHandler('onClientMarkerHit', Marker, takeMoney) 
  

Link to comment

Client-Side

local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"Buy Ticket",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(9,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
guiSetVisible(GUIEditor_Window[1], false) 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
  
addEventHandler('onClientMarkerHit', Marker,function() 
if (  source == GUIEditor_Button[1] ) then 
triggerServerEvent('SetM', localPlayer) 
elseif ( source == GUIEditor_Button[2]) then  
 guiSetVisible(GUIEditor_Window[1],false) 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
end) 
end 

Server-Side

addEvent('setM', true) 
addEventHandler('SetM', root, 
function() 
takePlayerMoney(source, 5000) 
end) 

Link to comment
It's the same thing X-SHADOW.

Why

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
function DestroyWindow() 
    guiSetVisible(GUIEditor_Window[1],false) 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
  
function take() 
takePlayerMoney (100000) 
end 
addEventHandler("onClientGUIClick", GUIEditor_Button[1], takePlayerMoney, false) 
  

GUIEditor_Button[1] why it's a nil value ?

Link to comment

I think it's because the event handler was out of the function with the defined button, try this:

  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], takePlayerMoney, false) 
end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
function DestroyWindow() 
    guiSetVisible(GUIEditor_Window[1],false) 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
  
function take() 
takePlayerMoney (100000) 
end 

Link to comment
I think it's because the event handler was out of the function with the defined button, try this:
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], takePlayerMoney, false) 
end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
function DestroyWindow() 
    guiSetVisible(GUIEditor_Window[1],false) 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
  
function take() 
takePlayerMoney (100000) 
end 

So when the player hit the marker force taking of money with out click on the button and i tried it if i have no money it show like this -100000 but i think this script has crashed fully : (

Link to comment

ok, try this:

  
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
function DestroyWindow() 
    guiSetVisible(GUIEditor_Window[1],false) 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
  
function take() 
    if(getPlayerMoney(localPlayer)>=100000)then 
        takePlayerMoney (100000) 
        guiSetVisible(GUIEditor_Window[1],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    else 
        outputChatBox("Sorry, you don't have enough money",100,0,0) 
    end 
end 

Link to comment
ok, try this:
  
  
local Marker = createMarker ( 1007.4000244141, -2302.6999511719, 12.10000038147, "cylinder", 1.29999995, 255, 0, 0, 255 ) 
addEventHandler('onClientMarkerHit', Marker,function(hitPlayer) 
    if (hitPlayer == localPlayer) then 
        guiSetVisible(GUIEditor_Window[1], true) 
        showCursor(true) 
    end 
end) 
  
  
function CreateGUIWindow() 
GUIEditor_Window = {} 
GUIEditor_Button = {} 
GUIEditor_Memo = {} 
GUIEditor_Image = {} 
  
GUIEditor_Window[1] = guiCreateWindow(502,268,480,290,"",false) 
GUIEditor_Image[1] = guiCreateStaticImage(240,20,229,261,"images/space.png",false,GUIEditor_Window[1]) 
GUIEditor_Button[1] = guiCreateButton(10,251,91,30,"Buy Ticket",false,GUIEditor_Window[1]) 
GUIEditor_Button[2] = guiCreateButton(155,251,69,30,"Exit",false,GUIEditor_Window[1]) 
GUIEditor_Memo[1] = guiCreateMemo(15,20,219,221,"=====|MoonTrip|=====\nWelcome to the\" MoonTrip\", the moon trip is wonderful trip full of mystery stuff and nice gravitation,You'll find the absolute fun but try to find fun enough \nbecause time is only 10 minutes you will find above signs should find it in different areas, each one under 5k have a nice time\n====|Ticket|====\nMoon 50,000$=====|MoonTrip|====",false,GUIEditor_Window[1]) 
guiMemoSetReadOnly(GUIEditor_Memo[1],true) 
  
guiSetVisible(GUIEditor_Window[1], false) 
  
    addEventHandler("onClientGUIClick", GUIEditor_Button[2], DestroyWindow, false) 
    addEventHandler("onClientGUIClick", GUIEditor_Button[1], take, false) 
end 
    addEventHandler("onClientResourceStart", getRootElement(), CreateGUIWindow) 
      
function DestroyWindow() 
    guiSetVisible(GUIEditor_Window[1],false) 
    guiSetInputEnabled(false) 
    showCursor(false) 
end 
  
function take() 
    if(getPlayerMoney(localPlayer)>=100000)then 
        takePlayerMoney (100000) 
        guiSetVisible(GUIEditor_Window[1],false) 
        guiSetInputEnabled(false) 
        showCursor(false) 
    else 
        outputChatBox("Sorry, you don't have enough money",100,0,0) 
    end 
end 

Thaaaaaaaanks bro !!! i love youuu i 'll never ever forget that : )

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