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

Im trying to make a game that has a killer and campers but no sheriff?

the main game script ive been using will not start the game at all at the moment i dont care for gui's i just want the game mechanics to work im not a good scripter so ive been using a muder mystery script off youtube but taking anything to do with the sheriff out is that even a good idea? any ideas of a way to fix the problem? heres my code its alot i appreciate any1 that looks through it Edit: and also the game spawn point isnt always the lobby its somewhere on the map or in the lobby plz help and i am aware of the \ near the end

local roundtimer = 300 local intermissiontime = 25 local serverstorage = game:GetService("SeverStorage") local replicatedstorage = game:GetService("ReplicatedStorage") local debris = game:GetService("Debris") local event = replicatedstorage:WaitForChild("RemoteEvent") local maps = serverstorage:WaitForChild("Maps") local mapholder = game.Workspace.WaitForChild("MapHolder") local statustag = replicatedstorage:WaitForChild("StatusTag") local timertag = replicatedstorage:WaitForChild("TimerTag")

function playeradded(player) local leaderstats = Instance.new("IntValue") leaderstats.Name = "leaderstats"

local points = Instance.new("IntValue")
points.Name = "Points"
points.Parent = leaderstats
lederstats.Parent = player

end

game.Players.PlayerAdded:connect(playeradded) for_, player in pairs(game.Players:GetPlayers()) do playeradded(player) end

--pick a random map statustag.Value = "Loading Map" timertag.Value = -1 mapholder:ClearAllChildren() wait(2) local allmaps = maps:GetChildren() local newmap = allmaps[math.random(1, #allmaps)] newmap.Parent = game.Workspace wait(2)

--waiting for players while true do wait(5) contenstants = {} for_, player in pairs(game.Players:GetPlayers())do if player and player.Character then local humanoid = player.Character:WaitForChild("Humanoid") if humanoid and humaniod.Health > 0 then table.insert(contestants, player) end end end if #contestants >=2 then break

else
	statustag.Value = "Waiting For Players"

timertag.Value = -1 end end statustag.Value = "Match" timertag.Value = roundtimer

--chose maniac maniac = contestants[math.random(1, #contestants)]

--tp contenstants local spawnsmodel= newmap:WaitForChild("Spawns")

local spawns = spawnsmodel:GetChildren for_, player in pairs(contenstants) do if player and player.Character and #spawns > 0 then local torso = player.Character:WaitForChild("Torso") local spawnindex = math.random(1, #spawns) local spawn = spawns[spawnindex] if spawn and torso then table.remove(spawns, spawnindex) torso.CFrame = CFrame.new(spawn.Position + Vector3.new(0, 3, 0)) local matchtag = Instance.new("StringValue") matchtag.Name = "MatchTag" matchtag.Parent = player.Character local backpack = player:FindFirstChild("Backpack") if backpack then if player == maniac then local sword = serverstorage:WaitForChild("Sword"):clone() sword.Parent = backpack event:FireAllClients("Class", "Maniac") else event:FireAllClients("Class", "Camper")

			end
		end
	end
end

end spawnsmodel:remove()

-- game ending local localtimer = roundtime while localtimer > 0 do wait(1) localtimer = localtimer - 1 timertag.Value = localtimer activecontestants = {} maniacactive = false for_, players in pairs(contestants) do if player then local character = player.Character if character then local matchtag = character:FindFirstChild("MatchTag") local humnoid = character:FindFirstChild("Humanoid") if matchtag and humanoid and humanoid.Health > 0 then if player == maniac then maniacactive = true end table.insert(activecontestants, player) end end end if #activecontestants <=1 or not maniacactive
break end end -- game results

local gameresults = "PlayersWin"
if maniacactive then
	if #contenstants > 2 then
		event:FireAllClients("Result", "PlayersWin")
	end
	else
		gameresult = "ManiacWins"
		event:FireAllClients("Result", "ManiacWin")
	end
end

local lobbyspawns = {}
for_, v in pairs(game.Workspace:WaitForChild("Lobby"):GetChildren())do
	if v and v.Name == "LobbySpawn" then
		table.insert(lobbyspawns, v)
	end
end
for_, player in pairs(activecontestants) do
	if player then
		if player.Character then
			local humanoid = player.Character:FindFirstChild("Humanoid")
			if humanoid then
				humanoid:UnequipTools()
			end
		local randomspawn = lobbyspawns[math.random(1, #lobbyspawns)]
		player.Character:MoveTo(randomspawn.Position)
		local backpack = player:FindFirstChild("Backpack")
		if backpack then
			backpack:ClearAllChildren()
		end
	end
	end
	
	--intermission wait
	statustag.Value = "Intermission"
	timertag.Value = intermissiontime
	local localtimer = intermissiontime
	while localtimer > 0 do
		wait(1)
		localtimer = localtimer - 1
		timertag.Value = localtimer
		
	end

1 answer

Hi Mr. OrbitYT I can maybe help you with the game Even know I cant script good either can you but I know a way to get your problems solved I will come on roblox and you can come to our scripting school. It will start at 11:00am to 12:00 for a lesson its EST/EDT so be on time for your lesson, we will help you script better and get to know cause I only know how to do admin and eat and talk and move and avatar and more like that but not script I can build which that is a part of scripting So dont worry just join our group and you can be able to learn to script/build if you do not want to learn then you can find someone else.

You need any help this is the place I got some people to help you just post down this also this is Important you must read:

Once you join do this:

  1. Post on wall ":scripthelp:"

  2. wait for a Teacher to say ":scripthelpgranted" if they say ":scripthelpdeclinded:" you maybe put in some wrong things

  3. Wait till 11:00am EDT/EST for classes to start, Wait till Noon EST/EDT for Classes to end.

  4. Be at the school at 10:50am or you will be attendance late.

1 comment

0

umm i live in a dirrent time zone so tha time is very difficult to wake up at

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