Code in a script that's inside of a tool; I have a RemoteEvent thats in the script and when the player equips the tool it copies the RE and puts it into game.ReplicatedStorage with a different name. Now I need help somehow firing the Remote Event.
script.Parent.Equipped:Connect(function()
local player = script.Parent.Parent.Name
local RE = script.WeaponEquipped:Clone()
RE.Name = ("Equipped" .. player)
RE.Parent = game.ReplicatedStorage
wait(1)
game.ReplicatedStorage:FindFirstChild("Equipped" .. player):FireClient(player)
end)
Output comes back with "Unable to cast value to object, line 7"

4 comments
Didnt work
Yeah, it wouldn't, because script.Parent.Parent being assigned to player is not a Player object, it's a character Model. You need to use Players:GetPlayerFromCharacter(script.Parent.Parent) to get the Player object.
Also, cloning the remote event is a very bad idea. The server Script and client LocalScript should reference the one that's the child of the script. It's already a copy. By cloning it and not giving it a unique name, you risk creating multiple copies of the event with the same name in ReplicatedStorage, and then client and server won't be referencing the same one except sometimes by random chance.
If you want one copy of the event in ReplicatedStorage, you have to add code to ensure that the server does not make a second copy of an event that already exists in there with the same name.