generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Grave doesnt appear

Previous Thread :: Next Thread 
Bit_blox is not online. 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 is not online. Bit_blox
Joined: 28 Aug 2016
Total Posts: 974
01 Oct 2016 09:39 PM
b


Report Abuse
Bit_blox is not online. Bit_blox
Joined: 28 Aug 2016
Total Posts: 974
01 Oct 2016 09:50 PM
b


Report Abuse
Real_Spooky is not online. Real_Spooky
Joined: 23 Oct 2013
Total Posts: 3149
01 Oct 2016 09:51 PM
this is so utterly stupid
Report Abuse
Bit_blox is not online. 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
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
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
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
01 Oct 2016 10:02 PM
Place it in server script storage as a normal script


Report Abuse
Bit_blox is not online. 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 is not online. 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
theUTMdiamond is not online. theUTMdiamond
Joined: 09 Feb 2016
Total Posts: 377
01 Oct 2016 10:25 PM
Are you sure humanoid is a child of Torso?
Report Abuse
Bit_blox is not online. Bit_blox
Joined: 28 Aug 2016
Total Posts: 974
01 Oct 2016 10:25 PM
#################################################################################################################################################################################################################################################################
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
01 Oct 2016 10:25 PM
oh yeah It's c.Humanoid.Died:connect(function()


Report Abuse
Bit_blox is not online. 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 is not online. Bit_blox
Joined: 28 Aug 2016
Total Posts: 974
01 Oct 2016 10:28 PM
nvm


Report Abuse
Bit_blox is not online. Bit_blox
Joined: 28 Aug 2016
Total Posts: 974
01 Oct 2016 10:30 PM
it worked thank you alot :D


Report Abuse
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
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
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
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
BusyCityGuy is not online. BusyCityGuy
Joined: 17 Aug 2012
Total Posts: 2144
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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image