Hey everyone! I’m working on a game concept called Platform Trivia, where players spawn on three platforms. Every time a player answers a question incorrectly, one platform is removed. Once all platforms are gone—they’re eliminated.
This elimination mechanic is something I’m building manually, and while I’ve got the foundation going, scripting it properly has been a real challenge. I’d really appreciate any help or guidance from the community. Here’s what I’ve put together so far:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local platformTemplate = ReplicatedStorage:WaitForChild("PlatformTemplate")
local platformHeight = 5 -- Height between stacked platforms
-- Create folder to store player platforms
local platformsFolder = workspace:FindFirstChild("PlayerPlatforms")
if not platformsFolder then
platformsFolder = Instance.new("Folder")
platformsFolder.Name = "PlayerPlatforms"
platformsFolder.Parent = workspace
end
local function createPlatformForPlayer(player, index)
local platform = platformTemplate:Clone()
platform.Name = player.Name .. "_Platform"
platform.Parent = platformsFolder
-- Space platforms along X-axis to avoid overlap
local basePosition = Vector3.new(0, 10, 0)
local spacing = 20
platform.Position = basePosition + Vector3.new(spacing * (index - 1), 0, 0)
return platform
end
Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Wait()
-- Assign platform to player
local playerIndex = #Players:GetPlayers()
local platform = createPlatformForPlayer(player, playerIndex)
-- Position player above their platform
local character = player.Character
if character and character:FindFirstChild("HumanoidRootPart") then
character.HumanoidRootPart.CFrame = CFrame.new(platform.Position + Vector3.new(0, 5, 0))
end
end)`Preformatted text`
type or paste code here