I’ve been trying to fix this for HOURS but I simply can’t figure this out.
here’s my script
local rs = game:GetService("ReplicatedStorage")
local re = rs.RemoteEvents
local bd = re.Birthday
local Evt = bd.Play
local Players = game:GetService("Players")
local play = rs.Birthday.Play
local stg = play.Stages
local val = play.Status
local va2 = play.Time
local Sky = stg.Sky:Clone()
local Bro = stg.Bros_Play:Clone()
local Cast = stg.Castle:Clone()
local Vote = play.VoteQ
local Votee = play.Vote
local Yes = play.Yes
local No = play.No
local plr1 = nil
local plr2 = nil
local stagetbl = {Cast,Bro,Sky}
local word1 = {"Pretty","Weirdly","Stupidly","Builderman's","Epically"}
local word2 = {"Awkward","Funky","Fake","Weird","Epic"}
local word3 = {"Night","Day","Party","Person","Killer"}
local AmountOfPlayers = #Players:GetPlayers()
Players.PlayerAdded:Connect(function(Player)
AmountOfPlayers = AmountOfPlayers + 1
end)
Players.PlayerRemoving:Connect(function(Player)
AmountOfPlayers = AmountOfPlayers - 1
end)
local function Play()
if AmountOfPlayers > 1 then
plr1 = math.random(1,#Players:GetChildren())
plr2 = math.random(1,#Players:GetChildren())
plr1.Character.HumanoidRootPart.Position.CFrame = Vector3.new(play.Plr1)
plr2.Character.HumanoidRootPart.Position.CFrame = Vector3.new(play.Plr1)
print(3)
local stagepick = math.random(1,#stagetbl)
print(stagepick)
local stage = stagetbl[stagepick]
print(stage)
stage.Parent = game.Workspace
local word1pic = math.random(1,#word1)
local word1p = word1[word1pic]
print(word1p)
local word2pic = math.random(1,#word2)
local word2p = word2[word2pic]
print(word2p)
local word3pic = math.random(1,#word3)
local word3p = word3[word3pic]
print(word3p)
local combined = word1p .. " " .. word2p .." " .. word3p
val.Value = combined
wait(6)
va2.Value = 30
repeat va2.Value = va2.Value -1
wait(1)
until va2.Value < 1
print("b")
plr1.Character.HumanoidRootPart.Position.CFrame = Vector3.new(play.Back)
plr2.Character.HumanoidRootPart.Position.CFrame = Vector3.new(play.Back)
Vote.Value = 1
wait(10)
Vote.Value = 0
print("a")
plr1 = nil
plr2 = nil
if Yes.Value > No.Value then
Votee.Value = "GOOD PLAY!"
print("good")
Yes.Value = 0
No.Value = 0
elseif Yes.Value < No.Value then
Votee.Value = "BAD PLAY!"
print("bad")
Yes.Value = 0
No.Value = 0
elseif Yes.Value == No.Value then
Votee.Value = "the play was ok."
print("eq")
Yes.Value = 0
No.Value = 0
end
end
end
Evt.OnServerEvent:Connect(Play)