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

[Help] Skill Chance and getPlayerSex

Shinmaru

エロルアー Scripter!
Joined
Aug 20, 2007
Messages
1,988
Reaction score
88
Location
Puerto Rico
I would like to know how can i make a chance variation for a skill, which is "Mining", i would like to make it that the higher the skill is the more chance on mining something out of the rocks the player will have, also i have a problem with getPlayerSex and it does not seem to work, I use TFS 0.3.5 and i was thinking if anyone can make a custom script that does the same thing with out using getPlayerSex function(since it does not work). Well Thanks for reading and for your help.
 
For mining just use storage values, to check if getPlayerSex works just do print(getPlayerSex(cid)) in some simple onUse script.
 
LUA:
local t;
local y = true;
for chance = 0, 100-getPlayerStorageValue(cid,MINING_SKILL)
t = math.random(100);
if(t<(100-getPlayerStorageValue(cid,MINING_SKILL))) then
y= false;
break;
end
end

if y then
--Give Item
else
--Kill Player
end
 
Code:
local t;
local y = true;
[B][COLOR="Red"]for chance = 0, 100-getPlayerStorageValue(cid,MINING_SKILL) do[/COLOR][/B]
t = math.random(100);
if(t<(100-getPlayerStorageValue(cid,MINING_SKILL))) then
y= false;
break;
end
end

if y then
--Give Item
else
--Kill Player
end
'do'
 
Back
Top