Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make Part using LocalScript w/ FireServer?

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

1 comment

0

Sorry you need remotes to do this

1 answer

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!

4 comments

0

What,

0

uhh whats the problem @incapaz

0

That script is pretty strange.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.