#Auto Shirt & Pant Equip not working

1 messages · Page 1 of 1 (latest)

lunar quarry
#
local player = game:GetService("Players")
local LPlayer = player.LocalPlayer
local Team = LPlayer.Team

local Rank = LPlayer:GetRankInGroup(35153508)
local Staff_Team_Ranks = {"255", "224", ""}
local Supervision_Team_Ranks = {"", "", ""}
local Corporate_Team_Ranks = {"", "", ""}

player.PlayerAdded:Connect(function(player)
    for _, v in pairs(Staff_Team_Ranks) do
        if Rank == v then
            LPlayer.Team = game.Teams:FindFirstChild("Staff")
            LPlayer:FindFirstChildOfClass("Shirt").ShirtTemplate = "rbxassetid://80018832805363"
            LPlayer:FindFirstChildOfClass("Pants").PantsTemplate = "rbxassetid://95282531461583"
        end
    end
    for _, v in pairs(Supervision_Team_Ranks) do
        if Rank == v then
            LPlayer.Team = game.Teams:FindFirstChild("Supervision Team")
        end
    end
    for _, v in pairs(Corporate_Team_Ranks) do
        if Rank == v then
            LPlayer.Team = game.Teams:FindFirstChild("Corporate Team")
        end
    end
end)

The Teaming parts of this script are functional and working.

The Auto-Shirt & Pant Equip is not working and idk why.

NO ERRORS!

tame abyss
#

I can help you 🙂

#

Your shirt & pants script isn’t working?

lunar quarry
#

Yep, The Teaming part works.

tame abyss
#

One second let me write you a better script 🙂

kind arch
lunar quarry
tame abyss
#

Okay I’ll just give u advice I guess

lunar quarry
#

I'm unsure on why it won't work.

kind arch
#

PlayerAdded is not just a server-side event.

lofty wadi
#

Of course hes using AI

lunar quarry
#

Like I said, The teaming isn't the issue.

kind arch
#

I doubt that.

lunar quarry
#

It's just the Clothing side of it.

kind arch
lofty wadi
#

Nit eveybody

lunar quarry
#

Wait.

#

I want it to change the player's Shirt and Pants. Can that not be done Locally?

kind arch
lofty wadi
lunar quarry
#

So do I need to use Remote Events or smth?

lofty wadi
#

No

#

It can be done without it

kind arch
lunar quarry
#

In theory, I should just change it to Server side and update the script accordingly?

#

Bc if that's the case, I can probs do that myself tbh

lofty wadi
#

Yeah

lunar quarry
#

I'll crack on and change it, I'll be back if I fuck up XD

#

Wait, You can't get LocalPlayer in Server so how am I gonna get the LocalPlayer :|

kind arch
kind arch
lunar quarry
#

So can I still get Player Service and all that in it?

lunar quarry
#

How will I get the Player's rank this time round then?

#

As I can't use Local Player as that's in a Local Script.

kind arch
lunar quarry
#

aaah ok

hasty shoreBOT
#

studio** You are now Level 6! **studio

kind arch
# lunar quarry aaah ok

A suggestion I'd give would be to just watch for Team changes, and alter their clothing based on their current team

lunar quarry
#

So like

#

Change their team and reset them and then apply the clothing?

kind arch
lunar quarry
#

How do I find the Player's Rank in group though. that's the bit i'm confused on

kind arch
lunar quarry
#

What would the Local be then?

#

local Rank = #####:GetRankInGroup

kind arch
#

Since you're updating clothing, you may need to update clothes in CharacterAppearenceLoaded as well as on team change

lunar quarry
#

One sec

#

I'm gonna try smth

#

Question:

#

I want it so when they join; They are teamed to the correct team for their rank. This will then change their clothing to the ID'd clothing. you get me so far?

lament kiln
lunar quarry
#

I'm just confused on how to do it.

#

I'm abit special today.

lament kiln
#

playeradded and team changed

lunar quarry
#

Sleep-Depravity goes mental

lament kiln
#

and then because the player doesn't have a shirt, their character does, you also need to listen for their character

#

this way you catch player initial join / team change / respawn, all these events need to be connected

lunar quarry
#

So how do I put this all together?

#

It's like a sewing project in my head.