local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Sprintd = ReplicatedStorage.Sprint:Clone()
local PlayerGui = game:GetService("StarterGui")

Character:WaitForChild("Humanoid").Died:Connect(function()
    if LocalPlayer.Team.Name == "Zombies" then -- This is to check if the player is on that team.
       Sprintd.Parent = LocalPlayer.PlayerGui
   end
end)

The code is to clone a GUI called "Sprint" from the replicatedstorage.

The output didnt give me any error.

This is a local script.

It only clones when the player dies.

Even if I am on the team Zombies it still doesnt clone.

Help please , thanks in advance!

1 comment

0

It doesn't clone because it is a localscript, Try using RemoteEvents.