Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 2 months ago
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

Log in to vote
2
Answered by
Raccoonyz 893 Donator Moderation Voter
2 months ago

: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")

Ad

Answer this question