Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Npc Targeting
#7
find where it targets the player when you click on them. copy that paste it where it should be and change to NPC. IT really help me if i saw the code though.

like for example, 4.6 code sorry ^^ but basically find something close to this in the player

Code:
' Change target
            TempPlayer(Index).Target = i
            TempPlayer(Index).TargetType = TARGET_TYPE_PLAYER
            Call PlayerMsg(Index, "Your target is now " & GetPlayerName(i) & ".", Yellow)

//npc// for 4.6
Code:
' Check for an npc
    For i = 1 To MAX_MAP_NPCS
        If MapNpc(GetPlayerMap(Index), i).Num > 0 Then
            If MapNpc(GetPlayerMap(Index), i).x = x And MapNpc(GetPlayerMap(Index), i).y = y Then
                ' Change target
                TempPlayer(Index).Target = i
                TempPlayer(Index).TargetType = TARGET_TYPE_NPC
                Call PlayerMsg(Index, "Your target is now a " & Trim$(Npc(MapNpc(GetPlayerMap(Index), i).Num).Name) & ".", Yellow)
                Exit Sub
            End If


TempPlayer(Index).Target = i changes the target selected

TempPlayer(Index).TargetType = TARGET_TYPE_NPC changes the target type to npc so it doesn't show up as a player haha ^^

Call PlayerMsg(Index, "Your target is now " & Trim$(Npc(MapNpc(GetPlayerMap(Index), i).Num).Name) & ".", Yellow) calls the message that says "Your target is now npc1.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)