• 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:
@Damon
'bout how long will my request take ya?^_^

I guess I might finish it today :)

@Cyro
Try out smth like this :

Lua:
function onUse(cid, item, frompos, item2, topos)
             if isPlayerPzLocked(cid) then
doPlayerSendCancel(cid,"You cannot be teleported when having pz!")

return true
end

But acctually I think somethings missing :p
 
In case you guys want, I could do a detailed explaination of Lua inside a teamviewer meeting today (in a hour or two)

Just sign up here ;3
 
@Vendeliko & Damon:
It isn't just HTML you need a some php experience, too for example for that Mail function.

Anyways, good luck :)
 
In case you guys want, I could do a detailed explaination of Lua inside a teamviewer meeting today (in a hour or two)

Just sign up here ;3

Afraid, no time :/
Why u dont writw a tutorial?
Would be cool :)

@Tosh
I alrdy made smth like this what Vendeliko requested someday haha :p
So I guess I might accomplish the task again :)
 
I'll livestream the thing and put it on my channel. might be useful to watch at anytime.

The Session starts at 15.30.
In approximate 45 min.
 
Those who are going to join and ask questions and stuff will need teamviewer.
I will post here when im starting stream and session

- - - Updated - - -

m47-461-409

That is the teamviewer id:

Also those who just want to watch, Check out twitch.tv/mindrage

- - - Updated - - -

I'm having problem with ports for the livestreaming software, i'll do some screen recording and put it on youtube.

Join the teamviewer meeting incase you want to participate.
 
Lua:
local chance = math.random (1,100)
local storageValue = getPlayerStorageValue(cid, 1000012)
function onUse(cid)
if storageValue ~= 1 then
	if chance <= 30 then
		doTransformItem (item.uid, 1213)
		setPlayerStorageValue(cid,storage,1)
elseif
doSendPlayerAnimatedText (cid, 21, "You cannot got back."

end
end
end

im trying to use math.random ^^ , mindrage really helped. REPP ++ for u sir
 
Vendeliko, if Damon doesn't succeed in completing the request I'll help you out :p but since Damon wants to learn I'll wait till he's done.
Damon, if you have any questions regarding HTML or PHP feel free to PM me.
 
Lua:
local chance = math.random (1,100)
local storageValue = getPlayerStorageValue(cid, 1000012)
function onUse(cid)
if storageValue ~= 1 then
	if chance <= 30 then
		doTransformItem (item.uid, 1213)
		setPlayerStorageValue(cid,storage,1)
elseif
doSendPlayerAnimatedText (cid, 21, "You cannot got back.[B]"[/B]

end
end
end

im trying to use math.random ^^ , mindrage really helped. REPP ++ for u sir
U missed a ) after "

Lua:
local chance = math.random (1,100)
local storageValue = getPlayerStorageValue(cid, 1000012)

function onUse(cid)
	if storageValue ~= 1 then
	if chance <= 30 then
		doTransformItem (item.uid, 1213)
		setPlayerStorageValue(cid,storage,1)
	elseif
		doSendPlayerAnimatedText (cid, 21, "You cannot got back.")
	end
	end
end
 
thx :p also, i got le question, how do u write down when u want to use something on something, like a key on a door

(limos, i didnt understand the message)

SOLVED

started a le picklocking system (i still have to fix stuff, dosent yet work)
 
Last edited:
Keep up the good work guys! Definitely liking the fact that more people are willing to learn scripting/programming.
 
Picklocking System

Actions.xml
Lua:
<action itemid="5941" event="script" value="picklocksystem1.lua"/>

PicklockingSystem.lua
Lua:
---Picklock System
--By XPRIMEX
--A HUUUUUGE thanks to Evan
-- Edit The Ids to your pleasure :P


	function onUse(cid, item, fromPosition, itemEx, toPosition)
		local chance = math.random (1,100)
		if item.itemid == 5941 and itemEx.itemid == 1213 then
			if itemEx.actionid == 1213 then
				if chance <= 50 then
					doTransformItem (itemEx.uid, 1214) ---Door Id
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The door has been unlocked !")
					else
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You failed to pick the lock and broken your pick in the attempt.")
					doPlayerRemoveItem(cid, 5941, 1)
				end
			end
		end
		return true
	end

thanks for helping me out Evan :p

- - - How To Use It :- - -

Place action id 1213 on the item you put in this line :
Lua:
if item.itemid == 5941 and itemEx.itemid == 1213 ---Here

Change this to make the picklocking easire/harder
Lua:
if chance <= 90 then

the doors will relock after it is closed.

REPP ++ Evan + Me if u'll be using it
 
Last edited:
any requests?

also, le picklockin script had a small bug in it ^^ thx limos, should be workin 100% perfectly naw :<

edit : made a request for a guy.

put in talkactions/scripts :
Lua:
local teleportpos = {x=70,y=70,z=7} -- just change this to change the pos
function onSay(cid, item, fromPosition, itemEx, toPosition)
doSendMagicEffect(getPlayerPosition(cid), 2)
doTeleportThing(cid, teleportpos)
end
return true

add to talkactions.xml :
Lua:
<talkaction words="!teleport" script="teleport.lua" />
 
Last edited:
Back
Top