I have a ModuleScript
handling tycoon purchasing functions in my game. It handles the cloning of objects, and placing bought objects into the tycoon’s system.
I was doing a system where an arrow would show where a player bought an object, however, this system only works for the first player to buy anything in the game, and then breaks it for every player after, where they can’t buy anything.
The code works where it is supposed to place the billboard GUI, with the adornee on the primary part of the object bought, into the player’s PlayerGui
, so they are the sole player who can see it. Here’s the code snippet:
local guis = game.ServerStorage:WaitForChild("gui"):Clone()
local Debris = game:GetService("Debris")
if BaseModules[Tycoon][ItemName].PrimaryPart then
guis.Active = true
guis.Adornee = BaseModules[Tycoon][ItemName].PrimaryPart
guis.Parent = Player.PlayerGui
Debris:AddItem(guis, 6)
end
Here’s the in-game output it gave:
(In the output, line 144 is
guis.Parent = Player.PlayerGui
, and the TycoonHandler
part is where the output from TycoonModule
goes)
Does anyone know what the issue/solution is?