So I have a problem right now because whenever I try to use certain buttons in my gui, it will have an error printed out in the Developer Consoles saying: ServerScriptService.IHelpSadLocalScripts:10: bad argument #2 (string expected, got Object) and then it happens at line 10.
Also, there is the same exact error but on line 5, line 20, and line 26. This is my code:
game.ReplicatedStorage.moneyevent.OnServerEvent:Connect(function(player,asd,amount)
game.ServerStorage.MoneyStorage[asd].Value = amount
end)
game.ReplicatedStorage.tempgui.OnServerEvent:Connect(function(player,asd)
game.Players[asd].admingui.Contents.Visible = true
game.Players[asd].admingui.Border1.Visible = true
game.Players[asd].admingui.TempClose.Visible = true
end)
game.ReplicatedStorage.giveitem.OnServerEvent:Connect(function(player,asd,itemid,amount)
game.ServerStorage.AwardItem:Invoke(game.Players[asd],itemid,amount)
end)
game.ReplicatedStorage.clearcrate.OnServerEvent:Connect(function(player,cratetype)
for i,v in pairs(workspace:GetChildren()) do
if v.Name == cratetype then
v:Destroy()
end
end
end)
game.ReplicatedStorage.ucevent.OnServerEvent:Connect(function(player,asd,amount)
game.Players[asd].Crystals.Value = amount
end)
game.ReplicatedStorage.crateevent.OnServerEvent:Connect(function(player,asd,cratetype,amount)
game.ServerStorage[cratetype]:Clone().Parent = workspace workspace[cratetype].Position = workspace[asd].HumanoidRootPart.Position workspace[cratetype].Position = workspace[cratetype].Position + Vector3.new(20,0,0) local x = 0 local y = amount while x < y do workspace[cratetype]:Clone().Parent = workspace x = x + 1 end
end)
game.ReplicatedStorage.boxevent.OnServerEvent:Connect(function(player,asd,boxtype,amount)
game.Players[asd].Crates[boxtype].Value = amount
end)
Thanks for helping. -- Nevermind, I fixed it myself long ago.

3 comments
It seems as if asd is an object. Try doing [asd.Name] or you can just call asd.Crystals. I can't tell for sure or not without seeing the script firing the tempgui
It is not a local-script. that is a server script that decides whenever the event is fired. What I mean by asd is the username defined by gui. Player was just there to fix another error i had.
What actually is "asd"?