You are changing the textlabel to the GUI in the startergui, I recommend you to make a local script inside the script, disable it and put this source
local client = game.Players.LocalPlayer
client.PlayerGui.Idol.Holder.Text = client.Name
and change the first script source to
local ToolNames = {"Immunity Idol"}
local Storage = game:GetService("ServerStorage")
local Part = script.Parent
local ClickDetector = Part:WaitForChild("ClickDetector")
ClickDetector.MouseClick:connect(function(Player)
if Player and Player.Character then
local Backpack = Player:WaitForChild("Backpack")
for i = 1, #ToolNames do
local Tool = Storage:FindFirstChild(ToolNames[i])
if Tool then
Tool:clone().Parent = Backpack
local ClonedLocal = script.LocalScript:Clone()
ClonedLocal.Parent = Player.Backpack
ClonedLocal.Disabled = false
end
end
end
end)
Hope it works!
1 comment
Did this work?