UUID Comparison fails on script start (Possible Duplicate)
complete
WolfGang Senizen
UUID Comparison is... Possibly cause by the same as this bug
function test()
if ll.GetOwner() == ll.GetOwner() then
ll.Say(0,"EQUAL")
else
ll.Say(0,"NOT EQUAL")
end
end
test()
touch_start = test
Prints
NOT EQUAL
On script start, but then EQUAL
on touchMore comprehensive script
function test()
ll.Say(0,"============================")
local own1 = ll.GetOwner()
local own2 = ll.GetOwner()
local comp = own1 == own2
if comp then
ll.Say(0, `UUID EQUAL: {comp}`)
else
ll.Say(0, `UUID NOT EQUAL: {comp}`)
end
if own1 == own2 then
ll.Say(0, `UUID EQUAL`)
else
ll.Say(0, `UUID NOT EQUAL`)
end
ll.Say(0, tostring(own1))
ll.Say(0, tostring(own2))
own1 = tostring(own1)
own2 = tostring(own2)
comp = own1 == own2
if comp then
ll.Say(0, `STRING EQUAL: {comp}`)
else
ll.Say(0, `STRING NOT EQUAL: {comp}`)
end
if own1 == own2 then
ll.Say(0, `STRING EQUAL`)
else
ll.Say(0, `STRING NOT EQUAL`)
end
ll.Say(0, own1)
ll.Say(0, own2)
ll.Say(0,"============================")
end
test()
touch_start = test
Log In
Signal Linden
complete
Fixed in the latest release, along with the similar string comparison issue. Thanks for the example scripts and easy test case.
Signal Linden
in progress
Wulfie Reanimator
UUIDs in Luau are
userdata
, which is the reason this fails.> Objects (tables, userdata, threads, and functions) are compared by reference: two objects are considered equal only if they are the same object.
However
I think
this could be fixed by implementing the equality operator in C.WolfGang Senizen
Wulfie Reanimator
Try the script
They compare just fine, after script start