Problem:
local String = Instance.new("ObjectValue", game.Workspace.Cake:FindFirstChild("Batter"))
String.Value = plr
String.Name = "Player Who Owns the Part"
Creates a string but puts it into the same part every time a part is made, and not the newest part.
Full Code:
local Button = script.Parent.Button2
local Drop = script.Parent.Drop
local Ready = true
local plrValue;
function MakeBlock(plr) -- added plr, because first argument of mouseclick is the player who has clicked it
if Ready then
Ready = false
local Block = Instance.new("Part", game.Workspace.Cake)
Block.CFrame = Drop.CFrame
Block.Size = Vector3.new(3, 1.2, 3)
Block.Material = Enum.Material.SmoothPlastic
Block.BrickColor = BrickColor.new("Pastel brown")
Block.Name = "Batter"
local String = Instance.new("ObjectValue", game.Workspace.Cake:FindFirstChild("Batter"))
String.Value = plr
String.Name = "Player Who Owns the Part"
game.Debris:AddItem(Block, 400)
wait(3)
Ready = true
end
end
Button.ClickDetector.MouseClick:Connect(MakeBlock)
Everything works, I just need it to insert a String into the newest part of the group..
This script listens to a button that tells the script to make a new part called Batter, in a group named Cake.
Then it gives the Batter a Object Value which states the owner.
It keeps placing the string into the same part though.. Here's whats happening. I need to find a way to make it put a string in the newest part
If anyone can help, that would be great. :)

2 comments
Wow haha. Thank you. :D I dont know how I didnt think of that. I sat here for a while thinking of complicated solutions, yet the answer was so simple.
np