So I am currently wanting to make a gui which if you click the Place Part button then it places a part at the players position. But when I click the Place Part button it shows this in the output:
Players.xxoplol47811t.PlayerGui.ScreenGui.Frame.PlacePartButton.LocalScript:7: invalid argument #2 to 'new' (Instance expected, got Vector3)
Also I probably use debounce weird compared to other scripters but I prefer this way.
Code which is in a local script in a button:
local button = script.Parent
local Position = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart").Position
debounce = false
script.Parent.MouseButton1Click:Connect(function()
if debounce == false then
Instance.new("Part", Position)
debounce = true
else
if debounce == true then
wait(0.5)
debounce = false
end
end
end)
Thanks.

1 comment
Your debounce implementation means that the second time you click, even if it's 10 seconds after the first click, nothing will happen.