#Loading UI script

1 messages · Page 1 of 1 (latest)

rugged prism
#

local Players=game:GetService("Players")
local player=Players.LocalPlayer
local playerGui=player:WaitForChild("PlayerGui")
local mainGui=playerGui:WaitForChild("MainGui")
local KillerNames={ "Hunter","Astraeus","Haker1897e","DeathAngel" }
local function isKillerName(name)
for _,k in pairs(KillerNames) do
if k==name then return true end
end
return false
end
local function getKillerType() return player:FindFirstChild("KillerType") end
local function updateAbilitiesUI()
local killerValue=workspace:WaitForChild("Info"):WaitForChild("Killer")
local killerName=killerValue.Value
local killerType=getKillerType()
local killerTypeValue=tonumber(killerType and killerType.Value) or 0
local isKiller=(killerName==player.Name) and (killerTypeValue==1) and isKillerName(player.Name)
print("[DEBUG] KillerName =",killerName)
print("[DEBUG] PlayerName =",player.Name)
print("[DEBUG] KillerType =",killerTypeValue)
print("[DEBUG] Is KillerName in table?",isKillerName(player.Name))
print("[DEBUG] isKiller =",tostring(isKiller))
mainGui:WaitForChild("Ability1").Visible=isKiller
mainGui:WaitForChild("Ability2").Visible=isKiller
mainGui:WaitForChild("Ability3").Visible=isKiller
end
updateAbilitiesUI()
workspace.Info.Killer:GetPropertyChangedSignal("Value"):Connect(updateAbilitiesUI)
local function setupKillerTypeListener()
local kt=getKillerType()
if kt then kt:GetPropertyChangedSignal("Value"):Connect(updateAbilitiesUI) end
end
setupKillerTypeListener()
player.ChildAdded:Connect(function(c)
if c.Name=="KillerType" then setupKillerTypeListener() updateAbilitiesUI() end
end)
player.ChildRemoved:Connect(function(c)
if c.Name=="KillerType" then updateAbilitiesUI() end
end)
task.spawn(function()
while true do
updateAbilitiesUI()
task.wait(0.5)
end
end)

#

my friend said he could help he tried and tested debug but still didnt work anyone can help?

weary windBOT
#

studio** You are now Level 13! **studio

marble oar
#

or a client?

rugged prism
marble oar
#

a loading gui?

#

could you explain me,

#

what this is for?

#

so i can help you.