This is the first script (localsript) which works perfectly
local player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local deboune = false
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.LeftShift then
if deboune == true then return end
deboune = true
game.ReplicatedStorage.Controls.ShiftCharge:FireServer(Input)
wait(.3)
deboune = false
end
end)
this is the script in which im having some trouble with. i got rid of lots of the script to shorten it to the important bits
local user = game:GetService("UserInputService")
game.ReplicatedStorage.Controls.ShiftCharge.OnServerEvent:Connect(function(plr, Input)
repeat
x = x + 1
wait(1)
until user.InputEnded --Input.UserInputState == Enum.UserInputState.End
end)
Input.UserInputState == Enum.UserInputState.End
works in studio as there is no client-server boundary but in game it doesnt work.
user.InputEnded doesnt work in studio and the game eventhough im still pressing the key.

2 comments
I would recommend using bool values.
UserInputService will never work in server scripts