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 it work?

Previous Thread :: Next Thread 
SirExpert is not online. SirExpert
Joined: 27 Jun 2013
Total Posts: 3
29 Jun 2013 10:26 AM
Im trying to put a script inside the part. so here is my script

local parent = Workspace.Part

function ontouch(part)
    Parent.Transparency = 1
    wait(.1)
    Parent.CanCollide = true
    wait(2)
    Parent.Transparency = 0
    wait(.1)
    Parent.CanCollide =false
    wait(1)
end

Im trying to make it so when the transparency isn't visible cancollide is true. But it isnt working! Help.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Jun 2013 10:28 AM
ROBLOX is case-sensitive. You called your variable 'parent', then tried changing the properties of 'Parent', which doesn't exist.

Also, you need a connection line.
Since you use waits in this function, I also recommend adding a debounce.
http://wiki.roblox.com/index.php/Debounce
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Jun 2013 10:29 AM
Sorry. Here's a link that will help you with your connection line using the .Touched event.

http://wiki.roblox.com/index.php/Touched_(Event)
Report Abuse
SirExpert is not online. SirExpert
Joined: 27 Jun 2013
Total Posts: 3
29 Jun 2013 10:31 AM
Ok thanks
Report Abuse
SirExpert is not online. SirExpert
Joined: 27 Jun 2013
Total Posts: 3
29 Jun 2013 10:32 AM
It says that the page is down...
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Jun 2013 11:03 AM
You know.. People have been telling me that, lately.. .-.
http://wiki.roblox.com/index.php/Touched

If that doesn't work, go to wiki.roblox.com and use the search bar.
Type in Touched and press 'go', and it will bring you right to the page.
Same with Debounce.
If there's no page under that name, it will give you search results with similar names or names that contain similar words.
Report Abuse
pudinrox is not online. pudinrox
Joined: 30 May 2010
Total Posts: 2358
29 Jun 2013 11:08 AM
Touched example is like this:
Workspace.Part.Touched:connect(function(otherPart)
print(otherPart)
end)
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
29 Jun 2013 11:24 AM
[ Content Deleted ]
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
29 Jun 2013 11:25 AM
[ Content Deleted ]
Report Abuse
Hergest is not online. Hergest
Joined: 17 May 2011
Total Posts: 309
29 Jun 2013 12:39 PM
A function can be called everything.

It could be function Food(part)

Read the wiki very good.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Jun 2013 12:55 PM
Because there are waits, you need a debounce.

parent = script.Parent
db = false

function ot(h)
if db or not game.Players:GetPlayerFromCharacter(h.Parent) then return end
db = true
parent.Transparency = 1
wait(.1)
parent.CanCollide = true
wait(2)
parent.Transparency = 0
wait(.1)
parent.CanCollide =false
wait(1)
db = false
end

parent.Touched:connect(ot)
Report Abuse
IAmReallyAwesome is not online. IAmReallyAwesome
Joined: 05 Mar 2010
Total Posts: 7371
29 Jun 2013 01:02 PM
script.Parent.Touched:connect(function(hit)
script.Parent.Transparency = 1
wait(.1)
script.Parent.CanCollide = true
wait(2)
script.Parent.Transparency = 0
wait(.1)
script.Parent.CanCollide = false
wait(1)
end

--if you put the script into the part you can simply do the above script.
Report Abuse
grimm343 is not online. grimm343
Joined: 18 Sep 2008
Total Posts: 2796
29 Jun 2013 01:47 PM
Once again, it won't work as he wants it to unless you add a debounce.
Report Abuse
IAmReallyAwesome is not online. IAmReallyAwesome
Joined: 05 Mar 2010
Total Posts: 7371
29 Jun 2013 01:50 PM
Ah, right. You're correct.

working = false
script.Parent.Touched:connect(function(hit)
if working == false then
working = true
script.Parent.Transparency = 1
wait(.1)
script.Parent.CanCollide = true
wait(2)
script.Parent.Transparency = 0
wait(.1)
script.Parent.CanCollide = false
wait(1)
working = false
end
end
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