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 » Scripting Helpers
Home Search
 

Re: Can someone explain why this doesnt work

Previous Thread :: Next Thread 
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 02:11 PM
local Part = Instance.new("Part", Player.Character)

the part never goes into player [variable, game.Players.LocalPlayer], even if I add this after it

Part.Parent = Player.Character
Report Abuse
devonson4 is not online. devonson4
Joined: 10 Apr 2011
Total Posts: 154
20 Aug 2014 02:11 PM
Is the script a localscript?
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 02:12 PM
ye
Report Abuse
devonson4 is not online. devonson4
Joined: 10 Apr 2011
Total Posts: 154
20 Aug 2014 02:13 PM
Could you post a larger amount of the script in question?
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 02:38 PM
local weld = Instance.new("Weld")
local Part = Instance.new("Part", Player.Character)
lookat.Parent = Player.Character
weld.Parent = Player.Character.Torso
weld.Part0 = Player.Character.Torso
weld.Part1 = Player.Character.Part
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
20 Aug 2014 02:40 PM
local player = game.Players.LocalPlayer
local Part = Instance.new("Part", Player.Character)

If you look closely, I don't give a crap.
Report Abuse
oatsssss is not online. oatsssss
Joined: 31 Jul 2014
Total Posts: 170
20 Aug 2014 02:40 PM
I dunno if this is the problem, but I was just in a thread where the problem was exactly this:

Make sure the LocalScript is in a place that actually allows it to run. ex. StarterGui or StarterPack
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 02:49 PM
it is
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 03:00 PM
here's the full script, line 22 seems to be the script's problem


local Mouse = game.Players.LocalPlayer:GetMouse()
local distance= 5

wait(.5)
while not game.Players.LocalPlayer.Character:FindFirstChild('Head') do wait() end
local cam = workspace.CurrentCamera
cam.CameraType = 'Custom'
cam.CameraType = 'Scriptable'
local head = game.Players.LocalPlayer.Character.Head

local RunService = Game:GetService('RunService')
while RunService.Stepped:wait() do
cam.CoordinateFrame= CFrame.new(Vector3.new(head.Position.x + 0, head.Position.y + distance, head.Position.Z + 10),head.Position)
local Torso = game.Players.LocalPlayer.Character.Torso
local Player = game.Players.LocalPlayer
local weld = Instance.new("Weld")
local lookat = Instance.new("Part", Player.Character)
lookat.Name = "Position"
lookat.Parent = Player.Character
weld.Parent = Player.Character.Torso
weld.Part0 = Player.Character.Torso
weld.Part1 = Player.Character.lookat
lookat.CFrame = Player.Character.Torso.CFrame
lookat.Parent = game.Players.LocalPlayer.Character
lookat.Position = Torso.CFrame.p * CFrame.new(0,0,-1)
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(Torso.Position, Vector3.new(Mouse.Hit.p.x, Torso.Position.Y, Mouse.Hit.p.z))
end
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 03:20 PM
b
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 03:42 PM
b2
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 04:07 PM
b3
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
20 Aug 2014 04:12 PM
lookat is not a defined variable.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
20 Aug 2014 04:13 PM
I'm wrong, I didn't even read the script btw.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
20 Aug 2014 04:14 PM
What do you need lookat for anyways?
Report Abuse
Absurdism is not online. Absurdism
Joined: 18 Jul 2013
Total Posts: 2568
20 Aug 2014 04:15 PM
i'm honestly not sure if you can add parts into a player obj
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
20 Aug 2014 04:17 PM
He's not, he's adding it to the character, but you can technically do both.
Report Abuse
islandmaker2012 is online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
20 Aug 2014 04:17 PM
player, Player.Character

WUT

u defined player instead of Player?
Report Abuse
Tripane is not online. Tripane
Joined: 03 Jun 2011
Total Posts: 11432
20 Aug 2014 04:41 PM
@island

lowercase p players was never said in the script
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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