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: Can't use weapons

Previous Thread :: Next Thread 
SteakFighter is not online. SteakFighter
Joined: 29 Oct 2014
Total Posts: 19
25 Nov 2017 01:29 PM
Hello! I have a little problem.. If I want to use a sword on my server, with my character, I can use it. But. If another person joins to my server, he can't use the sword. Why? Can you help? (I don't use any kohl type script.)
Report Abuse
Chrounum is not online. Chrounum
Joined: 04 Apr 2015
Total Posts: 2911
25 Nov 2017 01:31 PM
whats your code?


#code print("don't forget to dry the towel after use")
Report Abuse
SteakFighter is not online. SteakFighter
Joined: 29 Oct 2014
Total Posts: 19
26 Nov 2017 11:31 AM
-- Copied from Grimgold Periastron Beta

local Tool = script.Parent
local Sword = Tool.Handle

local vCharacter
local myTorso
local myHumanoid

local equipped = false

local debris = game:GetService("Debris")

function tagHumanoid(humanoid, player)
if humanoid then
local creatorTag = Instance.new("ObjectValue")
creatorTag.Value = player
creatorTag.Name = "creator"
creatorTag.Parent = humanoid
debris:AddItem(creatorTag, 1)
end
end

function cut(hit)
local humanoid
local vPlayer
if hit and hit.Parent and myHumanoid then
if hi####################= "Hat" then
humanoid = hit.Parent.Parent:FindFirstChild("Humanoid")
else
humanoid = hit.Parent:FindFirstChild("Humanoid")
end
vPlayer = game.Players:GetPlayerFromCharacter(vCharacter)
if humanoid ~= nil and humanoid ~= myHumanoid then
tagHumanoid(humanoid, vPlayer)
humanoid:TakeDamage(7.5)
end
end
end

function onEquipped()
vCharacter = Tool.Parent
myTorso = vCharacter:FindFirstChild("Torso")
myHumanoid = vCharacter:FindFirstChild("Humanoid")
end

Tool.Equipped:connect(onEquipped)

Sword.Touched:connect(cut)
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