Hello. I’m trying to copy a text variable onto a TextLabel inside of a Tool. Do I need to path a way into the player’s backpack and change it there? Or do I use StarterPack instead?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local numberService = ReplicatedStorage:WaitForChild("LotteryNumberService")
local LotteryCard = game:GetService("Lighting")["Lottery Card"]
local LotteryCardText = LotteryCard.LotteryCard.SurfaceGui.TextLabel.Text
local function onButtonPress(player, text)
local playerNumber = tonumber(text)
if typeof(playerNumber) == "number" then
if playerNumber >= 0 and playerNumber <= 100 then
end
end
end
numberService.OnServerEvent:Connect(function(player, text)
print(player, text)
onButtonPress(player, text)
LotteryCardText = text
local clone = LotteryCard:Clone()
clone.Parent = game.Players[player.Name].Backpack
end)
This is a server script inside of ServerScriptStorage.
Here’s a picture of the explorer.
I think the issue is that it only clones the tool itself, not the tool AND anything that’s a child of it. Not sure though.
Any help is greatly appreciated.