--Made by Luckymaxer


Players = game:GetService("Players")
Debris = game:GetService("Debris")
UserInputService = game:GetService("UserInputService")

Player = Players.LocalPlayer
Mouse = Player:GetMouse()

ServerControl = script:WaitForChild("ServerControl").Value

function InvokeServer(mode, value)
	pcall(function()
		local ServerReturn = ServerControl:InvokeServer(mode, value)
		return ServerReturn
	end)
end

function MouseClick(Down)
	InvokeServer("MouseClick", {Down = Down})
end

function KeyPress(Key, Down)
	InvokeServer("KeyPress", {Key = Key, Down = Down})
end

Mouse.Button1Down:connect(function()
	MouseClick(true)
end)

Mouse.KeyDown:connect(function(Key)
	KeyPress(Key, true)
end)

ServerControl.Changed:connect(function(Property)
	if Property == "Parent" and not ServerControl.Parent then
		Debris:AddItem(script, 1)
	end
end)
