• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

XprimeX/Damon's RequestAScript Service

XPRIMEX

Semi-Dead
Joined
Jun 19, 2012
Messages
293
Reaction score
14
Hey OTland, so i've been wanting to script for quite a while but i always have the problem, wth should i script ?!
anyway i'm not that great at scripting but, i can try ^.^, anyhow, what I ask of you is to post scripts i could make so that i might practice and hopefully get better.
Cheers, Prime


Picklocking System : >HERE<
Description : When the picklock (set id to your comfort) is used on a closed
door there is a XX% that the door will be unlocked or that your pick will break
and the door remain Locked


Teleporting Command : >HERE<
Description : When the command set is said the player will be teleported to
the position set.
 
Last edited:
alright so im trying to make it so when item 2471 is equiped ur outfits head color changes to yellow

Lua:
function onAddItem(cid)
if item.itemid=2471
then
doCreatureChangeOutfit(cid, outfit)
doPlayerSendTextMessage(cid,2,"Your Outfit has changed according to the look of your item!")
end

help plx :<
 
This isn't too simple but it was my first official script..
Hopefully this helps you abit.. It was compliated but everything has an order and consequence. Each function has an end etc.
Lua:
--[[ Script by Ghostx... 
Use minimap receive map marks
]]--
function onUse(cid, item, fromPosition, itemEx, toPosition) --- the function obviously
 
local Mark = { --- the marks that will be added to minimap
[1]={{x=1019,y=1044,z=7},"Temple",MAPMARK_TEMPLE},
[2]={{x=1024,y=1015,z=7},"Depot",MAPMARK_LOCK},
[3]={{x=1024,y=1007,z=7},"Equipment",MAPMARK_SWORD},
[4]={{x=1015,y=1017,z=7},"Hunting Shop",MAPMARK_STAR},
[5]={{x=1019,y=1005,z=7},"Castle",MAPMARK_FLAG},
[6]={{x=1009,y=1015,z=7},"Potion Shop",MAPMARK_TICK},
[7]={{x=992,y=1011,z=7},"Wilderness",MAPMARK_REDWEST},
[8]={{x=1056,y=1011,z=7},"Docks",MAPMARK_BAG}
}
for i=1,#Mark do
doPlayerAddMapMark(cid, Mark[i][1], Mark[i][3], Mark[i][2]) 
doPlayerSendTextMessage(cid,21,"You now have locations marked on your map")
end
return true
end

Excuse tabbing - pasted off iphone.

- - - Updated - - -

Its useful to start a script with a comment block to keep you focused on its use

