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

Why wont my script work to make the team name become the player?

I will accept another method of doing this

I tried using ChildAdded for the team first but Their doesn't appear to be players being listed in the Team folder?

I decided to use a script that will start on touch of a part that the player will spawn and walk on. No one else can reach it minus said player. The script is inside of the team, not the part; plus there is a script that is inside of the part you'll have to touch that also has the touched function inside. Here's the script inside of the Team.

DB = false
game.Workspace.NameDetector1.Touched:connect(function(Hit)
	if DB == false then DB = true
		script.Parent.Name = Hit.Parent.Name
		wait(0.1)
		DB = false
	end
end)

Hierarchy appears to be correct.

3 comments

0

Also, is there a way to fix my Reputation? I have been trolled by someone and basically all my Questions have -1. I had nearly 40 Rep. Can nothing be done for this?

0

alpha, report this to kinetic. I know about 5 people who had the same problem.

0

You mean Kenetec, Lol. Took a bit to find the person you meant with the wrong name. Ty, will do.

1 answer

✓ Accepted answer

Scripts do not run under Services other than Workspace or ServerScriptService. Instead, create a script on a brick:

db = false
script.Parent.Touched:connect(function(hit)
	if not db then	
		if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then
			plr = game.Players:GetPlayerFromCharacter(hit.Parent)
				if plr then
					db = false
					game.Teams.YOURTEAMNAMEHERE.Name = plr.Name
					wait(1)
					db = true
				end
			end
		end
	end
end)

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