Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can one remoteEvent be used to create instances and at the same time be used to change properties?

Asked by 5 years ago

if so, what would be the best way to carry this out? Im thinking of it carrying a reason for call value, and from that it would decide whether it should do what.

0
yes User#24403 69 — 5y
0
ok TheluaBanana 946 — 5y

1 answer

Log in to vote
0
Answered by
LuaDLL 253 Moderation Voter
5 years ago
Edited 5 years ago

Server Script:

local Remote = game:GetService("ReplicatedStorage").RemoteEvent

Remote.OnServerEvent:Connect(function(player,key,obj,Property,Value)
    if key == "ChangeProperties" then
        obj[Property]= Value
    elseif key == "Create" then
        local ob = Instance.new(obj)
        ob.Name = "CreatedObject"
        ob.Parent = workspace
    end
end)

local Script:

local Remote = game.ReplicatedStorage.RemoteEvent
-- Create a "Part"
Remote:FireServer("Create","Part","None","None")
--Change parts property
Remote:FireServer("ChangeProperties",workspace.Part,"Transparency",0.5)

Try that idk if that will work or not

0
im afraid not TheluaBanana 946 — 5y
0
for starters, line 05 wont work TheluaBanana 946 — 5y
0
although u could just define property as object.Property i think TheluaBanana 946 — 5y
Ad

Answer this question