Heyo. Thru a single remote event having gone from one localscript, to serverscript, to another localscript, I am unable to pass thru a player object or at some object. You interact with the other player and I raycast to get their character and a loop to get their player instance then pass it thru the event. Apparently it dies out when it hits the other client and I have no idea why. Any response would be dope!
LocalScript 1
--targetplayer is raycastresult.Parent
local servertarget
for _, v in pairs(Players:GetPlayers()) do
if v.Name == tostring(targetplayer) then
servertarget = v
print(tostring(servertarget))
end
end
if not servertarget then
warn("Your loop didnt work numbnuts!")
end
--...
--throw is remote event located in replicatedstorage
throw:FireServer(servertarget)
Server Script
throw.OnServerEvent:Connect(function(player,t)
throw:FireClient(t)
end)
LocalScript2
throw.OnClientEvent:Connect(function(player)
local HRP = player.Character:FindFirstChild("HumanoidRootPart") --Nils out right here
end)