local UIS = game:GetService("UserInputService")
PartCounter = 0
KeyPressed = false
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
KeyPressed = true
while KeyPressed == true do
wait()
local part = Instance.new("Part")
part.Position = Vector3.new(-12.078, 36.522, 34.601)
part.Size = Vector3.new(2,2,2)
part.Parent = game.Workspace
PartCounter = PartCounter + 1
game.StarterGui.PartCounterUI.Number.Text = PartCounter
end
end
end)
UIS.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Q then
KeyPressed = false
end
end)
so basically i made a UI to show the players how many parts they have spawned, i can say print(PartCounter) but then they wont be able to see how many parts they have spawned so idk what to do.