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
 

Projectile script

Previous Thread :: Next Thread 
nasirs001 is not online. nasirs001
Joined: 16 Jan 2010
Total Posts: 395
27 Jan 2015 08:50 PM
this script used to work but all of a sudden just didn't for me. I cant think of anything wrong with it because it works in studio but not in actual servers, any help is appreciated.

-clockwork

local bin = script.Parent
local Player = Game.Players.LocalPlayer
local mouse = Player:GetMouse()
local c = Player.Character

enabled = true


function onButton1Down(mouse)
if not enabled then return end
local player = game.Players.LocalPlayer
if player == true then return end
print("trigger")
-- find the best cf

enabled = false
local B1=game.Lighting.Boulder:Clone()
B1.Parent = workspace
B1.Anchored = false
B1.CanCollide = false
G= Instance.new("BodyVelocity", B1)
G.maxForce = Vector3.new(math.huge, math.huge, math.huge)
G.velocity = (mouse.Hit.p-c.Torso.Position).unit*80
B1.CFrame = c.Torso.CFrame*CFrame.new(0, 0,-6)
game:GetService("Debris"):AddItem(B1, 1.5)
function Damage(hit)
human = hit.Parent:FindFirstChild("Humanoid") -- returns "Humanoid" if exists, else returns nil
if human ~= nil then
local player = game.Players.LocalPlayer
if player == true then return end
print("trigger") -- if the toucher is human, then
human:TakeDamage(10) -- damage the human
end
end


function explode()
e = Instance.new("Explosion", B1)
e.BlastPressure = 0
e.BlastRadius = 1
e.Position = B1.Position
end

B1.Touched:connect(Damage)
B1.Touched:connect(explode)
game:GetService("Chat"):Chat(c.Head, "EARTH RELEASE:BOULDER SHOT!!!")
wait(1.5)

enabled = true
end

function onSelected(mouse)
print("select")
mouse.Icon = "rbxasset://textures\\GunCursor.png"
mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)
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