I think you need to use v.Level.Value
Also there is one end missing if im right.
I think you need to use v.Level.Value
Also there is one end missing if im right.
You’re trying to reference the Part that contains the child “level”.
the same LocalScript
local player = game.Players.LocalPlayer
local playerLevel = player.leaderstats:WaitForChild("Level")
local playerGui = player:WaitForChild("PlayerGui")
local shop = playerGui:WaitForChild("Shop")
local primaryShopButton = shop:WaitForChild("PrimaryShopButton")
local frameLevel = script.Parent:WaitForChild("FrameLevel")
primaryShopButton.MouseButton1Down:Connect(function()
print("Click")
wait(.1)
for _, v in pairs(script.Parent:GetDescendants()) do
if v:FindFirstChild("Level") then
if v.Value >= playerLevel.Value then
frameLevel.Visible = false
else
frameLevel.Visible = true
end
end
end
end)
yes I think
but its not giving any error for now
Oh. Yeah nevermind. The lines are just not clean. There is no end missing, sorry.
I change it to v.Level.Value
and it’s sending a new error at Line 14
error: attempt to compare number and string
One of your Values is a string then. Either change the string one to a number or try to handle it with tonumber()
awesome its work now!
thanks you very much
Thank you all very much
Would be appreciated if you give the solution for this topic.
yes I give it
I give the:
local player = game.Players.LocalPlayer
am I right is that I must give?
Whoever’s comment helped solve the problem click the “solution” button on it.
already did…