FSXTim Posted May 26, 2012 Posted May 26, 2012 Hello, I want that the name of the actual running map is in a label. clientside, (this happens, when the player open the GUI): triggerServerEvent("MapName", getRootElement(), localp) (localp is defined!) -- triggers the event to the following serverside function -- serverside, (gets the name of the map): function MapName () local MapN = getMapName() triggerClientEvent("SetText", getRootElement(), MapN) end addEvent ( "MapName", true ) addEventHandler ( "MapName", getRootElement(), MapName ) -- triggers the name of the map to the following clientside script -- clientside, (puts the name of the map in a label): function SetText() guiSetText(mapText, "Map: "..MapN.."") end addEvent ( "SetText", true ) addEventHandler ( "SetText", getRootElement(), SetText ) Error (clientside): attempt to concatenate global 'MapN' (a nil value) Greets
Guest Guest4401 Posted May 26, 2012 Posted May 26, 2012 Change function SetText() guiSetText(mapText, "Map: "..MapN.."") end addEvent ( "SetText", true ) addEventHandler ( "SetText", getRootElement(), SetText ) to function SetText(MapN) guiSetText(mapText, "Map: "..MapN.."") end addEvent ( "SetText", true ) addEventHandler ( "SetText", getRootElement(), SetText )
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