How would i make player bigger when hold a key

and make other player see the how big the player is instaed off a player floating in the air

when the player presses down on their keyboard fire a remote event and constantly keep resizing them. when they let go of the key then stop sizing them.

here is some “sample” code that illustrates how you could write something like this.

imaginary client code

local userinputservice = game:GetService("UserInputService")

local event = game.ReplicatedStorage.RemoteEvent

userinputservice.InputBegan:Connect(function(key, busy)
    if busy then return end
    if key.KeyCode ~= Enum.KeyCode.F then return end

    event:FireServer(true)
end)

userinputservice.InputEnded:Connect(function(key, busy)
    if busy then return end
    if key.KeyCode ~= Enum.KeyCode.F then return end

    event:FireServer(false)
end)

and some imaginary server listener

local event = game.ReplicatedStorage.RemoteEvent
local states = {}

event.OnServerEvent:Connect(function(player, value)
    states[player] = value

    while (states[player]) do
        coolFunctionThatResizesPlayer(player) 
        wait()
    end
end)
1 Like