Im trying to have weapons require a safety function, script is below with attached Gyazo of the scripts location in the model.
http://gyazo.com/481b196c3c4e91e8d1ceb9a9a7d5d9bd
C = script.Parent.Parent.Safety
local p = script.Parent:GetChildren()
function Toggle()
if C.Value == true then
open()
elseif C.Value == false then
close()
end
end
function open()
for i = 1, #p do
if p[i]:FindFirstChild("Flangs") then
p[i].Flangs.Transparency = 0
end
end
end
function close()
for i = 1, #p do
if p[i]:FindFirstChild("Flangs") then
p[i].Flangs.Transparency = 1
end
end
end
C.Changed:connect(Toggle)

1 comment
Perhaps use UserInput() instead?