Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

[Answered] attempt to compare two userdata values error?

Asked by 4 years ago
Edited 4 years ago
1 CheckSale = game.ReplicatedStorage.CheckSale
2 Sword = game.ServerStorage.ShopItems.Sword


3 CheckSale.OnServerInvoke = function(player, Sword)
4   local Points = player:WaitForChild("leaderstats"):WaitForChild("Points")
5   if player.leaderstats.Points < game.ServerStorage.ShopItems.Sword.Price then
        return false
    else
        return true
    end
end

I'm trying to make a shop GUI and I'm having trouble on the purchase process of an item. I've used a remote function to send the information over to the server.

The error comes on line 5, I'm not sure what the error means or how to fix it. I'm very new to scripting so if you could explain to me as simple as possible that would be great.

1
Points and Price are both Value instances. Use Points.Value and Price.Value. DeceptiveCaster 3761 — 4y
0
Thanks man! Master_Aaron 59 — 4y

Answer this question