Hey, So im making a scp tycoon ish game, and i need help with a script
i want this script to be able to detect instantly and only fire once per player after getting touched
and theres a condition to it
local rp = game:GetService("ReplicatedStorage")
local rle = rp:WaitForChild("RiotLightEvent")
local plrs = {}
script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if player and not plrs[player] then
plrs[player] = true
if script.Parent.Parent.Parent.Parent.RiotAlarm.Value == true then
rle:FireClient(player)
end
end
end)
i was going to make it fast but i honestly have no idea what im doing here ![]()
i want it to fire instantly (no need to move for it to reset) after the riotalarm is set to true
and i need it to fire once per player, but ping doesnt allow, it usually does it 100 times or something or im just bad at debug, whatever just make it work