Hi, i making combat system for my game but there is issue that i place remote event in replicated storage and then player in game get remote event in same time and do same thing at same times like this
I don’t know where i should i place my remote event please help me
i also create parameter and it dont work
Here in my local script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local player = game.Players.LocalPlayer
local EquipSword = ReplicatedStorage:WaitForChild("EquipSword")
local UserInputService = game:GetService("UserInputService")
local Attack = ReplicatedStorage:WaitForChild("Attack")
local function onInputBegan(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.E then
EquipSword:FireServer(player.Name)
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
Attack:FireServer(player.Name)
end
end
UserInputService.InputBegan:Connect(onInputBegan)
And this is some my script that get remote event
game.ReplicatedStorage.EquipSword.OnServerEvent:Connect(function(hhh, parameter)
if not parameter ~= player.Name then
EquipSword()
end
end)
equipsword = false
EquipSword()
respawned = true
game.ReplicatedStorage.Attack.OnServerEvent:Connect(function(hhh, parameter)
if not parameter ~= player.Name then
swing()
end
end)
