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

3 comments
Cool but we don't even have that server script
is this the whole script, because it doesn't look like it, PS, you dont need to send the Plr_name to the server because the server will automatically get the player who invoked the server on that remote function
Include the server script code from server script service and i'll be glad to help;