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: Defibrillator Script Broken

Previous Thread :: Next Thread 
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
08 Jun 2012 04:31 PM
This is all in a LocalScript, to get the mouse


script.Parent.Equipped:connect(function(mouse)
    function mouse.Button1Down:connect(function(m)
        if mouse.Target.Parent:findFirstChild("Humanoid") then
            if game.Players:findFirstChild(mouse.Target.Parent.Name).TeamColor == "Bright green" then
                script.Parent.HealSound:Play()
                game.Players:findFirstChild(mouse.Target.Parent.Name).TeamColor == "Bright red"
            end
        end
    end
end)


No output.
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
08 Jun 2012 04:35 PM
Hello? Hello?
I'm different
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
09 Jun 2012 12:00 PM
Skibbidy Bibbidy Bump
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
09 Jun 2012 12:14 PM
Edit:


script.Parent.Equipped:connect(function(mouse)
    mouse.Button1Down:connect(function(m)
        if mouse.Target.Parent:findFirstChild("Humanoid") then
            if game.Players:findFirstChild(mouse.Target.Parent.Name).TeamColor == "Bright green" then
                script.Parent.HealSound:Play()
                game.Players:findFirstChild(mouse.Target.Parent.Name).TeamColor = "Bright red"
            end
        end
    end)
end)



No output.
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
09 Jun 2012 12:18 PM
ehh..
TeamColor == BrickColor
BrickColor != String
Report Abuse
slayer9365 is not online. slayer9365
Joined: 22 Oct 2007
Total Posts: 2312
09 Jun 2012 12:18 PM
If I were you, I would first test for the player existing, then check for the team color being the same. If I remember correctly, the team color is actually a brick color, not a string, so you might need to do .TeamColor == BrickColor.new("Bright Green")
I could be forgetting things though, or it could have changed since the last time I was here.
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
09 Jun 2012 12:20 PM
Editier

script.Parent.Equipped:connect(function(mouse)
    mouse.Button1Down:connect(function(m)
        if m.Parent:findFirstChild("Humanoid") then
            if game.Players:findFirstChild(m.Parent.Name).TeamColor == "Bright green" then
                script.Parent.HealSound:Play()
                game.Players:findFirstChild(m.Parent.Name).TeamColor = "Bright red"
            end
        end
    end)
end)
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
09 Jun 2012 12:26 PM
Made those BrickColor thing changes but still no workie
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
09 Jun 2012 12:30 PM
Help
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
09 Jun 2012 12:49 PM
It's not a string.. It's brickcolor..
The other guy already told you to do
if .BrickColor == BrickColor.new(color) then
Report Abuse
GuideHelper is not online. GuideHelper
Joined: 01 Jun 2011
Total Posts: 1712
09 Jun 2012 12:56 PM
--Made By GuideHelper~~

script.Parent.Equipped:connect(function(mouse)
mouse.Button1Down:connect(function(m)
if m.Parent:findFirstChild("Humanoid") then
if game.Players:findFirstChild(m.Parent.Name).TeamColor == "Bright green" then
script.Parent.HealSound:Play()
game.Players:findFirstChild(m.Parent.Name).TeamColor = "Bright red"
end
Report Abuse
boynedmaster is not online. boynedmaster
Joined: 28 Jun 2008
Total Posts: 9735
09 Jun 2012 01:06 PM
Guide, I tried your script (and added ends) but no workie
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
09 Jun 2012 01:09 PM
I've already told you what to do.
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