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

How does it have to work on a published game? [SOLVED]

What I wanted to do with this script is whenever you come close enough to the object, you start capturing "the turf". At the same time a gui pops up, which will show who owns it. In studio play it works perfectly, but in a published game, not even the gui pops up, why?

while true do
	for i,plr in ipairs(game.Players:GetChildren()) do
		local char=plr.Character
		if char~=nil then
			local t=char:FindFirstChild("Torso")
			local h=char:FindFirstChild("Humanoid")
			if t~=nil and h~=nil then
				if h.Health>0 then
				 	pos1=t.Position*Vector3.new(1,0,1)
					pos2=script.Parent.Base.Position*Vector3.new(1,0,1)
					if (pos1-pos2).magnitude<10 then
						n=1
						plr.PlayerGui:WaitForChild("TurfScreenGui1").Enabled = true
					else
						captureprogress=0
						n=0
						plr.PlayerGui:WaitForChild("TurfScreenGui1").Enabled = false
					end
					
						if n==1 then
							captureprogress=captureprogress+1
							if captureprogress==10 then
								if plr:IsInGroup(3893650)then
								group = game:GetService("GroupService"):GetGroupInfoAsync(3893650)
								plr.PlayerGui:WaitForChild("TurfScreenGui1").GroupName.Text = group.Name
								plr.PlayerGui:WaitForChild("TurfScreenGui1").Frame.ImageLabel.Image = group.EmblemUrl
								
								end
								if plr:IsInGroup(3862805)then
								group = game:GetService("GroupService"):GetGroupInfoAsync(3893650)
								plr.PlayerGui:WaitForChild("TurfScreenGui1").GroupName.Text = group.Name
								end
								print("We captured")
							end
						end

				end
			end
		end
	end
wait(0.7)
end

4 comments

0

Is your game Filtering Enabled?

0

Where do I check filtering?

0

In your Explorer, click Workspace and check in the Properties tab.

0

It works! Thank you.

1 answer

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