My gui script works perfectly fine in studio, but not a server test or ingame?
Asked by
6 years ago Edited 6 years ago
Hi there, I have a script for assigning weapons that works perfectly fine in roblox studio, but not in the actual game, or the server test mode. Any help would from coders more experienced than myself would be very appreciated.
When I join the game in any way except for solo test, the GUI does not appear at all.
01 | game.Workspace:WaitForChild(game.Players.LocalPlayer.Name) |
02 | player = game.Players.LocalPlayer |
03 | backpack = player.Backpack |
04 | script.Parent.Main.Visible = true |
05 | function chooseClass(class) |
06 | for i, v in pairs (backpack:GetChildren()) do v:remove() end |
07 | for i, v in pairs (class:GetChildren()) do |
09 | v:clone().Parent = backpack |
10 | elseif v:IsA( "HopperBin" ) then |
11 | v:clone().Parent = backpack |
15 | script.Parent.Main.Visible = false |
16 | script.Parent.Title.Visible = false |
19 | function onHumanoidDied(humanoid, player) |
20 | script.Parent.Main.Visible = true |
21 | script.Parent.Title.Visible = true |
24 | for i, v in pairs (script.Parent.Main:GetChildren()) do |
25 | v.MouseButton 1 Up:connect( function () chooseClass(v) end ) |