Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

So I was trying to make a murderer game but I need help... Do you think you can help?

So i was using a code made by HowToRoblox and tried to modified it here's the code that I modified

I have added a BoolValue named it Ingame

This script is in the ServerScriptService

There's no errors in this script but I don't understand what I did wrong sorry --edited

local killerWeapon = game.ServerStorage.ClassicSword

local plrs = game.Players

local survivors = {}

local Ingame = game.ReplicatedStorage.InGame

while wait(Ingame.value == true) do
	
	local chosen = plrs:GetChildren()[math.random(1, #plrs:GetChildren())]	
			
	chosen.PlayerGui.Picker.Background.RoleGiven.Text = "Murder"
	chosen.PlayerGui.Picker.Background.RoleGiven.TextColor3 = Color3.fromRGB(0, 0, 0)
					
	chosen.PlayerGui.Picker.Background.Visible = true
	
	killerWeapon:Clone().Parent = chosen.Backpack
	
			
	for i, plr in pairs(plrs:GetChildren()) do
		
		if plr ~= chosen then
			
			table.insert(survivors, plr)

			plr.PlayerGui.Picker.Background.RoleGiven.Text = "Survivor"
			plr.PlayerGui.Picker.Background.RoleGiven.TextColor3 = Color3.fromRGB(0, 200, 0)
			
			plr.PlayerGui.Picker.Background.Visible = true
			wait()
			
		end	
	end	
end


Do you guys think you can fix what I have done wrong?

4 comments

0

ever heard of an output?

0

Yes.

0

What greatneil80 is saying is that what was the error. It is impossible to fix unless we know the error code

0

oh sorry

1 answer

✓ Accepted answer

the error might be that you put while wait(Ingame.value == true) do instead of while Ingame.Value == true because wait needs a number not a bool like true or false, do

while Ingame.value == true do

also, you put plr == chosen instead of plr.Name == chosen.Name, change that

1 comment

0

thank you

This discussion is preserved as it was. New answers, comments, and votes are closed.