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

[unanswered]why won't this script change values in the localplayer?

Asked by 9 years ago

why won't this script change values in the localplayer? Another script makes the values, I checked it and they are there. The script is a local script in a tool. the toolt is the tool. the value tool is in the player. it is not the tool itself.

local plyr = game.Players.LocalPlayer
local Toolt = script.Parent

Toolt.Equipped:connect(function(mouse)
    plyr.Tool.Value = "Test"
    plyr.Tool.Ammo.Value = 20
    plyr.Tool.Clip.Value = 100
end)

Toolt.Unequipped:connect(function(mouse)
    plyr.Tool.Value = "Hands"
    plyr.Tool.Ammo.Value = 0
    plyr.Tool.Clip.Value = 0
end)

2 answers

Log in to vote
0
Answered by
davness 376 Moderation Voter
9 years ago

As I know of your script, the error is simple:

You localized Toolt and called Tool, so, where you have

local Toolt = script.Parent

You should have

local Tool = script.Parent
0
sorry, I wasn't really clear about the problem, I edited the post GreyLuca 30 — 9y
Ad
Log in to vote
0
Answered by
Cuvette 246 Moderation Voter
9 years ago

I'm assuming you've put this script into a localscript? If not you would need to do so for it to be able to access the LocalPlayer function.

0
yes, its in a localscript, but it just won't change the values. GreyLuca 30 — 9y

Answer this question