Problem with "Click a model to earn badge."

Hey, I been trying to make a click to earn badge, but I am having trouble. I’m not the best at lua, and I used my knowledge that I have so far to make this.

image

When I went in game It did not work for me. I looked all over the dev forum on this, and then I went to the output to check the error. It said “Unable to cast Instance to int64.” I have no idea what this is so I searched it up, but it didn’t help. So if anyone can help me out here that would be great.

two problems:

1st,

remove the parenthesis around the id.

2nd,

Modify your code so the function looks like this:

ClickDetector.MouseClick:Connect(function(plr)
    print("Mouse Clicked!")
    badgeservice:AwardBadge(plr.Userid,id)
1 Like

which line of code is the id you are referring to?

the 3rd line; where the variable is defined

Thanks for the help! I’m going to test it out right now!

image

Use a Capital i, might work maybe

2 Likes

Wow, it worked. Cool, thanks too!