generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Could someone help me fix this script?

Previous Thread :: Next Thread 
SpartanJohn_117 is not online. SpartanJohn_117
Joined: 07 Feb 2010
Total Posts: 1721
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 is not online. yin_yang
Joined: 24 Feb 2016
Total Posts: 537
25 Jul 2017 01:42 AM
:IsA("Accessory")
Report Abuse
SpartanJohn_117 is not online. SpartanJohn_117
Joined: 07 Feb 2010
Total Posts: 1721
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
SpartanJohn_117 is not online. SpartanJohn_117
Joined: 07 Feb 2010
Total Posts: 1721
25 Jul 2017 02:08 AM
I tried it with "Accessory" instead of "Accessories" too.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image