RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a script for a game about batatas"
I'm not sure what specific gameplay you want for a game about batatas (potatoes), but here's a simple script for a game where players collect batatas and bring them to a sell pad to earn points. First, create a leaderstats value for each player to store their points and batatas. ```lua -- server script game.Players.PlayerAdded:Connect(function(player) local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player local Points = Instance.new("IntValue") Points.Name = "Points" Points.Parent = leaderstats local Batatas = Instance.new("IntValue") Batatas.Name = "Batatas" Batatas.Parent = leaderstats end) ``` Next, create a script for the batata part that players can collect. ```lua -- server script for batata part local part = script.Parent local canCollect = true local function collect(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player and canCollect then local playerBatatas = player.leaderstats.Batatas.Value if playerBatatas < 3 then canCollect = false player.leaderstats.Batatas.Value = player.leaderstats.Batatas.Value + 1 part.Position = Vector3.new(math.random(-100,100),part.Position.Y, math.random(-100,100)) wait(1) canCollect = true end end end part.Touched:Connect(collect) ``` Finally, create a script for the sell pad where players can sell their batatas for points. ```lua -- server script for sell pad local part = script.Parent local function sell(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local playerBatatas = player.leaderstats.Batatas.Value if playerBatatas > 0 then player.leaderstats.Batatas.Value = 0 player.leaderstats.Points.Value = player.leaderstats.Points.Value + (playerBatatas * 10) end end end part.Touched:Connect(sell) ``` This script creates a simple game where players collect batatas (up to 3) and bring them to a sell pad to earn points. You can customize the gameplay, values, and mechanics as desired.