Local Script:
local sendrequest = game.ReplicatedStorage:WaitForChild("GiveItem").SendRequest
local sendback = game.ReplicatedStorage:WaitForChild("GiveItem").Sendback
local frameTemplate = game.ReplicatedStorage:WaitForChild("GiveItem").Frame
local player = game.Players.LocalPlayer
sendrequest.OnClientEvent:Connect(function(target, playername, itemname)
if target.Name == player.Name then
local frame = frameTemplate:Clone()
frame.Parent = script.Parent.Frame
frame.TextLabel.Text = playername.." would like to give you a "..itemname
frame.Yes.MouseButton1Click:Connect(function()
frame:Destroy()
sendback:FireServer(itemname)
end)
frame.No.MouseButton1Click:Connect(function()
frame:Destroy()
end)
end
end)
Server Script:
local sendback = game.ReplicatedStorage:WaitForChild("GiveItem").Sendback
sendback.OnServerEvent:Connect(function(item)
print(item)
end)
As of right now, it just prints the player’s name. I want it to print the itemname.