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

How do i change two local values when i touch a part?

(Sorry for my english, is not my native language) Basicly, i need to change two local values (Value1, Value2) when i touch a part (x)

The two values are located in: game.StarterGui.Script.Value1 And: game.StarterGui.Script.Value2 And the part is located in: game.workspace.x

I tried to use a script similar to a healthpad but it didnt worked, and now im stuck in my project. Also, im kinda new i have little experience in scripting, so i dont know if the values should be stored somewhere else or the part should be stored somewhere else.

1 comment

0

Btw, i cant add an example because i have no clue what to do.

1 answer

✓ Accepted answer

Store the values in Workspace and the script in ServerScriptService (:

local Value1 = game.Workspace.Value1
local Value2 = game.Workspace.Value2
local part = game.Workspace.x

part.Touched:Connect(function()
	Value1.Value = whateverYouWant
	Value2.Value = whateverYouWant

Thank you so much for having such a descriptive question. You were the first person I've seen recognize where everything is stored. It really helps! Thank you!

3 comments

0

The script doesnt work, i moved the values and i placed the script in the right place.

0

Hey dude, it actualy worked, i just had to store the script in StarterGui. Thank you!

0

It kinda worked, but not as i intended

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