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

Module Script not running UserInput?

Asked by 4 years ago

I have a module script, and everything works when I run it, except the UserInput, any suggestions?

function GunStats.check3(player)
    local character = player.Character or player.CharacterAdded:Wait()
    local humRoot = character:WaitForChild("HumanoidRootPart")
for i, v in pairs(game.Workspace:GetDescendants()) do
if v:IsA("Part") then
    if v.Name == ("BillboardPart") then
        for i, v in pairs(v:GetChildren()) do
            if v.Name == ("BillboardGui") then
        while wait() do
    if (humRoot.Position - part.Position).Magnitude < 5 then
check = true
        v.Enabled = true
uis.InputBegan:Connect(function(input, gameprocessed)
    if input.Keycode == Enum.KeyCode.E then
        print("hi")
    end
end)

Script in Workspace connecting to the ModuleScript

local players = game:GetService("Players")
local serverStorage = game.ServerStorage
local gunStats = require(serverStorage:WaitForChild("ModuleScript"))


game.Players.PlayerAdded:Connect(function(players)
gunStats.check3(players)
end)

2 answers

Log in to vote
0
Answered by 4 years ago

I dont know :(

Ad
Log in to vote
0
Answered by 4 years ago

On line 13 i was taught that it should be like this

uis.InputBegan:Connect(function(input, gameProcessedEvent)

It probably makes no difference and i'm sorry if it doesn't work for you.

0
The argument names can just be whatever you want Luka_Gaming07 534 — 4y
0
oh kingblaze_1000 359 — 4y

Answer this question