RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Make a sell pad that sells Food add comments to code telling me where to put it in studio""
-- server script (ServerScriptService) local part = Instance.new("Part") part.Size = Vector3.new(10, 1, 10) part.BrickColor = BrickColor.new("Bright green") part.Anchored = true part.Parent = game.Workspace part.Position = Vector3.new(0, 0.5, 0) -- Change the position to where you want the sell pad in the game part.Name = "SellPad" local function sellFood(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local playerFood = player.leaderstats.Food.Value if playerFood > 0 then player.leaderstats.Food.Value = 0 player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + (playerFood * 10) -- Change 10 to the desired amount of coins per food end end end part.Touched:Connect(sellFood) -- Add this script to ServerScriptService in Roblox Studio and place a part named "SellPad" where you want the sell pad to be. Make sure the player has leaderstats for Food and Coins.