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

attempt to index global txt?

Asked by
Tranht 0
5 years ago
Edited 5 years ago

So yeah i'm trying this

local A_1 = "Pistol"
local A_2 = game:GetService("Workspace")[tostring(game:GetService('Players').LocalPlayer.Name)]["Pistol"].FrontEnd.Muzzle
local A_3 = game:GetService("Players")[Textboxname.Text]
local Event = game:GetService("ReplicatedStorage").Guns.Remotes.FireGun
Event:FireServer(A_1, A_2, A_3)

But every time I use it the error of attempt to index global Textboxname.Text happens.

0
i think you meant: local A_3 = game:GetService("Players")[Textboxname.Text] Gey4Jesus69 2705 — 5y
0
Yeah, it works but still with the same error. Tranht 0 — 5y
0
show more code then Gey4Jesus69 2705 — 5y
0
local A_1 = "Pistol" local A_2 = game:GetService("Workspace")[tostring(game:GetService('Players').LocalPlayer.Name)]["Pistol"].FrontEnd.Muzzle local A_3 = game:GetService("Players")[Textboxname.Text] local Event = game:GetService("ReplicatedStorage").Guns.Remotes.FireGun Event:FireServer(A_1, A_2, A_3) Tranht 0 — 5y
View all comments (6 more)
0
Remove `.name`? TheeDeathCaster 2368 — 5y
0
^ Btw, just edit your post; no need to put it into a comment. TheeDeathCaster 2368 — 5y
0
Oh, sorry I'm new to this..Also, to avoid questions. I'm making a gui that's why. Tranht 0 — 5y
0
You didn't define `Textboxname` prior. :p TheeDeathCaster 2368 — 5y
0
Wouldn’t you need to add something to get the actual connected players like PlayersAdded or a loop through players? ABK2017 406 — 5y
0
I don't think so since i'm doing a gui where you insert the name. Tranht 0 — 5y

Answer this question