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

How can I change the parent of message?

Asked by 10 years ago

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

Log in to vote
2
Answered by 10 years ago

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

Ad

Answer this question