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

How do I make this rank detector turn into a tool detector??? [closed]

Asked by 5 years ago

[THIS IS NOT A REQUEST. I NEED HELP.] Hello, I’m currently looking to turn this rank detector into a detector that searches the players inventory for a item called “Stolen Access Card” or “Stolen Glock”.
Here is my script:
https://hastebin.com/edogenamoq.sql

Thanks alot,
Rook

0
Could you explain the issue you're having gullet 471 — 5y
0
It doesn't seem you've provided an attempt... which makes it a request even if you claim it is not. gullet 471 — 5y
0
Exactly. Show something you tried @RookPvPz Doge_Brigade 94 — 5y
0
this is a request, im so rebel LoganboyInCO 150 — 5y
0
Are you using a free script? recanman 88 — 5y

Closed as Non-Descriptive by DeceptiveCaster, gullet, and namespace25

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

For starters, GetPlayerFromCharacter() should do the trick instead of that function up there.

`local hum = part.Parent:FindFirstChild("Humanoid")

It's quite a old tactic, but it would do the trick for checking if the touch is still a player's character and not some random part, as .Touched sometimes is buggy like that.

    if hum then
    local player = game.Players:GetPlayerFromCharacter(part.Parent)`

`

if player:GetRankInGroup(groupid) <= 11 then
    --DO THIS
end

Obviously there's a lot of other ways of doing hum, I just used that because it's been a method for years, I wouldn't use it for much now a days, but I figured I'd use it as an example of how you could redo a bit of the code.

Obviously if you need more than 1 group, you can use a table instead of that plain old if statement as well.

Ad