I recently made a carry script for one of the games im working on It works on npcs just fine but refuses to work on players, the script is filtering enabled and has nothing wrong with it (even tested it and the player carrying the npc would appear on screen, but wouldnt work on other players as i just said) if anyone has a solution for this please let me know, i posted this before but have gotten no response, i have tried making the humanoidrootpart massless and trying to find a possible fix, someone please help me
Please post your code, or else we will be clueless on how to assist you with this situation.
local UIS = game:GetService("UserInputService")
if grab == true then return end
local ray = Ray.new(char["Right Leg"].CFrame.p, (hit.p - char["Torso"].CFrame.p).unit*range)
local hit, position = game.Workspace:FindPartOnRay(ray, user)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid and humanoid ~= char.Humanoid then
grab = true
im not giving out my entire code for obvious reasons (my code is directed to r6 and the characters are r6)
We wont be able to help you in this situation if you do not show us your full code. For example, we dont know what grab is. We need to know what happenes before this chunk of code to analize for any problems.
script.Parent.RE.OnServerEvent:connect(function(Player,hit)
local player = game.Players.LocalPlayer
local char = Player.Character
local h = char.Humanoid
local tool = script.Parent
local user
local range = 10
local rightarm
local unknock = require(game.ReplicatedFirst.RagdollUnknock)
local rag = require(game.ReplicatedFirst.Ragdoll)
grab = false
You have oddly defined player as game.Players.LocalPlayer despite this being server-sided code. The player instance is given to you as the first argument of the OnServerEvent function.
i changed it to GetPlayerFromCharacter and its still broken
You don’t need that line of code. The player is already given to you as the first argument of the RemoteEvent as “Player”.
but the problem that i have is that it works on npcs but not players
You will need to provide your full code to get meaningful help with your problem ![]()
We are unable to derive the necessary troubleshooting info from the code you have provided.