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:)

d = script.Parent


function onTouch(part)
   d.Transparency = 1
   wait(5)
   d.Transparency = 0
    print "I was Touched!!"
end

d.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.

d = script.Parent

function onTouch(part)
   d.Transparency = 1
   wait(5)
   d.Transparency = 0
    print "I was Touched!!"
end

d.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