So in my gui, heres the script that sends the value to the server.
local s = script.Parent
local rs = game.ReplicatedStorage
for _,c in pairs(script.Parent.Frame.ScrollingFrame:GetChildren()) do
if c:IsA("ImageButton") then
c.MouseButton1Down:Connect(function()
local tattoo = c.TattooValue.Value
game.ReplicatedStorage.Remotes.Tattoo:FireServer(tattoo)
end)
end
end
but when it gets to the point where it gives them the value in their stats, and put the texture on their face, it doesn’t do it? It gives me a texture string value error.
local facelistthing = {
[2] = "rbxassetid://4591497668", --Face2
[4] = "rbxassetid://4591497895", --Face
}
game.ReplicatedStorage.Remotes.Tattoo.OnServerEvent:Connect(function(plr, tattoo)
local char = plr.Character
if tattoo and plr.stats.Cash.Value >= 100 then
plr.stats.Cash.Value = plr.stats.Cash.Value - 100
if tattoo >= 1 then
if tattoo >= #facelistthing then
char:WaitForChild("Head"):WaitForChild("face").Texture = facelistthing[#facelistthing]
plr.stats.Face.Value = tattoo
else
char:WaitForChild("Head"):WaitForChild("face").Texture = facelistthing[tattoo]
plr.stats.Face.Value = tattoo
end
end
end
end)
Since you said it was a string value, you’re essentially doing facelistthing["2"] or ["1"]. Arrays are numerically indexed, so you need to use a numerical index. Instead of using a string value, use a number value.
You said in the first reply it was a StringValue. If you store a number in its Value property, the number is just a string representation of a number. It’s still a string. Change it to a NumberValue. Or did I miss something here.