There are a couple of issues with the given code:
Fixing the player retrieval issue in the code.
local player = game.Players..split[2] is attempting to concatenate the Players service with the element at index 2 of the split array. This is not allowed in Luau, and would result in a runtime error. To retrieve the player with the specified name, you should use the GetPlayerByName method of the Players service, like this:
local player = game:GetService("Players"):FindFirstChild(split[2])
Fixing the tool retrieval issue in the code.
local tool = game.ReplicatedStorage..split[3]..split[4] is attempting to concatenate the ReplicatedStorage service with the element at index 3 of the split array, and then concatenate the result with the element at index 4 of the split array. This would also result in a runtime error. To retrieve the tool from ReplicatedStorage, you should use indexing, like this:
local tool = game:GetService("ReplicatedStorage")[split[3]][split[4]]
These changes should fix the issues with the code and allow it to work as intended.