It looks way too messy
Yeah of course it works, is only missing the speed/light/regen attributes and the supress thing which I think it can't be done in a "good" way.
Honestly I don't think I should update it lol. Maybe I'll do it one day, sorry
Lua Script Error: [Event Interface]
data/events/scripts/creature.lua:Creature@onChangeOutfit
data/events/scripts/creature.lua:24: attempt to index global 'oldOutfit' (a nil value)
stack traceback:
[C]: in function '__index'
data/events/scirpts/creature.lua:24: in function <data/events/scripts/creature.lua:23>
[C]: in function 'setOutfit'
data/creaturescripts/scripts/others/login.lua:91: in function <data/creaturescripts/scripts/others/login.lua:48>
Creature: onChangeOutfit executes when a creature's outfit changes.
Therefore, you'd have to change your outfit to receive the bonus.
Executing player:setOutfit(player:getOutfit()) as they login executes Creature: onChangeOutfit. This sets the outfit bonus when they login.
Red
But it's not a hack, it's how it's supposed to be.
You should get the bonuses when loggin in (if you logged out with an outfit that receive bonuses)
@Colors how can i change/ add the bonuses to this system i added it and it gave no erroe but it's not giving any bonuses either
i would be very greatful for any help
did all that here is the script i just dont know how to add the bonuses to the outfitsMake sure you registered the events in login.lua and if you added the system while the server is online and used /reload, you have to make sure you log out then back in to register the event. If you're still having issues, post your script here
local hp = Condition(CONDITION_ATTRIBUTES)
hp:setParameter(CONDITION_PARAM_TICKS, -1)
hp:setParameter(CONDITION_PARAM_SUBID, 100)
hp:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 300)
local distance = Condition(CONDITION_ATTRIBUTES)
distance:setParameter(CONDITION_PARAM_TICKS, -1)
distance:setParameter(CONDITION_PARAM_SUBID, 101)
distance:setParameter(CONDITION_PARAM_SKILL_DISTANCEPERCENT, 150)
local sword = Condition(CONDITION_ATTRIBUTES)
sword:setParameter(CONDITION_PARAM_TICKS, -1)
sword:setParameter(CONDITION_PARAM_SUBID, 102)
sword:setParameter(CONDITION_PARAM_SKILL_SWORDPERCENT, 150)
oldOutfit = {}
outfitBonuses = {
[128] = {[1] = {condition = distance}, [2] = {condition = sword}, [3] = {condition = hp}},
[129] = {[3] = {condition = hp}},
[130] = {[3] = {condition = {distance, sword, hp}}}
}
function Creature:onChangeOutfit(outfit)
if self:isPlayer() then
local getOutfit = self:getOutfit()
oldOutfit[self:getId()] = { --Colors (Head, Body, Legs, Feet) and lookTypeEx are unused, but I still keep them here because I'm stupid.
lookHead = getOutfit.lookHead;
lookBody = getOutfit.lookBody;
lookLegs = getOutfit.lookLegs;
lookFeet = getOutfit.lookFeet;
lookType = getOutfit.lookType;
lookTypeEx = getOutfit.lookTypeEx;
lookAddons = getOutfit.lookAddons;
lookMount = getOutfit.lookMount;
}
local old = oldOutfit[self:getId()]
local oldOutfit_t = outfitBonuses[old.lookType]
if oldOutfit_t and oldOutfit_t[old.lookAddons] then
local oldCondition = oldOutfit_t[old.lookAddons].condition
if type(oldCondition) == "table" then
for _, condition in pairs(oldCondition) do
self:removeCondition(condition:getType(), condition:getId(), condition:getSubId())
end
else
self:removeCondition(oldCondition:getType(), oldCondition:getId(), oldCondition:getSubId())
end
end
local currentOutfit = outfitBonuses[outfit.lookType]
if currentOutfit and currentOutfit[outfit.lookAddons] then
local newCondition = currentOutfit[outfit.lookAddons].condition
if type(newCondition) == "table" then
for _, condition in pairs(newCondition) do
self:addCondition(condition)
end
else
self:addCondition(newCondition)
end
end
end
return true
end
function Creature:onAreaCombat(tile, isAggressive)
return true
end
local function removeCombatProtection(cid)
local player = Player(cid)
if not player then
return true
end
local time = 0
if player:isMage() then
time = 10
elseif player:isPaladin() then
time = 20
else
time = 30
end
player:setStorageValue(Storage.combatProtectionStorage, 2)
addEvent(function(cid)
local player = Player(cid)
if not player then
return
end
player:setStorageValue(Storage.combatProtectionStorage, 0)
player:remove()
end, time * 1000, cid)
end
function Creature:onTargetCombat(target)
if not self then
return true
end
if target:isPlayer() then
if self:isMonster() then
local protectionStorage = target:getStorageValue(Storage.combatProtectionStorage)
if target:getIp() == 0 then -- If player is disconnected, monster shall ignore to attack the player
if protectionStorage <= 0 then
addEvent(removeCombatProtection, 30 * 1000, target.uid)
target:setStorageValue(Storage.combatProtectionStorage, 1)
elseif protectionStorage == 1 then
self:searchTarget()
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
return true
end
if protectionStorage >= os.time() then
return RETURNVALUE_YOUMAYNOTATTACKTHISPLAYER
end
end
end
return true
end
Nothing it's like it's not even added
i used citizens and mage outfit and neither had any effect on my stats or displayed any notification i have all addons i have tried with each addon seperatealright, first of all, which outfit are you switching to? the effects are based on which addon you have on as well as the outfit, so if you switch to citizen male (128) and have only addon 1, you'll get distance skill, if only addon 2, sword skill, if both addons, health, if no addons, no bonus. 129 and 130 (hunter and mage) will only work if you have both addons on
i used citizens and mage outfit and neither had any effect on my stats or displayed any notification i have all addons i have tried with each addon seperate
sorry i dont i havn't even a idea what team viewer isThis is a tough one to troubleshoot, do you have teamviewer? If so, pm me with partner id and password and I'll get you up and running.
ahh no thanks i better not i dont understand the program enough to use it it would be as much trouble to fix the script as to learn to set up another program lolit's software for remote desktop control, allows me to control your mouse, etc. and manually do things for you. Much easier than trying to identify a problem when there's no errors in the console www.teamviewer.com if you'd like to give it a try
local hp = Condition(CONDITION_ATTRIBUTES)
hp:setParameter(CONDITION_PARAM_TICKS, -1)
hp:setParameter(CONDITION_PARAM_SUBID, 100)
hp:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 300)