spAik Posted August 25, 2013 Posted August 25, 2013 Hi, I am trying to adjust a respawn-script to my needs. Its arezus training script. Now i want the client to be able to leave this modus and start spectating again... therefor i tried to use the following command: function spectator() clientCall(getLocalPlayer(), "Spectate.start", 'manual' ) end My question. Is this even the right command to make the client spectate other players?
EstrategiaGTA Posted August 25, 2013 Posted August 25, 2013 Can you post the full code so we know if that is the right?
spAik Posted August 25, 2013 Author Posted August 25, 2013 addEventHandler("onClientPlayerWasted", getLocalPlayer(), function() if(source ~= getLocalPlayer())then return end reset = true setElementData(getLocalPlayer(), "respawn.playing", false, true) setTimer(function() local statea = getElementData(getLocalPlayer(), "hunterarea.playing") if statea then setElementData(getLocalPlayer(), "hunterarea.playing", false, true) unbindKey("mouse1", "down", cdoshoot) unbindKey("lshift", "down", cdjump) unbindKey("lalt", "down", cdspeed) end end,1500,1) setTimer(function() --local state = getElementData(getLocalPlayer(), "respawn.playing") or true if(running)then showRespawn = true setElementData(getLocalPlayer(), "respawn.playing", false, true) bindKey(RESPAWN_KEY, "up", respawn) bindKey(SPECTATE_KEY, "up", spectator) end end, 3000, 1) end) local me = getLocalPlayer() function spectator() clientCall(me, "Spectate.start", 'manual' ) end
spAik Posted August 28, 2013 Author Posted August 28, 2013 someone have an idea how to call spectator mode manually?
Moderators IIYAMA Posted August 28, 2013 Moderators Posted August 28, 2013 addEventHandler("onClientPlayerWasted", getLocalPlayer(),function() if(source ~= getLocalPlayer())then return end Why check the local player, when he is the only player that can execute the event? function manualSpectate() bindKey(SPECTATE_KEY, "up", spectator) end Something like this or what?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now