Lua Syntax Check :3 menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    AngelSandy's Avatar Member
    Reputation
    19
    Join Date
    Jan 2009
    Posts
    330
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua Syntax Check :3

    *DISCLAIMER*
    No one is permitted to use this system anywhere else as its still in progress and not for release heh (yet? )
    ~ End of Disclaimer


    Sooo I am making a special script which I wont reveal to much about as of yet..can someone do a syntax check on this script? Would be greatly appreciated ^^
    (*NOTE*: Yes all the pets are warlock pets, and they are defined per locals)


    Code:
    local class = pUnit:GetPlayerClass()
    
    function Pet_Choice(pUnit,event)
    
    	class
    	if(class == 1 or 4 or 6) then
    	PetChoice=math.random(1, 2)
    		if PetChoice==1 then
    			pUnit:SpawnCreature(Succubus,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    		elseif PetChoice==2 then
    			pUnit:SpawnCreature(FelGuard,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    	else
    	if(class == 2) then
    	PetChoice2=math.random(1, 2)
    		if PetChoice2==1 then
    			pUnit:SpawnCreature(Succubus,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    		elseif PetChoice2==2 then
    			pUnit:SpawnCreature(FelHunter,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    	else
    	if(class == 3) then
    	PetChoice3=math.random(1, 2)
    		if PetChoice3==1 then
    			pUnit:SpawnCreature(Succubus,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    		elseif PetChoice3==2 then
    			pUnit:SpawnCreature(VoidWalker,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    	else
    	if(class == 5 or 8 or 9) then
    		pUnit:SpawnCreature(FelHunter,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	else
    	if(class == 6 or 7 or 11) then
    		pUnit:SpawnCreature(Imp,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    end
    end
    Again thanks, for anyone who can syntax check it ^^
    Last edited by AngelSandy; 05-03-2009 at 04:03 PM.

    Lua Syntax Check :3
  2. #2
    Scubast3ve's Avatar Member
    Reputation
    55
    Join Date
    Apr 2009
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dear god where did u learn structure, Anyway here is your fixed script:

    Code:
    local class = pUnit:GetPlayerClass()
    
    function Pet_Choice(pUnit,event)
    	if(class == 1 or 4 or 6) then
    		PetChoice=math.random(1, 2)
    		if PetChoice==1 then
    			pUnit:SpawnCreature(Succubus,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		elseif PetChoice==2 then
    			pUnit:SpawnCreature(FelGuard,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		end
    
    	elseif(class == 2) then
    		PetChoice2=math.random(1, 2)
    		if PetChoice2==1 then
    			pUnit:SpawnCreature(Succubus,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		elseif PetChoice2==2 then
    			pUnit:SpawnCreature(FelHunter,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		end
    
    	elseif(class == 3) then
    		PetChoice3=math.random(1, 2)
    		if PetChoice3==1 then
    			pUnit:SpawnCreature(Succubus,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		elseif PetChoice3==2 then
    			pUnit:SpawnCreature(VoidWalker,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		end
    
    	elseif(class == 5 or 8 or 9) then
    		pUnit:SpawnCreature(FelHunter,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    		
    	elseif(class == 6 or 7 or 11) then
    		pUnit:SpawnCreature(Imp,-13209.465820,272.450928,21.857121,4.245078,14,360000)
    	end
    end
    Don't Forget To Give Rep To People Who Help You.

  3. #3
    AngelSandy's Avatar Member
    Reputation
    19
    Join Date
    Jan 2009
    Posts
    330
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Where I learned structure? xD
    I didn't learn it anywhere, thats custom ^^

    You are gonna get +Rep for helping me, but could you highlight what you edited please?
    Last edited by AngelSandy; 05-04-2009 at 02:38 AM.

Similar Threads

  1. [LUA] Check a Spawned unit's HP? Is it possible?
    By controlsx2 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 05-20-2009, 09:57 AM
  2. [Lua][HowTo] Nil Checks, Local, and "And"
    By BrantX in forum WoW EMU Guides & Tutorials
    Replies: 11
    Last Post: 03-25-2009, 06:31 PM
  3. [LUA] will rep <-check real quick
    By Strupantwn in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 06-18-2008, 03:07 AM
  4. [Help] LUA script check it please
    By Strupantwn in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 06-09-2008, 12:52 PM
  5. [Help] Need someone to check LUA script
    By stealthpyro in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-21-2008, 09:50 AM
All times are GMT -5. The time now is 06:35 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search