Hi.
I have made an item system in my game that edits attributes within the item’s model on the server side.
When the player clicks on the item, the model goes invisible and an attribute called “clickable” is supposed to change to “false”. This used to work, but is currently not working.
I think this is a potential “bug”, because the other attribute called “Cost” that holds a number DOES change as it should.
Here is a video of what is happening:
Here is the script where the Boolean is supposed to change upon a remote fire. The “item”, is the correct item according to what the client and server prints out.
if item:GetAttribute("Clickable") and not item:HasTag("Money") then
player:SetAttribute("Item", item.Name)
item:SetAttribute("Clickable", false) -- Sets here
print(item, item.Name, item:GetAttribute("Clickable"), item.Parent)
local itemClone = getItem(item.Name);
itemClone.Parent = character
local itemPrimary = itemClone.PrimaryPart;
toggleAnchor(false, itemClone)
local motor6D = Instance.new("Motor6D");
motor6D.Name = "HeadAttachment"
motor6D.Parent = itemClone
motor6D.Part0 = playerHead
motor6D.Part1 = itemPrimary
motor6D.C0 = CFrame.new(0,0,0)
local x,y,z = playerHrp.CFrame:ToOrientation();
motor6D.C1 = CFrame.new(0,-1.35 - itemPrimary.Size.Y/2, 0) * CFrame.Angles(0,math.rad(y),0)
toggleTransparency(1, item)
for i, v in pairs(item:GetDescendants()) do
if v:IsA("TextLabel") then
v.TextTransparency = 1
end
end
end
EDIT: I’m tired and what I did in that video with the cost attribute wasn’t what I meant to show. If I set the cost value via server script, it still changes, unlike the Boolean.
When I print the attributes before and after, they both change. But, the model does not change for the boolean.
Thank you for any possible solutions and assistance.