#why is my script only detecting transparency but ignore booleans and other properties.

1 messages · Page 1 of 1 (latest)

wet laurel
orchid marsh
#

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

orchid marsh
#

254 bytes and it's not embedded into chat?

wet laurel
#

ok

#

but thst does not answer my question

#

nah jk

storm lotus
#

oh my god

#

what am i looking at

#

this has to be ragebait

#

surely

wet laurel
storm lotus
#

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

#

💔

wet laurel
#

wow

storm lotus
#

you can reduce the amount of parameters to 3

#

part, property, value

wet laurel
#

yeah but

wet laurel
#

value has to be boolean/number

storm lotus
#

but easier to read

wet laurel
#

😭

storm lotus
#

what about strings?

wet laurel
storm lotus
# wet laurel 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

wet laurel
#

So poo...

storm lotus
wet laurel
storm lotus
# wet laurel

before t is defined put

print(plr, part, prop, val)
#

show me what it returns

wet laurel
storm lotus
#

no wonder

#

ur values are mixed up on the client

#

show me the client side

wet laurel
#

how

storm lotus
#

show me the script that fires changeproperty

wet laurel
#

uh

#

ok

storm lotus
#

give me a recording of you trying to change a property in game

#

what does it look lkke

wet laurel
#

howdo i explain this

storm lotus
#

no obs?

wet laurel
#

no no

#

my pc absolutely goes garbage while recording

#
  • i cant even move my mouse
storm lotus
#

i see

#

so basically

#

ur client script is ass

#

💔

wet laurel
#

im on another pc btw

wet laurel
#

tf do u expect

#

😭

storm lotus
#

ur not sending any values to the server, the parameters are completely wrong for a textbox

wet laurel
#

wait let me try something worse

storm lotus
#

no

#

so

#

uh

#

when you set a value, is there a textbox for property and another for value?

wet laurel
#

you change the property with Value...

storm lotus
#

you would put the property name in the first and the desired value in the second

wet laurel
#

yup

#
  • there is an textbox that uh
#

you put the name of an part then the value thing

#

blah

storm lotus
# wet laurel you put the name of an part then the value thing
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)
wet laurel
#

wtf

#

.

#

nvm

storm lotus
#

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)
wet laurel
#

its straight up ignored

#

.

#

why it ignores everythin

#

except transparency

storm lotus
# wet laurel its straight up ignored
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

wet laurel