Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

1 comment

0

sorry, I wasn't really clear about the problem, I edited the post

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.

1 comment

0

yes, its in a localscript, but it just won't change the values.

This discussion is preserved as it was. New answers, comments, and votes are closed.