I have this local script that when an Image Button is clicked, it opens a gui called "Frame". The frame is used for editing inventory stuff, which raises an immediate problem, trolling. I have no idea why the gui is opening another gui rather than itself.
The bug only happens when multiple people are in the server, and to the second player to open the inventory. If that player tries to use the gui, the script spits out a wad of errors and doesn't do anything. Any help?
This is what I think the bugged part of the script is
script.Parent.MouseButton1Click:Connect(function(clk) print("Clicked") local Plr = game.Players.LocalPlayer local Box1 = workspace.InvetoryBoxes.Invetory1 local Box2 = workspace.InvetoryBoxes.Invetory2 local Box3 = workspace.InvetoryBoxes.Invetory3 local Box4 = workspace.InvetoryBoxes.Invetory4 local Box5 = workspace.InvetoryBoxes.Invetory5 workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable ----------------Check which boxes are occupied----------------- wait(0.01) ---security check--- if workspace.InvetoryBoxes.Invetory1.InvetoryBox1.Occupied.Value == false then print("1 is free!") workspace.CurrentCamera.CFrame = CFrame.new(Box1.Camera1.Position) print("Camera is Ready!") ----------Change Value Non-Locally----------- local remote = game.ReplicatedStorage:WaitForChild("Occupy1") local valueToChange = workspace.InvetoryBoxes.Invetory1.InvetoryBox1.Occupied remote:FireServer(valueToChange) print("Fired!") Plr.PlayerGui.Inventory.Frame.Visible = true Plr.PlayerGui.Inventory.ImageButton.Visible = false
QUESTION SOLVED ITSELF!!!! I have no idea why it started working, but it did. Bonus points to all those who checked the question out!