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: Why doesn't this work?

Previous Thread :: Next Thread 
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
10 Sep 2012 04:00 PM
BadgeId = 92417793
local h = script.Parent.Parent.Parent.Parent.Parent
function onButtonClicked()
if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
h.TeamColor=BrickColor.new("Bright red")
h.Humanoid.Health = 0
wait()
end
end)

script.Parent.MouseButton1Click:connect(onButtonClicked)


Suppose to make it so when you press the gui, If you have a certain badge then you die and your team goes to bright red.
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
10 Sep 2012 04:02 PM
Never defined p
Report Abuse
eJorge is not online. eJorge
Joined: 09 Jun 2011
Total Posts: 5966
10 Sep 2012 04:04 PM
'p' is not defined, and 'h' isn't defined properly either.

I think you mean this:

BadgeId = 92417793
local p = script.Parent.Parent.Parent.Parent.Parent --Check the hierarchy, it should be the Player instance
local h = p.Character
function onButtonClicked()
if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
h.TeamColor=BrickColor.new("Bright red")
h.Humanoid.Health = 0
wait()
end
end)

script.Parent.MouseButton1Click:connect(onButtonClicked)
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
10 Sep 2012 04:14 PM
Doesn't work, I checked parents
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
10 Sep 2012 04:22 PM
bump
Report Abuse
BobbyisLOLZ is not online. BobbyisLOLZ
Joined: 17 Aug 2010
Total Posts: 8045
10 Sep 2012 04:25 PM
... Then change the parents to the correct amount..
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
10 Sep 2012 04:27 PM
They are at the right amount
Report Abuse
epicpatrick123 is not online. epicpatrick123
Joined: 08 Sep 2010
Total Posts: 15039
10 Sep 2012 07:16 PM
bump help
Report Abuse
mamaguy is not online. mamaguy
Joined: 07 Oct 2010
Total Posts: 7073
10 Sep 2012 07:18 PM
*Claps for bobby*
Most helpful person EVER!
[/sarcasm]
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