我试图制作一个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