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

Indivitual player Tool Textures?

Asked by 9 years ago

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

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
9 years ago

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
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. ioutragous 0 — 9y
Ad

Answer this question