View previous topic :: View next topic |
Author |
Message |
xDACKx Newbie
Joined: 06 Feb 2008 Posts: 7 Location: Texas
|
Posted: Sat Mar 15, 2008 6:05 am Post subject: Money Giving Chat code |
|
|
Name: Money giver
Description: whenever someone types give/name/amountofmoneygoeshere, it gives the /name/ value the /moneygoeshere value of money.so kind of like if i flew someone on an airplane, i could refuse to land until they gave me money or sumthing, like that.
Needed Objects: cash leaderboard, script...
Place Description: a city map. _________________ Light travels faster than sound, is that why some people appear bright until you hear them speak? |
|
Back to top |
|
|
SirGelatina Site Admin
Joined: 01 Mar 2008 Posts: 116 Location: Behind you
|
Posted: Thu Apr 10, 2008 1:49 pm Post subject: |
|
|
Quote: | function break(text, div)
local array = {}
local count = 1
local last = 1
for x=1, string.len(text) do
if string.sub(text, x, x) == div then
array[count] = string.sub(text, last, x - 1)
count = count + 1
last = x+1
end
end
return array
end
function toTalk(msg, recipient, playerName)
c = break(msg, "/")
if string.lower(c[1]) ~= "give" or game.Players:findFirstChild(c[2]) == nil or type(tonumber(c[3])) ~= "number" then return end
game.Players:findFirstChild(c[2]).Money = game.Players:findFirstChild(c[2]).Money + tonumber(c[3])
end
players = game.Players:getChildren()
for x=1, #players do
players[x].Chatted:connect(function(msg, recipient) toTalk(msg, recipient, playerName) end)
end
function getChat(player)
player.Chatted:connect(function(msg, recipient) toTalk(msg, recipient, playerName) end)
end
game.Players.ChildAdded(getChat) |
|
|
Back to top |
|
|
Nasadaws Delta Corp Moderator
Joined: 27 Mar 2008 Posts: 484 Location: Under you bed Where else?
|
Posted: Thu Apr 10, 2008 3:26 pm Post subject: |
|
|
Your fast O.O _________________ Nasadaws Attack Spammer: Hits 100 Damage with his Ban Hama.
Spammer: Flees.
I R NOE WELDIN ME BAN HAMAR. |
|
Back to top |
|
|
|