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

The shark won't receive the tool?

Asked by 7 years ago

The following code is a server script and there are no errors in the output. The following code will give the players a tool in replicated storage and it doesn't seem to work.

local plrs = game.Players:GetPlayers()
local teams = game:GetService("Teams")
local shark = teams:WaitForChild("Shark")
local tool = game:GetService("ReplicatedStorage"):WaitForChild("Shark Tagger")

while wait() do
    if plrs.TeamColor == shark.TeamColor then
        tool:Clone().Parent = plrs.Backpack
    end
end

1 answer

Log in to vote
-1
Answered by 7 years ago
Edited 7 years ago

One idea.

Consider changing the following:

local plrs = game.Players:GetPlayers()
local teams = game:GetService("Teams")
local shark = teams:WaitForChild("Shark")
local tool = game:GetService("ReplicatedStorage"):WaitForChild("Shark Tagger")

while wait() do
    if plrs.TeamColor == shark.TeamColor then -- shark.TeamColor isn't a valid color. Try changing shark to a similar color.
        tool:Clone().Parent = plrs.Backpack
    end
end

I hope it will work! :D

0
Didn't seem to work. BennyBoiOriginal 293 — 7y
0
I am pretty Newbie with scripts, sorry that I couldn't do anything for you. TheCoolRobloxian4 20 — 7y
Ad

Answer this question