You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? What I’m trying to achieve is to fire a remote event when I buy a gamepass and sned the player name, gamepass id and gamepass name.
-
What is the issue? When I’m trying to buy my gamepasses as a test, my prints are printing out my player name twice and id once, this makes it really hard to find the gamepass value in the player in my script.
Local Script:
selected:FindFirstChild("GP"):FindFirstChild("Purchase").MouseButton1Click:Connect(function()
local GPNAME = tostring(selected:FindFirstChild("GP"):FindFirstChild("GPName").Text)
local gpassID = gps.Gamepasses[GPNAME]
mps:PromptGamePassPurchase(plr, gpassID)
game.ReplicatedStorage.Remotes.BoughtGamepass:FireServer(plr, gpassID, GPNAME)
end)
Server Script
game.ReplicatedStorage.Remotes.BoughtGamepass.OnServerEvent:Connect(function(plr, gpassID, GPNAME)
print(plr)
print(gpassID)
print(GPNAME)
end)
- What solutions have you tried so far? I looked for some answers in the Devforum but didn’t get the answer needed, I tried one thing where I made more variables in the remote function but then I got another Player twice, GamepassId once and Gamepass name once. it worked but I don’t really don’t want extra lines of code just for one value
I cant seem to solve this problem alone so some help would really help🙂
and Happy new years!