spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 25 Jan 2016 09:26 PM |
So when i try cloning the gui so players can see when they leveled up, it doesnt show it put the sound plays when a player levels up. First one to make a working one will get 150 robux. Just make a t shirt and send me a link.
--[[ The main thing i want to fix in this is this gui problem. It wont clone.
function onLevelUp(player, XP, level) local clone = script.LU:Clone() clone.Parent = player wait(6) script.LU:remove() script.LevelUpSound:Play() end ]]--
function onXPChanged(player, XP, level) if XP.Value>=level.Value * 5 then level.Value = level.Value + 1 XP.Value = 0 end end
function onLevelUp(player, XP, level) --Function that the gui clone script is in. local clone = script.LU:Clone() clone.Parent = player wait(6) script.LU:remove() script.LevelUpSound:Play() end
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local stats2 = Instance.new("IntValue") stats2.Name = "Tycoon"
local cash = Instance.new("IntValue") cash.Name = "Cash:" cash.Value = 0
local kills = Instance.new("IntValue") kills.Name = "Kills:" kills.Value = 0
local deaths = Instance.new("IntValue") deaths.Name = "Deaths:" deaths.Value = 0
local level = Instance.new("IntValue") level.Name = "Level" level.Value = 1
local xp = Instance.new("IntValue") xp.Name = "XP" xp.Value = 0 cash.Parent = stats stats2.Parent = newPlayer stats.Parent = newPlayer kills.Parent = stats deaths.Parent = stats level.Parent = stats xp.Parent = stats
xp.Changed:connect(function() onXPChanged(newPlayer, xp, level) end) level.Changed:connect(function() onLevelUp(newPlayer, xp, level) end) -- changed event function when a player levels up -- being called
|
|
|
| Report Abuse |
|
|
|
| 25 Jan 2016 09:29 PM |
"local clone = script.LU:Clone() clone.Parent = player"
should be Player.PlayerGui
make sure it's visible |
|
|
| Report Abuse |
|
|
|
| 25 Jan 2016 09:32 PM |
you are defining the onLevelUp function twice
|
|
|
| Report Abuse |
|
|
| |
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 25 Jan 2016 09:35 PM |
i dont have a variable for player to connect to local player could that be it.?
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 25 Jan 2016 09:40 PM |
ok now the gui works but it wont go away/ be removed
|
|
|
| Report Abuse |
|
|
spinywind
|
  |
| Joined: 26 Jan 2012 |
| Total Posts: 3580 |
|
|
| 25 Jan 2016 09:47 PM |
o i fixed the remove thing i just had to locate the gui right.
|
|
|
| Report Abuse |
|
|