OneCompiler

Framework

189

--Variables
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local humanoid = character:WaitForChild("Humanoid")

--Service
local UIS = game:GetService("UserInputService")
local SS = game:GetService("ServerStorage")
local REPS = game:GetService("ReplicatedStorage")

--Other Variables
local SuitsFolder = SS:WaitForChild("Suits")

local SuitOne = SuitsFolder.suit

--Events
local events = REPS:WaitForChild("Events")

local sendSuitEvent = events.SendSuit

--Checks
hasSuit = false
calledSuit = false

--Function
local function sendSuit()
if not hasSuit and calledSuit then
sendSuitEvent:FireServer()
end
end

--Events
UIS.InputBegan:Connect(function(input, chatting)
if not chatting then
if input.KeyCode == Enum.KeyCode.G then
sendSuit()
end
end
end)