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

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

Asked by 5 years ago

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

0
i have tried to solve this DONOT CLOSE PLS I NEED HELP Vortex_Vasne 89 — 5y

1 answer

Log in to vote
0
Answered by
Creacoz 210 Moderation Voter
5 years ago
Edited 5 years ago

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)
0
Also parent is deprecated. Trollapse 89 — 5y
0
ok thanks for this i am kind of a newbie at scripting Vortex_Vasne 89 — 5y
Ad

Answer this question