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

How do i take away from the current Y scale of my part?

Instead of changing the Y scale of the part to -10 I want to find the currunt Y scale and minus 10 from that. Example: The Y scale is 320 studs -10 =310 studs

local size = Vector3.new(380.5,-10,2318)--What I need help with.
local Lava = script.Parent
game:GetService('Players').PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(character)
		character:WaitForChild("Humanoid").Died:connect(function()
			print(player.Name .. " has died!")
			Lava.Size = size
		end)
	end)
end)

3 answers

✓ Accepted answer

Try this:

local Lava = script.Parent

Lava.Size = Vector3.new(380.5, Lava.Size.Y - 10, 2318)

Then complete the script. Hope this works.

1 comment

0

yyyyyeyeyeyssssssssssssssssssssssss

local y = -10
local size = Vector3.new(380.5,y,2318)--What I need help with.
local Lava = script.Parent
game:GetService('Players').PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        character:WaitForChild("Humanoid").Died:connect(function()
            print(player.Name .. " has died!")
	    	y = y - 10 --if that's what you're looking for
            script.Parent.Vector3 = Vector3.new(380.5,y,2318) 
        end)
    end)
end)

Try this out. Hope it works!

1 comment

0

still doesent take away 10 studs in height

Hope this works

local Lava = script.Parent
Lava.Size =  Vector3.new(380.5,-10,2318)
game:GetService('Players').PlayerAdded:Connect(function(player) -- :connect is deprectated use :Connect instead
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid").Died:Connect(function()
            print(player.Name .. " has died!")
            Lava.Size = Lava.Size - Vector3.new(0, 10, 0)
        end)
    end)
end)

1 comment

0

already tryed that

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