• 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!

Scripting problem

SaxtoN

New Member
Joined
Mar 1, 2010
Messages
81
Reaction score
0
Alright, this is my currently script. Actually never tested it, but as far i can see im pretty sure this will never work.

PHP:
function onStepIn(cid, item, pos)
	if item.uid == 1461 then
		doCreatureSay(cid, "I changed your speed by 200% for 20 seconds.", TALKTYPE_ORANGE_1) 
		 doChangeSpeed(cid, 200)
		 return TRUE	
	end
end

Well, you cann see what the script will do. So im just wondering how can i put a time into that script ?
 
Code:
local config = {
	increment = 200, -- percent
	time = 20 -- seconds
}

local function changeBack(cid)
	doChangeSpeed(cid, getCreatureBaseSpeed(cid))
end

function onStepIn(cid, item, position, fromPosition)
	doCreatureSay(cid, "I changed your speed by " .. config.increment .. "% for " .. config.time .. " seconds.", TALKTYPE_ORANGE_1) 
	doChangeSpeed(cid, getCreatureBaseSpeed(cid) * (config.increment / 100))
	addEvent(changeBack, config.time, cid)
end
 
But with this they can go inside there how many times as they want. Every time they go in the speed change by 200 precent.

Wich mean if i go in there like 5 times i get 1000 faster speed percent.

Also the timer dont work
 
Back
Top