Jump to content

I have problems with my scripts


Xwaw

Recommended Posts

local g = 0

function giveGold()
	local g = g+1
end

addCommandHandler("giveG", giveGold)

function showGold(source)
	outputChatBox(tostring(g), 255, 255, 0)
end

addCommandHandler("showG", showGold)

I mean, I want the "showG" command to show the Player amount of gold, and the "giveG" command wants it to add the Player amount of gold. It is on the client side.

PLS HELP

Link to comment
  • Scripting Moderators
25 minutes ago, Xwaw said:

local g = 0

function giveGold()
	local g = g+1
end

addCommandHandler("giveG", giveGold)

function showGold(source)
	outputChatBox(tostring(g), 255, 255, 0)
end

addCommandHandler("showG", showGold)

I mean, I want the "showG" command to show the Player amount of gold, and the "giveG" command wants it to add the Player amount of gold. It is on the client side.

PLS HELP

So explain what doesn't work in here?

 

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