Well then okay il be waiting for the answer
ok now I have a HUGE problem that file wont open ;-;
anyways ill get back to u once i finish my essay for school
Okay then good luck! I think il be going to sleep because itâs 1 am here and Iâm really tired il try tomorrow everything you said and maybe I can use remote events to fire the UIS anyways goodnight
local UIS = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local ValueCounter = 0
local ClickCounter = 0
print(Char.Name)
UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
ClickCounter = ClickCounter + 1
ValueCounter = ValueCounter + 0.01
print(ClickCounter)
Char:FindFirstChild("Ball").Value.Value = ValueCounter
end
end)
Local script inside of Starterplayerscripts.
The main issue was you defined the ballâs value, but you need to get the value property in order to change it, so I put in an extra .Value
Hope this helps
I see the flipping problem, InputBegan only works in local scripts ;-;
wait but would the value get replicated to the server?
wasnât there something about local scripts being unable to change things on the server?
Yeah im pretty sure you cant change values on local scripts and have it replicated on servers
show us your code
character limittttt
LocalScript:13: attempt to index nil with âValueâ - Client - LocalScript:13
://
what is code character limit and how will that help?
I think it would be best to use a RemoteEvent
for this one. Everything could be done in the LocalScripts, besides from all the values, which could be done in ServerScriptService?
i reworked the script and now everything works but the only problem is that the value is shared with everyone and now every player shares the same value, i made a RemoteEvent with a server script because thats the only script that allows me to change the value
What is the Script inside the âBallâ Tool?
the scripts that simply controls the ball thing and uses the value for vector movement
i did used them but the remote events are OnServer because local scripts simply wont update the value somehow
I tested the script out and I see what you mean. It prints the values in the Output, but it doesnât change it inside the playerâs Backpack for me. However, it works for you, just not how you want it to?
it works for me because i made a server script with this lines
while wait() do
script.Parent.Value.Value = script.Parent.Value.Value + 0.005
end
that is disabled but the RemoteEvent taunts it each time i click, it enables it and the disables it with a wait() command
the problem is that every player has the same Value number, and its not a unique one based on how many times each player clicks
@itzVasi, maybe you should put the script inside the Tool, instead of in ServerScriptService where this would work for everyone. You could even maybe combine the script, that you already have in the tool and just have it as one script.
Having said that, what does your updated script look like?
Sorry just woke up,
A way to replicate values to a server is with a remote event, and have the server change the value.
Also, the script will only work if the âballâ tool is equipped, it will not work if it is unequipped.
It is already there and already runs that way but still it doesnât work properly