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: whats wrong with this

Previous Thread :: Next Thread 
topcst is not online. topcst
Joined: 20 Dec 2011
Total Posts: 3052
05 Jan 2017 04:51 PM
Output says this, but idk how to fix, Help would be nice

'GetMouse is not a valid member of Backpack'
'Script 'Players.Player1.Backpack.Fireball.Script', Line 3'

local Tool = script.Parent
play = script.Parent.Parent
mouse = play:GetMouse()
char = play.Character
hum = char.Humanoid


local en = true
Tool.RemoteEvent.OnServerEvent:connect(function(play,mousehit)
hum.LoadAnimation(Tool.Throw):Play()
wait(0.5)
local fireball = Tool.Handle:clone()
fireball.CFrame = Tool.Handle.CFrame
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(1e8,1e8,1e8)
bv.Velocity = mousehit.lookVector * 50
bv.Parent = fireball
fireball.CanCollide = false
fireball.Parent = game.Workspace

end)


#thatsnotmeyeahiusedtoweargucci
Report Abuse
DJ3KJ is online. DJ3KJ
Joined: 19 Dec 2015
Total Posts: 207
05 Jan 2017 05:05 PM
I can help you fix if you can tell me what GetMouse is supposed to do. Do you mean touch? Hit? GetMouse according to you is a function.


Report Abuse
topcst is not online. topcst
Joined: 20 Dec 2011
Total Posts: 3052
05 Jan 2017 05:08 PM
Its supposed to find where your mouse is clicking, then throw a fireball wherever the mouse click is,


#thatsnotmeyeahiusedtoweargucci
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
05 Jan 2017 05:09 PM
You're trying to call GetMouse() on the player's backpack object.

This should work:

play = script.Parent.Parent.Parent --One more parent from Backpack is Player.
mouse = play:GetMouse()
Report Abuse
DJ3KJ is online. DJ3KJ
Joined: 19 Dec 2015
Total Posts: 207
05 Jan 2017 05:10 PM
My final question before I can help you is, is this a localscript, a script, or what is it? Also depends on what the parent is


Report Abuse
topcst is not online. topcst
Joined: 20 Dec 2011
Total Posts: 3052
05 Jan 2017 05:16 PM
Intended, Players.Player1.Backpack.Fireball.LocalScript:3: attempt to index global 'play' (a nil value) shows up when i edit the code to as you said.

DJ3, this is a script the parent its looking for is the player so the script is going script>tool>player
well it is now it was by accident
script>tool but it still doesnt work


#thatsnotmeyeahiusedtoweargucci
Report Abuse
topcst is not online. topcst
Joined: 20 Dec 2011
Total Posts: 3052
05 Jan 2017 05:18 PM
Nvm it shows this now 'GetMouse is not a valid member of DataModel'


#thatsnotmeyeahiusedtoweargucci
Report Abuse
Intended_Pun is not online. Intended_Pun
Joined: 10 Aug 2016
Total Posts: 4384
05 Jan 2017 05:19 PM
Ok make sure this is a local script:

local Tool = script.Parent
play = game.Players.LocalPlayer
mouse = play:GetMouse()
char = play.Character
hum = char.Humanoid


local en = true
Tool.RemoteEvent.OnServerEvent:connect(function(play,mousehit)
hum.LoadAnimation(Tool.Throw):Play()
wait(0.5)
local fireball = Tool.Handle:clone()
fireball.CFrame = Tool.Handle.CFrame
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(1e8,1e8,1e8)
bv.Velocity = mousehit.lookVector * 50
bv.Parent = fireball
fireball.CanCollide = false
fireball.Parent = game.Workspace

end)
Report Abuse
tbnj123 is online. tbnj123
Joined: 29 Oct 2010
Total Posts: 443
05 Jan 2017 05:20 PM
game.Players.LocalPlayer:GetMouse()
Report Abuse
topcst is not online. topcst
Joined: 20 Dec 2011
Total Posts: 3052
05 Jan 2017 05:26 PM
Thanks, but the animation doesnt work saying the Fireball is not a valid member of Player


#thatsnotmeyeahiusedtoweargucci
Report Abuse
topcst is not online. topcst
Joined: 20 Dec 2011
Total Posts: 3052
05 Jan 2017 05:28 PM
nvm fixed its called tool not fireball


#thatsnotmeyeahiusedtoweargucci
Report Abuse
DJ3KJ is online. DJ3KJ
Joined: 19 Dec 2015
Total Posts: 207
05 Jan 2017 05:37 PM
Try this:
function GetMouse()

local Tool = script.Parent
play = script.Parent.Parent
mouse = play:GetMouse()
char = play.Character
hum = char.Humanoid
extrhum = game.Workspace.GetChildren()


local en = true
Tool.RemoteEvent.OnServerEvent:connect(function(play,mousehit)
hum.LoadAnimation(Tool.Throw):Play()
wait(0.5)
local fireball = Tool.Handle:clone()
fireball.CFrame = Tool.Handle.CFrame
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(1e8,1e8,1e8)
bv.Velocity = mousehit.lookVector * 50
bv.Parent = fireball
fireball.CanCollide = false
fireball.Parent = game.Workspace

end
end)





Report Abuse
DJ3KJ is online. DJ3KJ
Joined: 19 Dec 2015
Total Posts: 207
05 Jan 2017 05:38 PM
Oh, nevermind then


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