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: simple script not working...

Previous Thread :: Next Thread 
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 02:55 PM
function player()
local p = Script.Parent.Parent.Parent.Character:FindFirstChild("Humanoid")
if p.TeamColor == BrickColor.new("White") then
p.MaxHealth = math.huge
p.Health = p.MaxHealth
script.Parent.Parent.Parent.OuterGui.Visible = false
script.Parent.Parent.Visible = false
end
end
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
07 Aug 2012 02:56 PM
function player()
local p = Script.Parent.Parent.Parent.Character:findFirstChild("Humanoid") -- LC
if p.TeamColor == BrickColor.new("White") then
p.MaxHealth = math.huge
p.Health = p.MaxHealth
script.Parent.Parent.Parent.OuterGui.Visible = false
script.Parent.Parent.Visible = false
end
end
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
07 Aug 2012 02:57 PM
Brain fart forget what I said
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
07 Aug 2012 02:58 PM
Wheres the connection line?
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 02:59 PM
what connection line
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 03:01 PM
bump
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
07 Aug 2012 03:01 PM
oh god.

Is a a ontouched?
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 03:03 PM
it's not working because you have no connection line!!!!!!!!!!!
Report Abuse
coldmillionare is not online. coldmillionare
Joined: 13 Feb 2010
Total Posts: 10560
07 Aug 2012 03:04 PM
game.Players.PlayerAdded:connect(function(player())
local p = Script.Parent.Parent.Parent.Character:FindFirstChild("Humanoid")
if p.TeamColor == BrickColor.new("White") then
p.MaxHealth = math.huge
p.Health = p.MaxHealth
script.Parent.Parent.Parent.OuterGui.Visible = false
script.Parent.Parent.Visible = false
end
end

Maybe this will work?
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 03:04 PM
It's a gui you get when you enter the game, and when you press play you're suppose to get infinite health, change teams, and get teleported to somewhere. right now i'm working on just getting rid of the gui when you press play...
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
07 Aug 2012 03:05 PM
well in that case you still need a connection line....
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 03:08 PM
what's a connection line...
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
07 Aug 2012 03:08 PM
script.Parent.MouseButton1Click:connect(player)

Put that at the bottom of the script and it should work.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 03:09 PM
ooh, never knew the name of a connection line, lol.
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
07 Aug 2012 03:10 PM
A connection line is what connects an event to a function. In this case the event would be the button being clicked once. (MouseButton1Click)
So
script.Parent -- Referring to the button its inside
script.Parent.MouseButton1Click -- When its clicked once, fires the function
script.Parent.MouseButton1Click:connect(player) -- Connects the event to the function you want to happen when it is clicked once.
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
07 Aug 2012 03:23 PM
Maybe since p goes to humanoid it checks for children of humanoid or something? help qq this is irritating
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