Yeah sorry, confusion with MouseClick1. Also, I dont think he wanted players in the group to have but in a particular team.
Ok, let me explain.
I want people, in the group be ABLE to get the tools if they click on the locker. If they donāt want it, they donāt have to click it. I want it to give the player that clicked on it the police tools that I have specified(only M4 atm).
I think I know what you did, you didnt put this:
game.ServerStorage.M4.Parent = PlayerModel
Do you want a specific rank or EVERYONE in that group?
Specific Rank & above.
Like Probationary Officer & above.
wait are you getting this from ServerStorage?
Iāve just selected a random group Iām in, and the rank rn because I ahvenāt made the CHP group.
local clickDetector = workspace.Part.ClickDetector
function onMouseClick()
if player:GetRankInGroup(123) >= 456 then -- replace 123 with group id 456 with minimum rank id
game.ServerStorage.M4:Clone()
game.ServerStorage.M4.Parent = player.Backpack
end
clickDetector.MouseClick:connect(onMouseClick)
Try to execute something like this. Just took some of @COUNTYL1MITSās code.
Yeah, lol where else would I get it from.
Ok, Iāll try it. I think its gonna work.
Okay hereās what you should do, put the tool in lighting and then put this script, as a server script inside of what you want to click to get the weapon. put āWaterBucketā to whatever the tools name is
function hi(x)
local y = x.Backpack
local z = game.Lighting["WaterBucket"]
z:Clone().Parent = y
end
script.Parent.ClickDetector.MouseClick:connect(hi)
( a server script is just a normal script, a few people have asked me that )
Again, didnāt work. OOOOOOOOF!
alr lemme try it, idk why Iād put it in lighting though.
Lighting is just a spot I like to hide weapons, it keeps their position and doesnāt let you touch it or even interact with it in studio, just like serverstorage.
show me the console.
There might be an error with the click detector
So we never thought of showing the Output or Script analysis lol, that could help
did you put the script inside a local script?