johnsamir
Advanced OT User
have never seen something like this this has been made by chatgpt, can a revscript works like an eventcallback?
Lua:
-- Define the name of the script
local scriptName = "PremiumExperienceBonus"
-- Define the callback function for the event
local function onGainExperience(player, experience, rawExperience, source, premium)
if premium then
-- Calculate the bonus experience (10% more)
local bonusExperience = math.ceil(experience * 0.1)
-- Add the bonus experience
player:addExperience(bonusExperience)
-- Inform the player about the bonus experience
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received a 10% bonus experience for being a premium account!")
end
end
-- Register the event callback
experiencemanager.registerCallback(scriptName, onGainExperience)