Here is my code, I simplified it and only has the barebones, but the issue pops up regardless:
Code is in a LocalScript container placed in game.StarterPlayer.StarterPlayerScripts
local ContextActionService = game:GetService("ContextActionService")
function A()
print("Wolf A is not fenced")
end
function B()
print("Wolf B is not fenced")
end
function C()
print("Wolf C is not fenced")
print("Wolf C is enclosed with Wolf D")
end
function D()
print("Wolf D is not fenced")
print("Wolf D is enclosed with Wolf C")
end
ContextActionService:BindAction("EncloseA", A, false, Enum.KeyCode.H, Enum.KeyCode.ButtonY)
ContextActionService:BindAction("EncloseB", B, false, Enum.KeyCode.J, Enum.KeyCode.ButtonX)
ContextActionService:BindAction("EncloseC", C, false, Enum.KeyCode.K, Enum.KeyCode.ButtonA)
ContextActionService:BindAction("EncloseC", D, false, Enum.KeyCode.L, Enum.KeyCode.ButtonB)
It seems to call the last BindAction everytime, I spent trying to change up the code and write it differently.
I made errors on my code intentionally, I changed function C and D
function C()
priadwnt("Wolf C is not fenced")
pridwant("Wolf C is enclosed with Wolf D")
Tedwadxt = "Wolf C is not fenced" .. "Wolf C is enclosed with Wolf D"
print("WHAT?1")
end
function D()
prwadint("Wolf D is not fenced")
prwadint("Wolf D is enclosed with Wolf C")
Texdwt = "Wolf D is not fenced" .. "Wolf D is enclosed with Wolf C"
print("WHAT?2")
end
It prints this error, notice how it only complains about function D and not C
00:13:19.737 - TTU Home auto-recovery file was created
00:13:30.138 - Go to Game Settings and turn on Allow HTTP requests.
00:13:30.325 - Players.Formidable_Beast.PlayerScripts.LocalScript:23: attempt to call global 'prwadint' (a nil value)
00:13:30.327 - Stack Begin
00:13:30.328 - Script 'Players.Formidable_Beast.PlayerScripts.LocalScript', Line 23
00:13:30.329 - Stack End
00:13:30.329 - ContextActionService: Unexpected error while invoking callback: Players.Formidable_Beast.PlayerScripts.LocalScript:23: attempt to call global 'prwadint' (a nil value)
I am obviously not trolling, this post took some time to write, it would be a waste of time if I wrote this as a joke.
I restarted studio and reset all settings to try and fix it. I run the script on an empty place with only the localscript inside. I haven’t tried unplugging all input devices yet(i don’t want to mess with wires). I did unplug my controller to see if it was the issue. I don’t know how to use call stack, but it does get called when I start the game. I used a watch to track variables.