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

How can I change the parent of message?

This is what I got so far, and I'm not sure if it will work... but that's not what matters right now, what matters is how I'm supposed to change the parent of the message. I want the parent of the message to change from game.ReplicatedStorage to game.Workspace.

Here is the code:

local PlayerAdmin,Rank=IsAdmin(game.Players.ScrewGuests)
local msg=Instance.new("Message",game.ReplicatedStorage)
msg.Name="The Message Has Arrived"
msg.Text="All hail the admin, who has arrived!"
backup=msg:Clone()

if PlayerAdmin==true then
	if msg.Parent==game.ReplicatedStorage then -- Can I remove one of these?
		if msg.Parent~=game.Workspace then
			
		end
	end
end

Also, if possible, can someone tell me if this will work, it's a plugin for LuaModelMaker's Admin, and it's a ModuleScript.

Thank you in advanced.

1 answer

✓ Accepted answer

You would simply do

msg.Parent=game.Workspace

The full script:

local PlayerAdmin,Rank=IsAdmin(game.Players.ScrewGuests)
local msg=Instance.new("Message",game.ReplicatedStorage)
msg.Name="The Message Has Arrived"
msg.Text="All hail the admin, who has arrived!"
backup=msg:Clone()

if PlayerAdmin==true then
    if msg.Parent==game.ReplicatedStorage then -- You can keep it if you want, it doesn't matter
        if msg.Parent~=game.Workspace then
msg.Parent=game.Workspace
        end
    end
end

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