Kownikuzyt
Member
- Joined
- Feb 11, 2020
- Messages
- 170
- Solutions
- 1
- Reaction score
- 8
Hello, I searched the forum for a script on !Cast + 20% exp.
I noticed the topic: experience cast open (https://otland.net/threads/experience-cast-open.261391/)
I got 55 exp from a monster and with this script I get 5 exp.
Code: data/talkactions/scripts/cast.lua
Code: /home/ots/data/events/scripts/player.lua
I noticed the topic: experience cast open (https://otland.net/threads/experience-cast-open.261391/)
I got 55 exp from a monster and with this script I get 5 exp.
Code: data/talkactions/scripts/cast.lua
Lua:
storage = 17754
function onSay(player, words, param)
if param == 'on' then
if player:startLiveCast() then
player:setStorageValue(storage, 1)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have started casting your gameplay.")
else
player:sendCancelMessage("You're already casting your gameplay.")
end
elseif param == 'off' then
if player:stopLiveCast() then
player:setStorageValue(storage, 0)
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have stopped casting your gameplay.")
else
player:sendCancelMessage("You're not casting your gameplay.")
end
end
return false
end
Code: /home/ots/data/events/scripts/player.lua
Lua:
function Player:onGainExperience(source, exp, rawExp)
if not source or source:isPlayer() then
return exp
end
local multiplier = 1.2
if player:getStorageValue(17754) == 1 then
exp = exp * multiplier
end