TalkAction Kick-Ass Script!

Jesper_Kladden

Donator
Joined
May 16, 2008
Messages
458
Best answers
0
Reaction score
1
Location
Sweden
This is my first script ever that I've done in LUA so I guess I'm 1337 now!!

J/K. I know it suxx, but anyways..

when the player says "!gold" - he will recieve 100 gold (1 platinum). !!!


Call this file "getgold.lua"
Code:
function onSay(cid, word, param)
doPlayerAddMoney(cid, 100)
doPlayerSendTextMessage(cid, 21, "You've just got 100 gold pieces!")
end
and this should be in the "Talkactions.xml"
Code:
<talkaction words="!gold" script="getgold.lua"/>

Rate it from 1~10 !! This is my first script ever :D

ps. - TFS 0.2
 

222222

New Member
Joined
Jul 3, 2007
Messages
124
Best answers
0
Reaction score
4
Awesome !!
Too bad I wont use it.
Players will get rich very fast >.>

try add an Access. Like only for tutors,GMs,GODs

Edit: forgot to say, Good 1st script.
 

JayBeee

Retired Global Mod
Joined
Jun 2, 2007
Messages
5,225
Best answers
0
Reaction score
13
Location
Sweden
Works for TFS 0.3 too. ;)

VERY basic script, but I guess it's a start. Good work!
 
OP
Jesper_Kladden

Jesper_Kladden

Donator
Joined
May 16, 2008
Messages
458
Best answers
0
Reaction score
1
Location
Sweden
Hehe. Yes, it's very basic!

I'm doing a script that if you say "!buyblessing1" you will buy it for 5000 gold. But can't do it ATM because of lack of access to a computer.

Bb :*
 

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
Why not making with storage value.. like


PHP:
function onSay(cid, word, param)
if getPlayerStorageValue(cid, 1000) == -1 then
doPlayerAddMoney(cid, 100)
setPlayerStorageValue(cid, 1000, 1)
doPlayerSendTextMessage(cid, 21, "You've just got 100 gold pieces!")
else
doPlayerSendTextMessage(cid, 22, "You already received your money")
end
return TRUE
end
Anyway, simple and great first script:)
 
Last edited:

Master-m

Need help? Just ask!
Joined
May 28, 2007
Messages
4,339
Best answers
0
Reaction score
15
Location
The Netherlands
Why not making with storage value.. like


PHP:
function onSay(cid, word, param)
if getPlayerStorageValue(cid, 1000) -1 then
doPlayerAddMoney(cid, 100)
setPlayerStorageValue(cid, 1000, 1)
doPlayerSendTextMessage(cid, 21, "You've just got 100 gold pieces!")
else
doPlayerSendTextMessage(cid, 22, "You already received your money")
end
return TRUE
end
Anyway, simple and great first script:)
If you want people to learn from it you should teach them right. Like adding comments on every line to explain what it does and tabbing correct lol.
 

Colandus

Advanced OT User
Joined
Jun 6, 2007
Messages
2,424
Best answers
18
Reaction score
165
Location
Sweden
Why not making with storage value.. like


PHP:
function onSay(cid, word, param)
if getPlayerStorageValue(cid, 1000) -1 then
doPlayerAddMoney(cid, 100)
setPlayerStorageValue(cid, 1000, 1)
doPlayerSendTextMessage(cid, 21, "You've just got 100 gold pieces!")
else
doPlayerSendTextMessage(cid, 22, "You already received your money")
end
return TRUE
end
Anyway, simple and great first script:)
if getPlayerStorageValue(cid, 1000) == -1 then
 

Pitufo™

InfinityOT.com
Joined
Feb 14, 2008
Messages
1,438
Best answers
0
Reaction score
7
Location
Mexico, Cuernavaca
Nice, i started like you now im a little more advanced! not as Colandus or Nahruto xD keep it like that. I can help you if you whant(PM) :D
 
OP
Jesper_Kladden

Jesper_Kladden

Donator
Joined
May 16, 2008
Messages
458
Best answers
0
Reaction score
1
Location
Sweden
haha! Owned x].. Thanks but no thanks. I've got all the help I need ^^
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Code:
<talkaction words="!gold" value="if(getPlayerLevel(cid) > 8) then (doPlayerAddItem(cid, 2148, 100) end"/>
Isn't this how Elf showed us?
Can't remember :p
 
Last edited:

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
852
Location
Caribbean Sea
@below up
lol why the old damn useless script thread revival?

@jdb
:) elf's student
 

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
Code:
<talkaction words="!gold" value="if(getPlayerLevel(cid) > 8) then (doPlayerAddItem(cid, 2148, 100) end"/>
Isn't this how Elf showed us?
Can't remember :p
Code:
<talkaction words="!gold" event="buffer" value="if(getPlayerLevel(cid) > 8) then doPlayerAddItem(cid, 2148, 100) end"/>
does it require cdata here?
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
852
Location
Caribbean Sea
lol why for? buffer shortens that
 

RealSoft

Banned User
Joined
Feb 3, 2009
Messages
4,382
Best answers
0
Reaction score
92
Location
There I sleep
make it easier ^^

!gold "9475

AddPlayerMoney, (Cid, '.. replie ..')

Something like that xD

very bad example, but you get my point.... I hope. ^^

Anyhow, would never use such script! :p
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
852
Location
Caribbean Sea
meh never-er, it is too simple/easy
 

nclx

Member
Joined
Jul 18, 2009
Messages
556
Best answers
0
Reaction score
15
@Jesper_Kladden
u gaylord chupapitos i go spam insult u in msn thx bye, why u post this nubak stuff go post source of spam bot ty
 
Top