local function retractTongue() if gameEnabled then tonguePart.Size = Vector3.new(tonguePart.Size.X, tonguePart.Size.Y, tonguePart.Size.Z - tongueRetractSpeed) if tonguePart.Size.Z < 0 then tonguePart.Size = Vector3.new(tonguePart.Size.X, tonguePart.Size.Y, 0) end updateLeaderboard() end end
In Roblox Studio, create a new LocalScript or Script (depending on your preference) and name it TongueBattlesScript . You can attach this script to a Part or Model in your game. Roblox Tongue Battles Script
You can display the leaderboard using a Gui or a BillboardGui . For simplicity, we'll just print the leaderboard to the console: For simplicity, we'll just print the leaderboard to
Create a function to update the leaderboard: 0 then tonguePart.Size = Vector3.new(tonguePart.Size.X
UserInputService.InputBegan:Connect(function(input) if input.KeyCode == Enum.KeyCode.E then -- Grow the tongue when the 'E' key is pressed growTongue() elseif input.KeyCode == Enum.KeyCode.R then -- Retract the tongue when the 'R' key is pressed retractTongue() end end)
We'll use the UserInputService to detect player input. Add the following code:
local UserInputService = game:GetService("UserInputService")