infirmn
(infirmn)
November 11, 2023, 5:29pm
#1
this is a script under the rock with a number value . this script:
local remote = game.ReplicatedStorage.MiningRemotes.Hit
remote.OnServerEvent:Connect(function(player, dur, mon)
local durab = script.Parent.Durability.Value
durab = durab - 1
print(durab)
print(player.Name)
end)
should take away 1 every time the remote is fired, which it takes away 1, once. it only stays at 1 no matter how many times its fired.
2 Likes
CZXPEK
(czo)
November 11, 2023, 5:32pm
#2
youre setting the value of durablity only to the durab variable so when you do:
xordium:
durab = durab - 1
its only gonna take away 1 from the variable, not the value
fixed script:
local remote = game.ReplicatedStorage.MiningRemotes.Hit
remote.OnServerEvent:Connect(function(player, dur, mon)
local durab = script.Parent.Durability
durab.Value -= 1 --// -= 1 is the same thing as (value = value - 1)
print(durab.Value)
print(player.Name)
end)
2 Likes
infirmn
(infirmn)
November 11, 2023, 5:33pm
#3
czo:
local remote = game.ReplicatedStorage.MiningRemotes.Hit
remote.OnServerEvent:Connect(function(player, dur, mon)
local durab = script.Parent.Durability
durab.Value -= 1 --// -= 1 is the same thing as (value = value - 1)
print(durab)
print(player.Name)
end)
now it doesnt even print anything
CZXPEK
(czo)
November 11, 2023, 5:35pm
#4
like the script doesnt run at all or what, edited the script above so it prints the value
infirmn
(infirmn)
November 11, 2023, 5:36pm
#5
only printed my name the first time, but then the second time i did it it printed what ever the heck the text in blue is
infirmn
(infirmn)
November 11, 2023, 6:11pm
#7
ive fixed the script thanks to everyone for the help
system
(system)
Closed
November 25, 2023, 6:11pm
#8
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.