Im trying to fire to a remote event that makes parts visible. The issue is that when the player is sitting down it doesnt fire. When standing: https://drive.google.com/file/d/1xs_VEXMaRNex3fLdOIUK5t8w7frplYHz/view?usp=sharing
When sitting: https://drive.google.com/file/d/1k40M4Au_RlSXiIzRl00fQBxNuwaIfPah/view?usp=sharing
The first one fires when I stand up, but when I sit down nothing fires when I touch the part.
Heres my server code:
local players = game:GetService("Players")
local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") and debounce == false then
debounce = true
local player = players:GetPlayerFromCharacter(hit.Parent)
local Fire1 = game.ReplicatedStorage.Jumpscare2
Fire1:FireClient(player)
end
end)
Here is my client code:
local FIred = game.ReplicatedStorage.Jumpscare2
local debounce = false
FIred.OnClientEvent:Connect(function()
if debounce == false then
for i,v in pairs (workspace.Train1.Model:GetDescendants()) do
if v:IsA("Part") or v:IsA("Decal") then
v.Transparency = 0
script.Parent.Scream:Play()
end
end
wait(2)
local function lights(value)
for i,v in pairs(game.Workspace.Train1:GetDescendants()) do
if v:IsA("SpotLight") or v:IsA("PointLight") then
v.Enabled = value
end
end
end
lights(false)
game.StarterGui.Electricity_surge:Play()
wait(3)
game.Workspace.Train1.Model:Destroy()
lights(true)
game.StarterGui.Electricity_Up:Play()
end
end)
I dont think this has to do with anything but I put my code here just in case.