I can’t figure out how i can make a trade request system i tried many tries but it all leads to no error output or the unable to cast value to object
This is my serverscript:
game.ReplicatedStorage.Remotes.SendTrade.OnServerEvent:Connect(function(plr,n)
if game.Players:FindFirstChild(n).PlayerGui.Value.Value ~= true then
print(plr,n)
game.ReplicatedStorage.Remotes.Monekytrading:FireClient(n,plr)
game.Players:FindFirstChild(n).PlayerGui.Value.Value = true
game.Players:FindFirstChild(n).PlayerGui.ScreenGui.request.Value.Value = plr
end
end)
This is the script which fires the remote event:
script.Parent.MouseButton1Up:Connect(function(plr)
local n = script.Parent.Parent.TextLabel.Text
script.Parent.Parent.Parent.Parent.Visible = false
game.ReplicatedStorage.Remotes.SendTrade:FireServer(n)
end)