Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tool does no damage & won't appear for other players, what's wrong?

Asked by 2 years ago

I have two different scripts which are tied together, one for a certain appearance of the object upon click, the second for the damage of the object when it collides with another player. The scripts are old and updated a quite a while ago; I've done a few tweaks and it's coming closer and closer to finished, however there are still two issues at hand.

The tool itself and its defining script for its size is kept in Lighting and is given to the player upon clicking a button in a GUI. The second portion containing the damage element is in ReplicatedStorage.

1. ** The projectile made upon click will appear on the screen of whoever uses it, but will not appear on the screen of a 2nd player. **2. The projectile, seemingly because it cannot be seen by any players except the user, does no damage. The damage portion of the tool is kept in ReplicatedStorage.

Tool Script:

01bin = script.Parent
02me = script.Parent.Parent.Parent
03 
04enabled = true
05 
06function onButton1Down(mouse)
07if not enabled then
08        return
09    end
10 
11    local player = game.Players.LocalPlayer
12    if player == nil then return end
13        enabled = false
14 
15 
View all 53 lines...

Damage Script:

01wait(0.01)
02damage = 5
03humanoidnames = {"Humanoid"}
04function onTouched(hit)
05if hit.Parent.Name ~= script.Parent.Name then
06if hit.Parent.Parent.Name ~= script.Parent.Name then
07 
08 
09for i = 1 , #humanoidnames do
10local d = hit.Parent.Parent:findFirstChild(humanoidnames[i])
11if d ~= nil then
12d.Health = d.Health - damage
13for i = 1 , 4 do
14local p = Instance.new("Part")
15p.Parent = game.Workspace
View all 41 lines...
0
Are the scripts LocalScripts? T3_MasterGamer 2189 — 2y

Answer this question