Making the player face a certain direction menu

User Tag List

Results 1 to 5 of 5
  1. #1
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making the player face a certain direction

    Hey, I'm trying to get a player to face a certian direction but for some reason the script doesen't seem to work. I believe it is because I'm not setting the player to the pPlayer variable but I'm not exactly sure how. If anyone sees where I made my mistake the help is welcomed.

    Code:
    function Teleport_FirstEnterWorld(pPlayer, Event) -- Remember to rename from teleport to change orentation
    	local race = pPlayer:GetPlayerRace()
    	if (race == 1) then
    		pPlayer:SetFacing(2.034960)
    		pPlayer:SendChatMessage(12, 7, "Glory to the Alliance!")
    RegisterServerHook(3, "Teleport_FirstEnterWorld")
    It is supposed to make the player face the orentation 2.034960 when he/she enters the game for the first time, this is because my playercreateinfo table doesen't have a field for orentation. The "Glory to the Alliance!" part is just for me to see that the script is working, so far it isn't. (This is just for human characters.)
    Last edited by tyeeeee1; 03-08-2012 at 09:27 PM.

    Making the player face a certain direction
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    A variable name makes no difference what so ever.

    Try this:

    pPlayer:SetPosition(pPlayer:GetX(), pPlayer:GetY(), pPlayer:GetZ(), 2.034960)

  3. #3
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesen't seem to work either. I've done a bit more testing by changing the orentation number to say 1, 3, 40, 60, etc... but the player always no matter what the number is faces the exact same spot. I'm going to think a bit more on this because without the script the player always faces a different direction on spawn, but with the script they always face the same direction.
    The orentation the player faces upon spawn every single time at the moment is around 6.

    Also, just so I can understand scripts a bit more. Does the line "function Teleport_FirstEnterWorld(pPlayer, Event)" combined with "RegisterServerHook(3, "Teleport_FirstEnterWorld")" tell the game that the player that is entering the world for the first time ever is pPlayer?
    Last edited by tyeeeee1; 03-09-2012 at 09:45 AM.

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Well what I posted just there worked fine for me, so /shrug.

    The hook listens for players entering the world which has the 'FirstLogin' field in the characters database flagged. When it detects a player with this flag, it fires the event, and all the hooks listening for this event will be triggered. The event carries two parameters - the player who triggered the event, and the event ID (in this case the event ID would be 3).

    Variables can be called anything you want, because it is a variable. It could be:

    function footballloggedin(Football, Lol)
    Football:SetPosition...
    end

  5. #5
    tyeeeee1's Avatar Member
    Reputation
    6
    Join Date
    Feb 2008
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It must be something on my end then, thanks for the help.
    Last edited by tyeeeee1; 03-09-2012 at 11:05 AM.

Similar Threads

  1. What sequence of Toys/Pots can make your player model the largest?
    By Monarlais in forum World of Warcraft General
    Replies: 1
    Last Post: 06-10-2016, 09:26 PM
  2. Replies: 0
    Last Post: 08-18-2014, 07:53 PM
  3. [ArcEmu] How to make your player start out in a certain faction
    By Samboychip4 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 06-10-2010, 09:44 PM
  4. Replies: 7
    Last Post: 12-19-2009, 11:45 AM
  5. How to make the darkmoon card: blue dragon proc without casting
    By Matt in forum World of Warcraft Guides
    Replies: 1
    Last Post: 04-17-2006, 05:17 AM
All times are GMT -5. The time now is 04:01 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