hi i am making a gta style game and im making the wanted level system (localscript if it shouldnt be let me know..) and i put it in StarterPlayerScripts but it doesnt change the visibility to true... what went wrong?
01 | local WLevel = 1 -- testing to see if it works.. |
02 | local character = game.Workspace.Player |
03 | local player = game.Players:GetPlayerFromCharacter(character) |
04 | local lvl 1 = game.StarterGui.wantedlevel.lv 1 |
05 | local lvl 2 = game.StarterGui.wantedlevel.lv 2 |
06 | local lvl 3 = game.StarterGui.wantedlevel.lv 3 |
07 | local lvl 4 = game.StarterGui.wantedlevel.lv 4 |
08 | local lvl 5 = game.StarterGui.wantedlevel.lv 5 |
09 |
10 | if WLevel = = 1 |
11 | then Instance.new( "Cop" , workspace) |
12 | and lvl 1. visible = true |
13 | and workspace.Cop.Torso.Position = Vector 3. new(player.Position) |
14 | else lvl 1. visible = false |
15 |
16 | end |
edit forgot to mention its for a HUD
You dont use 'And' like that. Try this:
01 | local WLevel = 1 -- testing to see if it works.. |
02 | local character = game.Workspace.Player |
03 | local player = game.Players:GetPlayerFromCharacter(character) |
04 | local lvl 1 = game.StarterGui.wantedlevel.lv 1 |
05 | local lvl 2 = game.StarterGui.wantedlevel.lv 2 |
06 | local lvl 3 = game.StarterGui.wantedlevel.lv 3 |
07 | local lvl 4 = game.StarterGui.wantedlevel.lv 4 |
08 | local lvl 5 = game.StarterGui.wantedlevel.lv 5 |
09 |
10 | if WLevel = = 1 then |
11 | Instance.new( "Cop" , workspace) |
12 | lvl 1. Visible = true |
13 | workspace.Cop.Torso.Position = Vector 3. new(player.Position) |
14 | else |
15 | lvl 1. Visible = false |
16 | end |
01 | wait( 0.1 ) |
02 | local WLevel = 1 -- testing to see if it works.. |
03 | local character = game.Players.LocalPlayer.Character |
04 | local player = game.Players:GetPlayerFromCharacter(character) |
05 | local lvl 1 = game.StarterGui.wantedlevel.lv 1 |
06 | local lvl 2 = game.StarterGui.wantedlevel.lv 2 |
07 | local lvl 3 = game.StarterGui.wantedlevel.lv 3 |
08 | local lvl 4 = game.StarterGui.wantedlevel.lv 4 |
09 | local lvl 5 = game.StarterGui.wantedlevel.lv 5 |
10 |
11 | if WLevel = = 1 |
12 | then Instance.new( "Cop" , workspace) |
13 | lvl 1. visible = true |
14 | workspace.Cop.Torso.Position = Vector 3. new(player.Position) |
15 | else lvl 1. visible = false |
16 |
17 | end |
This should work...