Title says it all. When a clickdetector is clicked, then the remote event is fired through the server script in the click detector.
Server Script
local Part = script.Parent.Parent
local PartClickDetector = Part:WaitForChild("ClickDetector", 2)
PartClickDetector.MouseClick:Connect(function(player)
local character = player.Character
local hum = character:WaitForChild("Humanoid")
local Torso = character:WaitForChild("Torso")
local RightLeg = character:WaitForChild("Right Leg")
local LeftLeg = character:WaitForChild("Left Leg")
local RightArm = character:WaitForChild("Right Arm")
local LeftArm = character:WaitForChild("Left Arm")
local Head = character:WaitForChild("Head")
local Hat = script:WaitForChild("ROBLOXRBaseballCap")
if Torso then
Torso.BrickColor = BrickColor.new("Bright blue")
RightLeg.BrickColor = BrickColor.new("Br. yellowish green")
LeftLeg.BrickColor = BrickColor.new("Br. yellowish green")
RightArm.BrickColor = BrickColor.new("Bright yellow")
LeftArm.BrickColor = BrickColor.new("Bright yellow")
hum:AddAccessory(Hat)
character.ClothesOn.Value = true
game.ReplicatedStorage.ClothesOn:FireClient(player)
print("rem1 fired")
end
end)
Client Script
local label = script.Parent
local text = label.Text
local rem1 = game.ReplicatedStorage.ClothesOn
text = "current objective: put some clothes on"
rem1.OnClientEvent:Connect(function(player)
text = "current objective: leave the house"
end)