OK, so earlier I asked a question about the stickmasterluke mad bloxxer tutorial. I got help from that, fixed it, and moved on. Now there is another error saying: "12:35:53.396 - Unable to cast value to Object" and I was thinking, is it because of FiringClient?
Here is what I have for the error:
--give players tools local backpack = player:FindFirstChild("Backpack") if backpack then if player == knifeman then local knife = ss:WaitForChild("Knife"):clone() knife.Parent = backpack event:FireClient("Class", "Knifeman") elseif player == officer then local revolver = ss:WaitForChild("Revolver"):clone() revolver.Parent = backpack event:FireClient("Class", "Officer") else event:FireClient("Class", "Innocent")
so it says that error on the "event:FireClient" parts. So is it something wrong? I added varibles for serverstorage to make it ss. Anyone know the problem and how should I fix it?
A quick search on the Wiki for FireClient
pulls up the API reference for RemoteEvent:FireClient
, which just so happens to be the function giving you the error.
As Kingdom mentions, your Player
argument is a string rather than a Player, and is therefore giving you an error. The solution is to provide a Player as the first argument so that it knows who to tell.
--give players tools local backpack = player:FindFirstChild("Backpack") if backpack then if player == knifeman then local knife = ss:WaitForChild("Knife"):clone() knife.Parent = backpack event:FireClient(player, "Class", "Knifeman") elseif player == officer then local revolver = ss:WaitForChild("Revolver"):clone() revolver.Parent = backpack event:FireClient(player, "Class", "Officer") else event:FireClient(player, "Class", "Innocent")