| |
|
»
»
|
|
| |
Re: Sound play
|
|
|
|
| 10 Jul 2015 09:08 PM |
HOW TO MAKE IT SO THAT THE SOUND PLAYS AS THE LEVEL GUI TWEENSIVE MOVES I WANT IT TO PLAY http://www.roblox.com/sfx-die-item?id=145486927
local Stats = game.Players.LocalPlayer:WaitForChild("leaderstat") local StatsServer = game.ReplicatedStorage:WaitForChild("Stats")
script.Parent.Frame:TweenSize(UDim2.new(Stats.CurrentXP.Value/(100), 0, 1, 0), "Out", "Linear", .2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" if Stats.CurrentXP.Value >= 100 then local Extra = Stats.CurrentXP.Value - 100 script.Parent.Frame:TweenSize(UDim2.new(0, 0, 1, 0), "Out", "Linear", 0.2, true) wait(0.2) StatsServer:FireServer("UpdateLevel") StatsServer:FireServer("UpdateXP", Extra) -- Update instantly, Even thought the Changed will fire again. It's better for instant results. -- (Latency may stop instant update) script.Parent.Frame:TweenSize(UDim2.new(Extra/(100), 0, 1, 0), "Out", "Linear", 0.2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" end
Stats.CurrentXP.Changed:connect(function() if Stats.CurrentXP.Value >= 100 then local Extra = Stats.CurrentXP.Value - 100 script.Parent.Frame:TweenSize(UDim2.new(0, 0, 1, 0), "Out", "Linear", 0.2, true) wait(0.2) StatsServer:FireServer("UpdateLevel") StatsServer:FireServer("UpdateXP", Extra) -- Update instantly, Even thought the Changed will fire again. It's better for instant results. -- (Latency may stop instant update) script.Parent.Frame:TweenSize(UDim2.new(Extra%100/(100), 0, 1, 0), "Out", "Linear", 0.2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" else script.Parent.Frame:TweenSize(UDim2.new(Stats.CurrentXP.Value/(100), 0, 1, 0), "Out", "Linear", .2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" end end) |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 09:10 PM |
b1
I'm just here so I don't get fined |
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 09:15 PM |
local Stats = game.Players.LocalPlayer:WaitForChild("leaderstat") local StatsServer = game.ReplicatedStorage:WaitForChild("Stats") local sound = Instance.new("Sound") sound.SoundId = "rbxassetid://145486927" sound.Parent = script.Parent
script.Parent.Frame:TweenSize(UDim2.new(Stats.CurrentXP.Value/(100), 0, 1, 0), "Out", "Linear", .2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%"
if Stats.CurrentXP.Value >= 100 then local Extra = Stats.CurrentXP.Value - 100 script.Parent.Frame:TweenSize(UDim2.new(0, 0, 1, 0), "Out", "Linear", 0.2, true) wait(0.2) StatsServer:FireServer("UpdateLevel") StatsServer:FireServer("UpdateXP", Extra) -- Update instantly, Even thought the Changed will fire again. It's better for instant results. -- (Latency may stop instant update) script.Parent.Frame:TweenSize(UDim2.new(Extra/(100), 0, 1, 0), "Out", "Linear", 0.2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" end
Stats.CurrentXP.Changed:connect(function() sound:Play() if Stats.CurrentXP.Value >= 100 then local Extra = Stats.CurrentXP.Value - 100 script.Parent.Frame:TweenSize(UDim2.new(0, 0, 1, 0), "Out", "Linear", 0.2, true) wait(0.2) StatsServer:FireServer("UpdateLevel") StatsServer:FireServer("UpdateXP", Extra) -- Update instantly, Even thought the Changed will fire again. It's better for instant results. -- (Latency may stop instant update) script.Parent.Frame:TweenSize(UDim2.new(Extra%100/(100), 0, 1, 0), "Out", "Linear", 0.2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" else script.Parent.Frame:TweenSize(UDim2.new(Stats.CurrentXP.Value/(100), 0, 1, 0), "Out", "Linear", .2, true) script.Parent.TextLabel.Text = "Current Level: "..Stats.Level.Value.." || Level Progress: "..math.ceil(Stats.CurrentXP.Value).."%" end end)
|
|
|
| Report Abuse |
|
|
|
| 10 Jul 2015 09:16 PM |
wow perfect person huh
I'm just here so I don't get fined |
|
|
| Report Abuse |
|
|
|
| |
|
|
| |
|
»
»
|
|
|
|
|