OnFireRobloxScriptin

Script under touch part (Server Side)

Mar 24th, 2026
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. --//Services
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3. local Players = game:GetService("Players")
  4.  
  5. --//Variables
  6. local openUiEvent = ReplicatedStorage.OpenUi
  7. local touchPart = script.Parent
  8.  
  9. --//Function
  10. touchPart.Touched:Connect(function(hit)
  11.     if hit and hit.Parent:FindFirstChild("Humanoid") then
  12.         local character = hit.Parent
  13.         local player = Players:GetPlayerFromCharacter(character)
  14.         openUiEvent:FireClient(player)
  15.     end
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment