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: This is stumping me

Previous Thread :: Next Thread 
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Jul 2016 09:09 PM
local function RandomBoatPos(player, boat) --// random position on the map
math.randomseed(math.random(-tick(),tick()))
local ChosenBoat = BoatsFolder:WaitForChild(boat):Clone()
ChosenBoat.Parent = workspace.PlayerBoats
ChosenBoat:MakeJoints()
print('POS - '..tostring(ChosenBoat.Roof.Position))
ChosenBoat:MoveTo(Vector3.new(math.random(-6000, -4014), 0, math.random(-1130, 853)))
local tag = Instance.new("StringValue", ChosenBoat)
tag.Name = "BoatOwner"
tag.Value = player.Name
wait()
print(ChosenBoat["Roof"].Position + Vector3.new(0, 10, 0))
return ChosenBoat["Roof"].Position + Vector3.new(0, 10, 0) --// "Roof" is in all boats
--return Vector3.new(0, 50, 0)
end

It prints the POS but when I try to print ChosenBoat["Roof"].Position it says that Roof is nil. I set up a childremoved event to workspace.PlayerBoats above this code and it confirmed my suspicions that the boat was being destroyed or something somehow. I thought it was because I didn't call MakeJoints but even after I added MakeJoints it still doesn't work. Any idea what's happening?


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
Spencerfun11 is not online. Spencerfun11
Joined: 22 Nov 2012
Total Posts: 43
30 Jul 2016 09:49 PM
It's stumping me as well. The roof shouldn't equal nil, as the part does exist, proven by the part that says "print('POS-'..tostring(ChosenBoat.Roof.Position))" not coming out as nil. The only thing that I've notice that is that after you checked the position the first time, you changed the position and then checked again. Though that shouldn't make the roof equal nil.
Report Abuse
Client_Replicated is not online. Client_Replicated
Joined: 18 Jul 2011
Total Posts: 1567
30 Jul 2016 10:12 PM
Post the bit where you call it.
Report Abuse
killerbot29003 is not online. killerbot29003
Joined: 04 Oct 2014
Total Posts: 3054
30 Jul 2016 10:16 PM
why not just ChosenBoat.Roof.Position


This siggy is copyrighted ©
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Jul 2016 11:13 PM
Same thing, different notation


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
30 Jul 2016 11:16 PM
I suggest anchoring the model, adding a welding script, then unanchoring the model when it gets welded (after being added to the Workspace.)


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
30 Jul 2016 11:27 PM
The best weld script I know is qPerfectionWeld. After adding that it still doesn't work.


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 12:13 AM
asd


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 12:32 AM
asdf


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Jul 2016 12:33 AM
ChosenBoat:WaitForChild("Roof")

also dont use MoveTo

give it a primary part and then use model.SetPrimaryPartCFrame(aCFrame)
Report Abuse
thedailyblarg is not online. thedailyblarg
Joined: 26 Feb 2012
Total Posts: 5506
31 Jul 2016 12:35 AM
:SetPrimaryPartCFrame(aCFrame)

my bad

but yea and MakeJoints is for characters or NPCs or humanoids i believe

you cant magically give something joints unless it has a rig like humanoids
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 12:51 AM
@blarg
it still has parts that need to stay together like an npcs :/

and did you see what i said about the whole boat model being nil


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
31 Jul 2016 12:52 AM
Is the boat dropping through the floor and hitting the falling parts destroy barrier?


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 12:54 AM
Well, the thing is, it's being spawned on top of smooth terrain water. So it couldn't be dropping through that.


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
Cuyler is not online. Cuyler
Joined: 27 Feb 2006
Total Posts: 3784
31 Jul 2016 12:57 AM
Well, if it's coming up nil, then there's only a couple explanations. Either a script is destroying the boat, or it's somehow falling through the water and being destroyed by the game. Try breakpointing right after you move the boat into the Workspace and then position your camera where the boat is and unbreakpoint. Maybe you'll see exactly what is happening to it. Oh, also, check the Archivable property. I doubt it's that, but if it was set to false for some reason, it wouldn't be able to be cloned.


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 01:00 AM
I did a few global searches for destroy() and remove() and such but didn't come up with anything that could've been destroying the boat. I found a couple of conditional statements that might've done it but I commented those out, tested, same result. I'll try breakpoints.


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 01:02 AM
...apparently you can't use breakpoints in team create scripts?


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
31 Jul 2016 01:05 AM
csgs are better. and use body forces


Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 01:06 AM
ugh


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 01:12 AM
last bump for the night


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
31 Jul 2016 06:29 PM
k


Ever wanted to learn how to script? Check out my YouTube channel: youtube.com/austintheslayer Want to see me code in action? Follow my twitch: twitch.tv/austinrblx
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