Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Soooooo Im having trouble with my scripts again I Just dont know why my door wont do anything, Why?

Soooo Im having trouble with my script The Output says Workspace.Door!.Script:12: attempt to call a userdata value heres the script

local sp = script.Parent
function onTouch(hit)
	sp.Transparency = 0.50 
	sp.CanCollide = false
	wait(1)
	sp.CanCollide = true	
	sp.Transparency = 0
end
script.parent.Touched:Connect(onTouch)(hit)

ive never heard the output error message

1 comment

0

i have tried to solve this DONOT CLOSE PLS I NEED HELP

1 answer

✓ Accepted answer

t's not

script.parent.Touched:Connect(onTouch)(hit)

but it is:

script.parent.Touched:Connect(onTouch)

and this is the script

local sp = script.Parent
function onTouch(hit)
    sp.Transparency = 0.50 
    sp.CanCollide = false
    wait(1)
    sp.CanCollide = true    
    sp.Transparency = 0
end
script.parent.Touched:Connect(onTouch)

2 comments

0

Also parent is deprecated.

0

ok thanks for this i am kind of a newbie at scripting

This discussion is preserved as it was. New answers, comments, and votes are closed.