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: Stay visible?

Previous Thread :: Next Thread 
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
20 Apr 2016 06:42 AM
In this script, how would you make the 'Locked' Visible stay false after you unlock it. Because after you die, it goes back to being visible.

wait(0.5)
local credits = game.Players.LocalPlayer.leaderstats.Credits
local WeaponName = game.Players.LocalPlayer.PlayerGui.ScreenGui.SupplyDropOpening:WaitForChild('WeaponName')
function Click()
wait(5)
if WeaponName.Text == "M1911" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.M1911.Locked.Visible = false
print "Unlocked M1911"
elseif WeaponName.Text == "K5" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.K5.Locked.Visible = false
print "Unlocked K5"
elseif WeaponName.Text == "Auto Glock" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.AutoGlock.Locked.Visible = false
print "Unlocked Auto Glock"
elseif WeaponName.Text == "M2012" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.M2012.Locked.Visible = false
print "Unlocked M2012"
elseif WeaponName.Text == "Cobra" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Cobra.Locked.Visible = false
print "Unlocked Cobra"
elseif WeaponName.Text == "Viptol" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Viptol.Locked.Visible = false
print "Unlocked Viptol"
elseif WeaponName.Text == "Deagle" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Deagle.Locked.Visible = false
print "Unlocked Deagle"
elseif WeaponName.Text == "Marhsal" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Marshal.Locked.Visible = false
print "Unlocked Marshal"
elseif WeaponName.Text == "Flintlock" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Flintlock.Locked.Visible = false
print "Unlocked Flintlock"
elseif WeaponName.Text == "500 Credits" then
credits.Value = credits.Value + 500
end
end

script.Parent.MouseButton1Click:connect(Click)


- hi add 3k to post count
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
20 Apr 2016 06:56 AM
b


- hi add 3k to post count
Report Abuse
2JJ1 is not online. 2JJ1
Joined: 15 Mar 2012
Total Posts: 1571
20 Apr 2016 07:01 AM
game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function()
--When ever the persons char is added, this code will run
end)
end)


Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
20 Apr 2016 07:09 AM
Didnt work.


- hi add 3k to post count
Report Abuse
Unravaled is not online. Unravaled
Joined: 18 Jul 2011
Total Posts: 1117
20 Apr 2016 07:18 AM
Don't use 'Locked' roblox confuses it for the Locked property of parts.

Also, MouseButton1Click has no arguments.
Report Abuse
Unravaled is not online. Unravaled
Joined: 18 Jul 2011
Total Posts: 1117
20 Apr 2016 07:19 AM
If you want to keep the name 'Locked' then instead reach for it like this:

game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Flintlock["Locked"]Visible = false
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
21 Apr 2016 06:58 AM
Also, the WeaponName.Text doesnt always stay as the weapon you unlocked, it changes between them. So what it's doing is that once the WeaponName.Text becomes one of those weapons, Locked.Visible = false. But the WeaponName changes after that, and the Locked.Visible is still false. But once you reset its set to true because that Text isnt what it was before.


- hi add 3k to post count
Report Abuse
Telamon_2 is not online. Telamon_2
Joined: 19 Apr 2016
Total Posts: 19
21 Apr 2016 09:18 AM
function guns()
wait(0.5)
local credits = game.Players.LocalPlayer.leaderstats.Credits
local WeaponName = game.Players.LocalPlayer.PlayerGui.ScreenGui.SupplyDropOpening:WaitForChild('WeaponName')
function Click()
wait(5)
if WeaponName.Text == "M1911" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.M1911.Locked.Visible = false
print "Unlocked M1911"
elseif WeaponName.Text == "K5" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.K5.Locked.Visible = false
print "Unlocked K5"
elseif WeaponName.Text == "Auto Glock" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.AutoGlock.Locked.Visible = false
print "Unlocked Auto Glock"
elseif WeaponName.Text == "M2012" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.M2012.Locked.Visible = false
print "Unlocked M2012"
elseif WeaponName.Text == "Cobra" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Cobra.Locked.Visible = false
print "Unlocked Cobra"
elseif WeaponName.Text == "Viptol" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Viptol.Locked.Visible = false
print "Unlocked Viptol"
elseif WeaponName.Text == "Deagle" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Deagle.Locked.Visible = false
print "Unlocked Deagle"
elseif WeaponName.Text == "Marhsal" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Marshal.Locked.Visible = false
print "Unlocked Marshal"
elseif WeaponName.Text == "Flintlock" then
game.Players.LocalPlayer.PlayerGui.ScreenGui.InventoryFrame.Pistols.PistolUnlocks.Flintlock.Locked.Visible = false
print "Unlocked Flintlock"
elseif WeaponName.Text == "500 Credits" then
credits.Value = credits.Value + 500
end
end

script.Parent.MouseButton1Click:connect(Click)
end

--enough bull𝐬𝐡𝐢𝐭 boi
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
22 Apr 2016 06:58 AM
Doesnt work.
Basically after clicking and waiting 5, if the text is the coordinating weapon name, the Locked visibility should stay false throughout the entire game for that weapon.


- hi add 3k to post count
Report Abuse
Kermit_Frog is not online. Kermit_Frog
Joined: 24 Feb 2016
Total Posts: 3347
22 Apr 2016 09:51 PM
I think that's the best I can explain this.
After clicking and waiting 5, the weapon has to stay unlocked (Locked visibility is false) after weaponname is the weapon you unlocked and never turn visible again.
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