-ffn-python Posted September 14, 2015 Share Posted September 14, 2015 Hey Guys i'm fixed Sigmar lobby. but the new problem. addEvent("onServerSendS",true) addEventHandler("onServerSendS",root, function(commandstring) local notReturned local commandFunction,errorMsg = loadstring("return "..commandstring) if errorMsg then notReturned = true commandFunction, errorMsg = loadstring(commandstring) end if errorMsg then outputDebugString(errorMsg); return end results = { pcall(commandFunction) } if not results[1] then return end if not notReturned then local resultsString = "" local first = true for i = 2, #results do if first then first = false else resultsString = resultsString..", " end local resultType = type(results[i]) if isElement(results[i]) then resultType = "element:"..getElementType(results[i]) end resultsString = resultsString..tostring(results[i]).." ["..resultType.."]" end outputDebugString(errorMsg); elseif not errorMsg then --loaded end removeEventHandler("onClientRender",root,drawWait); end) Link to comment
Rob Posted September 14, 2015 Share Posted September 14, 2015 commandstring not defined thats why its giving you nil value Check client side where you triggered event "onServerSendS" Link to comment
obuhhh Posted September 14, 2015 Share Posted September 14, 2015 bool triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] ) sendTo: The event will be sent to all players that are children of the specified element. By default this is the root element, and hence the event is sent to all players. event: The name of the event to trigger server-side. You should register this event with addEvent and add at least one event handler using addEventHandler. theElement: The element that is the source of the event. arguments...: A list of arguments to trigger with the event. Maybe the value in the arguments passed nil? Link to comment
-ffn-python Posted September 14, 2015 Author Share Posted September 14, 2015 Okay. just Complete ? Server-Side; triggerClientEvent( client,"onServerSendS", client) Link to comment
obuhhh Posted September 14, 2015 Share Posted September 14, 2015 Okay. just Complete ?Server-Side; triggerClientEvent( client,"onServerSendS", client) ...Like a this. local clieeent = getRandomPlayer() -- for who local soooource = getRandomPlayer() -- what be source in this eventhandler on clientside local someString = "HelloWorld" -- argument to trigger with the event triggerClientEvent( clieeent,"onServerSendS", soooource, someString) Link to comment
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