Trying to connect 2 scripts

Im trying to connect a localscript in starerplayer scripts that detects when someone clicks, and a script in a remote event in rep storage. Its supposed to detect when someone clicks, then play an animation. Ignore the text, as i dont think its relevant unless it is.
The localscript:

--local Rig = workspace.TemplateR6
--local Player = game.Players.localPlayer
local Rstor = game:GetService("ReplicatedStorage")
--local OrbFire = Rig.Humanoid:LoadAnimation(Rstor.Animations.OrbFire)
--local Isactive = false
local UIS = game:GetService("UserInputService")

--function PlayAnim(input)
    --if input.UserInputType == Enum.UserInputType.MouseButton1 then
        --if Isactive == false then
            --Isactive = true
            --OrbFire:Play()
            --wait(0.917)
            --Isactive = false
        --end
    --end
--end
UIS.InputBegan:Connect()

The script:

local Rstor = game:GetService("ReplicatedStorage")
local Player = game.Players.localPlayer
--local OrbFire = Player.Character:WaitForChild("Humonoid").Animator:LoadAnimation(Rstor.Animations.OrbFire)
local Isactive = false
local OrbAnim = Player:FindFirstAncestorWhichIsA("Humanoid"):LoadAnimation(Rstor.Animations.OrbFire)


function PlayAnim(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        if Isactive == false then
            Isactive = true
            OrbAnim:Play()
            wait(0.917)
            Isactive = false
        end
    end
end

you didnt fire the remote event in the localscript

to fire it do remoteevent:FireServer()
and on the server do remoteevent.OnServerEvent:Connect(functionnamehere)

1 Like