Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 6 years ago

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

Log in to vote
-1
Answered by 6 years ago

Try this:

local Lava = script.Parent

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

Then complete the script. Hope this works.

0
yyyyyeyeyeyssssssssssssssssssssssss Prbo1201 56 — 6y
Ad
Log in to vote
1
Answered by 6 years ago
Edited 6 years ago
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!

0
still doesent take away 10 studs in height Prbo1201 56 — 6y
Log in to vote
0
Answered by
Griffi0n 315 Moderation Voter
6 years ago
Edited 6 years ago

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)
0
already tryed that Prbo1201 56 — 6y

Answer this question