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

How to make Part using LocalScript w/ FireServer?

Asked by
Jetex_m -5
5 years ago

does anyone know the remote client without making a new instace as a script i made a part variable like

view source

local nou = Instance.new("Part")

then i want it to go with the fireserver how do i do that to make it so everyone would see it WITHOUT doing the create part w/ remote event i want the variable itself to go with the fireserver in remote event. i know,


local rep = game:GetService("ReplicatedStorage") local fireevent = rep.FireStarter

but i want to make it into so its easier without rewriting code

0
Sorry you need remotes to do this User#19524 175 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

little bit of a heads up; making a part in a local script cant necessarily be done like that. you have to FireServer in order to do that function, like this:

localscript:

local rep = game:GetService("ReplicatedStorage")
local fireevent = rep:WaitForChild("FireStarter")

local function somefunction()
    local parttype = "Part"
    local color = Color3.fromRGB(38, 190, 174)
    local size = Vector3.new(1, 1, 1)
    local material = 'Grass'
    fireevent:FireServer(parttype, color, size, material)
end

server script:

local rep = game:GetService("ReplicatedStorage")
local fireevent = Instance.new("RemoteEvent", rep)
fireevent.Name = "FireStarter"

local function letsago(parttype, color, size, material)
    local p = Instance.new(parttype)
    p.Color = color
    p.Size = size
    p.Material = material
end
fireevent.OnClientEvent:Connect(letsago)

hopefully this helps!

0
What, User#19524 175 — 5y
0
uhh whats the problem @incapaz SuperKirbylover 107 — 5y
0
That script is pretty strange. bluestreakejjp 41 — 5y
0
not sure how, i just jolted out what i knew, considering it works. i'm still working to learn more about scripting and one day i'll probably learn a better method SuperKirbylover 107 — 5y
Ad

Answer this question