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: Script won't work, what am i doing wrong?

Previous Thread :: Next Thread 
RobloxStar4536 is not online. RobloxStar4536
Joined: 16 Sep 2013
Total Posts: 313
11 Feb 2016 06:39 AM
ga me.Work space.Model.C Frame = C Frame.new(-6.8, 12.537, -82)

Note that i had to put the spaces in each word due to roblox not allowing me to post the thread.
Report Abuse
ranvlr2o50 is not online. ranvlr2o50
Joined: 30 Jan 2016
Total Posts: 46
11 Feb 2016 06:41 AM
Ur doing many things wrong. Use this script

While thruse do,

game.players.playeradded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local experience = Instance.new('IntValue', stats)
experience.Name = 'EXP'
experience.Value = 0
local level = Instance.new('IntValue', stats)
level.Name = 'Level'
level.Value = 0

experience.Changed:Connect(function()
level.Value = math.floor(experience.Value / 1000)
end)
While thruse do
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
game.players.playeradded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local experience = Instance.new('IntValue', stats)
experience.Name = 'EXP'
experience.Value = 0
local level = Instance.new('IntValue', stats)
level.Name = 'Level'
level.Value = 0

experience.Changed:Connect(function()
level.Value = math.floor(experience.Value / 1000)
end)
While thruse do
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
game.players.playeradded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local experience = Instance.new('IntValue', stats)
experience.Name = 'EXP'
experience.Value = 0
local level = Instance.new('IntValue', stats)
level.Name = 'Level'
level.Value = 0

experience.Changed:Connect(function()
level.Value = math.floor(experience.Value / 1000)
end)
While thruse do
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
local level = leaderstats:WaitForChild('Level')
local xp = player:WaitForChild('EXP')
level.Changed:connect(function()
if xp.Value < 1000 then
level.Value = 1
end
local level = leaderstats:WaitForChild('Level')
local xp = player:WaitForChild('EXP')
level.Changed:connect(function()
if xp.Value < 1000 then
level.Value = 1
end
local level = leaderstats:WaitForChild('Level')
local xp = player:WaitForChild('EXP')
level.Changed:connect(function()
if xp.Value < 1000 then
level.Value = 1
end
Report Abuse
RobloxStar4536 is not online. RobloxStar4536
Joined: 16 Sep 2013
Total Posts: 313
11 Feb 2016 06:44 AM
Teleport a MODEL only to the position, not all that.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Feb 2016 06:46 AM
He's just a spammer, don't mind him.


ga me.Work space.Model:Set Primary Part C CFrame(C Frame.new(-6.8, 12.537, -82))


Report Abuse
cowsoncows is not online. cowsoncows
Joined: 11 Oct 2013
Total Posts: 2522
11 Feb 2016 07:15 AM
Rather than put the model's CFrame, use MoveTo()

game.Workspace.Model:MoveTo(Vector3.new(-6.8, 12.537, -82))
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Feb 2016 08:02 AM
SetPrimaryPartCFrame is better for pretty nearly everything.


Report Abuse
RobloxStar4536 is not online. RobloxStar4536
Joined: 16 Sep 2013
Total Posts: 313
11 Feb 2016 08:34 AM
@cow

It worked! Thank you very much!
Report Abuse
RobloxStar4536 is not online. RobloxStar4536
Joined: 16 Sep 2013
Total Posts: 313
11 Feb 2016 08:44 AM
Now, i want it after 22 seconds, to appear at the position. How do i do that?
I added wait(22) but it doesn't seem to work.
Report Abuse
cowsoncows is not online. cowsoncows
Joined: 11 Oct 2013
Total Posts: 2522
11 Feb 2016 08:46 AM
:MoveTo() uses the middle of the model as it's origin, but SetPrimaryPartCFrame uses the primary part, which isn't always in the middle, therefore making it harder to position it properly. But yes, SetPrimaryPartCFrame is more exact if you need absolute precision.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Feb 2016 09:35 AM
MoveTo also uses the PrimaryPart, actually. It does not require PrimaryPart though, but it still doesn't move it based on the center.

MoveTo doesn't allow for rotations either. In fact, MoveTo even resets the rotation entirely! If there is anything in the way of the place you are moving the model, it will be moved upwards along the Y axis until there are no obstructions.


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
11 Feb 2016 09:37 AM
MoveTo moves the model based on the root part.
"Since the root part is not deterministic, it is recommended to always set the PrimaryPart first"


Report Abuse
cowsoncows is not online. cowsoncows
Joined: 11 Oct 2013
Total Posts: 2522
11 Feb 2016 03:04 PM
Yes, I agree that SetPrimaryPart is better, because, obviously, it take the CFrame, which has much more possibilities than Vector3. I just use MoveTo because, as you said, it will move it on the Y axis accordingly if there is something in it's way, and it's the first think I learned so it's a habit. Thanks for all the info on SetPrimaryPartCFrame though :D
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