|
| 25 Jul 2017 12:52 AM |
Upon putting the helmet on, this script used to remove the hats, then when the helmet went off, the hats were back on. Now hats are changed to Accessories, as seen with many hat removers. I just don't know how exactly to implement the transparent accessories and non-transparent accessories lines into this script:
wait(1)
local plr = game.Players.LocalPlayer.Character local VS = script.Parent.VisorSelect local HS = script.Parent.HelmetSelect
if not plr:findFirstChild("Helm") then script.Parent:remove() end
local HelmParts = plr.Helm:GetChildren() local HatObjs = script:GetChildren()
function onClickVisor(mouse) if not plr:findFirstChild("Helm") then return end if not plr.Helm:findFirstChild("Visor") then return end if VS.Value == true then VS.Value = false script.Parent.Visor.Text = "Visor [OFF]" if HS.Value == true then plr.Helm.Visor.Transparency = .8 plr.Head.Transparency = 0 else return end else VS.Value = true script.Parent.Visor.Text = "Visor [ON]" if HS.Value == true then plr.Helm.Visor.Transparency = 0 plr.Head.Transparency = 1 else return end end end
function onClickHelmet(mouse) if not plr:findFirstChild("Helm") then return end if HS.Value == true then HS.Value = false for i = 1,#HelmParts do if not HelmParts[i]:isA("BasePart") then return end HelmParts[i].Transparency = 1 end for e = 1,#HatObjs do if HatObjs[e].Name == "HatObj" then HatObjs[e].Value.Handle.Transparency = 0 end end plr.Head.Transparency = 0 script.Parent.Helmet.Text = "Helmet [OFF]" else HS.Value = true for i = 1,#HelmParts do if not HelmParts[i]:isA("BasePart") then return end HelmParts[i].Transparency = 0 end plr.Helm.Middle.Transparency = 1 for e = 1,#HatObjs do if HatObjs[e].Name == "HatObj" then HatObjs[e].Value.Handle.Transparency = 1 end end if VS.Value == true then plr.Head.Transparency = 1 else plr.Helm.Visor.Transparency = .8 end script.Parent.Helmet.Text = "Helmet [ON]" end end
script.Parent.Visor.MouseButton1Click:connect(onClickVisor) script.Parent.Helmet.MouseButton1Click:connect(onClickHelmet)
|
|
|
| Report Abuse |
|
|
yin_yang
|
  |
| Joined: 24 Feb 2016 |
| Total Posts: 537 |
|
| |
|
|
| 25 Jul 2017 02:02 AM |
I tried it, it's still not working. This is what it looks like now:
wait(1)
local plr = game.Players.LocalPlayer.Character local VS = script.Parent.VisorSelect local HS = script.Parent.HelmetSelect
if not plr:findFirstChild("Helm") then script.Parent:remove() end
local HelmParts = plr.Helm:GetChildren() local HatObjs = script:GetChildren()
function onClickVisor(mouse) if not plr:findFirstChild("Helm") then return end if not plr.Helm:findFirstChild("Visor") then return end if VS.Value == true then VS.Value = false script.Parent.Visor.Text = "Visor [OFF]" if HS.Value == true then plr.Helm.Visor.Transparency = .8 plr.Head.Transparency = 0 else return end else VS.Value = true script.Parent.Visor.Text = "Visor [ON]" if HS.Value == true then plr.Helm.Visor.Transparency = 0 plr.Head.Transparency = 1 else return end end end
function onClickHelmet(mouse) if not plr:findFirstChild("Helm") then return end if HS.Value == true then HS.Value = false for i = 1,#HelmParts do if not HelmParts[i]:isA("BasePart") then return end HelmParts[i].Transparency = 1 end for e = 1,#hats do if hats[e]:IsA("Accessories") then hats[e].Value.Handle.Transparency = 0 end end plr.Head.Transparency = 0 script.Parent.Helmet.Text = "Helmet [OFF]" else HS.Value = true for i = 1,#HelmParts do if not HelmParts[i]:isA("BasePart") then return end HelmParts[i].Transparency = 0 end plr.Helm.Middle.Transparency = 1 for e = 1,#hats do if hats[e]:IsA("Accessories") then hats[e].Value.Handle.Transparency = 1 end end if VS.Value == true then plr.Head.Transparency = 1 else plr.Helm.Visor.Transparency = .8 end script.Parent.Helmet.Text = "Helmet [ON]" end end
script.Parent.Visor.MouseButton1Click:connect(onClickVisor) script.Parent.Helmet.MouseButton1Click:connect(onClickHelmet)
|
|
|
| Report Abuse |
|
|
|
| 25 Jul 2017 02:08 AM |
I tried it with "Accessory" instead of "Accessories" too.
|
|
|
| Report Abuse |
|
|