How would I make a credit card tool, when you hold it, it opens a UI, then the UI has a randomly generated number as the card number. How do I randomly generate a number per each person and save that number for each game?
My current scripts are as follows:
https://gyazo.com/319be8392102647b53396d7bcb65cfe2 https://gyazo.com/0471345f1094227aca81e991696b552f https://gyazo.com/42ab2650d1132241290206567e1a30fd
LocalScript:
script.Parent.Equipped:Connect(function()
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
createPartEvent:FireServer()
local RandomFirstDigit = math.random(1,9)
local RandomSecondDigit = math.random(1,9)
local RandomThirdDigit = math.random(1,9)
end)
Script:
-- Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = Instance.new("RemoteEvent", ReplicatedStorage)
local function onCreatePartFired(player)
game.StarterGui.ScreenGui.Frame.Visible = true
end
createPartEvent.OnServerEvent:Connect(onCreatePartFired)

3 comments
Why are you using a RemoteEvent to enable a GUI? Since you're using a LocalScript you can enable the GUI.
Also keep in mind the StarterGui is not where the players current UI's are stored, they are stored in the player under Players. The StarterGui is used to copy its contents (GUI's) to the player so they receive the GUI's upon entering the game or re-spawning.
Lol im so confused by this. You used a remote event that wasnt needed, and then made variables for the "credit card number" then never called them?