I am making some effects for a gun, and the script i've attempted to create is supposed to create a forcefeild around the player on a key down toggle. i think possibly the weld could have gone wrong. I'm not sure.. Anyone got suggestions/ ideas why?
forcefeild=script.Parent.Forcefeild
torso=script.Parent.Parent.Torso
local tool=script.Parent
tool.Equipped:connect(function(mouse)
mouse.KeyDown:connect(function(key)
if key == "f" then
forcefeild.Script2.Disabled=false
forcefeild.Anrchored=true
local weld1 = Instance.new("Weld")
weld1.Parent=torso
weld1.Part0=torso
weld1.Part1 = forcefeild
forcefeild.Anrchored=false
local i = 1
while( i > 6) do
forcefeild.Size = i,i,i
wait(.1)
i = i - 1
end
elseif key=="f" then
forcefeild.Script2.Disabled=true
local i = 6
while( i < 0) do
forcefeild.Size = i,i,i
wait(.1)
i = i + 1
end
end
end)
end)
