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

I can't get my dart script to create a mesh. How would I do this?

Asked by 5 years ago

Hi everyone. I am trying to script a dart gun for a game I'm working on. The gun uses some simple remote events to communicate client to server.

The local script tests to see if the tool is equipped and is supposed to fire server. The server reads this and creates the dart projectile and mesh.

Then the local script sends another signal when the tool is clicked to clone the mesh.

Local script below: IGNORE VARIABLES

01--Constraints
02local IgnoreList = {rocket = 0, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
03--NOTE: Keys must be lowercase, values must evaluate to true
04--Variables
05local tool = script.Parent
06 
07local player = game.GetService("Players").LocalPlayer
08 
09local mouse = player:GetMouse()
10-----InTool
11local configs = game.ReplicatedStorage.MaverickConfigurations
12local gungui = tool:WaitForChild("GunGUI" )
13local firesound = tool.WaitForChild("FireSound")
14local reloadsound = tool.WaitForChild("ReloadSound")
15local primesound = tool.WaitForChild("PrimeSound")
View all 85 lines...

Server Script:

01--ServerScript
02 
03-----------------
04--| Constants |
05-----------------
06local player = game.Players.LocalPlayer
07local replicated = game:GetService("ReplicatedStorage")
08local configs = replicated:WaitForChild("MaverickConfigurations")
09local coolDown = configs.AttackCooldown.Value
10local Gravity = 196.2
11local reloadtime = configs.ReloadTime.Value -- Seconds until tool can be used again
12local dartspeed = configs.DartSpeed.Value -- Speed of the projectile
14local meshscale = Vector3.new(0.35, 0.35, 0.25)
15local dartsize = Vector3.new(1.2, 1.2, 3.27)
View all 65 lines...

Thanks for your help everyone!

0
Try placing prints all over to see where is the problem. Works 99% of the time. sahadeed 87 — 5y
0
That's good advice thanks ExHydraboy 30 — 5y
0
It might be you are using the wrong mesh type. Farsalis 369 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago

You can't create meshes through scripts due to Roblox security. The best method is to create it and put it in Replicated Storage and clone it.

Ad

Answer this question