RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 22 Aug 2016 08:51 PM |
Yes, I do have a level system.
So, I need help that a Team Picker GUI will only appear once and only at Level 5. For example, once a player dies after picking a team it won't appear again even though their level is at 5.
Can someone please help? I need help ASAP |
|
|
| Report Abuse |
|
|
seliso
|
  |
| Joined: 30 Jan 2011 |
| Total Posts: 6443 |
|
|
| 22 Aug 2016 08:57 PM |
if playerLevel <= 5 then --show gui end
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 23 Aug 2016 07:21 PM |
| @Seliso that won't work. It needs to appear only once and when the player just turns level 5. |
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 23 Aug 2016 07:23 PM |
@eznotinman
What the heck do you even mean. Do you even understand what I just asked for? I asked how am I gonna make a gui that will only appear once and only when a player just turns to level 5. |
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 23 Aug 2016 07:24 PM |
@ServerDaddy INCREASE WHAT MORE?? |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2016 07:27 PM |
first put your gui thingy in somewhere like replicatedstorage then just check for the value of the players level like this: if game.Players.LocalPlayer.leaderstats.levelthingy.Value == 5 then (you probably need to change this to what fits you) then just clone your gui to the player's player gui like this: local hi = game.ReplicatedStorage.GUIthingy.Frame:Clone() hi.Parent = game:GetService("Players").LocalPlayer.PlayerGui then make a close button or something to make it disappear |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2016 07:32 PM |
i was talking to the guy above me sorry if that wasnt clear but to answer your question just do an if statement like
if player is level 5 and not in a team then code end
pseudo code. |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2016 07:32 PM |
and make sure you include the .Changed function like this:
game.Players.LocalPlayer.leaderstats.level.Value.Changed:connect(function()
end) |
|
|
| Report Abuse |
|
|
GearMechs
|
  |
| Joined: 01 Dec 2010 |
| Total Posts: 1220 |
|
|
| 23 Aug 2016 07:57 PM |
a simple line of code for you:
d = 1
if playerLevel <= 5 and d == 1 then
d = 0
--your code here for the gui
end |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2016 07:59 PM |
^^^^^^^ but that wouldn't work if they re-joined the game right? |
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 24 Aug 2016 08:18 AM |
| none of them work. all of the above don't work. |
|
|
| Report Abuse |
|
|
|
| 24 Aug 2016 08:22 AM |
| how are you triggering the gui appearing in the first place? also are you using exp? |
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 25 Aug 2016 08:20 AM |
| @Enzo ya i use exp too. But i only make it trigger once the person is at level 5.. wait... I think I need to use exp as well. |
|
|
| Report Abuse |
|
|
Objectly
|
  |
| Joined: 18 Jul 2016 |
| Total Posts: 210 |
|
|
| 25 Aug 2016 08:47 AM |
Assuming your getting your numerical level from a userdata/object value, you can do object.Changed:connect. This will only fire once the object has changed via a decrease or increase in its value.
Since your level system should only be going up, once the level has hit five, you should check with if/then statements. Then the gui will pop up. This will only happen once as the player will only level up to level five once. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2016 10:23 AM |
| use datastore to make sure it'll only appear once.. |
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 28 Aug 2016 04:30 AM |
This is my script. Cloning the frame doesn't work so I made a button to function the Team Gui. Doesn't work still...
game.Players.LocalPlayer.leaderstats.EXP.Changed.Value:Connect(function() if game.Players.LocalPlayer.leaderstats.Level.Value <=5 then script.Parent.Parent.TextButton.Visible = true end end)
|
|
|
| Report Abuse |
|
|
|
| 28 Aug 2016 04:33 AM |
"script.Parent.Parent.TextButton.Visible = true"
try pathing this to the player's playergui
game.Players.LocalPlayer.PlayerGui.PathHere.Visible = true |
|
|
| Report Abuse |
|
|
Cole3bob4
|
  |
| Joined: 08 Jan 2011 |
| Total Posts: 4475 |
|
|
| 28 Aug 2016 04:36 AM |
lol are you trying to make a pokemon game
|
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 28 Aug 2016 04:52 AM |
@Cole Um, I already did. Just needs minor fixes and more updates. |
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 28 Aug 2016 04:57 AM |
@LordNarwhal
This is what my script looks like now, but it still doesn't work...
game.Players.LocalPlayer.leaderstats.EXP.Changed.Value:Connect(function() if game.Players.LocalPlayer.leaderstats.Level.Value == 5 then game.Players.LocalPlayer.PlayerGui["Pick a Team"].TextButton.Visible = true end end)
|
|
|
| Report Abuse |
|
|
RachelGP
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 25 |
|
|
| 28 Aug 2016 06:23 AM |
Updated the script, still doesn't work and i don't know why.. Can someone please help ASAP?
game.Players.LocalPlayer.leaderstats.Level.Value.Changed:connect(function() if game.Players.LocalPlayer.leaderstats.Level.Value == 5 then local Team = game.Lighting["Pick a Team"]:clone() Team.Parent = game.Players.LocalPlayer.PlayerGui end end)
|
|
|
| Report Abuse |
|
|
|
| 28 Aug 2016 06:31 AM |
my guess is that level is never changing
try using a print after the function
make sure it's happening
also
the first parameter in the changed event is the value
try this
game.Players.LocalPlayer.leaderstats.Level.Value.Changed:connect(function(value) if value == 5 then local Team = game.Lighting["Pick a Team"]:clone() Team.Parent = game.Players.LocalPlayer.PlayerGui end end) |
|
|
| Report Abuse |
|
|
|
| 28 Aug 2016 06:31 AM |
whoops, minor error
game.Players.LocalPlayer.leaderstats.Level.Changed:connect(function(value) if value == 5 then local Team = game.Lighting["Pick a Team"]:clone() Team.Parent = game.Players.LocalPlayer.PlayerGui end end) |
|
|
| Report Abuse |
|
|