I am trying to send a remote event to the server from the client in two module loaded module scripts
As of now, the server is not detecting anything being sent
I believe this may because of the fact that I changed the scope of my program by removing local from multiple functions, yet, this should still work
client function
function pickUp()
local target = mouse.Target
if target == nil then
return
end
if target:HasTag(TAG_GRABBED) or not target:HasTag(TAG_OBJECT) or (target.Position - player.Character:GetPivot().Position).Magnitude > RANGE_MAX or self.isGrabbing then
return
end
self.isGrabbing = true
unbindInit()
lockPlayer()
rev_InitInteraction:FireServer(target)
--event attempting to fire to the server
game.ReplicatedStorage.Remotes.RemoteEvent.InitInteraction:FireServer()
print("clicked")
end
server side
rev_InitInteraction.OnServerEvent:Connect(function(player:Player, target:Part) --Player requests to pick up an object
print("caught")
local magnitude = (player.Character:GetPivot().Position - target.Position).Magnitude
if target == nil then
rev_InitInteraction:FireClient(player)
return
end
if target:HasTag(TAG_GRABBED) or not target:HasTag(TAG_OBJECT) or magnitude > RANGE_MAX or target == nil then
rev_InitInteraction:FireClient(player)
return
end
local playerHumanoid = player.Character.Humanoid
target:AddTag(TAG_GRABBED)
target.Anchored = true
local targetPosition = player.Character:GetPivot().Position:Lerp(target.Position, (magnitude-RANGE_CLOSE)/magnitude)
while RunService.Heartbeat:Wait() do
playerHumanoid:MoveTo(Vector3.new(targetPosition.X,0,targetPosition.Z))
local xCheck = math.abs(player.Character:GetPivot().Position.X - targetPosition.X) < 1
local zCheck = math.abs(player.Character:GetPivot().Position.Z - targetPosition.Z) < 1
if xCheck and zCheck then
break
end
end
rev_InitAnimation:FireAllClients(player, "rbxassetid://118832436755769")
task.wait(0.5)
local rightArm:Part = player.Character["Right Arm"]
target.Anchored = false
target.CanCollide = false
Weld:Create(target, rightArm, target.CFrame,CFrame.Angles(-math.rad(90),0,0) * CFrame.new(0, 0, -1.5) * target.CFrame)
rev_InitInteraction:FireClient(player, target)
end)
client and server reffrence, both are named the same
topology
