local:
local plr = game:GetService("Players").LocalPlayer
local Disguisted = plr.Character.Values.Disguisted
script.Parent.Activated:Connect(function()
if Disguisted.Value == false then
game:GetService("ReplicatedStorage").Events.EquipMask:FireServer(plr)
Disguisted.Value = true
else
game:GetService("ReplicatedStorage").Events.UnEquipMask:FireServer(plr)
Disguisted.Value = false
end
end)
server:
local RS = game:GetService("ReplicatedStorage")
local isahat
game:GetService("ReplicatedStorage").Events.EquipMask.OnServerEvent:Connect(function(plr)
local BlueGnome = RS.Items.BlueGnome:Clone()
BlueGnome.Parent = plr.Character
BlueGnome.Motor6D.Part0 = plr.Character.Head
for i, v in pairs(plr.Character:GetChildren()) do
if v:IsA("Accessory") then
isahat = false
for j, desc in pairs(v:GetDescendants()) do
if desc:IsA("Attachment") and desc.Name == "HatAttachment" then
isahat = true
end
end
if isahat then
AccFolder = Instance.new("Folder", RS)
AccFolder.Name = plr.Character.Name.. "'s Folder"
v.Parent = AccFolder
else
end
end
end
end)
game:GetService("ReplicatedStorage").Events.UnEquipMask.OnServerEvent:Connect(function(plr)
local BlueGnome = plr.Character.Head:FindFirstChild("BlueGnome")
BlueGnome:Destroy()
for i, v in pairs(AccFolder:GetChildren()) do
if v:IsA("Accessory") then
v.Parent = plr.Character
end
end
end)
I am sure the problem is on the server because I tried printing something on the client and that worked
but if I try to print something on the server nothing happens. (output is clear)
Does someone know whats wrong?