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

Invalid argument #3 (string expected, got Instance)?

game.ReplicatedStorage.ChangeCrate.OnServerEvent:Connect(function(plr,str)
	local stats = plr:WaitForChild("stats").CrateValue
	local String = str
	stats.Value = String
end)

Event^^ Apparently str is an Instance.

local plr = game.Players.LocalPlayer
event:FireServer(plr,"Large Crate")

What I fired ^^

1 answer

✓ Accepted answer

:FireServer() does not require a player instance as the first argument. However, since you provided it, the "str" variable is actually the player instance. This is because :FireServer() accepts a tuple of arguments,

To fix it, you can do this. event:FireServer("Large Crate")

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