Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is it possible to fire a localscript to someone else?

Asked by 3 years ago
Edited 3 years ago

So right now im making a tool that when clicked a server script will make a part where clicked and if it detects a players humanoid then it will fire a remote event with fireclient to a localscript. What I want to happen is that the localscript will only fire for the detected player. Is that possible?

Localscript:

local Tool = script.Parent
local playere = game.Players.LocalPlayer
local mouse = playere:GetMouse()

Tool:WaitForChild("client").OnClientEvent:Connect(function()

    local lighting = game:GetService("Lighting")
    local col = lighting:WaitForChild("ColorCorrection")

    local cross = game.Workspace:WaitForChild("Cross")
    cross.Color = Color3.new(29, 29, 29)

    col.Enabled = true

    wait(7.5)
    col.Enabled = false

end)

Server script detect part:

Detect.Touched:Connect(function(hit)
        print("detect touched")
        if hit.Parent == player.Character then return end
        if hit and hit.Parent:FindFirstChild("Humanoid") then 
            local EnemyHum = hit.Parent:FindFirstChild("Humanoid")
            print("tsu hit")

            local playa = game.Players:GetPlayerFromCharacter(hit.Parent)

            if playa then
                Tool.client:FireClient(playa)
                print("fired client")

            else
                print("playa no exist or no fire client")
            end 
0
let me see your server script sata5pa3da 286 — 3y
0
Added it in Sabertooth11123 38 — 3y

Answer this question