#why is my script only detecting transparency but ignore booleans and other properties.
1 messages · Page 1 of 1 (latest)
darling I must say I absolutely LOVE what you've done to be specific about your inquiry
I, an established mind-reader, fully understand the purpose and nature of this post
254 bytes and it's not embedded into chat?
cdoe
hold on
game.ReplicatedStorage.changeproperty.OnServerEvent:Connect(function(p, num, name, prop)
tostring(prop)
tostring(name)
local boolean = true or false
local b = workspace:FindFirstChild(name)
local idk = tonumber(num)
b[prop] = idk or boolean
end)
ok
ok so
uh
💔
wow
yeah but
what the fuck is even that
value has to be boolean/number
im trying to fucking replicate roblox studio
ðŸ˜
why are you trying to only limit to boolean or number
what about strings?
aight let me try
game:GetService("ReplicatedStorage").changeproperty.OnServerEvent:Connect(function(plr, part, prop, val)
local t = typeof(val)
if t == "number" or t == "boolean" or t == "string" then
part[prop] = val
end
end)
in the client side, send the part itself rather than the part name
maybe
this doesnt eve work
So poo...
what is the error in output
before t is defined put
print(plr, part, prop, val)
show me what it returns
how
show me the script that fires changeproperty
💔
give me a recording of you trying to change a property in game
what does it look lkke
uhhh
howdo i explain this
no obs?
im on another pc btw
ur not sending any values to the server, the parameters are completely wrong for a textbox
wait let me try something worse
no
so
uh
when you set a value, is there a textbox for property and another for value?
yes.
you change the property with Value...
i meant are there 2 textboxes
you would put the property name in the first and the desired value in the second
yup
- there is an textbox that uh
you put the name of an part then the value thing
blah
local tb1: TextBox -- put the path to the first textbox (PROPERTY NAME)
local tb2: TextBox -- put the path to the second textbox (DESIRED VALUE)
local tb3: TextBox -- put the path to the third textbox (PART NAME)
tb2.FocusLost:Connect(function(enterPressed)
if enterPressed then
local prop = tb1.Text
local part = workspace:FindFirstChild(tb3.Text)
if part and part[prop] then
game:GetService("ReplicatedStorage").changeproperty:FireServer(part, prop, tb2.Text)
end
end
end)
replace the server event with this:
local bools = {
["true"] = true,
["false"] = false
}
game:GetService("ReplicatedStorage").changeproperty.OnServerEvent:Connect(function(plr, part, prop, val)
if bools[val] then val = bools[val] end
local t = typeof(val)
if t == "number" or t == "boolean" or t == "string" then
local success, err = pcall(function()
part[prop] = val
end)
if not success then print(err) end
end
end)
there is no errors but
its straight up ignored
.
why it ignores everythin
except transparency
local bools = {
["true"] = true,
["false"] = false
}
game:GetService("ReplicatedStorage").changeproperty.OnServerEvent:Connect(function(plr, part, prop, val)
print(`Received event | Part: {part}, Property: {prop}, Value: {val}`)
if bools[val] then val = bools[val] end
local t = typeof(val)
print(t)
if t == "number" or t == "boolean" or t == "string" then
print("Setting value...")
local success, err = pcall(function()
part[prop] = val
end)
if not success then print(err) end
end
end)
show me the output
]there is no output