So I was busy making a Raycast weapon, when I found that it was saying that ToP was a nil value. Has ToP been deprecated? I looked back at some RayCast videos from Feb 2019 and ToP was an official function. Here's the code:
local FireEvent = script.Parent.FireEvent local Dmg = math.random(15, 20) FireEvent.OnServerEvent:Connect(function(Player, FromP, ToP) local RayCast = Ray.new(FromP, (ToP-FromP).unit*100) local Part = game.Workspace:FindPartOnRay(RayCast, Player.Character, false, true) if Part then local Hum = Part.Parent:FindFirstChild("Humanoid") if Hum then Hum:TakeDamage(Dmg) end end end)
Any ideas? (I did look in object browser and found no results )
Judging from your code, "ToP" is not something made by roblox but a variable created by yourself in line 3. The issue seems to be that the client did not provide the third argument to the remote event, which is why "ToP" became nil. I would advice you to start looking into your localscript
to find out why the client doesn't provide the last argument.