Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to make this script edit a text box which is on a players torso?

Asked by 8 years ago

So the script is currently set to edit a bag in workspace, but I need to know how to edit it into making a character have a GUI on their torso, on the front, and then a script edits a name-tag to say their name and a random, but unique code..

function onclick(player)
tools=player.Backpack:GetChildren()
if(player:FindFirstChild("Bags"))==nil then
folder=Instance.new("Folder")
folder.Name="Bags"
folder.Parent=player
else
player.Bags:ClearAllChildren()
end
for i=1,#tools do
if (tools[i]:FindFirstChild("Bag"))~=nil then
tools[i].Parent=player.Bags
end
end
location=script.Parent.Parent.Location.Position

baghold=player.Bags:GetChildren()

for i=1, #baghold do
wait(1)
baghold[i].Parent=Workspace
baghold[i].Handle.CFrame=CFrame.new(location)
if(baghold[i].Handle:FindFirstChild("Tag"))==nil then
tag=script.Tag:Clone()
tag.Parent=baghold[i]:FindFirstChild(baghold[i].MainPart.Value)
tag.Player.Text=player.Name
end
end

local function Click(Player)
script.Tag.Player.Text = Player.Name
end
script.Parent.ClickDetector.MouseClick:connect(Click)


end
script.Parent.ClickDetector.MouseClick:connect(onclick) 

Answer this question