Button not teleporting on click and keyboard touch not teleporting bug error: "Argument 1 missing or nil"

Hello guys, i found 2 issues.

It’s the same one, but… diffirent…

  1. The mouse click button not teleporting.
  2. Any keys not teleporting (That comes to the same).

Script:

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Character = Player.Character or Player.CharacterAdded:Wait()
local ToSpawn = game.Workspace["Droplet's Modified Evercyan's RPG Kit"].ToSpawn
local debounce

local function TeleportToSpawn()
	if debounce then
		return
	end
	debounce = true
	Character:PivotTo()
	for i = 0, 9 do
		script.Parent.Text = "(T) Teleport To Spawn (".. (10 - i) ..")"
		task.wait(1)
		script.Parent.Text = "(T) Teleport to Spawn"
	end

	debounce = false
end

Mouse.KeyDown:connect(function(key)
	if key == "t" then
		TeleportToSpawn(ToSpawn)
	end
end)

script.Parent.MouseButton1Up:Connect(function()
	TeleportToSpawn(ToSpawn)
end)

It’s a localscript…

Also, this is probably not my script…

Issues: Line 12 / Line 24 / Line 29 (Not 3 issues but 2).

So yeah, any help is appreciated.

Oh yeah i realized that i didn’t found any images, but that’s okay…

I noticed you provided an argument where you’re calling the function, but in the original function you dont even have any parameters.

So i have to delete the issues that is on Line 12 / Line 24 / Line 29 ?