generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: I'm a little new to scripting could i have help?

Previous Thread :: Next Thread 
tik800 is not online. 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
dslink2009 is not online. dslink2009
Joined: 05 Jul 2010
Total Posts: 1108
23 Aug 2011 05:56 PM
Changing the humanoid's name to "zombie" doesn't do anything.
Report Abuse
dslink2009 is not online. dslink2009
Joined: 05 Jul 2010
Total Posts: 1108
23 Aug 2011 05:57 PM
a = game.Players.LocalPlayer

This doesn't work either.
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
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
builderman1171 is not online. builderman1171
Joined: 27 Mar 2010
Total Posts: 1595
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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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 is not online. 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 is not online. 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
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Aug 2011 06:14 PM
Tell me the color of the 'Royal Guards' team.
Report Abuse
tik800 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
23 Aug 2011 06:18 PM
@dark - Just do:

game:service("Teams")["Royal Guards"].TeamColor

:P

-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->-
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
23 Aug 2011 06:19 PM
x.x Thanks. Ugh, I'm exausted. It's been a horribly long day for me.
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
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 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
23 Aug 2011 06:22 PM
Put that script in Workspace.

-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->-
Report Abuse
tik800 is not online. 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
ElectricBlaze is not online. ElectricBlaze
Joined: 18 Jul 2011
Total Posts: 22930
23 Aug 2011 06:25 PM
No problem.


:3

-<-<-<-~~~In Soviet Russia, programs program you.~~~->->->-
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image