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

Make model spawner FE compatible?

Asked by 6 years ago

Hello I was wondering how you would make this script filtering enabled compatible. I have filtering enabled turned on, with it the script does not work Script:

bin = script.Parent

function onButton1Down(mouse)

    local model = bin.Car:clone() 
    model.Parent = game.Workspace
    model:MakeJoints()
    wait(1)
    model:MoveTo(mouse.hit.p)

end

function onSelected(mouse)
    mouse.Icon = "rbxasset://textures\\GunCursor.png"
    mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end



bin.Selected:connect(onSelected)

This is the layout: We have a tool, and inside this tool is this script along with the model named "Car". The tool is present in the starter pack. It works without filtering enabled, but not with FE.

Thanks!

1 answer

Log in to vote
0
Answered by 6 years ago

A really short answer from a person with no time is you need is you need a RemoteEvent to fire and a server script hears it and creates the car; LocalScripts can't create things in FE.

The Wiki is useful with RemoteEvents. Also remember whenever firing from a client to the server, the player is always the first argument, then the data after.

0
Actually localscripts can create things, it's just that anything done via a localscript is only visible to the player. Operation_Meme 890 — 6y
0
How do I fire it in my case? I can create a remote event in the workspace named "Car Spawner". How would I fire it to spawn the car? BADABOO2016 3 — 6y
0
Watch the video about remote events on alvinblox or watch this https://www.youtube.com/watch?v=4Dc_bri9mjs Agueroooooo16 15 — 6y
0
Do you still need help? I could do my best to explain RemoteEvents if you still need help. DatOneRandomDude 69 — 6y
Ad

Answer this question