How to make a button that make player's size smaller and bigger(ROBLOX STUDIO)

Поделиться
HTML-код
  • Опубликовано: 20 дек 2024

Комментарии • 2

  • @WomanFace-y5o
    @WomanFace-y5o 4 месяца назад

    the big button works but the small one makes everbody small.

  • @ItJJBOY0527
    @ItJJBOY0527  7 месяцев назад

    Big Script
    local textButton = script.Parent -- Reference to the TextButton instance
    -- Function to increase the player's size
    local function increasePlayerSize(player)
    local character = player.Character or player.CharacterAdded:Wait()
    if character then
    local currentScale = character:GetScale()
    character:ScaleTo(currentScale + 0.1) -- Increase the scale factor by 0.1
    end
    end
    -- Connect the function to the button's activation (click)
    textButton.MouseButton1Click:Connect(function()
    local player = game.Players.LocalPlayer
    increasePlayerSize(player)
    end)
    Small Script
    local button = script.Parent -- Reference to the TextButton instance
    -- Function to scale the player down
    local function makePlayerSmaller(player)
    local character = player.Character or player.CharacterAdded:Wait()
    local currentScale = character:GetScale()
    local newScale = currentScale * 0.9 -- Scale down by 10%
    character:ScaleTo(newScale)
    end
    -- Connect the button click event
    button.MouseButton1Click:Connect(function()
    local players = game:GetService("Players")
    for _, player in pairs(players:GetPlayers()) do
    makePlayerSmaller(player)
    end
    end)