I am making a GUI and I am trying to put the Name of the leaderstats in a GUI making it say (leaderstatsname):..
Here are my codes:
leaderstats:
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local Smashes = Instance.new("IntValue",leaderstats)
Smashes.Name = "Smashes"
Smashes.Value = 0
local Equipped = Instance.new("IntValue", player)
Equipped.Value = 1
Equipped.Name = "Equipped"
local Hammer = Instance.new("StringValue", leaderstats)
Hammer.Name = "Glove"
Hammer.Value = "Defaultt Hammer"
end)
GUI (textlabel) script:
local Player = game.Players.LocalPlayer
local Leaderstats = Player:WaitForChild("leaderstats")
local Hammer = Leaderstats:WaitForChild("Hammer")
while wait() do
script.Parent.Text = "Hammer: "..Hammer.Value
end
Other script:
local Player = game.Players.LocalPlayer
local Leaderstats = Player:WaitForChild("leaderstats")
local Smashes = Leaderstats:WaitForChild("Smashes")
while wait() do
script.Parent.Text = "Smashes: "..Smashes.Value
end
** You are now Level 1! **