im trying to do controls for my game but since module scripts dont replicate to server i put it in a local script that should replicate to the server yet it doesn’t replicate to the server
here’s my code:
LocalScript
local event = game.ReplicatedStorage.classEvents:WaitForChild("pilgrimmed")
local uis = game:GetService("UserInputService")
event:FireServer("WeldSword")
uis.InputBegan:Connect(function(input, gpe, chatting)
if chatting then return end
if gpe then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
event:FireServer("LMB")
elseif input.KeyCode == Enum.KeyCode.One then
event:FireServer("Backstab")
elseif input.KeyCode == Enum.KeyCode.Two then
event:FireServer("KingsSpin")
elseif input.KeyCode == Enum.KeyCode.Three then
event:FireServer("Parry")
end
end)
Script
(for some reason, doesn’t print the any or plr.Name)
local event = game.ReplicatedStorage.classEvents:WaitForChild("pilgrimmed")
local pilgrim = require(game.ReplicatedStorage.classes:WaitForChild("pilgrimmed"))
event.OnServerEvent:Connect(function(plr, any)
print(any)
print(plr.Name)
if any == "LMB" then
pilgrim.LMB(plr.Character, workspace.Terrain)
elseif any == "Backstab" then
pilgrim.Backstab(plr.Character, workspace.Terrain)
elseif any == "KingsSpin" then
pilgrim.KingsSpin(plr.Character, workspace.Terrain)
elseif any == "ParryButNotReally" then
pilgrim.ParryOrSoYouThink(plr.Character, workspace.Terrain)
elseif any == "WeldSword" then
pilgrim.WeldSword(plr.Character)
end
end)