Local Script doesnt work even if it was put in correct location AND no syntax errors?

Now this is truly weird, lately i am very confused and very angry about this one SMALL issue about a localscript i made.
So basically, it has 0% runtime in script perfomance tab, no activity whatsoever, 0 prints and EVERYTHING IS STILL IN A CORRECT SYNTAX.

local plrs = game:GetService("Players")
local reps = game:GetService("ReplicatedStorage")
local cas = game:GetService("ContextActionService")
local uis = game:GetService("UserInputService")
local runs = game:GetService("RunService")
local plr = plrs.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

local modules = reps.modules
local main = require(modules.main).new()

local uisTable = {
	[Enum.KeyCode.R] = reload,
	[Enum.UserInputType.MouseButton1] = fire,
	[Enum.UserInputType.MouseButton2] = aim,
}

function handleInput(input, gpe)
	if gpe then return end
	
	local action = uisTable[input]
	if action then
		action()
	else
		warn("Invalid input.")
	end
end


function onUpdate(dt)
	main:update(dt)

	print("idkman")
end

function reload()
	print("RELOAODOADOADOAODAOAO")
	main:reload()
end

function fire()
	print("FIRIIRIRIRIRIEIIEIEIEIEI")
	main:fire()
end

function aim()
	print("AIMMMMMMMM")
	main:aim()
end

function equip()
	print("YEYEYEYYEYEYEYYEYEYE")
	main:equip()
end

function unequip()
	print("NNNONOONONONONOONONONONONOON")
	main:unequip()
end

char.ChildAdded:Connect(function(child)
	if child:IsA("Tool") then
		equip()
		
		uis.InputBegan:Connect(handleInput)
		uis.InputEnded:Connect(handleInput)
	end
end)

char.ChildRemoved:Connect(function(child)
	if child:IsA("Tool") then
		unequip()
	end
end)


runs:BindToRenderStep("vmRender", Enum.RenderPriority.Camera - 1, onUpdate)

is this actually a real bug or a rookie mistake because i can’t even find where the bug comes from.
Please help :cry:


https://gyazo.com/898ab3ba22bd71e7735e6a9ab4a64b48

What? HOW?
It’s so weird is it not running on my side

where did you put the script. if you put it in starterplayer scripts, it should work

Yeah, i do put it in starterplayerscripts.
it’s extremely weird

So i figured out the problem, turns out it was with my custom events module. I just have to disable it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.