tik800
|
  |
| Joined: 04 Feb 2010 |
| Total Posts: 104 |
|
|
| 23 Aug 2011 05:50 PM |
OK so i've been going down these threads and i still need help i made my own script but that one didn't work so i asked for help and then i got this
function onTouched(hit)
a = game.Players.LocalPlayer if a.Character:findFirstChild("Zombie") == nil then a.Character.Humanoid.Name = "Zombie" else end end
script.Parent.Touched:connect(onTouched)
What's suppose to happen is that when you spawn it changes your humanoid to zombie, well i do what that but i want it if your on a certain team so if your on royal guards team then you have the zombie for a humnoid but if your on the raiders team your name is just humanoid
Cuz theres some royal guards that are robot and i don t whant them to attack you if your on the royal guards team :) PLEASE HELP! |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 05:56 PM |
| Changing the humanoid's name to "zombie" doesn't do anything. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 05:57 PM |
a = game.Players.LocalPlayer
This doesn't work either. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 05:58 PM |
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) char.Humanoid.Name = "Zombie" end) end) |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 05:58 PM |
@ds, don't post about what you don't know.
LocalPlayer allows you to access the player ONLY in LocalScripts.
Example
--Inside GUI
script.Parent.Text = game.Players.LocalPlayer.Name |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:01 PM |
I looked at your code, you have it all wrong, try this, it's written from the back of my hands...
function newPlayer(newPlayer)
if newPlayer.Character:findFirstChild("Zombie") == nil then human = newPlayer.Character:findFirstChild("Humanoid") human.Name = "Zombie" end
end
game.Players:ChildAdded:connect(function(newPlayer))
Now, I do realise your a new ROBLOXian, so I coded it easier, which means it might break, cause im used to writing the more advance way (Force of habbit), so if it doesn't work, post the code in Scripting Helpers for somone like Crazyman32 to fix, or Blocco, or someone... |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:02 PM |
@ Dark,
Your code will not work.
You have 2 end)'s which I only saw one Ananymous function. Actually, now to think of it, I think I didn't even see an Ananymous func... |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:05 PM |
@builder - His code definitely will work. Please do not post things about things you do not know yourself. Thank you.
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:08 PM |
| builder, read the first 2 lines of my code. Unless you're unable to read(in which you probably shouldn't be in this forum), or you're blind, you should most definitely see 2 anonomous function. |
|
|
| Report Abuse |
|
|
tik800
|
  |
| Joined: 04 Feb 2010 |
| Total Posts: 104 |
|
|
| 23 Aug 2011 06:10 PM |
"bumb"
i need the script only works if your on the royal guards team
well on certain team |
|
|
| Report Abuse |
|
|
tik800
|
  |
| Joined: 04 Feb 2010 |
| Total Posts: 104 |
|
|
| 23 Aug 2011 06:12 PM |
I need the the script to work if your on the royal guards team if your on a different team then your humanoid name is not changed to zombie |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:14 PM |
| Tell me the color of the 'Royal Guards' team. |
|
|
| Report Abuse |
|
|
tik800
|
  |
| Joined: 04 Feb 2010 |
| Total Posts: 104 |
|
|
| 23 Aug 2011 06:15 PM |
Red it's red the i can't remeber it's not bright red let me check |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:18 PM |
@dark - Just do:
game:service("Teams")["Royal Guards"].TeamColor
:P
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:19 PM |
| x.x Thanks. Ugh, I'm exausted. It's been a horribly long day for me. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:19 PM |
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(char) if p.TeamColor == game:service("Teams")["Royal Guards"].TeamColor then char.Humanoid.Name = "Zombie" end) end)
|
|
|
| Report Abuse |
|
|
tik800
|
  |
| Joined: 04 Feb 2010 |
| Total Posts: 104 |
|
|
| 23 Aug 2011 06:20 PM |
Ok the team color is bright red sorry
um.. could you tell me the script and where to put it?
Thanks guys :) |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:22 PM |
Put that script in Workspace.
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|
tik800
|
  |
| Joined: 04 Feb 2010 |
| Total Posts: 104 |
|
|
| 23 Aug 2011 06:24 PM |
THANK YOU SOOOO MUCH!!!!!!!! i hope the script works i know it wil!!!!! |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2011 06:25 PM |
No problem.
:3
-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->- |
|
|
| Report Abuse |
|
|