Hi, i have made a script that choses a player to be the monster, it uses a remote event to tell the player its been picked and display the correct information. It works perfect until a player is picked twice in a row, the remote event does not fire and display the cutscene.
–SERVER
local players2 = game:GetService("Players"):GetPlayers()
local pickedPlayer = players2[math.random(1,#players2)]
print(pickedPlayer)
--
local clone = game:GetService("ReplicatedStorage").StarterCharacter:Clone()
pickedPlayer.Character = clone
clone.Parent = workspace
clone.HumanoidRootPart.CFrame = pickedPlayer.Character:WaitForChild("HumanoidRootPart").CFrame
pickedPlayer.Team = MonsterTeam
print(pickedPlayer.Team)
monsterRoundStart:FireClient(pickedPlayer)
pickedPlayerName.Value = pickedPlayer.Name
meinarbeit -= 1
CatsNeededFeeding.Value = 5
for i,v in pairs(game.Players:GetPlayers()) do
v.PlayerGui.Interface.SkinGUI.Enabled = false
end
--Round Start
roundStarted:FireAllClients()
–CLIENT
local repStorage = game:GetService("ReplicatedStorage")
local monsterRoundStart = repStorage.RemoteEvents.MonsterRoundStart
monsterRoundStart.OnClientEvent:Connect(function()
print("Script started Running")
local localPlayer = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")
local TheCatText = localPlayer.PlayerGui.Interface.YouAre.TheCat
local UiStroke = localPlayer.PlayerGui.Interface.YouAre.TheCat.UIStroke
local Background = localPlayer.PlayerGui.Interface.YouAre.Frame
local cams = game.Workspace.Cams:WaitForChild("CatCamera")
local currentcamera = workspace.CurrentCamera
local youare = localPlayer.PlayerGui.Interface.YouAre.TextLabel
local tweenInf2 = TweenInfo.new(1)
local goals2 = {
BackgroundTransparency = 0
}
print(localPlayer.Team)
local backgroundtween = tweenService:Create(Background,tweenInf2,goals2)
print("Litesend")
backgroundtween:Play()
task.wait(1)
local tweenInf = TweenInfo.new(2)
local goals = {
TextTransparency = 0
}
local strokeGoals = {
Transparency = 0
}
local CatTextTween = tweenService:Create(TheCatText,tweenInf,goals)
local UiStrokeTween = tweenService:Create(UiStroke,tweenInf,strokeGoals)
task.wait(2)
youare.Visible = true
CatTextTween:Play()
UiStrokeTween:Play()
currentcamera.CameraType = Enum.CameraType.Scriptable
currentcamera.CFrame = cams.CFrame
currentcamera.CameraSubject = cams
task.wait(2)
local goals3 = {
BackgroundTransparency = 1
}
local background2tween = tweenService:Create(Background,tweenInf,goals3)
background2tween:Play()
task.wait(3)
TheCatText.Visible = false
UiStroke.Enabled = false
youare.Visible = false
currentcamera.CameraType = Enum.CameraType.Custom
currentcamera.CameraSubject = localPlayer.Character
end)