Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Could somone help with this snow plow script?

When a part named "Snow" touches the plow (this script is in the plow) The brick's Transparency will be changed to one, but this doesn't work.

function Touched(a)
	if a.Parent:FindFirstChild("Snow") then
		a.parent:FindFirstChild("Snow")Transparency = 1
	end
	
	
end



script.Parent.Touched:connect(Touched)

1 answer

✓ Accepted answer

If you want that to work, capitalize "P" for Parent and add a period after ("Snow") on line 02.

function Touched(a)
    if a.Parent:FindFirstChild("Snow") then
        a.Parent:FindFirstChild("Snow").Transparency = 1
    end
end

script.Parent.Touched:connect(Touched)

A better way you could manipulate your statement is to perhaps try 'a.Name == "Snow"' instead.

function Touched(a)
    if a.Name == "Snow" then
        a.Transparency = 1
    end
end

script.Parent.Touched:connect(Touched)

2 comments

0

Thanks, Red!

0

You're welcome.

This discussion is preserved as it was. New answers, comments, and votes are closed.