Hi! I’m King, I am trying to achieve an XP check system. I already have the XP minutes sytem. When a player runs “-xpcheck [user]”, it is supposed to check their minutes for the past 60 minutes. I have a boolvalue that shows the minutes they have. It removes one minute every hour, unless their value is already at 0! But, when I try to send a message to the client who ran the command, it gets an error in the local script! I’m trying to make it like Kavra’s Kingdom XP check, but I am having issues!
Picture of the error:
Picture of UI:

This is what is inside a player once they join.

Server Script Service Code:
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if plr:GetRankInGroup(7048567) >= 9 then
local words = string.split(msg, " ")
if words[1] == "-xpcheck" then
local name = words[2]
local player = game.Players:FindFirstChild(name)
if player then
game.ReplicatedStorage.XPCheck:FireClient(plr, player.Name, player.Minutes.Value)
local ti = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
local frame = plr.PlayerGui.XPCheck.XPCheck:Clone()
game:GetService("TweenService"):Create(frame, ti, { Position = UDim2.new(0.311, 0, 0.287, 0)}):Play()
frame.Desc.Text = "In the last 60 minutes, "..player.Name.." has has earned "..player.Minutes.Value.." Minutes."
end
end
end
end)
end)
Local Script Code:
local ti = TweenInfo.new(0.5, Enum.EasingStyle.Linear)
game:GetService("TweenService"):Create(script.Parent, ti, { Position = UDim2.new(0.311, 0, 0.287, 0)}):Play()
game.ReplicatedStorage.XPCheck.OnClientEvent:Connect(function(plr, p, name, mins)
script.Parent.Desc.Text = "In the past 60 minutes, "..name.." has earned "..mins.." Minutes worth of XP!"
game:GetService("TweenService"):Create(script.Parent, ti, { Position = UDim2.new(0.311, 0, 0.287, 0)}):Play()
game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
Text = "XP Check: "..plr.Name.." XP Checked "..name.."! In the past 60 minutes, "..name.." has earned "..mins.." XP!",
Color = Color3.new(0, 0.666667, 1),
Font = Enum.Font.SourceSansBold,
Size = Enum.FontSize.Size32,
})
end)
I have added an extra variable called “P” and removed it too, so either way I still get this error.
Any help is appreciated!