[SOLVED BY ME] attempt to concatenate string with nil (at line 9)?
Asked by
4 years ago Edited 4 years ago
local Events = game.ReplicatedStorage.AdminPanelEvents
Events.RankEvents.RankChange.OnServerEvent:Connect(function(player, PlayerToGiveRankTo, RankName)
print(PlayerToGiveRankTo.."'s rank has been changed to "..RankName.."!")
game.Players:FindFirstChild(PlayerToGiveRankTo).leaderstats.Rank.Value = RankName
local PlayerGui = game.Players:FindFirstChild(PlayerToGiveRankTo).PlayerGui
game.ReplicatedStorage.AdminPanelNotification:Clone().Parent = PlayerGui
game.Players:FindFirstChild(PlayerToGiveRankTo).PlayerGui.AdminPanelNotification.Frame.Title.Text = "Rank Change"
game.Players:FindFirstChild(PlayerToGiveRankTo).PlayerGui.AdminPanelNotification.Frame.Info.Text = "Your rank has been changed to "..RankName.Text
wait(1)
game.Players:FindFirstChild(PlayerToGiveRankTo).PlayerGui.AdminPanelNotification.Frame:TweenPosition(UDim2.new(0.488, -116,0.238, -100),"Out","Back",1,true)
wait(4.2)
game.Players:FindFirstChild(PlayerToGiveRankTo).PlayerGui.AdminPanelNotification.Frame:TweenPosition(UDim2.new(0.488, -116,0.238, -1000),"Out","Back",1.5,true)
wait(1.7)
game.Players:FindFirstChild(PlayerToGiveRankTo).PlayerGui.AdminPanelNotification:Destroy()
end)