Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

rboeger93

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

rboeger93's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. yeah, I want to know if there is a way to turn a string variable into a numeric variable. ex: lets say variable "string" = "12", "12" is a string variable, is it possible to turn that "12" into 12? or would I have to manually code it like``` if string = "12" then numeric = 12 end if ``` ty for whoever can help me or try to help me :)
  2. I am getting subscript out of range but I dont know why, this is my code. ``` Sub HotScript(Index, KeyID) Select Case KeyID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Executes when any player presses the PageUp key. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case 1 if skillwait = 0 then call dmgskill(index, 100, "damage skill") skillwait = 1 call settimer("skilldelay " & index, 5000) else call battlemsg(index, "You must wait to use that skill!", brightred, 0) end if ' Executes when any player presses the Delete key. Case 2 Call AreaEffect(index, 2, getplayermap(index)) ' Executes when players press the End key. Case 3 ' Executes when players press the PageDown key. Case 4 End Select End Sub sub dmgskill(Index, Damage, skillname) Dim npcnum Dim target dim npcx dim npcy dim playx dim playy npcnum = GetPlayerTargetNPC(Index) npcx = getnpcx(getplayermap(index), npcnum) npcy = getnpcy(getplayermap(index), npcnum) playx = getplayerx(index) playy = getplayery(index) if getplayerdir(index) = 0 then if playx = npcx or playx = getplayerx(getplayertarget(index)) then if playy - 1 = npcy or playy - 1 = getplayery(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy - 1) else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy - 1) end if end if end if elseif getplayerdir(index) = 1 then if playx = npcx or playx = getplayerx(getplayertarget(index)) then if playy + 1 = npcy or playy + 1 = getplayery(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy + 1) else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy + 1) end if end if end if elseif getplayerdir(index) = 2 then if playy = npcy or playy = getplayery(getplayertarget(index)) then if playx - 1 = npcx or playx - 1 = getplayerx(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx - 1, playy(index)) else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx - 1, playy) end if end if end if else if playy = npcy or playy = getplayery(getplayertarget(index)) then if playx + 1 = npcx or playx + 1 = getplayerx(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx + 1, playy) else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx + 1, playy) end if end if end if end if call battlemsg(index, "You have used " & skillname & "!", white, 0) call battlemsg(target, skilname & " has been used on you!", red, 0) End Sub sub skilldelay(index) skillwait = 0 call battlemsg(index, "You can now use " & skillname & "!", white, 0) call removetimer("skilldelay " & index) end sub ```
  3. well, Ive only tried it on npcs as of now.but it used to work fine on npcs, but once I added the do while loop, it stopped working. edit: hmmmm I have no idea whats wrong with it. I've looked it over multiple times but it wont work. oh and wulf, It turns out I already changed the target and everything later on in the script, so its fine.
  4. ok ty for the advice, ill be sure to change that. but is that why its not working? like as of right now, it wont even attack anyone, npc nor player. but it worked before I attempted the stun part of it. so its probably something with the changing direction. maybe I forgot to do something, Iunno. but I will try changing the dims.
  5. im using ee 2.7 and shadowwulf, those are just defining the dim statements.
  6. ok I wrote a script that will basically be an alternate attack that will hit a player and make them spin rapidly to make them stunned and dizzy. I got everything to work fine except for when I tried to make players be "stunned". can you please tell me what I did wrong? ``` sub stun(Index, Damage) Dim npcnum Dim target dim npcx dim npcy dim playx dim playy dim stuntime npcnum = GetPlayerTargetNPC(Index) npcx = getnpcx(getplayermap(index), npcnum) npcy = getnpcy(getplayermap(index), npcnum) playx = getplayerx(index) playy = getplayery(index) stuntime = 0 if getplayerdir(index) = 0 then if playx = npcx or playx = getplayerx(getplayertarget(index)) then if playy - 1 = npcy or playy - 1 = getplayery(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy - 1) do while stuntime < 50 stuntime = stuntime + 1 select case getplayerdir(target) case 0 call setplayerdir(target, 1) call sendplayerdata(target) case 1 call setplayerdir(target, 2) call sendplayerdata(target) case 2 call setplayerdir(target, 3) call sendplayerdata(target) case else call setplayerdir(target, 0) call sendplayerdata(target) end select call settimer("stuntimer " & index, 100) loop else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy - 1) end if end if end if elseif getplayerdir(index) = 1 then if playx = npcx or playx = getplayerx(getplayertarget(index)) then if playy + 1 = npcy or playy + 1 = getplayery(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy + 1) do while stuntime < 50 stuntime = stuntime + 1 select case getplayerdir(target) case 0 call setplayerdir(target, 1) call sendplayerdata(target) case 1 call setplayerdir(target, 2) call sendplayerdata(target) case 2 call setplayerdir(target, 3) call sendplayerdata(target) case else call setplayerdir(target, 0) call sendplayerdata(target) end select call settimer("stuntimer " & index, 100) loop else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), playx, GetNpcY(GetPlayerMap(index), npcnum)) Call SpellAnim(4, GetPlayerMap(index), playx, playy + 1) end if end if end if elseif getplayerdir(index) = 2 then if playy = npcy or playy = getplayery(getplayertarget(index)) then if playx - 1 = npcx or playx - 1 = getplayerx(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx - 1, playy(index)) do while stuntime < 50 stuntime = stuntime + 1 select case getplayerdir(target) case 0 call setplayerdir(target, 1) call sendplayerdata(target) case 1 call setplayerdir(target, 2) call sendplayerdata(target) case 2 call setplayerdir(target, 3) call sendplayerdata(target) case else call setplayerdir(target, 0) call sendplayerdata(target) end select call settimer("stuntimer " & index, 100) loop else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx - 1, playy) end if end if end if else if playy = npcy or playy = getplayery(getplayertarget(index)) then if playx + 1 = npcx or playx + 1 = getplayerx(getplayertarget(index)) then if getplayertarget(index) > 0 then target = getplayertarget(index) call damageplayer(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx + 1, playy) do while stuntime < 50 stuntime = stuntime + 1 select case getplayerdir(target) case 0 call setplayerdir(target, 1) call sendplayerdata(target) case 1 call setplayerdir(target, 2) call sendplayerdata(target) case 2 call setplayerdir(target, 3) call sendplayerdata(target) case else call setplayerdir(target, 0) call sendplayerdata(target) end select call settimer("stuntimer " & index, 100) loop else target = getplayertargetnpc(index) call damagenpc(index, target, damage) Call SpellAnim(4, GetPlayerMap(index), GetNpcX(GetPlayerMap(index), npcnum), playy) Call SpellAnim(4, GetPlayerMap(index), playx + 1, playy) end if end if end if end if End Sub sub stundelay(index) stunwait = 0 call battlemsg(index, "You can now use Stun!", white, 0) call removetimer("stundelay " & index) end sub sub stuntimer(index) call removetimer("stuntimer " & index) end sub ``` that is my sub for the attack. and I call it like this: ``` Sub HotScript(Index, KeyID) Select Case KeyID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Executes when any player presses the PageUp key. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case 1 'STUN ATTACK CALLED! if stunwait = 0 then Call stun(Index, 5) call battlemsg(index, "You have used Stun!", white, 0) stunwait = 1 call settimer("stundelay " & index, 5000) else call battlemsg(index, "You must wait to use that skill!", brightred, 0) end if 'STUN ATTACK ENDED! ' Executes when any player presses the Delete key. Case 2 Call AreaEffect(index, 2, getplayermap(index)) ' Executes when players press the End key. Case 3 ' Executes when players press the PageDown key. Case 4 End Select End Sub ``` if you find something wrong can you please tell me? ty :)
  7. does anyone know the key id for directional keys? I need them to make a stun script based on movement. ty in advance. :)
  8. I scripted this as a secondary attack for the ninja class. as of right now it is just a regular attack, but I am going to add stuff to it. however, it doesn't work. please tell me what's wrong with it. ``` '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 'ALTERNATIVE ATTACK - SMITE '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub Smite(Index, Damage, getplayermap(index)) Dim npcnum Dim Target dim npcx dim npcy dim plyrx dim plyry dim hitper npcnum = GetPlayerTargetNPC(Index) npcx = getnpcx(getplayermap(index), npcnum) npcy = getnpcy(getplayermap(index), npcnum) playx = getplayerx(index) playy = getplayery(index) hitper = rand(0, 9) if getplayerdir(index) = 0 then if playx = npcx then if playy + 1 = npcy then target = getplayertarget(index) call damageplayer(index, target, damage) end if end if elseif getplayerdir(index) = 1 then if playx = npcx then if playy - 1 = npcy then target = getplayertarget(index) call damageplayer(index, target, damage) end if end if elseif getplayerdir(index) = 2 then if playy = npcy then if playx - 1 = npcx then target = getplayertarget(index) call damageplayer(index, target, damage) end if end if elseif getplayerdir(index) = 3 then if playy = npcy then if playx + 1 = npcx then target = getplayertarget(index) call damageplayer(index, target, damage) end if end if else call playermsg(index, "WTF NOOB!!!11", red) end if ``` I am calling it in hotscript 1 ``` Sub HotScript(Index, KeyID) Select Case KeyID '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ' Executes when any player presses the PageUp key. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Case 1 Call Smite(Index, Damage, getplayermap(index)) Call PlaySound(Index, "Magic15.wav") ' Executes when any player presses the Delete key. Case 2 Call AreaEffect(index, 2, getplayermap(index)) ' Executes when players press the End key. Case 3 ' Executes when players press the PageDown key. Case 4 End Select End Sub ```
  9. Hey everyone! My name is rj and I am just starting off as a mapper. I'm not the best but I will try hard and I'm free. if you would like to talk to me, IM me on aim(Ryono172) or msn([email protected]). oh btw, I also can script, I took a class on visual basic last year, so if you need a scripter i'm here aswell.
  10. can u give me the command for it?
  11. is it possible to target every player and/or monster on the current map? I am trying to make an area effect script.
  12. oh wow dude ty! I forgot about cases lol.
  13. hey, I have no Idea why this will not work. I tried to make a scripted item that when u use it, it displays a spell animations on every x and y coordinate on the map; basicly a prototype for area effect spell animation. ``` sub AreaEffect(index, spellanimation) dim xquar dim yquar xquar = 0 yquar = 0 do while xquar yquar then if yquar = 14 then xquar = xquar + 1 else yquar = yquar + 1 end if elseif yquar > xquar then xquar = xquar + 1 else xquar = xquar + 1 end if loop end sub ``` that is my sub and this is what I used to call it up: ``` Sub ScriptedItem(Index, Script) Select Case Script Case 0 Call PlayerMsg(Index, "This scripted item has no apparent use.", WHITE) Exit Sub Case 1 dim spellanimation spellanimation = 2 Call AreaEffect(index, spellanimation) Case Else Call PlayerMsg(Index, "No item script found. Please contact an admin to solve this problem.", WHITE) Exit Sub End Select End Sub ``` I used Case 1 btw. Anyway, I have no idea why it doesn't work, if you know reply back :P
×
×
  • Create New...