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: Problem with .Touched

Previous Thread :: Next Thread 
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
26 Jun 2012 11:35 AM
script.Parent.Touched:connect(function(hit)

if hit.ClassName == "Part" then
print("CORN")
end

end)


It doesn't print anything, not CORN or any errors.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
26 Jun 2012 11:36 AM
Try this:

script.Parent.Touched:connect(function(hit)

if hit:IsA("Part") then
print("CORN")
end

end)

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Jun 2012 11:37 AM
script.Parent.Touched:connect(function(hit)
if (hit.ClassName == "Part") then
print("IS A PART")
else
print("NOT A PART")
end
end)
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
26 Jun 2012 11:39 AM
@swim
@thecaptain

Still won't print anything :I
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
26 Jun 2012 11:40 AM
Is the script disabled?

-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
26 Jun 2012 11:41 AM
No, It's inside of a part in Workspace.
Report Abuse
nate890 is not online. nate890
Joined: 22 Nov 2008
Total Posts: 21686
26 Jun 2012 11:41 AM
Odd? Maybe...

    basePart.Touched:connect(function(hit)
        if hit:IsA("BasePart") then --Part, wedge etc...
            print("Hit by a "..hit.ClassName)
        end
    end)
Report Abuse
heIlo is not online. heIlo
Joined: 29 Dec 2009
Total Posts: 139
26 Jun 2012 11:41 AM
How are you using the script? What is touching what?
Report Abuse
heIlo is not online. heIlo
Joined: 29 Dec 2009
Total Posts: 139
26 Jun 2012 11:42 AM
Also is it a local script, or just a regular script?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
26 Jun 2012 11:42 AM
Make sure that Studio isn't Paused?
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
26 Jun 2012 11:43 AM
A normal part with a Cylinder mesh is falling down to the default Base plate. It's a regular script.
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
26 Jun 2012 11:44 AM
@thecaptain

I'm using the Pause and Play buttons in Studio.
Report Abuse
heIlo is not online. heIlo
Joined: 29 Dec 2009
Total Posts: 139
26 Jun 2012 11:45 AM
Try disabling the script and then re-enabling?
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
26 Jun 2012 11:46 AM
Finally got it to work, it wouldn't work until I opened up Play Solo.
Report Abuse
heIlo is not online. heIlo
Joined: 29 Dec 2009
Total Posts: 139
26 Jun 2012 11:48 AM
Ya, Roblox studio is a pain sometimes.
Report Abuse
Shobobo99 is not online. Shobobo99
Joined: 30 Dec 2008
Total Posts: 5754
26 Jun 2012 12:35 PM
You really shouldn't test much things like those with pause and play, that's why you have test solo.
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