Question 1 : I want to get a Leaderstats to create an IntValue
Question 2 : Leaderstats isn’t creating IntValue
Question 3 : I’m trying to change from “game.Players.PlayerAdded(function(player)” to “game.Players.LocalPlayer”, And trying to use your assistant, And trying to view other’s forums
My leaderstats script (Not LocalScript it’s a Script)
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "Leaderstats"
leaderstats.Parent = player
local coins = Instance.new("IntValue")
coins.Name = "Coins"
coins.Value = 0
coins.Parent = leaderstats
local gems = Instance.new("IntValue")
gems.Name = "Gems"
gems.Value = 0
gems.Parent = leaderstats
end)
--Get the Player and Character in a server script
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
local humanoid = character:WaitForChild("Humanoid")
--
end)
end)
--Get the Player and Character in a client script
local player: Player = game:GetService("Players").LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()