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

Variable Cannot Be Assigned To?

Asked by
Hibobb 40
10 years ago

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

01bullet = script.Parent
02name = bullet.Name
03 
04bullet.Touched:connect(function(hit)
05    if hit.Parent.ClassName ~= "Tool" then
06        bullet:Destroy()
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"
14                    end
15                end
View all 41 lines...
0
Everything exists with the proper name and type. Hibobb 40 — 10y
0
I just noticed also that CanTeleport's value does not get changed either Hibobb 40 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

(This may or may not be the answer)

Okay so.

Hit is a part- right?

So parts don't have colors they have BrickColors

So you'd need to do:

1hit.BrickColor = BrickColor.new("Cyan")
0
How stupid of me. Color is a stringvalue I put inside the parts. However I shouldn't have named it Color. Hibobb 40 — 10y
0
Click on the "answered" button under my name so it makes a check mark saying I answered it, plus we both get reputation SpazzMan502 133 — 10y
Ad
Log in to vote
0
Answered by
Moxeh 84
10 years ago

Replace

1hit.Color.Value = "Cyan"

with

1hit.Color = Color3.new(0, 255, 255) --Cyan RGB Color Coordinates

Answer this question