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: Fishing not working?

Previous Thread :: Next Thread 
Blueguy195 is not online. Blueguy195
Joined: 17 Nov 2012
Total Posts: 7258
03 Jul 2014 09:28 PM
local tool = script.Parent
local user

tool.Equipped:connect(function(mouse)
user = tool.Parent


mouse.Button1Down:connect(function()
local ray = Ray.new(tool.ring.CFrame.p, (mouse.Hit.p - tool.ring.CFrame.p).unit*300)
local hit, position = game.Workspace:FindPartOnRay(ray, user)


local f = hit and hit.Parent and hit.Parent:FindFirstChild("Fish")
if f then

end

local distance = (position - tool.ring.CFrame.p).magnitude
local rayPart = Instance.new("Part", user)
rayPart.Name = "RayPart"
rayPart.BrickColor = BrickColor.new("Really Black")
rayPart.Transparency = 0
rayPart.Anchored = true
rayPart.CanCollide = true
rayPart.TopSurface = Enum.SurfaceType.Smooth
rayPart.BottomSurface = Enum.SurfaceType.Smooth
rayPart.formFactor = Enum.FormFactor.Custom
rayPart.Size = Vector3.new(0.2, 0.2, distance)
rayPart.CFrame = CFrame.new(position, tool.ring.CFrame.p) * CFrame.new(0, 0, -distance/2)
rayPart.BrickColor = BrickColor.new("Really Black")
m = Instance.new("Message")
wait(3)
m.Parent = game.Workspace
m.Text = math.random("You caught a fish", "You caught a shark", "You caught a Blueguy195!")
end)
end)

The script above is when the tool is equipped and it is clicked, a part is made where the mouse clicked. Problems are:
Message doesn't work
The color is always white
The tool is turned to the right by 2 studs.
Report Abuse
Blueguy195 is not online. Blueguy195
Joined: 17 Nov 2012
Total Posts: 7258
03 Jul 2014 09:42 PM
b1
Report Abuse
Blueguy195 is not online. Blueguy195
Joined: 17 Nov 2012
Total Posts: 7258
03 Jul 2014 09:50 PM
b2
Report Abuse
Blueguy195 is not online. Blueguy195
Joined: 17 Nov 2012
Total Posts: 7258
03 Jul 2014 09:54 PM
b3
Report Abuse
Blueguy195 is not online. Blueguy195
Joined: 17 Nov 2012
Total Posts: 7258
04 Jul 2014 11:13 AM
b4
Report Abuse
Blueguy195 is not online. Blueguy195
Joined: 17 Nov 2012
Total Posts: 7258
04 Jul 2014 03:51 PM
b5
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