Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TweenPostion is not a valid member of TextLabel in my StarterCharacter local script?

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)

2 answers

✓ Accepted answer

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)

1 comment

0

LMAO I DIDNT KNOW

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)

2 comments

0

This would tween the size, not the position.

0

i am not le script man then

This discussion is preserved as it was. New answers, comments, and votes are closed.