我試圖製作一個GUI,如roblox教程here。腳本未運行
它在我在工作室測試時有效,但不是當我點擊play game
時加入我的角色。
local player = game.Players.LocalPlayer
local unitFrame = script.Parent
unitFrame.Avatar.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&username="..player.Name
unitFrame.PlayerName.Text = player.Name
local healthBar = unitFrame.HealthBarContainer.HealthBar
player.CharacterAdded:connect(function(character)
local humanoid = character:WaitForChild('Humanoid')
humanoid.HealthChanged:connect(function(health)
local healthPercentage = health/character.Humanoid.MaxHealth
healthBar.Size = UDim2.new(healthPercentage, 0, 1, 0)
end)
end)
local StarterGui = game:GetService('StarterGui')
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
是的,它是一個本地腳本。我已經按f9,並在服務器日誌中說,內容失敗,因爲HTTP 404(HTTP/1.1 301永久移動) - 謝謝 – AskingEverythingForCode