Use ---[[ created by damon and old elements :) this script does xx and creates yy]]--- ( you dont have to put the --- on the end, i just do for cosmetic purposes (looks symmetrical)

- - - Updated - - -

Also regarding your script.. It hasn't got a command to change hair to yellow. Just "changeoutfit". I dont no much about outfit scripts so i'd have to look at functions but you're on the right track.. Besides dont think syntax works..

Use this to check syntax http://www.lua.org/cgi-bin/demo
 
Last edited:
Tested [not yet]

Hello, here is my second script, which
Is supposed to let the player buy any item with a command you can specify choose (e.g. !buyitem) .

data/talkactions

Add to talkactions.xml
Code:
<talkaction words="!buyitem" --Here you can change the words the player has to say to buy the item
script="buyitem.lua" />

Create a new .lua at data/talkactions/scripts
and name it
buyitem.lua
.
Now paste this in buyitem.lua:
Lua:
function onSay(cid, words, param)
 
	if doPlayerRemoveMoney(cid, 10000) then
		doPlayerAddItem(cid, 2160, 1)
	else 
		doPlayerSendTextMessage(cid, 21, "You are too poor yeye, u mad now?")
	end
	return true
end

How to edit?!
"10000" can be changed to the amount of Gold coins the player has to pay for the item when using the command.
"2160,1" can be changed to whatever u like, just keep in mind it is:
"itemidofitemtheplayerwillrecive,amount"
Regards,
//Damon
 
Last edited:
alright so im trying to make it so when item 2471 is equiped ur outfits head color changes to yellow

Lua:
function onAddItem(cid)
if item.itemid=2471
then
doCreatureChangeOutfit(cid, outfit)
doPlayerSendTextMessage(cid,2,"Your Outfit has changed according to the look of your item!")
end

help plx :<

Lua:
function onEquip(cid, item, slot)

local outfit = getCreatureOutfit(cid)

	if outfit.lookHead ~= 79 then
		setPlayerStorageValue(cid, 9345, outfit.lookHead)
	end
	doCreatureChangeOutfit (cid, {lookType = outfit.lookType, lookHead = 79, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet, lookAddons = outfit.lookAddons})
        doPlayerSendTextMessage(cid, 25, "Your Outfit has changed according to the look of your item!")
	return true	
end
 
function onDeEquip(cid, item, slot)

local outfit = getCreatureOutfit(cid)

	if getPlayerStorageValue(cid, 9345) == -1 then
		setPlayerStorageValue(cid, 9345, 79)
	end
	doCreatureChangeOutfit (cid, {lookType = outfit.lookType, lookHead = getPlayerStorageValue(cid, 9345), lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet, lookAddons = outfit.lookAddons}) 
	return true
end

@Damon
Don't forget to add else :p
 
Last edited:
@Limos
U mean like this?
Lua:
function onSay(cid, words, param)
if doPlayerRemoveMoney(cid, 10000) == 1 then
doPlayerAddItem(cid, 2160, 1)
else doPlayerSendTextMessage(cid,21,"You are too poor yeye, u mad now?")
end
end
 
Without the == 1 and with tabs please :p
Lua:
function onSay(cid, words, param)

	if doPlayerRemoveMoney(cid, 10000) then
		doPlayerAddItem(cid, 2160, 1)
	else 
		doPlayerSendTextMessage(cid, 21, "You are too poor yeye, u mad now?")
	end
	return true
end
 
Tabs is to make it better to read and the == 1 won't work since you are checking for 1 and well there is no 1 with that. TRUE should work too, but if you don't add it it's automaticly true.
 
it will work, but it wont tell him anything or do anything when he doesn't have the money; this will make him think that the server is bugged or smth like this -- if ya mean the first code u wrote Damon.

Good luck guys :)
 
@Vendeliko
Well I take HTML requests, however depends on the difficulty :p
Though Im learning html since a few months alrdy :D

Hey Cyro how ya doing bro? :D
 
Hey Cyro how ya doing bro? :D

am good; get online on msn

btw, do this script:

when u use something or onstepin u will get teleported to a certain place and u will have a backpack with ur starting items just add x,y,z etc as the ids of the items :)
 
@Vendeliko
Well I take HTML requests, however depends on the difficulty :p
Though Im learning html since a few months alrdy :D

Hey Cyro how ya doing bro? :D
Then if you can,i'd like you to make me 2 pages :)

Page 1:
A simple purple & black page with two boxes that will redirect to other pages when clicked.
Box 1 is to redirect for example to yomomma.com and Box 2 is to redirect for example to yodaddy.com
Above the boxes i'd like to see the text 'Wybierz co bys chcial kupic' written.
And in box 1 i'd like to see text 'Premium' and in box 2 'MegaPremium'.
1-3_zpse41a61a9.jpg

Page 2:
A simple purple & black page with a pretty much contact form which will
be sent to email [email protected]
when button at the bottom of the page is clicked and the text 'Dziekujemy za zamowienie'
to be shown on success.
It is to have the boxes to fill out that are on the screen below.
Whatever has * is required to fill out,dont let it pass without having them filled
When you choose 'Dlugosc' you get two options:
miesiac
na zawsze
when you choose miesiac I want text X appear where lambda lambda lambda is and when
you choose na zawsze I want text Y to appear.
At the bottom of the page I want a button that basically send it ;d,it must say 'zamow'
2-2_zps0b2165ba.jpg
 
@Cyro
Will try to make that haha :)

@Vendeliko
I guess I can do that however be preüared to wait a bit :)
Btw. U wanna sell botting? :O ?
 
good luck guys :)
just keep working and u'll be great ^^

i always wanted to start learning LUA but lacked the time and push to do it ^^
good luck :)
 
Back
Top