Empty
Empty
Empty
L'Interface Graphique de Départ est un service dans Roblox qui contient des éléments GUI (interface graphique) clonés dans l'interface graphique de chaque joueur lorsqu'ils rejoignent le jeu.
Empty
Empty
Empty
Les scripts placés dans l'Interface Graphique de Départ contrôlent généralement les éléments de l'interface utilisateur, tels que les boutons, les menus et d'autres éléments que les joueurs utilisent pendant le jeu.
Exemple de Interface Graphique de Départ
Empty
Empty
Empty
-- StarterGui > HealthGui > HealthScript
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local healthGui = script.Parent
local healthBar = healthGui:WaitForChild("Frame")
local healthLabel = healthBar:WaitForChild("TextLabel")
local function updateHealth()
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid then
local healthPercent = humanoid.Health / humanoid.MaxHealth
healthBar.Size = UDim2.new(healthPercent, 0, 1, 0)
healthLabel.Text = math.ceil(humanoid.Health) .. " / " .. math.ceil(humanoid.MaxHealth)
end
end
local humanoid = character:WaitForChild("Humanoid")
humanoid.HealthChanged:Connect(updateHealth)
updateHealth()
Roblox Studio
Si ce tutoriel vous a été utile et que vous souhaitez soutenir mon travail, veuillez envisager de m'offrir un café.
Merci beaucoup pour votre soutien !
M'offrir un café