Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with this script?

Asked by
iSvenDerp 233 Moderation Voter
9 years ago

So I am learning the basics of scripting and I understand almost all the basics so I decided to make it where it says print "I have been Touched" with a script that works that i made along time ago. So I need help printng"I was touched!" Thanks in advance:)

01d = script.Parent
02 
03 
04function onTouch(part)
05   d.Transparency = 1
06   wait(5)
07   d.Transparency = 0
08    print "I was Touched!!"
09end
10 
11d.Touched:connect(onTouch)
0
You forgot something. drew1017 330 — 9y
0
what is it? iSvenDerp 233 — 9y
0
The script makes the brick go invisible for 5 seconds btw(that works) iSvenDerp 233 — 9y
0
Okay iSvenDerp bro. Try it this way. On Line 8, where it says print "I was Touched!!", add parenthesis to both side. So it would be like this: print ("I was Touched!!"). Try that and tell me if it works :D RobotChitti 167 — 9y
0
Ok thanks I mean I knew how to do it I jut typoed thanks for helping yall! iSvenDerp 233 — 9y

1 answer

Log in to vote
1
Answered by 9 years ago

You used the print function incorrectly.

01d = script.Parent
02 
03function onTouch(part)
04   d.Transparency = 1
05   wait(5)
06   d.Transparency = 0
07    print "I was Touched!!"
08end
09 
10d.Touched:connect(onTouch)

Add parentheses and it should work.

0
Thanks so much iSvenDerp 233 — 9y
0
Thanks for the thumbs down random jerk secretassassin3 30 — 9y
0
Np man. Thanks for the thumbs down random jerk. secretassassin3 30 — 9y
Ad

Answer this question