Elite Diviner
- Joined
- Sep 12, 2020
- Messages
- 442
- Reaction score
- 224
Rune Analyzer Item 243520
ok my lua code is not the best but i can do most of the quest myself except the boss fight, anyone understand why this does not work inside the locations it gives ? help would be nice ? but it works with out the check and it should not because you can finish the quest with out going to that location .
Code:function LuaS_243520_USE() local player = OwnerID(); local npc = TargetID(); local QuestID = 427683; local Item1 = 243520; -- delete items local Flag = 549525; -- request local requiredX, requiredY = -965.2, 167.4; -- Replace with the desired X and Y coordinates local radius = 10; -- Set the desired radius local GetPlayerX = requiredX local GetPlayerY = requiredY -- Calculate the distance between the player's location and the target location local distance = math.sqrt((GetPlayerX(player) - requiredX)^2 + (GetPlayerY(player) - requiredY)^2); -- Check if the player is within the specified radius of the target location if TargetID > radius then return false; -- Player is outside the radius, exit the function end if CheckAcceptQuest(player, QuestID) == true then SetFlag(player, Flag, 1); DelBodyItem(player, Item1, 1); if CountBodyItem(player, Item1) == 1 then SetFlag(player, Flag, 1); DelBodyItem(player, Item1, 1); end end return true; end
ok my lua code is not the best but i can do most of the quest myself except the boss fight, anyone understand why this does not work inside the locations it gives ? help would be nice ? but it works with out the check and it should not because you can finish the quest with out going to that location .