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

Indivitual player Tool Textures?

I made this terrible code in attempts to make a script to give each player his/her own texture for a sword used here: Please help me correct it (AND I KNOW ITS WAY AND AND TERRIBLE :/ )

if game.workspace.Gamestart.Value == true then
	game.ReplicatedStorage.ClassicSword:Clone(localPlayer.BackPack)
	sword = script:FindFirstChild("TextureId")
	sword.Handle.Mesh.TextureId = (TextureId)
end

1 answer

TextureId, and localPlayer are never set. Clone doesn't take any arguments either, IIRC.

I assume you want 'sword' set to the actual cloned sword, and the TextureId set to the value of script.TextureId?

if game.workspace.Gamestart.Value then -- == true is not necessary for BoolValues
    local sword = game.ReplicatedStorage.ClassicSword:Clone()
	sword.Parent = game:GetService("Players").LocalPlayer.Backpack
    sword.Handle.Mesh.TextureId = script:WaitForChild("TextureId").Value
end

1 comment

0

I have it setup as this script and a value named TextureId in a screengui. I want the sword the be clone into the local players backpack, and the textureid will be used to change the swords mesh texture id. Thx for reading this.

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