This murder script I made is working (but not updating the status.) The script inside the text label is a script, here is the code for it:
script.Parent.Text = game.ReplicatedFirst.Status.Value game.ReplicatedFirst.Status.Changed:Connect(function() script.Parent.Text = game.ReplicatedFirst.Status.Value end)
Here is the main script code.
wait(5) local maps = game.Workspace:FindFirstChild('Map') local Players = game.Players:GetChildren() local murderer = game.Players:GetChildren(math.random(1, #Players)) local Innocent = game.Players:GetChildren() local plrcount = 2 local status = script.Parent.Status local EndRound = script.EndRound -- local m = murderer local i = Innocent -- local Gamemodes = {"Classic"} local KnifeSkins = {"Normal"} local GunSkins = {"Normal"} local Auras = {} local CurrencyName = "CrazyPointz" local CurrencyName2 = "CrazyTikz" --Event things local SpookyRounds = {} local Eggs = {} local Foods = {} -- local Roundtime = 100 local IntermissionTime = 10 --Stats Adder game.Players.PlayerAdded:Connect(function(plr) local ls = Instance.new("BoolValue",plr) ls.Name = 'leaderstats' local currency1 = Instance.new("IntValue",ls) local currency2 = Instance.new("IntValue",ls) currency1.Name = CurrencyName currency2.Name = CurrencyName2 end) function Round() for i,v in pairs(game.Players:GetPlayers()) do v.Character.Humanoid.Jump = true v.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Workspace.Map.Mineshaft.Spawns.Spawn.Position.X,game.Workspace.Map.Mineshaft.Spawns.Spawn.Position.Y +5,game.Workspace.Map.Mineshaft.Spawns.Spawn.Position.Z)) end script.Parent["Virtual Knife"]:Clone().Parent = murderer.Backpack local timer = 100 repeat timer = timer -1 status.Value = 'Round ('..timer..')' wait(1) until timer == 0 status.Value = 'Round over!' EndRound.Value = true end --Intermission function Intermission() local timer = 30 repeat status.Value = 'Intermission ('..timer..')' wait(1) timer = timer -1 until timer == 0 status.Value = 'Picking murder...' wait(3) murderer = game.Players:GetPlayers(math.random(1, #Players)) status.Value = 'Murderer Has Been Picked!' wait(4) status.Value = 'Round starting' wait(1) Round() end Intermission() --Round --Round end EndRound.Changed:connect(function() if EndRound.Value == true then EndRound.Value = false for i,v in pairs(game.Players:GetPlayers()) do v.Character.Humanoid.Health = 0 end game.SoundService.RoundEndMusic:Play() wait(5) Intermission() end end)
Hope you can help.
Well, I've changed around some things and moved some stuff, everything works except from line 87 to line 102. Hope you can help.
print('Script is running!') wait(5) local maps = game.Workspace:FindFirstChild('Map') local Players = game.Players:GetChildren() local murderer = game.Players:GetChildren(math.random(1, #Players)) local Innocent = game.Players:GetChildren() local plrcount = 2 local status = script.Parent.Parent.ReplicatedStorage.Status local EndRound = script.Parent.Parent.ReplicatedStorage.EndRound -- local m = murderer local i = Innocent -- local Gamemodes = {"Classic"} local KnifeSkins = {"Normal"} local GunSkins = {"Normal"} local Auras = {} local CurrencyName = "CrazyPointz" local CurrencyName2 = "CrazyTikz" --Event things local SpookyRounds = {} local Eggs = {} local Foods = {} -- local Roundtime = 100 local IntermissionTime = 10 --Stats Adder game.Players.PlayerAdded:Connect(function(plr) local ls = Instance.new("BoolValue",plr) ls.Name = 'leaderstats' local currency1 = Instance.new("IntValue",ls) local currency2 = Instance.new("IntValue",ls) currency1.Name = CurrencyName currency2.Name = CurrencyName2 end) function Round() for i,v in pairs(game.Players:GetPlayers()) do v.Character.Humanoid.Jump = true v.Character.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(game.Workspace.Map.Mineshaft.Spawns.Spawn.Position.X,game.Workspace.Map.Mineshaft.Spawns.Spawn.Position.Y +5,game.Workspace.Map.Mineshaft.Spawns.Spawn.Position.Z)) end script.Parent.Parent.ReplicatedStorage["Virtual Knife"]:Clone().Parent = murderer.Backpack local timer = 10 repeat timer = timer -1 status.Value = 'Round ('..timer..')' wait(1) until timer == 0 status.Value = 'Round over!' EndRound.Value = true end --Intermission function Intermission() local timer = 30 repeat status.Value = 'Intermission ('..timer..')' wait(1) timer = timer -1 until timer == 0 status.Value = 'Picking murder...' wait(3) murderer = game.Players:GetPlayers(math.random(1, #Players)) status.Value = 'Murderer Has Been Picked!' wait(4) status.Value = 'Round starting' wait(1) Round() end Intermission() --Round --Round end --Heres the bit that doesn't work, it doesn't error or print or anything! EndRound.Changed:connect(function() print('End variable has changed') if EndRound.Value == true then print('End variable was called!') EndRound.Value = false for i,v in pairs(game.Players:GetPlayers()) do v.Character.Humanoid.Health = 0 end print('Sucsessfully reset players.') game.SoundService.RoundEndMusic:Play() print('Sucsessfully played song') wait(5) Intermission() print('Sucsessfully started intermission') end end)