- What do you want to achieve?
So in this gun script the arms move with your camera, ex: you look up and your arms point up, and it’s supposed to just send the data of the arm angles over to the server where it then changes the arm angle on the server so everyone can see.
- What is the issue? Include screenshots / videos if possible!
This used to work but for whatever reason it stopped working and I’m not certain why. The issue is that even though the event fires and there is a OnServerEvent it still says that it the event was dropped, the problem is probably that the event isn’t being reached for whatever reason but I’m not sure why.
- What solutions have you tried so far?
- I have tried looking at other posts
- I have added a print statement in the event and above the event to see if it reaches the event (it doesn’t)
- Rewriting the “OnServerEvent” + Checking for spelling errors
- Moving the OnServerEvent to the top of the script so nothing obstructs it
This image shows how everything is set up.
Server Script:
print("reached this thingy")
script.Parent.position.OnServerEvent:Connect(function(player, armdata1, armdata2)
if tool.Enabled == true and player.Name == character then
character.Torso["Left Shoulder"].C0 = armdata1
character.Torso["Right Shoulder"].C0 = armdata2
--else
--player:Kick("Gun System: Potential Exploiter")
end
end)
Local Script:
runservice.Heartbeat:Connect(function()
if equiped then
local rightX, rightY, rightZ = char.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
char.Torso["Right Shoulder"].C0 = (char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
local leftX, leftY, leftZ = char.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
char.Torso["Left Shoulder"].C0 = (char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))
script.Parent.position:FireServer((char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y)), (char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y)))
end
end)
Error: Remote event invocation queue exhausted for Workspace.Asmetics.AK-47.position; did you forget to implement OnServerEvent? (x events dropped)