Checking if a place id your in is your place?

So I probably could’ve made the title a bit less hard to comprehend, but I was wondering if there’s a way to make it so if a players in a game you can check if the id of the place is your id?

If this works, I’m only using it for business purposes like deals. If someone happened to steal my game for example, they would have to know how to script to actually remove checks for certain stuff.

3 Likes
function isYourPlace(YourUserId)
	if game.CreatorType == Enum.CreatorType.User then
		if game.CreatorId == YourUserId then
			return true
		else
			return false
		end
	else
		if game.CreatorType == Enum.CreatorType.Group then
			local ownerId = game:GetService('GroupService'):GetGroupInfoAsync(game.CreatorId).Owner.Id
			if ownerId == YourUserId then
				return true
			else
				return false
			end
		end
	end
end

hope this helps!

So when I make a place the places id is my player’s id? I’m confused you didn’t really tell me what this script does.

Ok so,
In your script have the script I sent and then after it do isYourPlace(409522146)
The script will then return true or false

if true. then the place is owned by you.
if false. then it is not owned by you.

Here is an example:

function isYourPlace(YourUserId)
	if game.CreatorType == Enum.CreatorType.User then
		if game.CreatorId == YourUserId then
			return true
		else
			return false
		end
	else
		if game.CreatorType == Enum.CreatorType.Group then
			local ownerId = game:GetService('GroupService'):GetGroupInfoAsync(game.CreatorId).Owner.Id
			if ownerId == YourUserId then
				return true
			else
				return false
			end
		end
	end
end
if isYourPlace(409522146) then
	print("You own this place!!")
else
	print("You dont own this place.")
end

Hope this helps.

That’s not what I meant what I’m trying to say is you never really described what each part of your script does, so it’s confusing to understand. I’m seeing things I usually don’t tamper with, and I don’t know what you’re doing.

I think I know have an idea of what you mean,

Are you looking for a way to check if the game running your script is owned by you?

if game.CreatorId == 409522146 then
    -- the game hasnt been stolen.
else
    -- the game has been stolen.
end

Sorry for not understanding. Hope this helps!

So, I’ll try to explain how this script works for the OP.

Enomphia has created a function which you can call that will check if the given UserId is the owner of the place. So if you give your UserId to the function, the function will return true if the game is owned by you, and false if you don’t (so someone stole your game).

The first two lines check whether game’s CreatorId is equal to that of the given UserId. Theoretically this given UserId should be your UserId. (The first if-statement is there because the game might be owned by a group – so the CreatorId won’t be accurate. This case is handled in the second half of the function, where it gets the group’s owner’s UserId and compares it your UserId the same way as before.)

In essence, though, the function is just a longer version of this:

if game.CreatorId ~= <your UserId here> then
    print("Oh no, the game is stolen!")
end
2 Likes

I have a security system that notifies me on discord when my game is stolen or even when a start startup and shutdown the game.

691646a95fe010c228b4f85b037fa0ba

28f196368de2b3ad85f150d8d81973e9

  • i added a system that i can shutdown servers with a service id with a Developer Product Description checker
5 Likes