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: 8 lines long script that I fear won't work.

Previous Thread :: Next Thread 
CrossArms is not online. CrossArms
Joined: 27 Feb 2011
Total Posts: 2654
16 Jan 2012 01:35 AM
[ Content Deleted ]
Report Abuse
camrocks918 is not online. camrocks918
Joined: 18 Nov 2010
Total Posts: 3298
16 Jan 2012 01:38 AM
Not exactly sure but


"function onTouch(toucher)

game.Workspace.toucher.Health = game.Workspace.toucher.Health +50
Script.parent.BrickColor = BrickColor.new("Black")
wait(10)
Script.parent.BrickColor = BrickColor.new("Lime green")
Script.Parent.Touched:connect(onTouched)
end "

That probably has something worg with it aswell :c

Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
16 Jan 2012 01:38 AM
well for one, the connector is wrong, it should go after the end,
the "toucher" part is wrong as well, if a random brick touches it, it doens't have the Health value so it won't work.

what are you trying to do?
Report Abuse
Thunderx10 is not online. Thunderx10
Joined: 17 Jun 2009
Total Posts: 2316
16 Jan 2012 01:41 AM
    debounce = false
    thing = game.Workspace.toucher
    
    
    function onTouch(toucher)
        if debounce == false and game.Players:GetPlayerFromCharacter(toucher.Parent) then
            debounce = true
            thing.Humanoid.Health = thing.Humanoid.Health + 50 --I added "humanoid" I think that's what you wanted
            script.Parent.BrickColor = BrickColor.new("Black")
            wait(10)
            script.Parent.BrickColor = BrickColor.new("Lime green")
            debounce = false
        end
    end
    script.Parent.Touched:connect(onTouched)

Try that

Report Abuse
camrocks918 is not online. camrocks918
Joined: 18 Nov 2010
Total Posts: 3298
16 Jan 2012 01:41 AM
wait
no


function onTouch(toucher)

if toucher.Parent:FindFirstChild("Humanoid") then

toucher.Parent.Humanoid.Health = toucher.Parent.Humanoid.Health + 50
Script.parent.BrickColor = BrickColor.new("Black")
wait(10)
Script.parent.BrickColor = BrickColor.new("Lime green")
Script.Parent.Touched:connect(onTouched)
end

Lol
Made a major mistake in the last one.
Report Abuse
mage11561 is not online. mage11561
Joined: 03 Sep 2008
Total Posts: 13217
16 Jan 2012 01:42 AM
@thunder

i think "toucher" is the thing that activates the onTouch script,
so you shouldn't define it in a variable
Report Abuse
Ravenshield is not online. Ravenshield
Joined: 21 Nov 2007
Total Posts: 4143
16 Jan 2012 02:09 AM
Why make it so difficult?


script.Parent.Touched:connect(function(toucher)
if toucher and toucher.Parent:FindFirstChild("Humanoid") then
toucher.Parent.Humanoid.Health = toucher.Parent.Humanoid.Health + 50
script.Parent.BrickColor = BrickColor.new("Black")
wait(10)
script.Parent.BrickColor = BrickColor.new("Lime green")
end
end)
Report Abuse
joshrocks101 is not online. joshrocks101
Joined: 07 Jun 2011
Total Posts: 1712
16 Jan 2012 02:54 AM
it's funny how only 2 people who fix'd this put connection lines.
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