#how to use value of argument

38 messages · Page 1 of 1 (latest)

wheat stone
#
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr,block)
    local bricks = require(game.ServerScriptService.ModuleScript)
    local brick = game.ReplicatedStorage.PlacableBlocks

in this script, the argument block has a value of "killbrick" idk if it is a string or not but I want to use the name killbrick in the variable brick after placeable blocks like

  local brick = game.ReplicatedStorage.PlacableBlock.killbrick

how am I supposed to do that

mint arrow
#

local brick = game.ReplicatedStorage.PlacableBlock.(block)

#

Maybe

rose tiger
#

First off, you need to understand what the server event actually does.
It's supposed to answer the client's call with the function :FireSetver(block) (plr is already included as the first argument automatically)
In your case these are (plr, block) from the server.

So here are a few questions:

  1. What is block?
  • Why local bricks requires a module script inside of the function and what is that module responsible for?
  • How do you fire the remote from the client? (show the :FireServer() code)
  • can you screenshot the properties of the value killbrick?
  • can you please explain better what you're attempting to do here? Specifically the goal that you want to achieve.
wheat stone
mint arrow
#

Remove () ig

wheat stone
# mint arrow Remove () ig

but i dont want block i want its value like there a block called killbrick and i want to refrence it with the variable block which has a value of killbrick

wheat stone
buoyant linden
#

bro im so confused on what the issue is

wheat stone
#

there isnt a issue its just something i dont know

zenith jackalBOT
#

studio** You are now Level 5! **studio

buoyant linden
#
  local brick = game.ReplicatedStorage.PlacableBlock.killbrick

so for this line you wanted to use "killbrick", just as you have done right?

wheat stone
# buoyant linden bro im so confused on what the issue is

here's a simplified explanation of my situation
I have a part named brick and i also have a button with the name brick so, i created a variable which has the button.name and i passed it through the remote event so now i want to reference the part "brick" using the variable i created in local script

buoyant linden
#

ohh

#

button.name is a string so you can not use that to reference the part if thats what you mean

wheat stone
buoyant linden
wheat stone
#

im using a gui

wheat stone
rose tiger
#

Oh

wheat stone
rose tiger
#

You're probably wanting to reference them like so if I got you right:
PlaceableBlocks[block]

wheat stone
rose tiger
#

Do tostring()

buoyant linden
wheat stone
# rose tiger Do tostring()

yea did that but now there some prob in my local script

local buttons = game.StarterGui.Building.TextButton.ScrollingFrame:GetChildren()
for i, v in pairs(buttons) do
    v.Activated:Connect(function()

        game.ReplicatedStorage.RemoteEvent:FireServer(tostring(v.Name))

    end)
end
rose tiger
rose tiger
wheat stone
rose tiger
#

Skill issue

#

My phone is at 69%

wheat stone
#

ok now i give up for today

rose tiger
#

I still wasn't able to understand what you attempted to achieve from this. If you were more clear about the purpose I could easily suggest you a method.

wheat stone