Hello, i made this script and it works but is not firing the event
This is the script that fires the event
(both event is not firing)
i removed the local with the hat on the script below, it works very well, just dont fire anything
local cd = script.Parent.ClickDetector
local plr = game.Players.LocalPlayer
local remoteevent = game.ReplicatedFirst.Value1ToHat
local remoteevent2 = game.ReplicatedFirst.StartCountdownToHat
cd.MouseClick:connect(function(player)
if player.ReadyForHat.Value == '1' then
remoteevent:FireClient(player)
print("FiredEventForShowGui")
end
if player.ReadyForHat.Value == '0' then
remoteevent2:FireClient(player)
player.ReadyForHat.Value = 1
if player.Character then
if not player.Character:FindFirstChild("UnicornHood") then
local hum = player.Character.Humanoid
local hats = {}
for _,v in pairs(hum:GetAccessories()) do
table.insert(hats, v:Clone())
end
hum:RemoveAccessories()
local clone = hat:Clone()
clone.Parent = player.Character
wait(30)
clone:Destroy()
for _,v in pairs(hats) do
hum:AddAccessory(v)
player.ReadyForHat.Value = 0
end
end
end
end
end)
and this is the script that receives the fire
local remoteevent = game.ReplicatedFirst.Value1ToHat
local plr = game.Players.LocalPlayer
local secondsleft = plr:WaitForChild("TimeLeftForHat")
remoteevent.OnClientEvent:Connect(function()
if plr.TimerReadyForHat.Value == '1' then
print("timerison")
end
if plr.TimerReadyForHat.Value == '0' then
plr.TimerReadyForHat.Value = 1
plr.PlayerGui.Warn1Hats.Hats.Visible = true
plr.PlayerGui.Warn1Hats.Hats.Text = "You need wait " ..secondsleft.Value.. " seconds for try a new hat!"
wait(3)
plr.PlayerGui.Warn1Hats.Hats.Visible = false
plr.TimerReadyForHat.Value = 0
end
end)
---
i made the test to do this
local plr = game.Players.LocalPlayer
local remoteevent = game.ReplicatedFirst.Value1ToHat
local secondsleft = plr:WaitForChild("TimeLeftForHat")
remoteevent.OnClientEvent:Connect(function(playeractive)
print("whyisnotworking?")
end)
And dont prints nothing, dont give any error on console and dont fire anything too, can someone help?