I am making a vibe game and I need help with the level system where every 1 minute your level goes up 1. The script I got works BUT it displays it in leader stats and not overhead and I don’t know how to make it go overhead. I did not make this script I watched a video on how to make it.
The Script:
local function onPlayerJoin(player)
local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player
local seconds = Instance.new('IntValue')
seconds.Name = 'Seconds'
seconds.Value = 0
seconds.Parent = player
local minutes = Instance.new('IntValue')
minutes.Name = 'Minutes'
minutes.Value = 0
minutes.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
local function addTime(player)
while true do
wait(1)
player.Seconds.Value = player.Seconds.Value + 1
if player.Seconds.Value == 60 then
player.Seconds.Value = 0
player.leaderstats.Minutes.Value = player.leaderstats.Minutes.Value + 1
end
end
end
game.Players.PlayerAdded:Connect(addTime)
BillboardGui | Roblox Creator Documentation here is all the neccessary resources to create and modify a billboard gui. Also, you will need to create an IntValue inside the player Instance called Level and store it over there. Then, you will have to use Instance | Roblox Creator Documentation to sync it with the billboard GUI text.
It is like inserting a Script so click on the ‘+’, then search Billboard then click on BillboardGui. Then re-name it to ‘My Overhead’; also place it in Workspace!
Once done, let’s get a script to do it on the overhead! Copy it below:
local function onPlayerJoin(player)
local leaderstats = Instance.new('Folder')
leaderstats.Name = 'leaderstats'
leaderstats.Parent = player
local seconds = Instance.new('IntValue')
seconds.Name = 'Seconds'
seconds.Value = 0
seconds.Parent = player
local minutes = Instance.new('IntValue')
minutes.Name = 'Minutes'
minutes.Value = 0
minutes.Parent = leaderstats
local overhead = game.Workspace["My Overhead"]
local Textz = Instance.new("TextLabel")
Textz.Parent = player.Character.Head
Textz.Text = "0 DANCING XP"
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
local function addTime(player)
while true do
wait(1)
player.Seconds.Value = player.Seconds.Value + 1
Textz.Text = player.Seconds.Value.." DANCING XP"
if player.Seconds.Value == 60 then
player.Seconds.Value = 0
player.leaderstats.Minutes.Value = player.leaderstats.Minutes.Value + 1
Textz.Text = player.Seconds.Value.." SECONDS & "..player.Minutes.Value.." MINUTES OF DANCING XP"
end
end
end
game.Players.PlayerAdded:Connect(addTime)
I recommend to set-up your overhead searching on YouTube.