Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is the ToP function deprecated?

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 )

4 comments

0

Deprecated != Doesn't work

0

Well I know that. I'm asking if ToP is deprecated?

0

What is top

0

I can't find any history on ToP. Not even on the wiki. When I look up all the deprecated functions, the only thing i see is LoadLibrary. No history on ToP whatsoever

1 answer

✓ Accepted answer

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.

2 comments

0

Ah, thanks. Lemme try it

0

I still don't know what top is????

This discussion is preserved as it was. New answers, comments, and votes are closed.