Hello, i tried to make a local script in StarterCharacter that warns you you are about to die. but, the script has the error: 23:03:47.384 TweenPostion is not a valid member of TextLabel "Players.Nozazxe.PlayerGui.Warnings.Health"
local script:
local character = script.Parent local humanoid = character:WaitForChild("Humanoid") local player = game.Players:WaitForChild(character.Name) humanoid.HealthChanged:Connect(function(health) if health < 30 then local object = player.PlayerGui.Warnings.Health object:TweenPostion(UDim2.new(0.271, 0, 0.75, 0)) wait(3) object:TweenPostion(UDim2.new(0.271, 0, 1, 0)) end end)
A simple answer really. You spelled TweenPosition wrong. You spelled it "TweenPostion", missing an i in Position
local character = script.Parent local humanoid = character:WaitForChild("Humanoid") local player = game.Players:WaitForChild(character.Name) humanoid.HealthChanged:Connect(function(health) if health < 30 then local object = player.PlayerGui.Warnings.Health object:TweenPosition(UDim2.new(0.271, 0, 0.75, 0)) wait(3) object:TweenPosition(UDim2.new(0.271, 0, 1, 0)) end end)
Parts and things use Position, ui uses TweenSize!
just copy this, im pretty sure this will work
local character = script.Parent local humanoid = character:WaitForChild("Humanoid") local player = game.Players:WaitForChild(character.Name) humanoid.HealthChanged:Connect(function(health) if health < 30 then local object = player.PlayerGui.Warnings.Health object:TweenSize(UDim2.new(0.271, 0, 0.75, 0)) wait(3) object:TweenSize(UDim2.new(0.271, 0, 1, 0)) end end)