Code formatting fixed by phxntxsmic

game.ReplicatedStorage.Buy.OnServerEvent:Connect(function(pla, price, name)
--pla is the plr 
--price is the price of an object
--name is the name of an item, (Not important here)

print(pla.Parent.Name)
	local char = game.Workspace:FindFirstChild(pla.Name)
	local srtn = tostring(price)
	
	if pla.leaderstats.Points.Value >= srtn then
		print("works")
	else
		print("Nope")
	end
end)

This code should, Tell how much i have, if i have enough it should prink "works" and if i dont it should print "nope". But no matter how much i have it always prints "nope". whats wrong!! :D

4 comments

0

what happened to your code formatting

0
  1. comparaison operators don't work with strings. that's literally it
0

if you need more help dm me on discord (Loma#8374)

0

You shouldn't have the client send the price of the object.