idk, It seems pretty basic, but it ain't workin I keep gettin the error: touched is not a valid member of workspace :Line 9
1 | function onTouched(part) |
2 | local h = part.Parent:findFirstChild( "Humanoid" ) |
3 | if h~ = nil then |
4 | script.Parent.Parent.Parent = h.Parent |
5 | script:remove() |
6 | end |
7 | end |
8 |
9 | script.Parent.Touched:connect(onTouched) |
I think its where you say script.Parent.Parent.Parent = h.Parent
theres an extra parent that would make it game, game is locked. so thats all you did wrong
1 | function onTouched(part) |
2 | local h = part.Parent:findFirstChild( "Humanoid" ) |
3 | if h~ = nil then |
4 | script.Parent.Parent = h.Parent --parent of script, parent of the parent of script is workspace |
5 | script:remove() |
6 | end |
7 | end |
8 |
9 | script.Parent.Touched:connect(onTouched) |