Advertisement
Mautiku

FE Simon says counter

Feb 14th, 2025
3,205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local ChatService = game:GetService("Chat")
  3. local player = Players.LocalPlayer
  4. local char = player.Character or player.CharacterAdded:Wait()
  5. local hrp = char:WaitForChild("HumanoidRootPart")
  6. local humanoid = char:WaitForChild("Humanoid")
  7.  
  8. local TARGET_ANIMATION_ID = "rbxassetid://12351854556"
  9.  
  10. local CHAT_MESSAGE = "simon says counter"
  11.  
  12. local detectionRadius = 10
  13.  
  14. local hasSpoken = false
  15.  
  16. game:GetService("RunService").RenderStepped:Connect(function()
  17. local conditionMet = false
  18.  
  19. for _, otherPlayer in pairs(Players:GetPlayers()) do
  20. if otherPlayer ~= player and otherPlayer.Character and otherPlayer.Character:FindFirstChild("HumanoidRootPart") and otherPlayer.Character:FindFirstChild("Humanoid") then
  21. local otherHRP = otherPlayer.Character.HumanoidRootPart
  22. if (otherHRP.Position - hrp.Position).Magnitude <= detectionRadius then
  23. local otherHumanoid = otherPlayer.Character.Humanoid
  24. local tracks = otherHumanoid:GetPlayingAnimationTracks()
  25. for _, track in pairs(tracks) do
  26. if track.Animation and track.Animation.AnimationId == TARGET_ANIMATION_ID then
  27. conditionMet = true
  28. break
  29. end
  30. end
  31. end
  32. end
  33. if conditionMet then break end
  34. end
  35.  
  36. if conditionMet and not hasSpoken then
  37.  
  38. game.ReplicatedStorage.DefaultChatSystemChatEvents.SayMessageRequest:FireServer(CHAT_MESSAGE, "All")
  39. hasSpoken = true
  40. end
  41.  
  42. if not conditionMet then
  43. hasSpoken = false
  44. end
  45. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement