I ran a code in which a script in the starter gui catches a value of a string val inside a folder inside the workspace. The folder is named Transaction and the string var is named transactor.
The starting value of the string is “”.
Then i call a function inside of a local script
And inside of it there is a script called lender
it has this code
script.Parent.Parent.MouseButton1Click:Connect(function()
wait(3)
local Transactor = game.Workspace.Transaction.Trasactor
local PlayerName = Transactor.Value
print(PlayerName)
local Model = game.Workspace:FindFirstChild(PlayerName)
local Gumanoid = Model:WaitForChild("Humanoid")
local Lolit = game.ReplicatedStorage["Classic Lolita Skirt"]:Clone()
Lolit.Parent = game.Workspace
Gumanoid:Equip(Lolit)
end)
I thought the output of print(PlayerName) will be my name but the output is just coming as blank.
And there is another error.
07:46:40.801 - Players.pirospacepride1.PlayerGui.SHOP.ShopMenu.BackAccesories.SKIRTS.Buy Button.LocalScript.Lender:7: attempt to index nil with 'WaitForChild'
07:46:40.801 - Stack Begin
07:46:40.801 - Script 'Players.pirospacepride1.PlayerGui.SHOP.ShopMenu.BackAccesories.SKIRTS.Buy Button.LocalScript.Lender', Line 7
07:46:40.802 - Stack End
It will be very helpful if you try to find the problem.
Thank you.
I have already got the humanoid. My problem is the script not updating the Object-value.
I checked whether the script had the humanoid value and it had that. But when i made the code to take the vaalue into another script, the script picked up a nil value.
The video I’m about to show you is FE I recorded it myself. But, Localscript are client sided which in really basic terms only you can see that the objectvalue.Value = Humanoid. While the server says its nil.