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

How to put people in teams on a minigame?

Asked by 5 years ago

I've made a roblox game that is multiple minigames. I've got one minigame that doesn't work :( It's a game where 2 random people are sharks that have to kill the fish before they get to the end.

-- variables

local status = game.ReplicatedStorage:WaitForChild("Status") local sharkfish = game.ReplicatedStorage:WaitForChild("sharkfish") local players = game.Players.LocalPlayer local wall = game.Workspace.wallblock local shrek = game.ServerStorage:FindFirstChild("Shrekmap") local maze = game.ServerStorage:FindFirstChild("Maze") local doge = game.ServerStorage:FindFirstChild("doge") local music = game.Workspace:FindFirstChild("Elevator Music") local babyshark = game.ServerStorage:FindFirstChild("babyshark")

-- the minigame that doesnt work :(

wait(2) music:Play() status.Value = "Intermemeission" local sharkc = babyshark:Clone() sharkc.Parent = game.Workspace sharkc.Name = "sharkc" wait(38) status.Value = "Don't get eaten by babyshark!" wait(1) wall.Transparency = 0.6 wait(1)

local reveal = game.StarterGui.sharkrole.reveal reveal.Visible = true wait(4)

local sharkorfish = game.StarterGui.sharkrole.sharkfish sharkorfish.Visible = true

local list = game.Players:GetPlayers()

local rand1 = math.random(1, #list)

local murderer1 = list[rand1]

table.remove(list, rand1)

if players == murderer1 then

sharkfish.Value = "Baby Shark - try to stop other players from getting to the end!"

local deathttouch = game.ServerStorage:FindFirstChild("Death touch")

game.Workspace.Player1.Humanoid:EquipTool(deathttouch)

game.Players.LocalPlayer.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(58.939, -0.127, 182.439))

end

if players ~= murderer1 then

sharkfish.Value = "Fish - try to reach the end!"

game.Players.LocalPlayer.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-53.061, -0.127, 182.439))

end

wait(30)

sharkc.Parent = game.ServerStorage

wall.Transparency = 0

-- please help I 'm a scripting beginner :) my roblox username = annaolivia98

1
The client can't access ServerStorage's contents. That's the problem. DeceptiveCaster 3761 — 5y
1
A reasonable solution would be to move what you're trying to access in ServerStorage to ReplicatedStorage. ReplicatedStorage's contents can be accessed by both the client and server. DeceptiveCaster 3761 — 5y

Answer this question