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

Why isnt my script working in the actual game?

game.Players.PlayerAdded:connect(function(plr)
	Screen = game.ServerStorage.ScreenGui:Clone()
	Screen.Parent = plr.PlayerGui
	
	plr.PlayerGui.ScreenGui.Frame.TextButton.MouseButton1Click:connect(function()
		a = plr.PlayerGui.ScreenGui.Frame.TextBox.Text
			for i, v in pairs(game.Workspace:GetChildren()) do
				print(a)
				if v.Name == a then
					print("Q")
					v.Transparency = 1 
				
				end
			end
		end)
	end)
	


It's a gui that you write in, let's say you write "Part" and press the go button, all the parts should go invisible. It works but only in studio and not the real game. Help?

6 comments

0

Probably because you have Filtering Enabled on. With FE the server can't access the client. Also if this is a local script. Then you shouldn't use PlayerAdded as that will detect all players that join.

0

FE is enabled and it is a server script.

0

Manipulating GUI objects from the server is seen as bad practice. Use a LocalScript for that.

0

A less important issue (that still needs to be addressed); ":connect()" is deprecated, use ":Connect()" instead.

0

How would I get the GUI inside their PlayerGui without it interfering witth other GUIs then=?

0

change PlayerGui to CoreGui but im not sure that will work because u might need more access to the server side but not sure

1 answer

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