Hello! I'm BlackOrange3343 and I'll be helping you today.
There a few problems here, one being you are setting the speed value based on a text. Also another problem being you're doing StarterGui not PlayerGui
Difference Between StarterGui and PlayerGui
StarterGui is somewhat similar to a storage. What happens is when the game runs and a player joins, everything in the StarterGui will be cloned and re parented to the PlayerGui. When you update the StarterGui, the next player who joins will see the changes.
PlayerGui on the other hand is live. It is what's displayed to the Client. What you want to do is update elements with in the PlayerGui for the player to see live updates.
So:
- Insert a
Script into ServerScriptService
- Create all the variables you'll need.
local Players = game:GetService('Players')
local PlayerCount = 0
Players.PlayerAdded:Connect(function(Player)
PlayerCount = #Players:GetChildren()
local Character = Player.Character or Player.CharacterAdded:Wait()
local PlayerGui = Player:WaitForChild('PlayerGui')
end)
- Now finish it off
local Players = game:GetService('Players')
local PlayerCount = 0
Players.PlayerAdded:Connect(function(Player)
PlayerCount = #Players:GetChildren()
local Character = Player.Character or Player.CharacterAdded:Wait()
local PlayerGui = Player:WaitForChild('PlayerGui')
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = Player
local speed = Instance.new("IntValue")
speed.Name = "Speed"
speed.Value = PlayerGui.ScreenGui.speed.Text
speed.Parent = leaderstats
end)
If you want anything additional, you'll have to add it yourself. ScriptingHelpers is a place where we help developers script. We will not write full scripts for you. I've somewhat have but do not expect it to work. This is a raw script that I have simply edited from yours. If you do expect other functions then add them yourself.
Best of luck developer and hope this helped.
BlackOrange3343
PS: Learn the basics before making a game or failure will strike multiple times until the scripter gives up or actually restarts.
1 comment
the only lua and roblox studio i learn is from youtube and other scripts that i read