I have a transparent brick and when it is touched by a player. I want 2 bricks which are in the workspace to move with cframe but when I try it, it does not work!
Trigger has a touch intrest in it but when I touch it the intrest goes away! Help!
I tried this.
function onTouched(hit) script.Parent.Parent.Wall1.CFrame = script.Parent.Wall1.CFrame + Vector3.new(0,0,1) script.Parent.Parent.Wall2.CFrame = script.Parent.Wall2.CFrame + Vector3.new(0,0,-1) end script.Parent.Touched:connect(onTouched)
I'm awful at scripting!
touch interest is not important just so you know.
you also forgot a Parent in your variables
Here's a script that might help.
script.Parent.Touched:connect(function(hit) --Fires the touched event if hit.Parent:FindFirstChild("Humanoid") then --making sure it's a player script.Parent.Parent.Wall1.CFrame = script.Parent.Parent.Wall1.CFrame + Vector3.new(0,0,1) script.Parent.Parent.Wall2.CFrame = script.Parent.Parent.Wall2.CFrame - Vector3.new(0,0,1) end end)
script.Parent.Touched:connect(function(hit) --Fires the touched event if hit.Parent:FindFirstChild("Humanoid") then --making sure it's a player for i= 1,600 do script.Parent.Parent.Wall1.CFrame = script.Parent.Parent.Wall1.CFrame + Vector3.new(0,0,0.1) script.Parent.Parent.Wall2.CFrame = script.Parent.Parent.Wall2.CFrame - Vector3.new(0,0,0.1) end
Line 3 red :( Halp