Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Re spawn GUI, ship only appears for the player that spawned it, help?

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

1 answer

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!

14 comments

0

It is the StarterGui I'm afraid.

0

what do you mean with "afraid"?

0

Oh, I mean it is the StarterGui, that's just how I word things.

0

Just to know, you think that, or are you sure?

0

I think, I'm new to this sort of thing.

0

You have to put this in a server script if this is filtering enabled.

0

Give a look at the script.

0

Now it's not working period

0

"period" !?

0

It's how I word things.

0

Yeah, but I didn't understand, what's the error there?

0

Now nothing spawns

0

im pretty sure if you use a normal script it will count as everyone but if you use a local script it will count as one player

0

what makes you think that?

This discussion is preserved as it was. New answers, comments, and votes are closed.