Hello, I would like to validate the roles but this is not printing on the screen, what is wrong?..
I need to check if the player is in a specific role.Name or if not, but the code doesn’t work for me, what’s wrong?
StarterPlayerScripts:
-- Player:
local Player = game.Players.LocalPlayer
-- UI Screens:
local GuiToEnable_Q1 = Player.PlayerGui:WaitForChild("Question1")
local GuiToEnable_Q2 = Player.PlayerGui:WaitForChild("Question2")
local GuiToEnable_Q3 = Player.PlayerGui:WaitForChild("Question3")
local GuiToEnable_Q4 = Player.PlayerGui:WaitForChild("Question4")
local GuiToEnable_Q5 = Player.PlayerGui:WaitForChild("Question5")
local GuiToEnable_Q6 = Player.PlayerGui:WaitForChild("Question6")
local GuiToEnable_Q7 = Player.PlayerGui:WaitForChild("Question7")
local GuiToEnable_Q8 = Player.PlayerGui:WaitForChild("Question8")
-- Leaderstats:
local leaderstats = Player:WaitForChild("leaderstats")
-- TEAMS → Ladrillos a tocar
local ladrillos_team_rojo = {
['parts'] = {
['red_part1'] = game.Workspace.redteam.part_1;
['red_part2'] = game.Workspace.redteam.part_2;
['red_part3'] = game.Workspace.redteam.part_3;
-- You can put more here..
}
}
local ladrillos_team_azul = {
['parts'] = {
['blue_part1'] = game.Workspace.blueteam.part_1;
['blue_part2'] = game.Workspace.blueteam.part_2;
['blue_part3'] = game.Workspace.blueteam.part_3;
-- You can put more here..
}
}
ladrillos_team_rojo.parts.red_part1.MouseClick:Connect(function()
local role = leaderstats.Roles
print(role.Value)
if role.Value == "Player" then
print("You are in player team.") -- This does not print on screen
else
print("you has not team.") -- This does not print on screen
end
end)