I want to have a part where when a player touches it, a half transparent GUI appears on their screen like they took damage. I used remote events for this but the GUI did not appear. I tried to do this in the past before but the same issue happened.
This is the server script:
local debounce = false local part = script.Parent local explosion = part:WaitForChild("ParticleEmitter") local SFX = part:WaitForChild("Punch Kit Beefy Hit 5 (SFX)") local dmgEvent = game.ReplicatedStorage.DamageGUI local function onTouch(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum and not debounce then debounce = true local player = players:GetPlayerFromCharacter(hit.Parent) local dmgGUI = game.StarterGui.HarmGUI.HarmFrame print("Debounce is working??") dmgEvent:FireClient(player, dmgGUI) explosion:Emit(100) SFX:Play() wait(1) local A = part:Clone() A.Parent = game.Workspace A.Position = part.Position + Vector3.new(5, 0, 0) part:Destroy() wait(1) debounce = false end end part.Touched:Connect(onTouch)
This is the local script:
local dmgEvent = game.ReplicatedStorage.DamageGUI local function onClient(dmgGUI) print("Frame visible g shi") dmgGUI.Visible = true wait(0.5) dmgGUI.Visible = false end dmgEvent.OnClientEvent:Connect(onClient)
Whenever I test it out, this happens: Video
The output prints that the frame appears but it does not. All help is appreciated, thank you.