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

Someone help me with Filtering Enabled involving guis?

I've made several posts about this one intermission script and i'm grateful for all the responses but none of them worked or they were very vague answers. I've been trying to study up on fe but i've been stuck as the wiki can be vague at times and there's not a lot tutorials on youtube. I've been trying a lot of things but none of them worked when i launched a server. Can someone explain to me filtering enabled involving guis and/or help me with my script. Either way will be greatly appreciated

My Script in SSS

local Int = game:GetService("ReplicatedStorage"):WaitForChild("Int")



game.ReplicatedStorage.Intermis.OnServerEvent:Connect(function(player, text, tim)
while true do 	
			Int.Value = Int.Value - 1
			wait(1)
	if Int.Value == 0 then
		for _,player in pairs (game.Players:GetPlayers()) do		
			if player.Character then			
			player.Character:MoveTo(Vector3.new(game.Workspace.tele.Position))
				end
			end
		end
	end
end)

Local Script in StarterGui

local inter = game:GetService("ReplicatedStorage")
inter:WaitForChild("Intermis"):FireServer(script.Parent.TextLabel)

there was another iteration of this that had :fireclient I've been working on this for a couple weeks cause i'm terrible at FE

2 comments

0

Ew don't use MoveTo, use SetPrimaryPartCFrame

0

ok thanks for the that! I changed :MoveTo to :SetPrimaryPartCFrame

1 answer

You are on the right track! Now let's get down to breaking down your issue..

With the LocalScript, you're attempting to pass a TextLabel to the server, though I'm pretty sure you meant to pass the Text within it. So in turn, line 2 becomes

inter:WaitForChild('Intermis'):FireServer(script.Parent.TextLabel.Text)

Great, now we've sent the RemoteEvent our text. Let's hop on over to the server's side. By glancing at your script, I do see you have a while loop that doesn't break, but it keeps minusing one. Correct me if I'm mistaken, but I believe you want it to where once the IntValue has hitten 0, the script then teleports the player to the position ONCE. The way you have your script setup, it'll constantly be teleporting the player to that position every single second, which doesn't seem right. If I have gotten this assumption wrong, feel free to edit the script to your liking. I did notice in line 15 you are asking for the text, and tim, which you aren't passing. Unless this is apart of your elaborate plan and you aren't showing some code,tim doesn't seem needed. Continuing with your arguments, it seems you never read the text argument on the Server side. Again, this is all speculation and you may have a larger plan for it in the end.. Anyways

local Int = game:GetService("ReplicatedStorage"):WaitForChild("Int")

game.ReplicatedStorage.Intermis.OnServerEvent:Connect(function(player, text, tim)
	while true do
		Int.Value = Int.Value - 1	
		wait(1)
		if Int.Value == 0 then
			for _,player in pairs(game.Players:GetPlayers()) do
				if player.Character then
					player.Character:MoveTo(Vector3.new(game.Workspace.tele.Position))
				end
			end
			break -- See Below
		end
	end
end)

break breaks (morseso ends) the current while loop in this instance. Since you'd only want to have to teleport everybody once I'd assume, you'd want to break your while loop.

There is definitely a cleaner way to approach this task, however this will work nonetheless.

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