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

How do I locate a part/model or something else if it keeps changing name?

Asked by
ko_oky -3
6 years ago
Edited 6 years ago

Lets suppose I have a part in a model and I want that when you touch that part the parent of the part(model) will change name to the age of the player who touched it .

Now lets suppose I have a script which locates the model and after that it changes its name to the player's acc age who touched the brick.

Lets say the model's name after it has been touched is "100 days old"'

How do I locate the model? Cause the model can be a name is an age I do not know.

0
Declare it as a variable or store it in a table Amiaa16 3227 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

I Recommend That You Make It In A Model With A Specific Name In The Workspace For Example "Name_Changing_Brick", You Would Then Do A Script With The Following:

game.workspace.Name_Changing_Brick:GetAllChildren()
local plr = game.players.LocalPlayer
local sg = instance.new("ScreenGui")
sg.Parent = plr.PlayerGui

local fr = instance.new("Frame")
fr.Parent = sg
fr.BackgroundTransparency = 0.4
fr.BackgroundColor3 = Color3.FromRBG (4, 33, 61)
fr.Name = "OutputBackground"
fr.size = {0, 356},{0, 161}
fr,Position = {0.661, 0},{0, 0}

local tl = Instance.new("TextLabel")
tl.Parent = fr
tl.BackgroundTransparency = 1
tl.TextColor3 = Color3.FromRBG (255, 255, 255)
tl.Position = {0, 0},{0, 0}
tl.TextSize = 26
tl.Text = "Name Changing Brick Is Now Known As:"

local tl2 = Intance.new("TextLabel")
tl2.Parent = fr
tl2.BackgroundTransparency = 1
tl2.TextColor3 = Color3.FromRBG (255, 255, 255)
tl2.Position = {0, 0},{0.509, 0}
tl2.TextSize = 26
tl2.Text = game.workspace.Name_Changing_Brick.Child.Name

end

-- I Know Your Probably Gonna Remove tHese Credits But I Don't Care --

-- Script Made By jamiethegreatQ777 --
-- Twitter: @jamiethegreatQ7
-- Roblox jamietheGreatQ777
-- YouTube jamiethegreatQ777

Ad

Answer this question