https://developer.roblox.com/en-us/api-reference/class/UserInputService
don't know what 'input' is in your script.
when you fire the event, you aren't even using the input thing. You are just firing it right away so pressing r won't do anything.
local userinput = game:GetService'UserInputService'
local Event = game:GetService("ReplicatedStorage").Events.Compulsion
local A_1 = "PunchSelf"
local A_2 =
{
[1] = game:GetService("Workspace").mouse.target
}
userinput.inputbegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.R then
Event:FireServer(A_1, A_2)
in the server script, it could be something like this
local Event = game:GetService("ReplicatedStorage").Events.Compulsion
Event.OnServerEvent:Connect(function(player, A_1, A_2)
end)
1 comment
*made