Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 09:24 PM |
grave isnt cloned, doesnt appear.
repeat wait() until game.Players.LocalPlayer local p = game.Players.LocalPlayer.Character local g = game.ReplicatedStorage.graves local playerpos = p.Torso.Position if p.Humanoid.Health == 0 then math.random(1,1) if math.random == 1 then g.cgrave1:Clone().Name = "CheapGrave" g.CheapGrave.Parent = game.Workspace g.CheapGrave.Position = playerpos end end
I don't know whats wrong .-.
|
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
| |
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
| |
|
| |
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 09:53 PM |
I'm sorry that I'm new to scripting -_-
you could have just helped me instead of that
I just need help, not hate.
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:01 PM |
Real spooky have respect for people who want to learn.
local g = game.ReplicatedStorage.graves game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) c.Died:connect(function() local playerpos = c.Torso.Position --I think this is what you want to do local Chance = math.random(1,1) if Chance == 1 then local Grave = g.CheapGrave:Clone() Grave.Parent = workspace Grave.Position = playerpos end end) end) end)
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:02 PM |
Place it in server script storage as a normal script
|
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 10:14 PM |
Sorry for the late reply
In the output I got "Died is not a valid member of model"
"c.Died:connect(function()"
|
|
|
| Report Abuse |
|
|
storm_xst
|
  |
| Joined: 27 Jul 2016 |
| Total Posts: 1205 |
|
|
| 01 Oct 2016 10:22 PM |
| c will have to be a humanoid I think, Died is an event of the humanoid |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:25 PM |
Are you sure humanoid is a child of Torso?
|
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 10:25 PM |
| ################################################################################################################################################################################################################################################################# |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:25 PM |
oh yeah It's c.Humanoid.Died:connect(function()
|
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 10:26 PM |
wow.
would i have to use
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(Humanoid) Humanoid.Died:connect(function()
|
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
| |
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 10:30 PM |
it worked thank you alot :D
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:31 PM |
local g = game.ReplicatedStorage.graves game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) c.Humanoid.Died:connect(function() local chance = math.random(1, 10) -- Note this has a 1/10 chance now, Idk what you wanted but before it was math.random(1,1) which means it's always 1 if chance == 1 then local grave = g.CheapGrave:Clone() grave.Parent = workspace grave.CFrame = c.Torso.CFrame end end) end) end) |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:33 PM |
busycityguy I noticed it was useless but incase he wanted to increase the number and add an else statement to expand on it I just left it in.
|
|
|
| Report Abuse |
|
|
|
| 01 Oct 2016 10:34 PM |
I also changed it to use CFrame, because Position would spawn it on top of the character.
-The [Guy] |
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 10:40 PM |
it was (1,1) because i was testing i was going to add more graves for a variety
|
|
|
| Report Abuse |
|
|
Bit_blox
|
  |
| Joined: 28 Aug 2016 |
| Total Posts: 974 |
|
|
| 01 Oct 2016 10:46 PM |
also thanks for the cframe, it spawns on the ground instead of falling over, which still would be good because the main goal is to get the grave to spawn
|
|
|
| Report Abuse |
|
|