Why wont this work?? Nothing wrong with output, it just wont work.
local player = Game.Players.LocalPlayer local swordMesh = script.Parent local GuiBar = player.PlayerGui.ScreenGui.TextBox --Change to correct path. GuiBar.FocusLost:connect(function() pcall(function() swordMesh.Texture = "http://www.roblox.com/asset/?id="..GuiBar.Text --Try to change the texture. end) end)
It's TextureId mostly, depending on what you're changing:
local player = Game.Players.LocalPlayer local swordMesh = script.Parent local GuiBar = player.PlayerGui.ScreenGui.TextBox GuiBar.FocusLost:connect(function() pcall(function() swordMesh.TextureId = "http://www.roblox.com/asset/?id=" .. (GuiBar.Text) end) end)
Also, with roblox you are wanting to get the base image of the decal, so take 1 off the ID when you type it in. E.g. if the ID of the decal is 141225665 then when you type it in change it to 141225664.
local player = Game.Players.LocalPlayer local swordMesh = script.Parent local GuiBar = player.PlayerGui.Example.TextBox --Change to correct path. 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) --Try to change the texture. end) end)
Should function correctly.
First things first: Is this in a LocalScript?
If it is: I have no idea what can have caused it
If it isn't: It's most probably the reason, as focuslost happens on a client. Copy the code into a localscript and it will most probably work