Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Put this in a local script wont work no output what's problem?

Help me please, this script's supposed to change a sword's mesh TextureID, when you type a ID from the catalog, into the TextBox. But the thing is, when I type it in, it wont work, I tried both local, and non local scripts, and yet it still wont work, I put it into the mesh, so that's it's parent, yet I made the path, and it wont get to it correctly. Could somebody help me out? Here's the script that wont work.

local player = Game.Players.LocalPlayer

local swordMesh = script.Parent

local GuiBar = player.PlayerGui.StarterGui.Frame.TextBox -- If this isn't the right way to find the path, someone fix it please.

GuiBar.FocusLost:connect(function() --When someone is finished typing into the TextBox,

pcall(function()

swordMesh.TextureId = "http://www.roblox.com/asset/?id="..tostring(tonumber(GuiBar.Text)-1)\

end)
end)

1 comment

0

There's no output problem, I really do need help.

1 answer

✓ Accepted answer

On line 5 is that StarterGui the name of the ScreenGui?

local GuiBar = player.PlayerGui.StarterGui.Frame.TextBox -- If this isn't the right way to find the path, someone fix it please.

On line 11, remove that random \

swordMesh.TextureId = "http://www.roblox.com/asset/?id="..tostring(tonumber(GuiBar.Text)-1)\

And at the top, add

repeat wait() until game.Players.LocalPlayer

This script has to be LocalScript btw.

3 comments

0

Best guess that the error is in the function inside call since that almost entirely masks the error unless you set values to it.

0

*pcall Blame my iPad on that comment above.

0

Thanks man it works now!!

This discussion is preserved as it was. New answers, comments, and votes are closed.