Cj3Shots
(Cj3Shots)
1
I get an error whith this code:
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == script.Parent.KeyCardValue.Value then
script.Parent.Transparency = .5
script.Parent.CanCollide = false
wait(1)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end)
Error:
[21:25:14.438 - Workspace.Part.Script:8: Expected identifier when parsing expression, got β)β
1 Like
punyman9
(punyman9)
2
Your if statement has no end.
Also, please format your code properly using
```
β your code
```

1 Like
Its just a simple typo issue, I donβt think you should post these threads without trying to solve the problem yourself a bit:
script.Parent.Touched:Connect(function(hit)
if hit.Parent.Name == script.Parent.KeyCardValue.Value then
script.Parent.Transparency = .5
script.Parent.CanCollide = false
wait(1)
script.Parent.Transparency = 0
script.Parent.CanCollide = true
end
end)
You had forgot an end for closing the If statement, also please format your code, most error fixes come up easily if you format your code.
2 Likes
Cj3Shots
(Cj3Shots)
4
Thanks, I tried but am VERY new to scripting.
1 Like
Cj3Shots
(Cj3Shots)
5
Will do next time, didnt know about that.
Not a problem, just make sure you do it from next time.
1 Like