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: I don't know whats wrong

Previous Thread :: Next Thread 
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Aug 2011 10:55 PM
Honestly, I literally don't know whats wrong with this function

function onTouched(Part)
Game.Workspace.Touchtoopen.Head.Transparency = 0
Game.Workspace.Touchtoopen.Head.CanCollide = true
wait(2)
Game.Workspace.Touchtoopen.Head.Transparency = .6
Game.Workspace.Touchtoopen.Head.CanCollide = false
end
script.Parent.Touched:connect (onTouched)

I mean I'm sure I spelled everything write, and where it says Touchtoopen is the model name.But I don't know whats wrong with this
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Aug 2011 11:05 PM
anyone, please?
Report Abuse
Ulla42 is not online. Ulla42
Joined: 14 Dec 2009
Total Posts: 1774
02 Aug 2011 11:07 PM
try making Game lowercase, ex: game
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Aug 2011 11:11 PM
That didnt work.
DO you think it didnt work because I have 2 of the Touchtoopen in my game.
Do you think thats why?
Report Abuse
Ulla42 is not online. Ulla42
Joined: 14 Dec 2009
Total Posts: 1774
02 Aug 2011 11:13 PM
Yep, that it
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Aug 2011 11:23 PM
It didnt work :(-
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
02 Aug 2011 11:28 PM
And the weird thing is when I touch it its transparent but the CanCollide is still true and the weirder thing is the waits dont work.What I mean is the brick is transparent forever until I touch it again
Report Abuse
scepile3 is not online. scepile3
Joined: 27 Feb 2009
Total Posts: 260
03 Aug 2011 12:04 AM
First off, what's the brick's original properties? (before you touch it)

Secondly, you're going to need to add some prints. Putting one after the wait line lets you know if the wait actually worked.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Aug 2011 12:14 AM
Ok, the properties are all checked(Anchored,CanCollide,andarchivable)exept locked isnt checked at the beginning.

for the second what do I say?print what?
Report Abuse
Ulla42 is not online. Ulla42
Joined: 14 Dec 2009
Total Posts: 1774
03 Aug 2011 12:23 AM
removed 2nd touchtoopen?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Aug 2011 12:26 AM
im pretty sure that wouldn't work -_-
Report Abuse
Spectrumw is not online. Spectrumw
Joined: 04 Aug 2009
Total Posts: 13510
03 Aug 2011 12:36 AM
Game.Workspace.Touchtoopen.Head.Transparency = 0
Game.Workspace.Touchtoopen.Head.CanCollide = true -- Isn't this supposed to be false?
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
03 Aug 2011 12:43 AM
umm..No?Because the transparency is .6 when the transparency is 0 the CanCollide is true
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
03 Aug 2011 09:09 AM
script.Parent.Touched:connect(function()
workspace.Touchtoopen.Head.Transparency = 0
workspace.Touchtoopen.Head.CanCollide = true
wait(2)
workspace.Touchtoopen.Head.Transparency = .6
workspace.Touchtoopen.Head.CanCollide = false
end)


Try that. Also, sometimes .Touched events error in solo mode, so test it in online mode.
Report Abuse
mikelaltmn is not online. mikelaltmn
Joined: 11 Feb 2010
Total Posts: 64
03 Aug 2011 09:17 AM
script.Parent.Touched:connect(function()
workspace.Touchtoopen.Head.Transparency = 0
workspace.Touchtoopen.Head.CanCollide = false--Opened
wait(2)
workspace.Touchtoopen.Head.Transparency = .6
workspace.Touchtoopen.Head.CanCollide = true--Closed
end)
Report Abuse
mikelaltmn is not online. mikelaltmn
Joined: 11 Feb 2010
Total Posts: 64
03 Aug 2011 09:19 AM
Im Positive.
Report Abuse
Fredfishy is online. Fredfishy
Joined: 21 Mar 2009
Total Posts: 4197
03 Aug 2011 09:19 AM
function onTouched(hit)
Workspace.Touchtoopen.Head.Transparency = 0
Workspace.Touchtoopen.Head.CanCollide = true
wait(2)
Workspace.Touchtoopen.Head.Transparency = 0.6
Workspace.Touchtoopen.Head.CanCollide = false
end

script.Parent.Touched:connect(onTouched)





Do you want it to open when touched? If so, try





function onTouched(hit)
Workspace.Touchtoopen.Head.Transparency = 0.6
Workspace.Touchtoopen.Head.CanCollide = false
wait(2)
Workspace.Touchtoopen.Head.Transparency = 0
Workspace.Touchtoopen.Head.CanCollide = true
end

script.Parent.Touched:connect(onTouched)
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
03 Aug 2011 09:21 AM
Mikel, 0 transparency means you can't see through the door >.>

Fred, what's the difference between that and his original script?
Report Abuse
mikelaltmn is not online. mikelaltmn
Joined: 11 Feb 2010
Total Posts: 64
03 Aug 2011 09:22 AM
you could do...


local Object = Workspace.Touchtoopen.Head

script.Parent.Touched:connect(function()
Object.Transparency = 0
Object.CanCollide = false--Opened
wait(2)
Object.Transparency = .6
Object.CanCollide = true--Closed
end)


Cant reply to this post :D
|
|
v
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
03 Aug 2011 09:22 AM
Mikel, that's just a unnessissary variable T.T



~I still posted, what now~
Report Abuse
Fredfishy is online. Fredfishy
Joined: 21 Mar 2009
Total Posts: 4197
03 Aug 2011 09:24 AM
@dark
I just rewrote it.
Sometimes that fixes it for me.

The difference between the first and second of my scripts is that the first closes then opens and the second opens then closes.
Report Abuse
mikelaltmn is not online. mikelaltmn
Joined: 11 Feb 2010
Total Posts: 64
03 Aug 2011 09:24 AM
@dark oh you're right, It should be




local Object = Workspace.Touchtoopen.Head

script.Parent.Touched:connect(function()
Object.Transparency = 0.6
Object.CanCollide = false--Opened
wait(2)
Object.Transparency = 0
Object.CanCollide = true--Closed
end)


Cant Reply to this one either :D

|
|
v
Report Abuse
darkkiller5555 is not online. darkkiller5555
Joined: 22 Nov 2009
Total Posts: 6359
03 Aug 2011 09:25 AM
@Fred, I'm pretty sure the error is just solo mode. .Touched scripts error all the time for me in solo mode :o
Report Abuse
mikelaltmn is not online. mikelaltmn
Joined: 11 Feb 2010
Total Posts: 64
03 Aug 2011 09:26 AM
@dark not unessicary, It makes it shorter thus, (possibly), lowering lag by a nth degree.

~What now, cant reply~

|
|
v
Report Abuse
mikelaltmn is not online. mikelaltmn
Joined: 11 Feb 2010
Total Posts: 64
03 Aug 2011 09:27 AM
unnecessary*

|
|
v
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