How would I go about making this script detect if the local player is wearing Pal Hair? I can’t seem to get it to work in the same manner like detecting the Headless Head mesh. Insert a Local Script into StarterCharacterScripts and paste in the code below to see if you can find the problem.
local plr = game.Players.LocalPlayer
local Char = plr.Character
local Humanoid = Char.Humanoid
if Char:FindFirstChild(“Pal Hair”).Handle.MeshId == “rbxassetid://83293901” then
Humanoid.WalkSpeed = 24
bc = BrickColor.new(“Lime green”)
game.StarterGui:SetCore(“ChatMakeSystemMessage”, {
Text = “You have been detected for wearing Pal Hair.”;
Font = Enum.Font.Legacy;
Color = bc.Color;
FontSize = Enum.FontSize.Size10;
})
bc = BrickColor.new(“New Yeller”)
game.StarterGui:SetCore(“ChatMakeSystemMessage”, {
Text = “+8 WalkSpeed”;
Font = Enum.Font.Legacy;
Color = bc.Color;
FontSize = Enum.FontSize.Size10;
})
end
for _,child in pairs(Char:GetChildren()) do
if string.match(child.Name,"Buns") and child:IsA("Accessory") then
print(child.Name) --Braided Buns 2
end
end
local plr = game.Players.LocalPlayer
local Char = plr.Character
local Humanoid = Char.Humanoid
if Char:FindFirstChild(“Pal Hair”).Handle.MeshId == “rbxassetid://83293901” then
Humanoid.WalkSpeed = 24
bc = BrickColor.new("Lime green")
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "You have been detected for wearing Pal Hair.";
Font = Enum.Font.Legacy;
Color = bc.Color;
FontSize = Enum.FontSize.Size10;
})
bc = BrickColor.new("New Yeller")
game.StarterGui:SetCore("ChatMakeSystemMessage", {
Text = "+8 WalkSpeed";
Font = Enum.Font.Legacy;
Color = bc.Color;
FontSize = Enum.FontSize.Size10;
})
end
--SERVER SCRIPT[serviceScriptService]
local client = game.ReplicatedStorage.Client
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Char)
task.wait(1)
for _,child in pairs(Char:GetChildren()) do
if string.match(child.Name,"Pal Hair") and child:IsA("Accessory") then
Char.Humanoid.WalkSpeed = 24
client:FireClient(Player,"You have been detected for wearing a Pal Hair!")
task.wait(3)
client:FireClient(Player,"Enjoy your +8 extra WalkSpeed!")
end
end
end)
end)
--Client[StarterPlayerScripts]
local rs= game:GetService("ReplicatedStorage")
local event = rs:WaitForChild("Client")
event.OnClientEvent:Connect(function(msg)
game.StarterGui:SetCore("ChatMakeSystemMessage",{
Text = msg;
Font = Enum.Font.Legacy;
})
end)