i was coding my new game and i got a Error: 19:11:40.756 - ServerScriptService.events.stashon:3: bad argument #3 to 'Value' (string expected, got Object)
on line 3 of this code
local Plr_name = script.Parent.Parent.Parent.Parent.Parent.Parent.Name script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Parent.Visible = false game.ReplicatedStorage.stashon:InvokeServer(Plr_name) end)
this is the Server script
function give_stshon(Plr_name) if game.ServerScriptService.ONrs.s_1.Value == "" then game.ServerScriptService.ONrs.s_1.Value = Plr_name return 1 end if game.ServerScriptService.ONrs.s_2.Value == "" then game.ServerScriptService.ONrs.s_2.Value = Plr_name return 2 end if game.ServerScriptService.ONrs.s_3.Value == "" then game.ServerScriptService.ONrs.s_3.Value = Plr_name return 3 end if game.ServerScriptService.ONrs.s_4.Value == "" then game.ServerScriptService.ONrs.s_4.Value = Plr_name return 4 end if game.ServerScriptService.ONrs.s_5.Value == "" then game.ServerScriptService.ONrs.s_5.Value = Plr_name return 5 end if game.ServerScriptService.ONrs.s_6.Value == "" then game.ServerScriptService.ONrs.s_6.Value = Plr_name return 6 end end game.ReplicatedStorage.stashon.OnServerInvoke = give_stshon
Change (Plr_name) after "InvokeServer" to () because by default Roblox sets the value to the player that clicked the Gui.