|
| 22 Jul 2014 10:01 AM |
| I know I've seen this before. How do you make a weapon, like, say, a sword, that is defaultly equipped and you can't deselect it. It doesnt show up in the toolbox either? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 10:20 AM |
| The way that I would do this is welding a weapon to the player's arm and then using the player:GetMouse method to get the mouse. You wouldn't even need a Tool object. |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jul 2014 10:21 AM |
| so its not tool its kinda part and script using getmouse |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 10:50 AM |
I'm sorry, I'm pretty new to making tools and weapons.
So I would need a script that welds the weapon to the player's arm right when they join? |
|
|
| Report Abuse |
|
|
| |
|
CWRA0444
|
  |
| Joined: 14 Jan 2010 |
| Total Posts: 6013 |
|
|
| 22 Jul 2014 11:04 AM |
| If you dont understand this you might want to do some research before you make the weapon... Those people described it as well as you can pretty much. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:11 AM |
Someone else wanted some help with a script and a wrote accidentally wrote the script that you needed instead >.< I'll repost it here.
local tool = --Change this local player = --And this local character = player.Character or player.CharacterAdded:wait() local mouse = player:GetMouse()
local function weld(part0, part1) local joint = Instance.new("Weld", part0) joint.Part0 = part0 joint.Part1 = part1 joint.C0 = CFrame.new() * CFrame.Angles()--You will need to mess with these to joint.C1 = CFrame.new() * CFrame.Angles()--rotate the tool correctly. end
local function onButton1Down() local target = mouse.Target local hit = mouse.Hit --Do stuff here end
weld(tool.Handle, character:WaitForChild("LeftArm")) mouse.Button1Down:connect(onButton1Down) |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:12 AM |
| And so local tool is just a model that will be attached to the player? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:21 AM |
| And in the angles part, do I put in the grip position stuff that I had in the old tool? |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:23 AM |
| Yes and yes. Make sure the model has a part named "Handle." You will have to mess around with the angles and CFrames because it wont be as easy as the tool grip property, but it does the same thing. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:24 AM |
And then after the mousebutton1 part I can put in the sword swing animation and make it hurt people.
I feel like that sounds right, but I also might just be unintelligently thinking to myself. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:24 AM |
@Arbiter
Thanks. I'll have to mess around with that a bit. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:25 AM |
| Depends. If the animation only works on the player's body (like most do) then yes. I have made a animation that also moves the tool in the player's hand and that requires a motor6D instead of a weld between the left arm and the handle. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:32 AM |
| Ok. Yeah, the weapon itself doesnt move, just the arm. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 11:47 AM |
After the local player part, would game.Players:GetPlayers() work? Also, it appears the script is stack ending on the third line.
12:45:18.986 - Workspace.Script:3: attempt to index field 'CharacterAdded' (a nil value) Is what it says.
Should
player.CharacterAdded:wait()
be changed to
player:CharacterAdded() wait()
? |
|
|
| Report Abuse |
|
|
| |
|