|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|