local innocent = {}
local players = game.Players:GetPlayers()
_G.murderer = players[math.random(#players)].Name
_G.sheriff = players[math.random(#players)].Name
for i,v in pairs(players) do
if v.Name ~= sheriff and v.Name ~= murderer then
_G.table.insert(innocent, v.Name)
end
end
print("MURDERER: "..murderer,"SHERIFF: "..sheriff, "INNOCENTS: "..table.concat(innocent,", "))
Ok this will pretty much just pick random murder, sheriff and make the rest innocents
while true do
if _G.player.Name == _G.murder.Name then
script.Parent.Text = "MURDERER"
script.Parent.TextColor3 = Color3.new(255,0,0)
elseif _G.player.Name == _G.sheriff.Name then
script.Parent.Text = "SHERIFF"
script.Parent.TextColor3 = Color3.new(0,0,255)
elseif _G.player.Name == _G.innocent.Name then
script.Parent.Text = "INNOCENT"
script.Parent.TextColor3 = Color3.new(0,255,0)
end
end
This is in a GUI TextLabel, and I want it to check the other script to see if the player is murder, sheriff or innocent. Whatever they are, it chnages the text to their role.
So, I have tried using the _G. thingy to get the scripts to use each others code, but this dosent work. Anyone got an Idea of what I am doing wrong?

1 comment
don't work? It still picks the players to be murder, innocent, sheriff, but dosent make the text pop up?