I am trying to make a tipping system in which staff can upload their own gamepasses as donation options!
I’ve made This ScreenGui:
On my LocalScript when FocusIsLost on the TextBox, it fires a RemoteEvent with the value. It also checks if it’s a number with tonumber(text)
.
I’ve added print statements, and I’ve seen it prints before and after the RemoteEvent is fired.
On my ServerScript I have the following script:
game.Players.PlayerAdded:Connect(function(plr)
game.ReplicatedStorage.Edit.OnServerEvent:Connect(function(id)
print(id)
local clone = script.Template:Clone()
clone.Id.Text = tostring(id)
clone.PriceValue.Text = game.MarketplaceService:GetProductInfo(id, Enum.InfoType.GamePass) --Line 8
clone.Parent = plr.PlayerGui.TipGui.Tips.ScrollingFrame
local success, err = pcall(function()
clone.PriceValue.Text = game.MarketplaceService:GetProductInfo(id, Enum.InfoType.GamePass).PriceInRobux.." R$"
end)
if not success then
game.ReplicatedStorage.Error:FireClient(plr, true)
else
game.ReplicatedStorage.Error:FireClient(plr, false)
end
end)
end)
The error I’m getting is Unable to cast Instance to int64
, from Line 8 so the script doesn’t continue.
It also doesn’t print the id.