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

TFS 1.X+ Accuracy of a dystasium attack with a weapon

Michcol94

Member
Joined
Sep 2, 2021
Messages
105
Reaction score
18
Hello. I created a ranged "bullet" weapon without ammunition, everything is beautiful, but how to set the accuracy of the weapon so that it is always 100% on target. Can you do it in Lua ? Do I need to change the source code? Please help I strongly care that the accuracy was 100%.
action/ball.lua
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target and target:isCreature() then
        local damage = math.random(10,50) -- możesz dostosować minimalne i maksymalne obrażenia
        target:addHealth(-damage)
       
        return true
    end
    return false
end
items.xml
XML:
<item id="12662" article="a" name="ball" plural="balls">
    <attribute key="weight" value="500" />
    <attribute key="slotType" value="two-handed" />
    <attribute key="weaponType" value="distance" />
    <attribute key="attack" value="50" />
    <attribute key="range" value="7" />
    <attribute key="shoottype" value="ball" />
    </item>
 
Back
Top