|
| 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 |
|
|
|
| 20 Apr 2016 06:56 AM |
b
- hi add 3k to post count |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 20 Apr 2016 07:09 AM |
Didnt work.
- hi add 3k to post count |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|