Jump to content

Problem with string.gsub.


Rat32

Recommended Posts

Posted
local dosyfa = "$500" 
syfik = tonumber(string.gsub(dosyfa, "%$", "", 1)) 
    givePlayerMoney(client, tonumber(syfik)) 
  

Debugscript nothing. Gsub not working, any help?

Posted

Oh I know what. string.gsub returns more than one value, so

local dosyfa = "$500" 
syfik = dosyfa:gsub ( "$", "" ) 
givePlayerMoney(client, tonumber(syfik) ) 

Posted
local dosyfa = "$500" 
syfik = string.gsub ( dosyfa, "$", "" ) 
outputChatBox ( syfik ) 
givePlayerMoney(client, tonumber(syfik) ) 

Posted
local dosyfa = "$500" 
syfik = string.len ( dosyfa, 1, #dosyfa ) 
outputChatBox ( syfik ) 
givePlayerMoney(client, tonumber(syfik)) 

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