Jump to content

[HELP] Attempt to concetanate local 'otherPlayer'


Recommended Posts

The part where the error is:

client:

    addEventHandler ("onClientGUIClick", sendB, 
        function (selectedName, moneyAmount) 
            local selectedName = guiGridListGetItemText (gridlist, guiGridListGetSelectedItem (gridlist), 1) 
            local yourMoney = getPlayerMoney (localPlayer) 
            if selectedName then 
                local moneyAmount = guiGetText (moneyInput) 
                local moneyAmount = tonumber (moneyAmount) 
                if moneyAmount then 
                    if yourMoney > moneyAmount then 
                        outputChatBox ("* You have sent "..selectedName.." an amount of "..moneyAmount.."$.", 255, 255, 255, false) 
                        takePlayerMoney (moneyAmount) 
                        triggerServerEvent ("takingPlayerMoney", getRootElement(), moneyAmount, selectedName) 
                    end 
                end 
            end 
        end, false 
    ) 

server:

addEvent ("takingPlayerMoney", true) 
addEventHandler ("takingPlayerMoney", getRootElement(), 
    function (amount, selectedName) 
        local otherPlayer = getPlayerFromName (selectedName) 
        outputChatBox (amount.." "..otherPlayer) -- I can replace this otherPlayer with selectedName but the purpose isn't really outputhing the name, I'll be giving money to otherPlayer 
    end 
) 

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