I am trying to fix a gui that lets me spawn in a ship, it will appear for the player who spawned it and only that player. The game is FE enabled, anyone know how to fix it?
print("Regen GUI made by AzulFX/Vandalized by boatmaster6602") Player = game.Players.LocalPlayer for i, v in pairs(script.Parent:GetChildren()) do if v:IsA("TextButton") then v.MouseButton1Click:connect(function() local Ship = game.Lighting:WaitForChild(v.Name):clone() local Folder = game.Workspace:WaitForChild(Player.Character.Name) Folder:ClearAllChildren() Ship.Parent = Folder Ship:MoveTo (Player.Character.Torso.Position) end) end end
I would say it's because you're putting the Visible in the PlayerGui... I think that if you want the Gui to enable to EVERY player, you have to use StarterGui.. Give it a try!
game.Players.PlayerAdded:connect(function(player) print("Regen GUI made by AzulFX/Vandalized by boatmaster6602") for i, v in pairs(script.Parent:GetChildren()) do if v:IsA("TextButton") then v.MouseButton1Click:connect(function() local Ship = game.Lighting:WaitForChild(v.Name):clone() local Folder = game.Workspace:WaitForChild(Player.Character.Name) Folder:ClearAllChildren() Ship.Parent = Folder Ship:MoveTo (Player.Character.Torso.Position) end) end end
Ok so, I just adapted your localscript to a script, because apparently you need to use a script. Also gave your script some indentation.
Alright, if this solved your problem, please mark as the answer :'( xD
As always, good scripting!