Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years ago

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?

0
ever heard of an output? greatneil80 2647 — 4y
0
Yes. Eric_pokemon 133 — 4y
0
What greatneil80 is saying is that what was the error. It is impossible to fix unless we know the error code applebugr21 30 — 4y
0
oh sorry Eric_pokemon 133 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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

0
thank you Eric_pokemon 133 — 4y
Ad

Answer this question