Variable Cannot Be Assigned To?
I feel like this is easy but I can't get it.
Output:
16:22:42.022 - Value cannot be assigned to
16:22:42.023 - Script 'Workspace.Cyan.Portal', Line 22
16:22:42.025 - Stack End
04 | bullet.Touched:connect( function (hit) |
05 | if hit.Parent.ClassName ~ = "Tool" then |
07 | if hit.Name = = "WhiteWall" then |
08 | if name = = "Cyan" then |
09 | for _,v in pairs (workspace.Walls:GetChildren()) do |
10 | if v:FindFirstChild( "CyanPortal" ) then |
11 | v.CyanPortal:Destroy() |
12 | v.CanTeleport.Value = false |
13 | v.Color.Value = "White" |
17 | local decal = Instance.new( "Decal" ,hit) |
20 | decal.Name = "CyanPortal" |
21 | hit.CanTeleport.Value = true |
22 | hit.Color.Value = "Cyan" |
23 | elseif name = = "Orange" then |
24 | for _,v in pairs (workspace.Walls:GetChildren()) do |
25 | if v:FindFirstChild( "OrangePortal" ) then |
26 | v.OrangePortal:Destroy() |
27 | v.CanTeleport.Value = false |
28 | v.Color.Value = "White" |
32 | local decal = Instance.new( "Decal" ,hit) |
35 | decal.Name = "OrangePortal" |
36 | hit.CanTeleport.Value = true |
37 | hit.Color.Value = "Orange" |