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

How to add multiplication into Function?

Asked by 9 years ago

I'm trying to get it to where the YMINUS is multiplied by the Queue so if it's 5 it multiplies 55 by 5

---------[Constants]-------------------------------------------------------------------------------

local X = -200
local XCLOSE = 200
local Y = 355
local YCLOSE = 355
local YMINUS = 55
local Queue = 0

---------[End]-------------------------------------------------------------------------------------

function Notify()
    if Queue == 0 then
        local Notification = script.Parent.Notification:clone()
        Notification.Name = "Notification1"
        Notification.Parent = script.Parent
        Notification:TweenPosition(UDim2.new(1, X, 0, Y), "Out", "Bounce", .5, true)
        Queue = Queue + 1
        wait(5)
        Notification:TweenPosition(UDim2.new(1, XCLOSE, 0, Y), "Out", "Bounce", .5, true)
        Queue = Queue - 1
    elseif Queue == 1 then
        script.Parent.Notification1:TweenPosition(UDim2.new(1, X, 0, Y-YMINUS), "Out", "Back", .5, true)
        YCLOSE = YCLOSE-YMINUS
        local Notification = script.Parent.Notification:clone()
        Notification.Name = "Notification2"
        Notification.Parent = script.Parent
        Notification:TweenPosition(UDim2.new(1, X, 0, Y), "Out", "Bounce", .5, true)
        Queue = Queue + 1
        wait(5)
        Notification:TweenPosition(UDim2.new(1, XCLOSE, 0, Y), "Out", "Bounce", .5, true)
        Queue = Queue - 1
    end
end

game.workspace.PlayerJoined.OnClientEvent:connect(function()
    script.Parent.Notification.Text = game.workspace.PlayerJoined.PlayerName.Value .. " has joined."
    Notify()
end)

game.workspace.PlayerLeft.OnClientEvent:connect(function()
    script.Parent.Notification.Text = game.workspace.PlayerLeft.PlayerName.Value .. " has left."
    Notify()
end)

Answer this question