|
| 11 Jun 2014 02:58 PM |
So this is a function for showing a message at the top of the screen IMPORTANT: BEFORE the function is called, "Zombie" is picked as only 1 player. What I want is to show one message to all players who are not Zombie, and a different message to only the player who IS zombie.
The Problem: It's showing the zombie messages for all players, not just the one zombie.
-----------------------------------------------------
message = nil
function showMessage(Msg) if message == nil then c = game.Players:GetPlayers() for i = 1, #c do message = c[i]:WaitForChild("PlayerGui"):WaitForChild("GameGui"):WaitForChild("Message") if Msg ~= MsgYouAreHuman or Msg ~= MsgYouAreZombie then message.Image = URL .. Msg -- blah blah unrelated message showing code here elseif Msg == MsgYouAreHuman then if c[i] ~= Zombie then message.Image = URL .. MsgYouAreHuman -- blah blah same unrelated message showing code here end elseif Msg == MsgYouAreZombie then if c[i] == Zombie then message.Image = URL .. MsgYouAreZombie -- blah blah same unrelated message showing code here end end end end message = nil end |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jun 2014 04:03 PM |
| didnt connect the function? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 04:06 PM |
| Did you read the top part or just the script...? -_- |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jun 2014 04:26 PM |
Also how I call it is:
blah blah pick a player, assign them to "Zombie" (I tested it and this part works) showMessage(MsgYouAreHuman) showMessage(MsgYouAreZombie) |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jun 2014 04:55 PM |
I get confused right around here, if Msg ~= MsgYouAreHuman or Msg ~= MsgYouAreZombie then --What are you trying to do and what are MsgYouAreHuman etc. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 04:56 PM |
Convert this:
showMessage(MsgYouAreHuman) showMessage(MsgYouAreZombie)
to this:
showMessage("MsgYouAreHuman") showMessage("MsgYouAreZombie")
In other words, you are calling a variable right now. Use string instead |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 05:03 PM |
No it's supposed to be a variable
They are variables for IDs
only the zombie one is showing though |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 05:03 PM |
| And humans are getting the zombie message when they aren't supposed to |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 05:04 PM |
| Please reveal those vriables or at least describe the type -__- |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 06:05 PM |
The only undefined variables are MsgYouAreHuman and MsgYouAreZombie They both hold a number which is the ID for the image |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jun 2014 06:32 PM |
Haha what did I tell you. Silly mistake.
I needed to change "or" to "and"
Changed "if Msg ~= MsgYouAreHuman or Msg ~= MsgYouAreZombie then" to "if Msg ~= MsgYouAreHuman and Msg ~= MsgYouAreZombie then" and it worked. Yey. |
|
|
| Report Abuse |
|
|