Firstly I am sorry if this question has been answered over 100 times before. I have searched the forum without finding an usable answer, on how to do this in Lua. I have tried out code, I thought might work or be related without getting the result i wanted.
I have a pivot.When the player collides with the pivot, I want to change the texture on a different object lets call it box1
the collision and change of texture is not a problem. The problem is how I change the box's texture from within the script of the pivot
below is an example of an failed attempt at calling a function within a diffrent script. This script would be attached to the pivot
function Script:Collision(entity, position, normal, speed)
if (entity:GetKeyValue("name") == "Player") then
// the function test123 is located inside the script attached to box1
CallFunction("test123");
end
end